2015-03-14 22:25:50 +00:00
|
|
|
/* ReC98
|
|
|
|
* -----
|
|
|
|
* 2nd part of code segment #2 of TH02's MAIN.EXE
|
|
|
|
*/
|
|
|
|
|
2020-11-03 15:25:41 +00:00
|
|
|
#pragma codeseg SHARED
|
2020-10-01 14:34:46 +00:00
|
|
|
#pragma option -3
|
|
|
|
|
2021-01-23 13:27:55 +00:00
|
|
|
extern "C" {
|
2020-02-18 18:46:34 +00:00
|
|
|
#include "libs/kaja/kaja.h"
|
2015-03-14 22:25:50 +00:00
|
|
|
#include "th02/th02.h"
|
2020-09-05 21:55:18 +00:00
|
|
|
#include "th02/hardware/frmdelay.h"
|
2021-01-23 13:27:55 +00:00
|
|
|
#include "th02/hardware/input.hpp"
|
2019-11-23 20:28:21 +00:00
|
|
|
#include "th02/mem.h"
|
2020-02-18 18:46:34 +00:00
|
|
|
#include "th02/snd/snd.h"
|
2015-03-14 22:25:50 +00:00
|
|
|
|
|
|
|
extern const char pf_fn[];
|
|
|
|
|
|
|
|
#include "th02/hardware/input.c"
|
|
|
|
#include "th02/exit.c"
|
|
|
|
#include "th02/snd/mmd_res.c"
|
|
|
|
#include "th02/snd/detmode.c"
|
|
|
|
#include "th02/snd/pmd_res.c"
|
|
|
|
#include "th02/snd/delayvol.c"
|
|
|
|
#include "th02/snd/load.c"
|
|
|
|
|
|
|
|
#pragma option -k
|
|
|
|
|
|
|
|
void pascal mptn_palette_show(void)
|
|
|
|
{
|
|
|
|
palette_set_all(mptn_palette);
|
|
|
|
palette_show();
|
|
|
|
}
|
|
|
|
|
|
|
|
int pascal mptn_load_inner(const char *fn)
|
|
|
|
{
|
|
|
|
mptn_header_t header;
|
|
|
|
|
|
|
|
file_ropen(fn);
|
|
|
|
file_read(&header, sizeof(header));
|
|
|
|
mptn_count = header.count;
|
|
|
|
file_read(&mptn_palette, sizeof(mptn_palette));
|
|
|
|
if(mptn_show_palette_on_load) {
|
|
|
|
mptn_palette_show();
|
|
|
|
}
|
|
|
|
if(mptn_buffer) {
|
|
|
|
mptn_free();
|
|
|
|
}
|
2021-01-23 13:27:55 +00:00
|
|
|
mptn_buffer = reinterpret_cast<int *>(MK_FP(
|
|
|
|
hmem_allocbyte((mptn_count + 1) * MPTN_SIZE), 0
|
|
|
|
));
|
2015-03-14 22:25:50 +00:00
|
|
|
if(!mptn_buffer) {
|
|
|
|
file_close();
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
file_read(mptn_buffer, (mptn_count + 1) * MPTN_SIZE);
|
|
|
|
file_close();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#include "th02/initmain.c"
|
2021-01-23 13:27:55 +00:00
|
|
|
|
|
|
|
}
|