From 75b8765e44fa54c1816d618692f4c66efc20d45f Mon Sep 17 00:00:00 2001 From: nmlgc Date: Mon, 16 Mar 2015 22:35:52 +0100 Subject: [PATCH] [C decompilation] Finish TH02's OP.EXE --- Makefile.mak | 2 +- ReC98.h | 8 + th02/main02_2.c | 4 - th02/maine_03.c | 3 +- th02/maine_04.c | 3 - th02/op_01.c | 670 +++++++++++++++ th02/op_04.c | 10 +- th02/op_06.c | 3 +- th02/snd/data.c | 4 - th02/snd/se.c | 2 - th02/strings/ranks_c.c | 7 + th02/th02.h | 50 +- th02_op.asm | 1777 +--------------------------------------- 13 files changed, 741 insertions(+), 1802 deletions(-) create mode 100644 th02/op_01.c create mode 100644 th02/strings/ranks_c.c diff --git a/Makefile.mak b/Makefile.mak index d47706c5..cf35aa99 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -43,7 +43,7 @@ bin\th01\fuuin.exe: bin\th01\fuuin.obj th01\fuuin_06.c th01\fuuin_11.c th01\fuui $** | -bin\th02\op.exe: bin\th02\op.obj th02\op_02_1.c th02\op_02_2.c th02\op_03.c th02\op_04.c th02\op_05.c th02\op_06.c +bin\th02\op.exe: th02\op_01.c bin\th02\op.obj th02\op_02_1.c th02\op_02_2.c th02\op_03.c th02\op_04.c th02\op_05.c th02\op_06.c $(CC) $(CFLAGS) -ml -Z -DGAME=2 -nbin\th02\ -eOP.EXE @&&| $** | diff --git a/ReC98.h b/ReC98.h index db6991b6..c0939b6b 100644 --- a/ReC98.h +++ b/ReC98.h @@ -4,6 +4,14 @@ */ #include +#include + +// master.lib extensions +// --------------------- +#define palette_entry_rgb_show(fn) \ + palette_entry_rgb(fn); \ + palette_show(); +// --------------------- // Macros // ------ diff --git a/th02/main02_2.c b/th02/main02_2.c index b7b000f7..f2b8e349 100644 --- a/th02/main02_2.c +++ b/th02/main02_2.c @@ -10,10 +10,6 @@ #define frame_delay_2 frame_delay -extern char snd_active; -extern char snd_interrupt_if_midi; -extern char snd_fm_possible; - extern const char pf_fn[]; #include "th02/hardware/input.c" diff --git a/th02/maine_03.c b/th02/maine_03.c index bf6c9b2d..a2f7a7cf 100644 --- a/th02/maine_03.c +++ b/th02/maine_03.c @@ -3,7 +3,6 @@ * Code segment #3 of TH02's MAINE.EXE */ -#include #include "th02\th02.h" char rank = RANK_NORMAL; @@ -23,7 +22,7 @@ int pascal cfg_load(void) { int resident_sgm; - file_ropen("huuma.cfg"); + file_ropen(CFG_FN); file_seek(offsetof(huuma_cfg_t, resident_sgm), 0); file_read(&resident_sgm, sizeof(resident_sgm)); file_close(); diff --git a/th02/maine_04.c b/th02/maine_04.c index 09b49c09..bed19e48 100644 --- a/th02/maine_04.c +++ b/th02/maine_04.c @@ -7,14 +7,11 @@ #include "th02\score.c" -extern char rank; extern long score; long score_highest; score_file_t hi; -void pascal sub_B4B7(void); - void pascal score_defaults_set(void) { int i; diff --git a/th02/op_01.c b/th02/op_01.c new file mode 100644 index 00000000..54034e93 --- /dev/null +++ b/th02/op_01.c @@ -0,0 +1,670 @@ +/* ReC98 + * ----- + * Code segment #1 of TH02's OP.EXE + */ + +#include +#include "th02/th02.h" + +#pragma option -d + +typedef void pascal near putfunc_t(int sel, unsigned int atrb); + +char menu_sel = 0; +char in_option = 0; +char quit = 0; +char unused_1 = 0; + +char snd_bgm_mode; +static int unused_2; +unsigned int idle_frames; +unsigned char demo_num; +unsigned int mikoconfig_sgm; +putfunc_t near *putfunc; + +// No, we don't want to put these two into th02.h. Apparently, declaring +// variables with extern before definining them for real within the same +// compilation unit causes Turbo C++ to emit *everything* in a different +// order... really, I couldn't make this up. +extern char extra_unlocked; +extern unsigned int score_duration; + +int game_init_op(void); +void game_exit_to_dos(void); + +void title_flash(void); +void pascal score_menu(void); +void pascal shottype_menu(void); +void pascal musicroom(void); + +int cfg_load(void) +{ + huuma_cfg_t cfg; + const char *cfg_fn = CFG_FN; + + if(file_exist(cfg_fn)) { + file_ropen(cfg_fn); + file_read(&cfg, sizeof(cfg)); + rank = cfg.rank; + snd_bgm_mode = cfg.bgm_mode; + bombs = cfg.bombs; + lives = cfg.lives; + mikoconfig_sgm = cfg.resident_sgm; + if(!mikoconfig_sgm) { + return 1; + } + mikoconfig = MK_FP(mikoconfig_sgm, 0); + mikoconfig->perf = cfg.perf; + mikoconfig->debug = cfg.debug; + file_close(); + + if(snd_bgm_mode == SND_BGM_OFF) { + snd_fm_possible = 0; + snd_active = 0; + } else if(snd_bgm_mode == SND_BGM_FM) { + snd_midi_active = 0; + snd_determine_mode(); + } else { + snd_midi_active = snd_midi_possible; + snd_determine_mode(); + } + return 0; + } + return 1; +} + +void cfg_save(void) +{ + const char *cfg_fn = CFG_FN; + huuma_cfg_t cfg; + + cfg.debug = 0; + cfg.rank = rank; + cfg.bgm_mode = snd_bgm_mode; + cfg.bombs = bombs; + cfg.lives = lives; + cfg.perf = mikoconfig->perf; + + file_create(cfg_fn); + file_write(&cfg, offsetof(huuma_cfg_t, resident_sgm)); + file_write(&mikoconfig_sgm, sizeof(mikoconfig_sgm)); + file_write(&cfg.debug, sizeof(cfg.debug)); + file_close(); +} + +void text_wipe(void) +{ + text_clear(); + text_fillca(' ', TX_BLACK | TX_REVERSE); +} + +void pascal near pi_load_put_free_to(const char near *fn, char page) +{ + pi_slot_load(0, fn); + graph_accesspage(page); + pi_slot_palette_apply(0); + pi_slot_put(0, 0, 0); + graph_pi_free(&pi_slot_headers[0], pi_slot_buffers[0]); +} + +void op_animate(void) +{ + int door_x, door_y; // Sony Vegas calls this a "Barn Door" transition. + const char gbZUN[] = {gb_Z_, gb_U_, gb_N_, 0}; + + text_wipe(); + snd_load("huuma.efc", SND_LOAD_SE); + pi_load_put_free_to("op2.pi", 1); + pi_load_put_free_to("op.pi", 0); + pi_slot_load(0, "opa.pi"); + pi_slot_load(1, "opb.pi"); + pi_slot_load(2, "opc.pi"); + palette_white(); + + for(door_x = 0; door_x < 40; door_x++) { + for(door_y = 0; door_y < 25; door_y++) { + text_putca(39 - door_x, door_y, ' ', TX_WHITE); + text_putca(door_x + 40, door_y, ' ', TX_WHITE); + } + palette_settone(200 - (door_x * 2)); + frame_delay(1); + } + for(door_x = 40; door_x < 50; door_x++) { + palette_settone(200 - (door_x * 2)); + frame_delay(1); + } + palette_100(); + + if(mikoconfig->demo_num == 0) { + door_x = 0; + if(snd_midi_possible) { + door_x = snd_midi_active; + snd_midi_active = 1; + snd_load("op.m", SND_LOAD_SONG); + } + snd_midi_active = 0; + snd_load("op.m", SND_LOAD_SONG); + snd_midi_active = door_x; + } + + frame_delay(18); + title_flash(); + + palette_white(); + graph_accesspage(1); + + graph_gaiji_putc(548, 384, gs_COPYRIGHT, 0); + graph_gaiji_puts(564, 384, 16, gbZUN, 0); + graph_gaiji_putc(544, 380, gs_COPYRIGHT, 6); + graph_gaiji_puts(560, 380, 16, gbZUN, 6); + graph_copy_page(0); + + if(mikoconfig->demo_num == 0) { + snd_kaja_func(KAJA_SONG_PLAY, 0); + } + mikoconfig->demo_num = 0; + palette_entry_rgb_show("op.rgb"); + palette_white_in(6); +} + +void pascal near start_init(void) +{ + snd_se_reset(); + snd_se_play(13); + snd_se_update(); + frame_delay(20); + + mikoconfig->rem_lives = lives; + mikoconfig->rem_bombs = bombs; + mikoconfig->start_lives = lives; + mikoconfig->start_bombs = bombs; + mikoconfig->bgm_mode = snd_bgm_mode; + mikoconfig->start_power = 0; + mikoconfig->score = 0; + mikoconfig->continues_used = 0; + mikoconfig->unused_3 = 0; + mikoconfig->unused_1 = 0; + mikoconfig->demo_num = 0; + mikoconfig->score_highest = 0; +} + +#define start_exec() \ + cfg_save(); \ + pi_slot_load(0, "ts1.pi"); \ + text_clear(); \ + shottype_menu(); \ + snd_kaja_func(KAJA_SONG_FADE, 15); \ + gaiji_restore(); \ + super_free(); \ + game_exit(); \ + if(mikoconfig->debug) { \ + execl("select", "select", 0, 0); \ + } else { \ + execl("main", "main", 0, 0); \ + } + +void start_game(void) +{ + start_init(); + mikoconfig->rank = rank; + mikoconfig->stage = 0; + start_exec(); +} + +void start_demo(void) +{ + mikoconfig->rem_lives = 2; + mikoconfig->rem_bombs = 3; + mikoconfig->start_lives = 2; + mikoconfig->start_bombs = 3; + mikoconfig->bgm_mode = snd_bgm_mode; + mikoconfig->rank = RANK_NORMAL; + mikoconfig->continues_used = 0; + mikoconfig->unused_3 = 0; + mikoconfig->demo_num = demo_num; + mikoconfig->shottype = 0; + cfg_save(); + text_clear(); + graph_pi_free(&pi_slot_headers[0], pi_slot_buffers[0]); + graph_pi_free(&pi_slot_headers[1], pi_slot_buffers[1]); + graph_pi_free(&pi_slot_headers[2], pi_slot_buffers[2]); + gaiji_restore(); + super_free(); + game_exit(); + execl("main", "main", 0, 0); +} + +void start_extra(void) +{ + start_init(); + mikoconfig->rank = RANK_EXTRA; + mikoconfig->stage = 5; + mikoconfig->rem_lives = 2; + mikoconfig->rem_bombs = 1; + mikoconfig->start_lives = 2; + mikoconfig->start_bombs = 1; + start_exec(); +} + +#pragma option -d- + +#include "th02/strings/ranks_c.c" +const unsigned char gbHIT_KEY[] = { + gb_H_, gb_I_, gb_T_, gb_SP, gb_K_, gb_E_, gb_Y_, 0 +}; +const unsigned char gb7SPACES[] = { + gb_SP, gb_SP, gb_SP, gb_SP, gb_SP, gb_SP, gb_SP, 0 +}; + +const unsigned char gbSTART[] = { + gb_S_,gb_T_,gb_A_,gb_R_,gb_T_, 0, 0, 0, 0, 0 +}; +const unsigned char gbEXTRA_START[] = { + gb_E_,gb_X_,gb_T_,gb_R_,gb_A_,gb_SP,gb_S_,gb_T_,gb_A_,gb_R_,gb_T_, 0 +}; +const unsigned char gbHISCORE[] = { + gb_H_,gb_I_,gb_S_,gb_C_,gb_O_,gb_R_,gb_E_, 0, 0, 0 +}; +const unsigned char gbOPTION[] = { + gb_O_,gb_P_,gb_T_,gb_I_,gb_O_,gb_N_, 0, 0, 0, 0 +}; +const unsigned char gbQUIT[] = { + gb_Q_,gb_U_,gb_I_,gb_T_, 0, 0, 0, 0, 0, 0 +}; +const unsigned char gbRANK[] = { + gb_R_,gb_A_,gb_N_,gb_K_, 0, 0, 0, 0, 0, 0 +}; +const unsigned char gbPLAYER[] = { + gb_P_,gb_L_,gb_A_,gb_Y_,gb_E_,gb_R_, 0, 0, 0, 0 +}; +const unsigned char gbMUSIC[] = { + gb_M_,gb_U_,gb_S_,gb_I_,gb_C_, 0, 0, 0, 0, 0 +}; +const unsigned char gbBOMB[] = { + gb_B_,gb_O_,gb_M_,gb_B_, 0, 0, 0, 0, 0, 0 +}; +const unsigned char gbMUSIC_MODE[] = { + gb_M_,gb_U_,gb_S_,gb_I_,gb_C_,gb_SP,gb_M_,gb_O_,gb_D_,gb_E_, 0 +}; +const unsigned char gbRESET[] = { + gb_R_,gb_E_,gb_S_,gb_E_,gb_T_, 0, 0, 0, 0, 0 +}; + +const unsigned char gsRANKS[4][3] = { + gs_EA, gs_SY, 0, + gs_NOR, gs_MAL, 0, + gs_HA, gs_RD, 0, + gs_LUN, gs_ATIC, 0 +}; + +const unsigned char gbcBGM_MODE[3][5] = { + gb_O_, gb_F_, gb_F_, gb_SP, 0, + gb_SP, gb_F_, gb_M_, gb_SP, 0, + gb_M_, gb_I_, gb_D_, gb_I_, 0 +}; + +const char *PERF_TITLE = "演出"; +const char *PERF_OPTIONS[2] = {" 通常 ", "一部軽減"}; + +#pragma option -d + +void pascal near main_put_shadow(void) +{ + graph_gaiji_puts(284, 260, 16, gbSTART, 0); + graph_gaiji_puts(236, 276, 16, gbEXTRA_START, 0); + graph_gaiji_puts(268, 292, 16, gbHISCORE, 0); + graph_gaiji_puts(276, 308, 16, gbOPTION, 0); + graph_gaiji_puts(244, 324, 16, gbMUSIC_MODE, 0); + graph_gaiji_puts(292, 340, 16, gbQUIT, 0); + + graph_gaiji_puts(212, 372, 16, gbRANK, 0); + graph_gaiji_puts(308, 372, 16, gbcRANKS[rank], 0); +} + +void pascal near main_put(int sel, unsigned int atrb) +{ + if(sel == 0) { + gaiji_putsa(35, 16, gbSTART, atrb); + } else if(sel == 2) { + gaiji_putsa(33, 18, gbHISCORE, atrb); + } else if(sel == 3) { + gaiji_putsa(34, 19, gbOPTION, atrb); + } else if(sel == 4) { + gaiji_putsa(30, 20, gbMUSIC_MODE, atrb); + } else if(sel == 5) { + gaiji_putsa(36, 21, gbQUIT, atrb); + } + if(sel == 1) { + if(extra_unlocked) { + gaiji_putsa(29, 17, gbEXTRA_START, atrb); + } else { + gaiji_putsa(29, 17, gbEXTRA_START, TX_BLUE); + } + } + gaiji_putsa(26, 23, gbRANK, TX_GREEN); + gaiji_putsa(38, 23, gbcRANKS[rank], TX_GREEN); +} + +void pascal near menu_sel_move(char sel_count, char direction) +{ + putfunc(menu_sel, TX_YELLOW); + menu_sel += direction; + if(!in_option && !extra_unlocked && menu_sel == 1) { + menu_sel += direction; + } + if(menu_sel < 0) { + menu_sel = sel_count; + } + if(menu_sel > sel_count) { + menu_sel = 0; + } + putfunc(menu_sel, TX_WHITE); +} + +void main_update_and_render(void) +{ + static char input_allowed; + static char initialized = 0; + if(!initialized) { + int i; + input_allowed = 0; + initialized = 1; + text_clear(); + graph_showpage(1); + graph_copy_page(0); + main_put_shadow(); + graph_showpage(0); + idle_frames = 0; + for(i = 0; i < 6; i++) { + main_put(i, menu_sel == i ? TX_WHITE : TX_YELLOW); + } + putfunc = main_put; + } + if(!input) { + input_allowed = 1; + } + if(input_allowed) { + if(input & INPUT_UP) { + menu_sel_move(5, -1); + } + if(input & INPUT_DOWN) { + menu_sel_move(5, 1); + } + if(input & INPUT_SHOT || input & INPUT_OK) { + switch(menu_sel) { + case 0: + start_game(); + break; + case 1: + start_extra(); + break; + case 2: + score_duration = 2000; + text_clear(); + score_menu(); + graph_accesspage(1); + graph_showpage(0); + pi_load_put_free(0, "op2.pi"); + palette_entry_rgb_show("op.rgb"); + graph_copy_page(0); + graph_accesspage(0); + initialized = 0; + break; + case 3: + menu_sel = 0; + in_option = 1; + initialized = 0; + break; + case 4: + text_clear(); + musicroom(); + initialized = 0; + break; + case 5: + quit = 1; + break; + } + } + if(input & INPUT_CANCEL) { + quit = 1; + } + if(input) { + input_allowed = 0; + idle_frames = 0; + } + } + if(idle_frames > 640) { + start_demo(); + } +} + +void pascal near option_put_shadow(void) +{ + graph_gaiji_puts(196, 260, 16, gbRANK, 0); + graph_gaiji_puts(196, 276, 16, gbMUSIC, 0); + graph_gaiji_puts(196, 292, 16, gbPLAYER, 0); + graph_gaiji_puts(196, 308, 16, gbBOMB, 0); + graph_putsa_fx(196, 324, 0, PERF_TITLE); + graph_gaiji_puts(284, 340, 16, gbRESET, 0); + graph_gaiji_puts(292, 372, 16, gbQUIT, 0); +} + +void pascal near option_put(int sel, unsigned int atrb) +{ + if(sel == 0) { + gaiji_putsa(24, 16, gbRANK, atrb); + gaiji_putsa(42, 16, gbcRANKS[rank], atrb); + graph_copy_rect_1_to_0(336, 260, 128, 16); + graph_gaiji_puts(340, 260, 16, gbcRANKS[rank], 0); + } else if(sel == 1) { + gaiji_putsa(24, 17, gbMUSIC, atrb); + gaiji_putsa(47, 17, gbcBGM_MODE[snd_bgm_mode], atrb); + graph_copy_rect_1_to_0(376, 276, 64, 16); + graph_gaiji_puts(380, 276, 16, gbcBGM_MODE[snd_bgm_mode], 0); + } else if(sel == 2) { + gaiji_putsa(24, 18, gbPLAYER, atrb); + gaiji_putca(49, 18, lives + 1 + GB_DIGITS, atrb); + graph_copy_rect_1_to_0(392, 292, 32, 16); + graph_gaiji_putc(396, 292, lives + 1 + GB_DIGITS, 0); + } else if(sel == 3) { + gaiji_putsa(24, 19, gbBOMB, atrb); + gaiji_putca(49, 19, bombs + GB_DIGITS, atrb); + graph_copy_rect_1_to_0(392, 308, 32, 16); + graph_gaiji_putc(396, 308, bombs + GB_DIGITS, 0); + } else if(sel == 4) { + text_putsa(24, 20, PERF_TITLE, atrb); + text_putsa(45, 20, PERF_OPTIONS[mikoconfig->perf], atrb); + graph_copy_rect_1_to_0(360, 324, 128, 16); + graph_putsa_fx(364, 324, 0, PERF_OPTIONS[mikoconfig->perf]); + } else if(sel == 5) { + gaiji_putsa(35, 21, gbRESET, atrb); + } else if(sel == 6) { + gaiji_putsa(36, 23, gbQUIT, atrb); + } +} + +void pascal near snd_bgm_restart(void) +{ + if(snd_bgm_mode == SND_BGM_OFF) { + snd_fm_possible = 0; + snd_kaja_func(KAJA_SONG_STOP, 0); + snd_active = 0; + return; + } else if(snd_bgm_mode == SND_BGM_FM) { + snd_kaja_func(KAJA_SONG_STOP, 0); + snd_midi_active = 0; + snd_determine_mode(); + snd_kaja_func(KAJA_SONG_PLAY, 0); + } else if(snd_bgm_mode == SND_BGM_MIDI) { + snd_kaja_func(KAJA_SONG_STOP, 0); + snd_midi_active = snd_midi_possible; + snd_determine_mode(); + snd_kaja_func(KAJA_SONG_PLAY, 0); + } +} + +void option_update_and_render(void) +{ + static char input_allowed = 0; + static char initialized = 0; + + #define OPTION_CHANGE(direction) \ + option_put(menu_sel, TX_YELLOW); \ + switch(menu_sel) { \ + case 0: \ + RING_##direction##(rank, RANK_LUNATIC); \ + break; \ + case 1: \ + RING_##direction##(snd_bgm_mode, SND_BGM_MIDI); \ + snd_bgm_restart(); \ + break; \ + case 2: \ + RING_##direction##(lives, 4); \ + break; \ + case 3: \ + RING_##direction##(bombs, 3); \ + break; \ + case 4: \ + mikoconfig->perf = 1 - mikoconfig->perf; \ + break; \ + } \ + option_put(menu_sel, TX_WHITE); + + #define OPTION_QUIT \ + menu_sel = 3; \ + in_option = 0; \ + initialized = 0; + + if(!initialized) { + int i; + input_allowed = 0; + initialized = 1; + text_clear(); + graph_showpage(1); + graph_copy_page(0); + option_put_shadow(); + graph_showpage(0); + for(i = 0; i < 7; i++) { + option_put(i, menu_sel == i ? TX_WHITE : TX_YELLOW); + } + putfunc = option_put; + } + if(!input) { + input_allowed = 1; + } + if(input_allowed) { + if(input & INPUT_UP) { + menu_sel_move(6, -1); + } + if(input & INPUT_DOWN) { + menu_sel_move(6, 1); + } + if(input & INPUT_RIGHT) { + OPTION_CHANGE(INC); + } + if(input & INPUT_LEFT) { + OPTION_CHANGE(DEC); + } + if(input & INPUT_SHOT || input & INPUT_OK) { + switch(menu_sel) { + case 5: + rank = RANK_NORMAL; + snd_bgm_mode = SND_BGM_FM; + snd_kaja_func(KAJA_SONG_STOP, 0); + snd_midi_active = 0; + snd_determine_mode(); + snd_kaja_func(KAJA_SONG_PLAY ,0); + lives = 2; + bombs = 3; + mikoconfig->unused_2 = 1; + mikoconfig->perf = 0; + option_put(0, TX_YELLOW); + option_put(1, TX_YELLOW); + option_put(2, TX_YELLOW); + option_put(3, TX_YELLOW); + option_put(4, TX_YELLOW); + break; + case 6: + OPTION_QUIT; + break; + } + } + if(input & INPUT_CANCEL) { + OPTION_QUIT; + } + if(input) { + input_allowed = 0; + } + } +} + +int main(void) +{ + unsigned char ret; + if(snd_pmd_resident()) { + snd_mmd_resident(); + if(game_init_op()) { + zun_error(ERROR_OUT_OF_MEMORY); + return 1; + } + extra_unlocked = score_cleared_load(); + if(cfg_load() == 1) { + return 1; + } + } else { + return 1; + } + gaiji_backup(); + gaiji_entry_bfnt("MIKOFT.bft"); + if(mikoconfig->demo_num == 0) { + demo_num = 1; + snd_kaja_func(KAJA_SONG_STOP, 0); + } else { + demo_num = mikoconfig->demo_num + 1; + if(demo_num > 3) { + demo_num = 1; + } + score_duration = 350; + score_menu(); + graph_showpage(0); + graph_accesspage(0); + } + input = 0; + + snd_active = snd_bgm_mode; + if(!mikoconfig->demo_num && snd_midi_possible) { + char midi_active = snd_midi_active; + + snd_midi_active = 1; + snd_load("gminit.m", SND_LOAD_SONG); + snd_kaja_func(KAJA_SONG_PLAY, 0); + snd_midi_active = midi_active; + } + + op_animate(); + pi_slot_load(2, "ts3.pi"); + pi_slot_load(1, "ts2.pi"); + input = 0; + idle_frames = 0; + + while(!quit) { + input_sense(); + if(in_option == 0) { + main_update_and_render(); + } else if(in_option == 1) { + option_update_and_render(); + } + mikoconfig->frame++; + idle_frames++; + frame_delay(1); + } + + ret = mikoconfig->op_main_retval; + mikoconfig_sgm = 0; + cfg_save(); + text_clear(); + graph_clear(); + game_exit_to_dos(); + gaiji_restore(); + return ret; +} diff --git a/th02/op_04.c b/th02/op_04.c index 5bb064b6..fc4e1608 100644 --- a/th02/op_04.c +++ b/th02/op_04.c @@ -11,19 +11,20 @@ char rank = RANK_NORMAL; #include "th02\score.c" -const unsigned char gbcRANK[4][8] = { +const unsigned char gbcRANKS[4][8] = { gb_SP, gb_E_, gb_A_, gb_S_, gb_Y_, gb_SP, gb_SP, 0, gb_N_, gb_O_, gb_R_, gb_M_, gb_A_, gb_L_, gb_SP, 0, gb_SP, gb_H_, gb_A_, gb_R_, gb_D_, gb_SP, gb_SP, 0, gb_L_, gb_U_, gb_N_, gb_A_, gb_T_, gb_I_, gb_C_, 0, }; + const char *SHOTTYPES[] = {"高機動", "防御", "攻撃"}; int logo_step = 0; char need_op_h_bft = 1; score_file_t hi; char extra_unlocked; -unsigned score_duration; +unsigned int score_duration; #include "th02\scorelod.c" @@ -89,7 +90,7 @@ void pascal near scores_put(int place_to_highlight) unsigned atrb = TX_WHITE; int i; gaiji_putsa(22, 2, gbHI_SCORE, TX_GREEN); - gaiji_putsa(40, 2, gbcRANK[rank], TX_GREEN); + gaiji_putsa(40, 2, gbcRANKS[rank], TX_GREEN); text_putsa( 8, 4, " お名前      得点    STAGE TYPE 日付", @@ -156,8 +157,7 @@ void pascal score_menu(void) need_op_h_bft = 0; super_entry_bfnt("op_h.bft"); } - palette_entry_rgb("op_h.rgb"); - palette_show(); + palette_entry_rgb_show("op_h.rgb"); grc_setclip(128, 96, 512, 304); grcg_setcolor(GC_RMW, 10); grcg_fill(); diff --git a/th02/op_06.c b/th02/op_06.c index a1a6063a..dbffdc48 100644 --- a/th02/op_06.c +++ b/th02/op_06.c @@ -334,8 +334,7 @@ controls: graph_clear(); graph_accesspage(1); pi_load_put_free(0, "op2.pi"); - palette_entry_rgb("op.rgb"); - palette_show(); + palette_entry_rgb_show("op.rgb"); graph_copy_page(0); graph_accesspage(0); } diff --git a/th02/snd/data.c b/th02/snd/data.c index 9e370199..6c2222a1 100644 --- a/th02/snd/data.c +++ b/th02/snd/data.c @@ -1,6 +1,2 @@ char snd_active = 0; char snd_unused = 0; - -extern char snd_interrupt_if_midi; -extern char snd_fm_possible; -extern char snd_midi_active; diff --git a/th02/snd/se.c b/th02/snd/se.c index 8ebe5f41..26ff9065 100644 --- a/th02/snd/se.c +++ b/th02/snd/se.c @@ -1,5 +1,3 @@ -extern char snd_fm_possible; - extern unsigned char snd_se_playing; extern unsigned char snd_se_priorities[]; extern unsigned char snd_se_priority_frames[]; diff --git a/th02/strings/ranks_c.c b/th02/strings/ranks_c.c new file mode 100644 index 00000000..19300b47 --- /dev/null +++ b/th02/strings/ranks_c.c @@ -0,0 +1,7 @@ +// Moved to the right by one character compared to the one in op_04.c. +static const unsigned char gbcRANKS[4][8] = { + gb_SP, gb_SP, gb_E_, gb_A_, gb_S_, gb_Y_, gb_SP, 0, + gb_SP, gb_N_, gb_O_, gb_R_, gb_M_, gb_A_, gb_L_, 0, + gb_SP, gb_SP, gb_H_, gb_A_, gb_R_, gb_D_, gb_SP, 0, + gb_L_, gb_U_, gb_N_, gb_A_, gb_T_, gb_I_, gb_C_, 0, +}; diff --git a/th02/th02.h b/th02/th02.h index da64da0b..eac5c9b4 100644 --- a/th02/th02.h +++ b/th02/th02.h @@ -40,7 +40,7 @@ void pi_slot_put(int x, int y, int slot); pi_slot_put(0, 0, slot); \ graph_pi_free(&pi_slot_headers[slot], pi_slot_buffers[slot]); -// ""譚ア譁ケ蟆鬲.骭イ" in Shift-JIS +// "譚ア譁ケ蟆鬲.骭イ" in Shift-JIS #define PF_FN "\x93\x8C\x95\xFB\x95\x95\x96\x82\x2E\x98\x5E" #define PF_KEY 0x12 // ------- @@ -55,9 +55,12 @@ void pi_slot_put(int x, int y, int slot); #define FX(color, weight, spacing) \ (color | (weight & 3) << 4 | (spacing & 7) << 6) void graph_putsa_fx(int x, int y, int fx, const unsigned char *str); + +void pascal graph_copy_rect_1_to_0(int x, int y, int w, int h); // ------- // Gaiji characters +// ---------------- /* ZUN messed up and swapped M and N in MIKOFT.BFT for both regular and bold * fonts. Therefore, other code shouldn't really use the straightforward * solution of just adding char literals to a defined start offset, as it may @@ -124,8 +127,16 @@ typedef enum { gs_ARROW_LEFT, // 竊 gs_ARROW_RIGHT, // 竊 gs_END, // "End" - gs_ALL = 240 // "All" + + // Unused 32x16 rank sprites + gs_EA, gs_SY, // "Ea", "sy" + gs_NOR, gs_MAL, // "Nor, "mal" + gs_HA, gs_RD, // "Ha, "rd" + gs_LUN, gs_ATIC, // "Lun", "atic" + + gs_ALL, // "All" } gaiji_symbols_t; +// ---------------- typedef enum { INPUT_UP = 0x1, @@ -154,15 +165,29 @@ void key_delay(void); // Sound // ----- +typedef enum { + SND_BGM_OFF, + SND_BGM_FM, + SND_BGM_MIDI +} snd_bgm_mode_t; + #include "libs\kaja\kaja.h" -extern char snd_midi_active; +extern char snd_active; +extern char snd_interrupt_if_midi; +extern unsigned char snd_midi_active; extern char snd_midi_possible; +extern char snd_fm_possible; +int snd_pmd_resident(void); +int snd_mmd_resident(void); + +int snd_determine_mode(void); int snd_kaja_interrupt(int ax); #define snd_kaja_func(func, param) snd_kaja_interrupt((func) << 8 | (param)) #define SND_LOAD_SONG (KAJA_GET_SONG_ADDRESS << 8) +#define SND_LOAD_SE (PMD_GET_SE_ADDRESS << 8) void snd_load(const char *fn, kaja_func_t func); @@ -177,10 +202,12 @@ void snd_se_update(void); #define MUSIC_CMT_LINE_COUNT 20 // Configuration file +// ------------------ +#define CFG_FN "huuma.cfg" #pragma option -a1 typedef struct { char rank; - char music; + char bgm_mode; char bombs; char lives; char perf; @@ -188,8 +215,10 @@ typedef struct { char debug; } huuma_cfg_t; #pragma option -a2 +// ------------------ // Resident structure +// ------------------ typedef struct { char id[11]; // = "MIKOConfig" char stage; @@ -206,8 +235,8 @@ typedef struct { long frame; int unused_1; char unused_2; - char op_main_retval; - char perf; + unsigned char op_main_retval; + unsigned char perf; char unused_3; char shottype; char demo_num; @@ -218,9 +247,15 @@ typedef struct { extern resident_t *mikoconfig; +extern char rank; +extern char bombs; +extern char lives; +// ------------------ + #define SHOTTYPE_COUNT 3 // Highscores +// --------- #define SCORE_PLACES 10 #define SCORE_NAME_LEN 6 /* excluding the terminating 0 */ #define EXTRA_CLEAR_FLAGS {1, 2, 4} @@ -263,6 +298,9 @@ typedef struct { extern char cleared_game_with[SHOTTYPE_COUNT]; extern char cleared_extra_with[SHOTTYPE_COUNT]; +int pascal score_cleared_load(void); +// --------- + // Debugging // --------- // Calls ZUN's interrupt vector set up in ZUNINIT.COM to display an error diff --git a/th02_op.asm b/th02_op.asm index c8c3dcf3..29b5b323 100644 --- a/th02_op.asm +++ b/th02_op.asm @@ -21,9 +21,6 @@ include ReC98.inc include th02/th02.asm -include th02/music/music.inc - - extern _execl:proc ; =========================================================================== @@ -125,1776 +122,21 @@ _TEXT ends ; =========================================================================== -; Segment type: Pure code op_01_TEXT segment byte public 'CODE' use16 - assume cs:op_01_TEXT - assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_9BF0 proc far - -var_C = word ptr -0Ch -var_A = word ptr -0Ah -var_8 = byte ptr -8 -var_7 = byte ptr -7 -var_6 = byte ptr -6 -var_5 = byte ptr -5 -var_4 = byte ptr -4 -var_3 = word ptr -3 -var_1 = byte ptr -1 - - enter 0Ch, 0 - mov [bp+var_A], ds - mov [bp+var_C], 163h - push [bp+var_A] - push [bp+var_C] - call file_exist - or ax, ax - jnz short loc_9C0E - jmp loc_9C9D -; --------------------------------------------------------------------------- - -loc_9C0E: - push [bp+var_A] - push [bp+var_C] - call file_ropen - push ss - lea ax, [bp+var_8] - push ax - push 8 - call file_read - mov al, [bp+var_8] - mov _rank, al - mov al, [bp+var_7] - mov _snd_bgm_mode, al - mov al, [bp+var_6] - mov byte_F3E2, al - mov al, [bp+var_5] - mov byte_F3E1, al - mov ax, [bp+var_3] - mov word_E900, ax - cmp word_E900, 0 - jz short loc_9C9D - mov ax, word_E900 - mov word ptr _mikoconfig+2, ax - mov word ptr _mikoconfig, 0 - les bx, _mikoconfig - mov al, [bp+var_4] - mov es:[bx+mikoconfig_t.perf], al - mov al, [bp+var_1] - mov es:[bx+mikoconfig_t.debug_flag], al - call file_close - cmp _snd_bgm_mode, SND_BGM_OFF - jnz short loc_9C80 - mov _snd_fm_possible, 0 - mov _snd_active, 0 - jmp short loc_9C99 -; --------------------------------------------------------------------------- - -loc_9C80: - cmp _snd_bgm_mode, SND_BGM_FM - jnz short loc_9C8E - mov _snd_midi_active, 0 - jmp short loc_9C94 -; --------------------------------------------------------------------------- - -loc_9C8E: - mov al, _snd_midi_possible - mov _snd_midi_active, al - -loc_9C94: - call _snd_determine_mode - -loc_9C99: - xor ax, ax - leave - retf -; --------------------------------------------------------------------------- - -loc_9C9D: - mov ax, 1 - leave - retf -sub_9BF0 endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_9CA2 proc far - -var_C = byte ptr -0Ch -var_B = byte ptr -0Bh -var_A = byte ptr -0Ah -var_9 = byte ptr -9 -var_8 = byte ptr -8 -var_5 = byte ptr -5 -var_4 = word ptr -4 -var_2 = word ptr -2 - - enter 0Ch, 0 - mov [bp+var_2], ds - mov [bp+var_4], 163h - mov [bp+var_5], 0 - mov al, _rank - mov [bp+var_C], al - mov al, _snd_bgm_mode - mov [bp+var_B], al - mov al, byte_F3E2 - mov [bp+var_A], al - mov al, byte_F3E1 - mov [bp+var_9], al - les bx, _mikoconfig - mov al, es:[bx+mikoconfig_t.perf] - mov [bp+var_8], al - push [bp+var_2] - push [bp+var_4] - call file_create - push ss - lea ax, [bp+var_C] - push ax - push 5 - call file_write - push ds - push offset word_E900 - push 2 - call file_write - push ss - lea ax, [bp+var_5] - push ax - push 1 - call file_write - call file_close - leave - retf -sub_9CA2 endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_9D0A proc far - push bp - mov bp, sp - call text_clear - call text_fillca pascal, ' ', TX_BLACK + TX_REVERSE - pop bp - retf -sub_9D0A endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_9D1D proc near - -arg_0 = byte ptr 4 -arg_2 = word ptr 6 - - push bp - mov bp, sp - call _pi_slot_load stdcall, 0, [bp+arg_2], ds - mov dx, 0A6h ; 'ヲ' - mov al, [bp+arg_0] - out dx, al - call _pi_slot_palette_apply stdcall, 0 - call _pi_slot_put stdcall, 0, 0, 0 - add sp, 0Eh - freePISlot 0 - pop bp - retn 4 -sub_9D1D endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_9D5C proc far - -var_6 = word ptr -6 -var_4 = word ptr -4 -var_2 = word ptr -2 - - enter 6, 0 - push si - mov dx, word ptr gZUN+2 - mov ax, word ptr gZUN - mov [bp+var_4], dx - mov [bp+var_6], ax - call sub_9D0A - call _snd_load stdcall, offset aHuuma_efc, ds, SND_LOAD_SE - push 177h - push 1 - call sub_9D1D - push 17Eh - push 0 - call sub_9D1D - call _pi_slot_load stdcall, 0, offset aOpa_pi, ds - call _pi_slot_load stdcall, 1, offset aOpb_pi, ds - call _pi_slot_load stdcall, 2, offset aOpc_pi, ds - add sp, 18h - mov PaletteTone, 0C8h ; 'ネ' - call far ptr palette_show - mov [bp+var_2], 0 - jmp short loc_9E0F -; --------------------------------------------------------------------------- - -loc_9DC4: - xor si, si - jmp short loc_9DED -; --------------------------------------------------------------------------- - -loc_9DC8: - mov ax, 39 - sub ax, [bp+var_2] - call text_putca pascal, ax, si, ' ', TX_WHITE - mov ax, [bp+var_2] - add ax, 40 - call text_putca pascal, ax, si, ' ', TX_WHITE - inc si - -loc_9DED: - cmp si, 25 - jl short loc_9DC8 - mov ax, [bp+var_2] - add ax, ax - mov dx, 0C8h ; 'ネ' - sub dx, ax - mov PaletteTone, dx - call far ptr palette_show - push 1 - call frame_delay - inc [bp+var_2] - -loc_9E0F: - cmp [bp+var_2], 28h ; '(' - jl short loc_9DC4 - mov [bp+var_2], 28h ; '(' - jmp short loc_9E39 -; --------------------------------------------------------------------------- - -loc_9E1C: - mov ax, [bp+var_2] - add ax, ax - mov dx, 0C8h ; 'ネ' - sub dx, ax - mov PaletteTone, dx - call far ptr palette_show - push 1 - call frame_delay - inc [bp+var_2] - -loc_9E39: - cmp [bp+var_2], 32h ; '2' - jl short loc_9E1C - mov PaletteTone, 64h ; 'd' - call far ptr palette_show - les bx, _mikoconfig - cmp es:[bx+mikoconfig_t.demo_num], 0 - jnz short loc_9E97 - mov [bp+var_2], 0 - cmp _snd_midi_possible, 0 - jz short loc_9E7D - mov al, _snd_midi_active - mov ah, 0 - mov [bp+var_2], ax - mov _snd_midi_active, 1 - call _snd_load c, offset aOp_m, ds, SND_LOAD_SONG - -loc_9E7D: - mov _snd_midi_active, 0 - call _snd_load c, offset aOp_m, ds, SND_LOAD_SONG - mov al, byte ptr [bp+var_2] - mov _snd_midi_active, al - -loc_9E97: - push 12h - call frame_delay - call _title_flash - mov PaletteTone, 0C8h ; 'ネ' - call far ptr palette_show - mov dx, 0A6h ; 'ヲ' - mov al, 1 - out dx, al - push 224h - push 180h - push 0DFh ; '゚' - push 0 - call graph_gaiji_putc - push 234h - push 180h - push 10h - push ss - lea ax, [bp+var_6] - push ax - push 0 - call graph_gaiji_puts - push 220h - push 17Ch - push 0DFh ; '゚' - push 6 - call graph_gaiji_putc - push 230h - push 17Ch - push 10h - push ss - lea ax, [bp+var_6] - push ax - push 6 - call graph_gaiji_puts - push 0 - call graph_copy_page - les bx, _mikoconfig - cmp es:[bx+mikoconfig_t.demo_num], 0 - jnz short loc_9F16 - kajacall KAJA_SONG_PLAY - pop cx - -loc_9F16: - les bx, _mikoconfig - mov es:[bx+mikoconfig_t.demo_num], 0 - push ds - push offset aOp_rgb ; "op.rgb" - call palette_entry_rgb - call far ptr palette_show - push 6 - call palette_white_in - pop si - leave - retf -sub_9D5C endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_9F37 proc near - push bp - mov bp, sp - call _snd_se_reset - call _snd_se_play stdcall, 13 - pop cx - call _snd_se_update - push 14h - call frame_delay - les bx, _mikoconfig - mov al, byte_F3E1 - mov es:[bx+mikoconfig_t.rem_lives], al - mov al, byte_F3E2 - mov es:[bx+mikoconfig_t.rem_bombs], al - mov al, byte_F3E1 - mov es:[bx+mikoconfig_t.start_lives], al - mov al, byte_F3E2 - mov es:[bx+mikoconfig_t.start_bombs], al - mov al, _snd_bgm_mode - mov es:[bx+mikoconfig_t.bgm_mode], al - mov es:[bx+mikoconfig_t.start_power], 0 - mov word ptr es:[bx+mikoconfig_t.score+2], 0 - mov word ptr es:[bx+mikoconfig_t.score], 0 - mov es:[bx+mikoconfig_t.continues_used], 0 - mov es:[bx+mikoconfig_t.unused_3], 0 - mov es:[bx+mikoconfig_t.unused_1], 0 - mov es:[bx+mikoconfig_t.demo_num], 0 - mov word ptr es:[bx+mikoconfig_t.score_highest+2], 0 - mov word ptr es:[bx+mikoconfig_t.score_highest], 0 - pop bp - retn -sub_9F37 endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_9FAF proc far - push bp - mov bp, sp - call sub_9F37 - les bx, _mikoconfig - mov al, _rank - mov es:[bx+mikoconfig_t.rank], al - mov es:[bx+mikoconfig_t.stage], 0 - call sub_9CA2 - call _pi_slot_load stdcall, 0, offset aTs1_pi, ds - call text_clear - call shottype_menu - kajacall KAJA_SONG_FADE, 15 - add sp, 8 - call gaiji_restore - call super_free - call _game_exit - les bx, _mikoconfig - cmp es:[bx+mikoconfig_t.debug_flag], 0 - jz short loc_A011 - push 0 - push 0 - push ds - push offset aSelect ; "select" - push ds - push offset aSelect ; "select" - jmp short loc_A01D -; --------------------------------------------------------------------------- - -loc_A011: - push 0 - push 0 - push ds - push offset path ; "main" - push ds - push offset path ; "main" - -loc_A01D: - call _execl - add sp, 0Ch - pop bp - retf -sub_9FAF endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_A027 proc far - push bp - mov bp, sp - les bx, _mikoconfig - mov es:[bx+mikoconfig_t.rem_lives], 2 - mov es:[bx+mikoconfig_t.rem_bombs], 3 - mov es:[bx+mikoconfig_t.start_lives], 2 - mov es:[bx+mikoconfig_t.start_bombs], 3 - mov al, _snd_bgm_mode - mov es:[bx+mikoconfig_t.bgm_mode], al - mov es:[bx+mikoconfig_t.rank], 1 - mov es:[bx+mikoconfig_t.continues_used], 0 - mov es:[bx+mikoconfig_t.unused_3], 0 - mov al, byte_E8FE - mov es:[bx+27h], al - mov es:[bx+mikoconfig_t.shottype], 0 - call sub_9CA2 - call text_clear - freePISlot 0 - freePISlot 1 - freePISlot 2 - call gaiji_restore - call super_free - call _game_exit - push 0 - push 0 - push ds - push offset path ; "main" - push ds - push offset path ; "main" - call _execl - add sp, 0Ch - pop bp - retf -sub_A027 endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_A0C6 proc far - push bp - mov bp, sp - call sub_9F37 - les bx, _mikoconfig - mov es:[bx+mikoconfig_t.rank], 4 - mov es:[bx+mikoconfig_t.stage], 5 - mov es:[bx+mikoconfig_t.rem_lives], 2 - mov es:[bx+mikoconfig_t.rem_bombs], 1 - mov es:[bx+mikoconfig_t.start_lives], 2 - mov es:[bx+mikoconfig_t.start_bombs], 1 - call sub_9CA2 - call _pi_slot_load stdcall, 0, offset aTs1_pi, ds - call text_clear - call shottype_menu - kajacall KAJA_SONG_FADE, 15 - add sp, 8 - call gaiji_restore - call super_free - call _game_exit - les bx, _mikoconfig - cmp es:[bx+mikoconfig_t.debug_flag], 0 - jz short loc_A13A - push 0 - push 0 - push ds - push offset aSelect ; "select" - push ds - push offset aSelect ; "select" - jmp short loc_A146 -; --------------------------------------------------------------------------- - -loc_A13A: - push 0 - push 0 - push ds - push offset path ; "main" - push ds - push offset path ; "main" - -loc_A146: - call _execl - add sp, 0Ch - pop bp - retf -sub_A0C6 endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_A150 proc near - push bp - mov bp, sp - push 11Ch - push 104h - push 10h - push ds - push offset gSTART - push 0 - call graph_gaiji_puts - push 0ECh - push 114h - push 10h - push ds - push offset gEXTRA_START - push 0 - call graph_gaiji_puts - push 10Ch - push 124h - push 10h - push ds - push offset gHISCORE - push 0 - call graph_gaiji_puts - push 114h - push 134h - push 10h - push ds - push offset gOPTION - push 0 - call graph_gaiji_puts - push 0F4h - push 144h - push 10h - push ds - push offset gMUSIC_MODE - push 0 - call graph_gaiji_puts - push 124h - push 154h - push 10h - push ds - push offset gQUIT - push 0 - call graph_gaiji_puts - push 0D4h - push 174h - push 10h - push ds - push offset gRANK - push 0 - call graph_gaiji_puts - push 134h - push 174h - push 10h - push ds - mov al, _rank - cbw - shl ax, 3 - add ax, offset gcEASY - push ax - push 0 - call graph_gaiji_puts - pop bp - retn -sub_A150 endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_A1F5 proc near - -arg_0 = word ptr 4 -arg_2 = word ptr 6 - - push bp - mov bp, sp - push si - push di - mov si, [bp+arg_2] - mov di, [bp+arg_0] - or si, si - jnz short loc_A20E - push 35 - push 16 - push ds - push offset gSTART - jmp short loc_A248 -; --------------------------------------------------------------------------- - -loc_A20E: - cmp si, 2 - jnz short loc_A21D - push 33 - push 18 - push ds - push offset gHISCORE - jmp short loc_A248 -; --------------------------------------------------------------------------- - -loc_A21D: - cmp si, 3 - jnz short loc_A22C - push 34 - push 19 - push ds - push offset gOPTION - jmp short loc_A248 -; --------------------------------------------------------------------------- - -loc_A22C: - cmp si, 4 - jnz short loc_A23B - push 30 - push 20 - push ds - push offset gMUSIC_MODE - jmp short loc_A248 -; --------------------------------------------------------------------------- - -loc_A23B: - cmp si, 5 - jnz short loc_A24E - push 36 - push 21 - push ds - push offset gQUIT - -loc_A248: - push di - call gaiji_putsa - -loc_A24E: - cmp si, 1 - jnz short loc_A274 - cmp _extra_unlocked, 0 - jz short loc_A265 - push 29 - push 17 - push ds - push offset gEXTRA_START - push di - jmp short loc_A26F -; --------------------------------------------------------------------------- - -loc_A265: - push 29 - push 17 - push ds - push offset gEXTRA_START - push TX_BLUE - -loc_A26F: - call gaiji_putsa - -loc_A274: - call gaiji_putsa pascal, 26, 23, ds, offset gRANK, TX_GREEN - push 38 - push 23 - push ds - mov al, _rank - cbw - shl ax, 3 - add ax, offset gcEASY - push ax - push TX_GREEN - call gaiji_putsa - pop di - pop si - pop bp - retn 4 -sub_A1F5 endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_A2A2 proc near - -arg_0 = byte ptr 4 -arg_2 = byte ptr 6 - - push bp - mov bp, sp - mov al, byte_D6C0 - cbw - call fp_E902 pascal, ax, TX_YELLOW - mov al, [bp+arg_0] - add byte_D6C0, al - cmp byte_D6C1, 0 - jnz short loc_A2D1 - cmp _extra_unlocked, 0 - jnz short loc_A2D1 - cmp byte_D6C0, 1 - jnz short loc_A2D1 - add byte_D6C0, al - -loc_A2D1: - cmp byte_D6C0, 0 - jge short loc_A2DE - mov al, [bp+arg_2] - mov byte_D6C0, al - -loc_A2DE: - mov al, byte_D6C0 - cmp al, [bp+arg_2] - jle short loc_A2EB - mov byte_D6C0, 0 - -loc_A2EB: - mov al, byte_D6C0 - cbw - push ax - push 0E1h - call fp_E902 - pop bp - retn 4 -sub_A2A2 endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_A2FB proc far - push bp - mov bp, sp - push si - cmp byte_D790, 0 - jnz short loc_A356 - mov byte_E8F8, 0 - mov byte_D790, 1 - call text_clear - mov dx, 0A4h ; '、' - mov al, 1 - out dx, al - push 0 - call graph_copy_page - call sub_A150 - mov dx, 0A4h ; '、' - mov al, 0 - out dx, al - mov word_E8FC, 0 - xor si, si - jmp short loc_A34B -; --------------------------------------------------------------------------- - -loc_A335: - push si - mov al, byte_D6C0 - cbw - cmp ax, si - jnz short loc_A343 - mov ax, TX_WHITE - jmp short loc_A346 -; --------------------------------------------------------------------------- - -loc_A343: - mov ax, TX_YELLOW - -loc_A346: - push ax - call sub_A1F5 - inc si - -loc_A34B: - cmp si, 6 - jl short loc_A335 - mov fp_E902, offset sub_A1F5 - -loc_A356: - cmp _input, 0 - jnz short loc_A362 - mov byte_E8F8, 1 - -loc_A362: - cmp byte_E8F8, 0 - jnz short loc_A36C - jmp loc_A466 -; --------------------------------------------------------------------------- - -loc_A36C: - test byte ptr _input, INPUT_UP - jz short loc_A37A - push 5 - push 0FFFFh - call sub_A2A2 - -loc_A37A: - test byte ptr _input, INPUT_DOWN - jz short loc_A388 - push 5 - push 1 - call sub_A2A2 - -loc_A388: - test byte ptr _input, INPUT_SHOT - jnz short loc_A399 - test byte ptr _input, INPUT_OK - jnz short loc_A399 - jmp loc_A448 -; --------------------------------------------------------------------------- - -loc_A399: - mov al, byte_D6C0 - cbw - mov bx, ax - cmp bx, 5 - jbe short loc_A3A7 - jmp loc_A448 -; --------------------------------------------------------------------------- - -loc_A3A7: - add bx, bx - jmp cs:off_A475[bx] - -loc_A3AE: - call sub_9FAF - jmp loc_A448 -; --------------------------------------------------------------------------- - -loc_A3B5: - call sub_A0C6 - jmp loc_A448 -; --------------------------------------------------------------------------- - -loc_A3BC: - mov _score_duration, 7D0h - call text_clear - call score_menu - mov dx, 0A6h ; 'ヲ' - mov al, 1 - out dx, al - mov dx, 0A4h ; '、' - mov al, 0 - out dx, al - call _pi_slot_load stdcall, 0, offset aOp2_pi, ds - call _pi_slot_palette_apply stdcall, 0 - call _pi_slot_put stdcall, 0, 0, 0 - add sp, 0Eh - freePISlot 0 - push ds - push offset aOp_rgb ; "op.rgb" - call palette_entry_rgb - call far ptr palette_show - push 0 - call graph_copy_page - mov dx, 0A6h ; 'ヲ' - mov al, 0 - out dx, al - -loc_A424: - mov byte_D790, 0 - jmp short loc_A448 -; --------------------------------------------------------------------------- - -loc_A42B: - mov byte_D6C0, 0 - mov byte_D6C1, 1 - jmp short loc_A424 -; --------------------------------------------------------------------------- - -loc_A437: - call text_clear - call musicroom - jmp short loc_A424 -; --------------------------------------------------------------------------- - -loc_A443: - mov byte_D6C2, 1 - -loc_A448: - test byte ptr _input, INPUT_CANCEL - jz short loc_A454 - mov byte_D6C2, 1 - -loc_A454: - cmp _input, 0 - jz short loc_A466 - mov byte_E8F8, 0 - mov word_E8FC, 0 - -loc_A466: - cmp word_E8FC, 280h - jbe short loc_A472 - call sub_A027 - -loc_A472: - pop si - pop bp - retf -sub_A2FB endp - -; --------------------------------------------------------------------------- -off_A475 dw offset loc_A3AE - dw offset loc_A3B5 - dw offset loc_A3BC - dw offset loc_A42B - dw offset loc_A437 - dw offset loc_A443 - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_A481 proc near - push bp - mov bp, sp - push 0C4h ; 'ト' - push 104h - push 10h - push ds - push offset gRANK - push 0 - call graph_gaiji_puts - push 0C4h ; 'ト' - push 114h - push 10h - push ds - push offset gMUSIC - push 0 - call graph_gaiji_puts - push 0C4h ; 'ト' - push 124h - push 10h - push ds - push offset gPLAYER - push 0 - call graph_gaiji_puts - push 0C4h ; 'ト' - push 134h - push 10h - push ds - push offset gBOMB - push 0 - call graph_gaiji_puts - push word ptr PERF_TITLE+2 - push word ptr PERF_TITLE - push 0 - push 144h - push 0C4h ; 'ト' - call _graph_putsa_fx - add sp, 0Ah - push 11Ch - push 154h - push 10h - push ds - push offset gRESET - push 0 - call graph_gaiji_puts - push 124h - push 174h - push 10h - push ds - push offset gQUIT - push 0 - call graph_gaiji_puts - pop bp - retn -sub_A481 endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_A510 proc near - -arg_0 = word ptr 4 -arg_2 = word ptr 6 - - push bp - mov bp, sp - push si - push di - mov di, [bp+arg_2] - mov si, [bp+arg_0] - or di, di - jnz short loc_A568 - push 24 - push 16 - push ds - push offset gRANK - push si - call gaiji_putsa - push 42 - push 16 - push ds - mov al, _rank - cbw - shl ax, 3 - add ax, offset gcEASY - push ax - push si - call gaiji_putsa - push 150h - push 104h - push 80h - push 10h - call graph_copy_rect_1_to_0 - push 154h - push 104h - push 10h - push ds - mov al, _rank - cbw - shl ax, 3 - add ax, offset gcEASY - jmp short loc_A5B3 -; --------------------------------------------------------------------------- - -loc_A568: - cmp di, 1 - jnz short loc_A5BE - call gaiji_putsa pascal, 24, 17, ds, offset gMUSIC, si - push 47 - push 17 - push ds - mov al, _snd_bgm_mode - cbw - imul ax, 5 - add ax, offset gOFF - push ax - push si - call gaiji_putsa - push 178h - push 114h - push 40h - push 10h - call graph_copy_rect_1_to_0 - push 17Ch - push 114h - push 10h - push ds - mov al, _snd_bgm_mode - cbw - imul ax, 5 - add ax, 145h - -loc_A5B3: - push ax - push 0 - call graph_gaiji_puts - jmp loc_A6E9 -; --------------------------------------------------------------------------- - -loc_A5BE: - cmp di, 2 - jnz short loc_A60A - call gaiji_putsa pascal, 24, 18, ds, offset gPLAYER, si - push 49 - push 18 - mov al, byte_F3E1 - cbw - add ax, 0A1h ; '。' - push ax - push si - call gaiji_putca - push 188h - push 124h - push 20h ; ' ' - push 10h - call graph_copy_rect_1_to_0 - push 18Ch - push 124h - mov al, byte_F3E1 - cbw - add ax, 0A1h ; '。' - push ax - push 0 - call graph_gaiji_putc - jmp loc_A6E9 -; --------------------------------------------------------------------------- - -loc_A60A: - cmp di, 3 - jnz short loc_A656 - call gaiji_putsa pascal, 24, 19, ds, offset gBOMB, si - push 49 - push 19 - mov al, byte_F3E2 - cbw - add ax, 0A0h - push ax - push si - call gaiji_putca - push 188h - push 134h - push 20h ; ' ' - push 10h - call graph_copy_rect_1_to_0 - push 18Ch - push 134h - mov al, byte_F3E2 - cbw - add ax, 0A0h - push ax - push 0 - call graph_gaiji_putc - jmp loc_A6E9 -; --------------------------------------------------------------------------- - -loc_A656: - cmp di, 4 - jnz short loc_A6C7 - call text_putsa pascal, 24, 20, word ptr PERF_TITLE+2, word ptr PERF_TITLE, si - push 45 - push 20 - les bx, _mikoconfig - mov al, es:[bx+mikoconfig_t.perf] - mov ah, 0 - shl ax, 2 - mov bx, ax - push word ptr (PERF_OPTION+2)[bx] - push word ptr PERF_OPTION[bx] - push si - call text_putsa - push 168h - push 144h - push 80h - push 10h - call graph_copy_rect_1_to_0 - les bx, _mikoconfig - mov al, es:[bx+mikoconfig_t.perf] - mov ah, 0 - shl ax, 2 - mov bx, ax - push word ptr (PERF_OPTION+2)[bx] - push word ptr PERF_OPTION[bx] - push 0 - push 144h - push 16Ch - call _graph_putsa_fx - add sp, 0Ah - jmp short loc_A6E9 -; --------------------------------------------------------------------------- - -loc_A6C7: - cmp di, 5 - jnz short loc_A6D6 - push 35 - push 21 - push ds - push offset gRESET - jmp short loc_A6E3 -; --------------------------------------------------------------------------- - -loc_A6D6: - cmp di, 6 - jnz short loc_A6E9 - push 36 - push 23 - push ds - push offset gQUIT - -loc_A6E3: - push si - call gaiji_putsa - -loc_A6E9: - pop di - pop si - pop bp - retn 4 -sub_A510 endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_A6EF proc near - push bp - mov bp, sp - cmp _snd_bgm_mode, SND_BGM_OFF - jnz short loc_A70E - mov _snd_fm_possible, 0 - kajacall KAJA_SONG_STOP - pop cx - mov _snd_active, 0 - pop bp - retn -; --------------------------------------------------------------------------- - -loc_A70E: - cmp _snd_bgm_mode, SND_BGM_FM - jnz short loc_A725 - kajacall KAJA_SONG_STOP - pop cx - mov _snd_midi_active, 0 - jmp short loc_A73B -; --------------------------------------------------------------------------- - -loc_A725: - cmp _snd_bgm_mode, SND_BGM_MIDI - jnz short loc_A748 - kajacall KAJA_SONG_STOP - pop cx - mov al, _snd_midi_possible - mov _snd_midi_active, al - -loc_A73B: - call _snd_determine_mode - kajacall KAJA_SONG_PLAY - pop cx - -loc_A748: - pop bp - retn -sub_A6EF endp - - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_A74A proc far - push bp - mov bp, sp - push si - cmp byte_D792, 0 - jnz short loc_A79F - mov byte_D791, 0 - mov byte_D792, 1 - call text_clear - mov dx, 0A4h ; '、' - mov al, 1 - out dx, al - push 0 - call graph_copy_page - call sub_A481 - mov dx, 0A4h ; '、' - mov al, 0 - out dx, al - xor si, si - jmp short loc_A794 -; --------------------------------------------------------------------------- - -loc_A77E: - push si - mov al, byte_D6C0 - cbw - cmp ax, si - jnz short loc_A78C - mov ax, TX_WHITE - jmp short loc_A78F -; --------------------------------------------------------------------------- - -loc_A78C: - mov ax, TX_YELLOW - -loc_A78F: - push ax - call sub_A510 - inc si - -loc_A794: - cmp si, 7 - jl short loc_A77E - mov fp_E902, offset sub_A510 - -loc_A79F: - cmp _input, 0 - jnz short loc_A7AB - mov byte_D791, 1 - -loc_A7AB: - cmp byte_D791, 0 - jnz short loc_A7B5 - jmp loc_A9A1 -; --------------------------------------------------------------------------- - -loc_A7B5: - test byte ptr _input, INPUT_UP - jz short loc_A7C3 - push 6 - push 0FFFFh - call sub_A2A2 - -loc_A7C3: - test byte ptr _input, INPUT_DOWN - jz short loc_A7D1 - push 6 - push 1 - call sub_A2A2 - -loc_A7D1: - test byte ptr _input, INPUT_RIGHT - jnz short loc_A7DB - jmp loc_A85C -; --------------------------------------------------------------------------- - -loc_A7DB: - mov al, byte_D6C0 - cbw - call sub_A510 pascal, ax, TX_YELLOW - mov al, byte_D6C0 - cbw - mov bx, ax - cmp bx, 4 - ja short loc_A851 - add bx, bx - jmp cs:off_A9AF[bx] - -loc_A7F8: - inc _rank - cmp _rank, 3 - jle short loc_A851 - mov _rank, 0 - jmp short loc_A851 -; --------------------------------------------------------------------------- - -loc_A80A: - inc _snd_bgm_mode - cmp _snd_bgm_mode, SND_BGM_MIDI - jle short loc_A81A - mov _snd_bgm_mode, SND_BGM_OFF - -loc_A81A: - call sub_A6EF - jmp short loc_A851 -; --------------------------------------------------------------------------- - -loc_A81F: - inc byte_F3E1 - cmp byte_F3E1, 4 - jle short loc_A851 - mov byte_F3E1, 0 - jmp short loc_A851 -; --------------------------------------------------------------------------- - -loc_A831: - inc byte_F3E2 - cmp byte_F3E2, 3 - jle short loc_A851 - mov byte_F3E2, 0 - jmp short loc_A851 -; --------------------------------------------------------------------------- - -loc_A843: - les bx, _mikoconfig - mov al, 1 - sub al, es:[bx+mikoconfig_t.perf] - mov es:[bx+mikoconfig_t.perf], al - -loc_A851: - mov al, byte_D6C0 - cbw - call sub_A510 pascal, ax, TX_WHITE - -loc_A85C: - test byte ptr _input, INPUT_LEFT - jnz short loc_A866 - jmp loc_A8E7 -; --------------------------------------------------------------------------- - -loc_A866: - mov al, byte_D6C0 - cbw - call sub_A510 pascal, ax, TX_YELLOW - mov al, byte_D6C0 - cbw - mov bx, ax - cmp bx, 4 - ja short loc_A8DC - add bx, bx - jmp cs:off_A9A5[bx] - -loc_A883: - dec _rank - cmp _rank, 0 - jge short loc_A8DC - mov _rank, 3 - jmp short loc_A8DC -; --------------------------------------------------------------------------- - -loc_A895: - dec _snd_bgm_mode - cmp _snd_bgm_mode, SND_BGM_OFF - jge short loc_A8A5 - mov _snd_bgm_mode, SND_BGM_MIDI - -loc_A8A5: - call sub_A6EF - jmp short loc_A8DC -; --------------------------------------------------------------------------- - -loc_A8AA: - dec byte_F3E1 - cmp byte_F3E1, 0 - jge short loc_A8DC - mov byte_F3E1, 4 - jmp short loc_A8DC -; --------------------------------------------------------------------------- - -loc_A8BC: - dec byte_F3E2 - cmp byte_F3E2, 0 - jge short loc_A8DC - mov byte_F3E2, 3 - jmp short loc_A8DC -; --------------------------------------------------------------------------- - -loc_A8CE: - les bx, _mikoconfig - mov al, 1 - sub al, es:[bx+mikoconfig_t.perf] - mov es:[bx+mikoconfig_t.perf], al - -loc_A8DC: - mov al, byte_D6C0 - cbw - push ax - push 0E1h - call sub_A510 - -loc_A8E7: - test byte ptr _input, INPUT_SHOT - jnz short loc_A8F8 - test byte ptr _input, INPUT_OK - jnz short loc_A8F8 - jmp loc_A97F -; --------------------------------------------------------------------------- - -loc_A8F8: - mov al, byte_D6C0 - cbw - cmp ax, 5 - jz short loc_A908 - cmp ax, 6 - jz short loc_A970 - jmp short loc_A97F -; --------------------------------------------------------------------------- - -loc_A908: - mov _rank, 1 - mov _snd_bgm_mode, SND_BGM_FM - kajacall KAJA_SONG_STOP - mov _snd_midi_active, 0 - call _snd_determine_mode - kajacall KAJA_SONG_PLAY - add sp, 4 - mov byte_F3E1, 2 - mov byte_F3E2, 3 - les bx, _mikoconfig - mov es:[bx+mikoconfig_t.unused_2], 1 - mov es:[bx+mikoconfig_t.perf], 0 - call sub_A510 pascal, 0, TX_YELLOW - call sub_A510 pascal, 1, TX_YELLOW - call sub_A510 pascal, 2, TX_YELLOW - call sub_A510 pascal, 3, TX_YELLOW - call sub_A510 pascal, 4, TX_YELLOW - jmp short loc_A97F -; --------------------------------------------------------------------------- - -loc_A970: - mov byte_D6C0, 3 - mov byte_D6C1, 0 - mov byte_D792, 0 - -loc_A97F: - test byte ptr _input, INPUT_CANCEL - jz short loc_A995 - mov byte_D6C0, 3 - mov byte_D6C1, 0 - mov byte_D792, 0 - -loc_A995: - cmp _input, 0 - jz short loc_A9A1 - mov byte_D791, 0 - -loc_A9A1: - pop si - pop bp - retf -sub_A74A endp - -; --------------------------------------------------------------------------- - db 0 -off_A9A5 dw offset loc_A883 - dw offset loc_A895 - dw offset loc_A8AA - dw offset loc_A8BC - dw offset loc_A8CE -off_A9AF dw offset loc_A7F8 - dw offset loc_A80A - dw offset loc_A81F - dw offset loc_A831 - dw offset loc_A843 - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -; int __cdecl main(int _argc, const char **_argv, const char **_envp) -public _main -_main proc far - -var_2 = byte ptr -2 -var_1 = byte ptr -1 -_argc = word ptr 6 -_argv = dword ptr 8 -_envp = dword ptr 0Ch - - enter 2, 0 - call _snd_pmd_resident - or ax, ax - jz short loc_A9EE - call _snd_mmd_resident - call _game_init_op - or ax, ax - jz short loc_A9DD - push 3 - call zun_error - jmp short loc_A9EE -; --------------------------------------------------------------------------- - -loc_A9DD: - call score_cleared_load - mov _extra_unlocked, al - call sub_9BF0 - cmp ax, 1 - jnz short loc_A9F3 - -loc_A9EE: - mov ax, 1 - leave - retf -; --------------------------------------------------------------------------- - -loc_A9F3: - call gaiji_backup - push ds - push offset aMikoft_bft ; "MIKOFT.bft" - call gaiji_entry_bfnt - les bx, _mikoconfig - cmp es:[bx+mikoconfig_t.demo_num], 0 - jnz short loc_AA1C - mov byte_E8FE, 1 - kajacall KAJA_SONG_STOP - pop cx - jmp short loc_AA4A -; --------------------------------------------------------------------------- - -loc_AA1C: - les bx, _mikoconfig - mov al, es:[bx+27h] - inc al - mov byte_E8FE, al - cmp byte_E8FE, 3 - jbe short loc_AA35 - mov byte_E8FE, 1 - -loc_AA35: - mov _score_duration, 15Eh - call score_menu - mov dx, 0A4h ; '、' - mov al, 0 - out dx, al - mov dx, 0A6h ; 'ヲ' - out dx, al - -loc_AA4A: - mov _input, 0 - mov al, _snd_bgm_mode - mov _snd_active, al - les bx, _mikoconfig - cmp es:[bx+mikoconfig_t.demo_num], 0 - jnz short loc_AA8F - cmp _snd_midi_possible, 0 - jz short loc_AA8F - mov al, _snd_midi_active - mov [bp+var_2], al - mov _snd_midi_active, 1 - call _snd_load stdcall, offset aGminit_m, ds, SND_LOAD_SONG - kajacall KAJA_SONG_PLAY - add sp, 8 - mov al, [bp+var_2] - mov _snd_midi_active, al - -loc_AA8F: - call sub_9D5C - call _pi_slot_load stdcall, 2, offset aTs3_pi, ds - call _pi_slot_load stdcall, 1, offset aTs2_pi, ds - add sp, 0Ch - mov _input, 0 - mov word_E8FC, 0 - jmp short loc_AAF0 -; --------------------------------------------------------------------------- - -loc_AABA: - call _input_sense - cmp byte_D6C1, 0 - jnz short loc_AACC - call sub_A2FB - jmp short loc_AAD7 -; --------------------------------------------------------------------------- - -loc_AACC: - cmp byte_D6C1, 1 - jnz short loc_AAD7 - call sub_A74A - -loc_AAD7: - les bx, _mikoconfig - add word ptr es:[bx+mikoconfig_t.frame], 1 - adc word ptr es:[bx+mikoconfig_t.frame+2], 0 - inc word_E8FC - push 1 - call frame_delay - -loc_AAF0: - cmp byte_D6C2, 0 - jz short loc_AABA - les bx, _mikoconfig - mov al, es:[bx+mikoconfig_t.main_retval] - mov [bp+var_1], al - mov word_E900, 0 - call sub_9CA2 - call text_clear - call graph_clear - call _game_exit_to_dos - call gaiji_restore - mov al, [bp-1] - mov ah, 0 - leave - retf -_main endp - op_01_TEXT ends ; =========================================================================== op_02_TEXT segment word public 'CODE' use16 - extern _game_exit_to_dos:proc - extern ZUN_ERROR:proc - extern _graph_putsa_fx:proc - extern _pi_slot_load:proc - extern GRAPH_COPY_RECT_1_TO_0:proc - extern _input_sense:proc - extern _game_init_op:proc - extern _game_exit:proc - extern _snd_mmd_resident:proc - extern _snd_determine_mode:proc - extern _snd_pmd_resident:proc - extern _snd_load:proc - extern _pi_slot_palette_apply:proc - extern _pi_slot_put:proc - extern _snd_kaja_interrupt:proc - extern _snd_se_reset:proc - extern _snd_se_play:proc - extern _snd_se_update:proc - extern FRAME_DELAY:proc op_02_TEXT ends ; =========================================================================== op_03_TEXT segment word public 'CODE' use16 - extern _title_flash:proc op_03_TEXT ends -; =========================================================================== - -op_04_TEXT segment byte public 'CODE' use16 - extern SCORE_MENU:proc - extern SCORE_CLEARED_LOAD:proc -op_04_TEXT ends - -; =========================================================================== - -op_05_TEXT segment byte public 'CODE' use16 - extern SHOTTYPE_MENU:proc -op_05_TEXT ends - -; =========================================================================== - -op_06_TEXT segment byte public 'CODE' use16 - extern MUSICROOM:proc -op_06_TEXT ends - .data -byte_D6C0 db 0 -byte_D6C1 db 0 -byte_D6C2 db 0 - db 0 -gZUN db 0C3h, 0BEh, 0B6h, 0 -include th02/strings/ranks_center[data].asm -gHIT_KEY db 0B1h, 0B2h, 0BDh, 0CFh, 0B4h, 0AEh, 0C2h, 0 -g7SPACES db 0CFh, 0CFh, 0CFh, 0CFh, 0CFh, 0CFh, 0CFh, 0 -gSTART db 0BCh, 0BDh, 0AAh, 0BBh, 0BDh, 0, 0, 0, 0, 0 -gEXTRA_START db 0AEh, 0C1h, 0BDh, 0BBh, 0AAh, 0CFh, 0BCh, 0BDh, 0AAh, 0BBh, 0BDh, 0 -gHISCORE db 0B1h, 0B2h, 0BCh, 0ACh, 0B8h, 0BBh, 0AEh, 0, 0, 0 -gOPTION db 0B8h, 0B9h, 0BDh, 0B2h, 0B8h, 0B6h, 0, 0, 0, 0 -gQUIT db 0BAh, 0BEh, 0B2h, 0BDh, 0, 0, 0, 0, 0, 0 -gRANK db 0BBh, 0AAh, 0B6h, 0B4h, 0, 0, 0, 0, 0, 0 -gPLAYER db 0B9h, 0B5h, 0AAh, 0C2h, 0AEh, 0BBh, 0, 0, 0, 0 -gMUSIC db 0B7h, 0BEh, 0BCh, 0B2h, 0ACh, 0, 0, 0, 0, 0 -gBOMB db 0ABh, 0B8h, 0B7h, 0ABh, 0, 0, 0, 0, 0, 0 -gMUSIC_MODE db 0B7h, 0BEh, 0BCh, 0B2h, 0ACh, 0CFh, 0B7h, 0B8h, 0ADh, 0AEh, 0 -gRESET db 0BBh, 0AEh, 0BCh, 0AEh, 0BDh, 0, 0, 0, 0, 0 -gsEASY db 0E8h, 0E9h, 0 -gsNORMAL db 0EAh, 0EBh, 0 -gsHARD db 0ECh, 0EDh, 0 -gsLUNATIC db 0EEh, 0EFh, 0 -gOFF db 0B8h, 0AFh, 0AFh, 0CFh, 0 -gFM db 0CFh, 0AFh, 0B7h, 0CFh, 0 -gMIDI db 0B7h, 0B2h, 0ADh, 0B2h, 0 -PERF_TITLE dd aPERF_TITLE -PERF_OPTION dd aPERF_NORMAL - dd aPERF_TRUNCATE -byte_D790 db 0 -byte_D791 db 0 -byte_D792 db 0 -aHuuma_cfg db 'huuma.cfg',0 -aHuuma_efc db 'huuma.efc',0 -aOp2_pi db 'op2.pi',0 -aOp_pi db 'op.pi',0 -aOpa_pi db 'opa.pi',0 -aOpb_pi db 'opb.pi',0 -aOpc_pi db 'opc.pi',0 -aOp_m db 'op.m',0 -aOp_rgb db 'op.rgb',0 -aTs1_pi db 'ts1.pi',0 -aSelect db 'select',0 -; char path[] -path db 'main',0 -aPERF_TITLE db '演出',0 -aPERF_NORMAL db ' 通常 ',0 -aPERF_TRUNCATE db '一部軽減',0 -aMikoft_bft db 'MIKOFT.bft',0 -aGminit_m db 'gminit.m',0 -aTs3_pi db 'ts3.pi',0 -aTs2_pi db 'ts2.pi',0 - db 0 include libs/master.lib/bfnt_id[data].asm include libs/master.lib/clip[data].asm include libs/master.lib/edges[data].asm @@ -1915,19 +157,9 @@ include libs/master.lib/mem[data].asm include libs/master.lib/super_entry_bfnt[data].asm include libs/master.lib/superpa[data].asm include th02/formats/pfopen[data].asm -extern _snd_active:byte -extern _rank:byte .data? -byte_E8F8 db ? -_snd_bgm_mode db ? - dw ? -word_E8FC dw ? -byte_E8FE db ? - db ? -word_E900 dw ? -fp_E902 dw ? include libs/master.lib/clip[bss].asm include libs/master.lib/fil[bss].asm include libs/master.lib/pal[bss].asm @@ -1945,12 +177,11 @@ include th02/snd/load[bss].asm public _mikoconfig _mikoconfig dd ? db ? ; -byte_F3E1 db ? -byte_F3E2 db ? +public _lives +_lives db ? +public _bombs +_bombs db ? dd ? ; dd ? ; - db ? ; -extern _extra_unlocked:byte -extern _score_duration:word end