; ; +-------------------------------------------------------------------------+ ; | This file has been generated by The Interactive Disassembler (IDA) | ; | Copyright (c) 2009 by Hex-Rays, | ; +-------------------------------------------------------------------------+ ; ; Input MD5 : F97D1B72F01476639E9D33E361F57330 ; File Name : th05/OP.EXE ; Format : MS-DOS executable (EXE) ; Base Address: 0h Range: 0h-14240h Loaded length: 1280Ah ; Entry Point : 0:0 ; OS type : MS DOS ; Application type: Executable 16bit .286 ; Force the .model directive to create 16-bit default segments... .model large __LARGE__ equ 1 .386 ; ... then switch to what we actually need. ; And yes, we can't move this to an include file for some reason. BINARY = 'O' include ReC98.inc include th05/th05.inc include th05/music/music.inc include th05/music/piano.inc extern SCOPY@:proc extern _execl:proc extern _getch:proc extern _strlen:proc ; =========================================================================== ; Segment type: Pure code _TEXT segment word public 'CODE' use16 assume cs:_TEXT assume es:nothing, ds:_DATA, fs:nothing, gs:nothing include libs/master.lib/bfnt_entry_pat.asm include libs/master.lib/bfnt_header_read.asm include libs/master.lib/bfnt_header_analysis.asm include libs/master.lib/atrtcmod.asm include libs/master.lib/bcloser.asm include libs/master.lib/bfill.asm include libs/master.lib/bfnt_palette_set.asm include libs/master.lib/bgetc.asm include libs/master.lib/palette_black_in.asm include libs/master.lib/palette_black_out.asm include libs/master.lib/bopenr.asm include libs/master.lib/bread.asm include libs/master.lib/bseek.asm include libs/master.lib/bseek_.asm include libs/master.lib/dos_axdx.asm include libs/master.lib/dos_keyclear.asm include libs/master.lib/dos_puts2.asm include libs/master.lib/dos_read.asm include libs/master.lib/dos_seek.asm include libs/master.lib/dos_setvect.asm include libs/master.lib/egc.asm include libs/master.lib/file_append.asm include libs/master.lib/file_close.asm include libs/master.lib/file_create.asm include libs/master.lib/file_exist.asm include libs/master.lib/file_read.asm include libs/master.lib/file_ropen.asm include libs/master.lib/file_seek.asm include libs/master.lib/file_write.asm include libs/master.lib/dos_close.asm include libs/master.lib/dos_ropen.asm include libs/master.lib/grcg_byteboxfill_x.asm include libs/master.lib/grcg_hline.asm include libs/master.lib/grcg_polygon_c.asm include libs/master.lib/grcg_setcolor.asm include libs/master.lib/grcg_vline.asm include libs/master.lib/get_machine_98.asm include libs/master.lib/get_machine_at.asm include libs/master.lib/get_machine_dosbox.asm include libs/master.lib/check_machine_fmr.asm include libs/master.lib/get_machine.asm include libs/master.lib/graph_400line.asm include libs/master.lib/graph_clear.asm include libs/master.lib/graph_copy_page.asm include libs/master.lib/graph_extmode.asm include libs/master.lib/graph_pi_free.asm include libs/master.lib/graph_pi_load_pack.asm include libs/master.lib/graph_show.asm include libs/master.lib/graph_start.asm include libs/master.lib/js_end.asm include libs/master.lib/keybeep.asm include libs/master.lib/make_linework.asm include libs/master.lib/palette_init.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm include libs/master.lib/pfgetc.asm include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm include libs/master.lib/random.asm include libs/master.lib/rottbl.asm include libs/master.lib/smem_release.asm include libs/master.lib/smem_wget.asm include libs/master.lib/soundio.asm include libs/master.lib/text_clear.asm include libs/master.lib/txesc.asm include libs/master.lib/vsync.asm include libs/master.lib/vsync_wait.asm include libs/master.lib/hmem_lallocate.asm include libs/master.lib/mem_assign_dos.asm include libs/master.lib/mem_assign.asm include libs/master.lib/memheap.asm include libs/master.lib/mem_unassign.asm include libs/master.lib/super_free.asm include libs/master.lib/super_entry_pat.asm include libs/master.lib/super_entry_at.asm include libs/master.lib/super_entry_bfnt.asm include libs/master.lib/super_cancel_pat.asm include libs/master.lib/super_put_rect.asm include libs/master.lib/super_put.asm include libs/master.lib/respal_exist.asm include libs/master.lib/respal_free.asm include libs/master.lib/js_start.asm include libs/master.lib/draw_trapezoid.asm include libs/master.lib/js_sense.asm include libs/master.lib/bgm_bell_org.asm include libs/master.lib/bgm_mget.asm include libs/master.lib/bgm_read_sdata.asm include libs/master.lib/bgm_timer.asm include libs/master.lib/bgm_pinit.asm include libs/master.lib/bgm_timerhook.asm include libs/master.lib/bgm_play.asm include libs/master.lib/bgm_sound.asm include libs/master.lib/bgm_effect_sound.asm include libs/master.lib/bgm_stop_play.asm include libs/master.lib/bgm_set_tempo.asm include libs/master.lib/bgm_init_finish.asm include libs/master.lib/bgm_stop_sound.asm include libs/master.lib/graph_pack_put_8_noclip.asm include libs/master.lib/graph_gaiji_puts.asm include libs/master.lib/graph_gaiji_putc.asm include libs/master.lib/pfint21.asm db 0 include th03/formats/pfopen.asm include libs/master.lib/pf_str_ieq.asm _TEXT ends ; =========================================================================== ; Segment type: Pure code op_01_TEXT segment byte public 'CODE' use16 assume cs:op_01_TEXT ; org 0Ch 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 public START_GAME start_game proc near push bp mov bp, sp push si push di les bx, _resident mov es:[bx+resident_t.end_sequence], ES_SCORE mov es:[bx+resident_t.demo_num], 0 mov es:[bx+resident_t.stage], 0 mov al, es:[bx+resident_t.cfg_lives] mov es:[bx+resident_t.credit_lives], al mov al, es:[bx+resident_t.cfg_bombs] mov es:[bx+resident_t.credit_bombs], al call playchar_menu or ax, ax jnz short loc_A443 xor si, si jmp short loc_A400 ; --------------------------------------------------------------------------- loc_A3CF: les bx, _resident add bx, si mov es:[bx+resident_t.score_last], 0 mov bx, word ptr _resident add bx, si mov es:[bx+resident_t.score_highest], 0 xor di, di jmp short loc_A3FA ; --------------------------------------------------------------------------- loc_A3E9: mov ax, di shl ax, 3 les bx, _resident add bx, ax mov es:[bx+si+resident_t.stage_score], 0 inc di loc_A3FA: cmp di, 6 jl short loc_A3E9 inc si loc_A400: cmp si, 8 jl short loc_A3CF call main_cdg_free call cfg_save kajacall KAJA_SONG_FADE, 10 call game_exit les bx, _resident cmp es:[bx+resident_t.debug_mode], 0 jnz short loc_A430 pushd 0 push ds push offset aMain ; "main" push ds push offset aMain ; "main" jmp short loc_A43B ; --------------------------------------------------------------------------- loc_A430: pushd 0 push ds push offset path ; "deb" push ds push offset path ; "deb" loc_A43B: call _execl add sp, 0Ch loc_A443: pop di pop si pop bp retn start_game endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public START_EXTRA start_extra proc near push bp mov bp, sp push si push di les bx, _resident mov es:[bx+resident_t.demo_num], 0 mov es:[bx+resident_t.stage], STAGE_EXTRA mov es:[bx+resident_t.credit_lives], 3 mov es:[bx+resident_t.credit_bombs], 3 call playchar_menu or ax, ax jnz short loc_A4CB xor si, si jmp short loc_A4A0 ; --------------------------------------------------------------------------- loc_A46F: les bx, _resident add bx, si mov es:[bx+resident_t.score_last], 0 mov bx, word ptr _resident add bx, si mov es:[bx+resident_t.score_highest], 0 xor di, di jmp short loc_A49A ; --------------------------------------------------------------------------- loc_A489: mov ax, di shl ax, 3 les bx, _resident add bx, ax mov es:[bx+si+resident_t.stage_score], 0 inc di loc_A49A: cmp di, 6 jl short loc_A489 inc si loc_A4A0: cmp si, 8 jl short loc_A46F call main_cdg_free call cfg_save kajacall KAJA_SONG_FADE, 10 call game_exit pushd 0 push ds push offset aMain ; "main" push ds push offset aMain ; "main" call _execl add sp, 0Ch loc_A4CB: pop di pop si pop bp retn start_extra endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public START_DEMO start_demo proc near push bp mov bp, sp push si les bx, _resident mov es:[bx+resident_t.end_sequence], ES_SCORE mov es:[bx+resident_t.stage], 0 mov es:[bx+resident_t.credit_lives], 3 mov es:[bx+resident_t.credit_bombs], 3 inc es:[bx+resident_t.demo_num] cmp es:[bx+resident_t.demo_num], 4 jbe short loc_A4FB mov es:[bx+resident_t.demo_num], 1 loc_A4FB: cmp _key_det, INPUT_LEFT or INPUT_RIGHT jnz short loc_A535 cmp _extra_playable_with.PLAYCHAR_REIMU, 0 jz short loc_A529 cmp _extra_playable_with.PLAYCHAR_MARISA, 0 jz short loc_A529 cmp _extra_playable_with.PLAYCHAR_MIMA, 0 jz short loc_A529 cmp _extra_playable_with.PLAYCHAR_YUUKA, 0 jz short loc_A529 les bx, _resident mov es:[bx+resident_t.demo_num], 5 jmp short loc_A535 ; --------------------------------------------------------------------------- loc_A529: les bx, _resident mov es:[bx+resident_t.demo_num], 0 jmp loc_A5E9 ; --------------------------------------------------------------------------- loc_A535: les bx, _resident mov al, es:[bx+resident_t.demo_num] mov ah, 0 dec ax mov bx, ax cmp bx, 4 ja short loc_A5A4 add bx, bx jmp cs:off_A5EC[bx] loc_A54E: les bx, _resident mov es:[bx+resident_t.playchar], PLAYCHAR_REIMU mov es:[bx+resident_t.demo_stage], 3 jmp short loc_A5A4 ; --------------------------------------------------------------------------- loc_A55E: les bx, _resident mov es:[bx+resident_t.playchar], PLAYCHAR_MARISA mov es:[bx+resident_t.demo_stage], 1 jmp short loc_A5A4 ; --------------------------------------------------------------------------- loc_A56E: les bx, _resident mov es:[bx+resident_t.playchar], PLAYCHAR_MIMA mov es:[bx+resident_t.demo_stage], 2 jmp short loc_A5A4 ; --------------------------------------------------------------------------- loc_A57E: les bx, _resident mov es:[bx+resident_t.playchar], PLAYCHAR_YUUKA mov es:[bx+resident_t.demo_stage], 4 jmp short loc_A5A4 ; --------------------------------------------------------------------------- loc_A58E: les bx, _resident mov es:[bx+resident_t.playchar], PLAYCHAR_MIMA mov es:[bx+resident_t.demo_stage], 6 kajacall KAJA_SONG_FADE, 8 loc_A5A4: xor si, si jmp short loc_A5BF ; --------------------------------------------------------------------------- loc_A5A8: les bx, _resident add bx, si mov es:[bx+resident_t.score_last], 0 mov bx, word ptr _resident add bx, si mov es:[bx+resident_t.score_highest], 0 inc si loc_A5BF: cmp si, 8 jl short loc_A5A8 call main_cdg_free call cfg_save push 1 call palette_black_out call game_exit pushd 0 push ds push offset aMain ; "main" push ds push offset aMain ; "main" call _execl add sp, 0Ch loc_A5E9: pop si pop bp retn start_demo endp ; --------------------------------------------------------------------------- off_A5EC dw offset loc_A54E dw offset loc_A55E dw offset loc_A56E dw offset loc_A57E dw offset loc_A58E ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public MAIN_PUT main_put proc near var_2 = word ptr -2 arg_0 = word ptr 4 arg_2 = word ptr 6 enter 2, 0 push si push di mov si, [bp+arg_2] mov ax, si imul ax, 20 add ax, 250 mov di, ax call egc_copy_rect_1_to_0 pascal, 256, ax, (128 shl 16) or 16 call grcg_setcolor pascal, GC_RMW, [bp+arg_0] mov [bp+var_2], si mov bx, si cmp bx, 5 ja short loc_A69A add bx, bx jmp cs:off_A70B[bx] loc_A634: push (272 shl 16) or 250 push 10 call cdg_put_nocolors les bx, _resident mov al, es:[bx+resident_t.rank] mov ah, 0 add ax, 22 mov [bp+var_2], ax jmp short loc_A69A ; --------------------------------------------------------------------------- loc_A653: cmp _extra_unlocked, 0 loc_A658: jnz short loc_A665 call grcg_setcolor pascal, (GC_RMW shl 16) + 2 loc_A665: push (272 shl 16) or 270 push 11 jmp short loc_A695 ; --------------------------------------------------------------------------- loc_A66F: push (272 shl 16) or 290 push 12 jmp short loc_A695 ; --------------------------------------------------------------------------- loc_A679: push (272 shl 16) or 310 push 13 jmp short loc_A695 ; --------------------------------------------------------------------------- loc_A683: push (272 shl 16) or 330 push 14 jmp short loc_A695 ; --------------------------------------------------------------------------- loc_A68D: push (272 shl 16) or 350 push 15 loc_A695: call cdg_put_nocolors loc_A69A: GRCG_OFF_CLOBBERING dx cmp [bp+arg_0], 0Eh jnz short loc_A705 call cdg_put pascal, 256, di, 35 call cdg_put pascal, 352, di, 36 call egc_copy_rect_1_to_0 pascal, large (0 shl 16) or 384, (RES_X shl 16) or 16 mov _graph_putsa_fx_func, 2 mov bx, [bp+var_2] shl bx, 2 pushd _MENU_DESC[bx] call _strlen add sp, 4 shl ax, 3 mov dx, 624 sub dx, ax push dx push (384 shl 16) or 9 mov bx, [bp+var_2] shl bx, 2 pushd _MENU_DESC[bx] call graph_putsa_fx loc_A705: pop di pop si leave retn 4 main_put endp ; --------------------------------------------------------------------------- off_A70B dw offset loc_A634 dw offset loc_A653 dw offset loc_A66F dw offset loc_A679 dw offset loc_A683 dw offset loc_A68D ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public OPTION_PUT option_put proc near @@y = word ptr -4 var_2 = word ptr -2 arg_0 = word ptr 4 arg_2 = word ptr 6 enter 4, 0 push si push di mov di, 224 mov ax, [bp+arg_2] shl ax, 4 add ax, 250 mov [bp+@@y], ax cmp [bp+arg_2], 7 jnz short loc_A737 mov [bp+@@y], 366 loc_A737: call egc_copy_rect_1_to_0 pascal, 224, [bp+@@y], (192 shl 16) or 16 call grcg_setcolor pascal, GC_RMW, [bp+arg_0] mov bx, [bp+arg_2] cmp bx, 7 ja loc_A8DA add bx, bx jmp cs:off_A958[bx] loc_A764: push (224 shl 16) or 250 push 16 call cdg_put_nocolors push (320 shl 16) or 250 les bx, _resident mov al, es:[bx+resident_t.rank] mov ah, 0 add ax, 21 push ax call cdg_put_nocolors les bx, _resident mov al, es:[bx+resident_t.rank] mov ah, 0 add ax, 6 loc_A797: mov si, ax jmp loc_A8DA ; --------------------------------------------------------------------------- loc_A79C: push (224 shl 16) or 266 push 17 call cdg_put_nocolors push (320 shl 16) or 266 les bx, _resident mov al, es:[bx+resident_t.cfg_lives] mov ah, 0 push ax call cdg_put_nocolors mov si, 0Ah jmp loc_A8DA ; --------------------------------------------------------------------------- loc_A7C5: push (224 shl 16) or 282 push 18 call cdg_put_nocolors push (320 shl 16) or 282 les bx, _resident mov al, es:[bx+resident_t.cfg_bombs] mov ah, 0 push ax call cdg_put_nocolors mov si, 0Bh jmp loc_A8DA ; --------------------------------------------------------------------------- loc_A7EE: push (224 shl 16) or 298 push 19 call cdg_put_nocolors les bx, _resident cmp es:[bx+resident_t.bgm_mode], SND_BGM_OFF jnz short loc_A80B mov ax, 1Ch jmp short loc_A818 ; --------------------------------------------------------------------------- loc_A80B: les bx, _resident mov al, es:[bx+resident_t.bgm_mode] mov ah, 0 add ax, 18h loc_A818: mov [bp+var_2], ax push (320 shl 16) or 298 push ax call cdg_put_nocolors les bx, _resident mov al, es:[bx+resident_t.bgm_mode] mov ah, 0 add ax, 0Ch jmp loc_A797 ; --------------------------------------------------------------------------- loc_A837: push (224 shl 16) or 314 push 20 call cdg_put_nocolors les bx, _resident cmp es:[bx+resident_t.se_mode], SND_SE_OFF jnz short loc_A854 mov ax, 1Ch jmp short loc_A865 ; --------------------------------------------------------------------------- loc_A854: les bx, _resident loc_A858: mov al, es:[bx+resident_t.se_mode] mov ah, 0 push ax mov ax, 1Fh pop dx sub ax, dx loc_A865: mov [bp+var_2], ax push (320 shl 16) or 314 push ax call cdg_put_nocolors les bx, _resident mov al, es:[bx+resident_t.se_mode] mov ah, 0 add ax, 0Fh jmp loc_A797 ; --------------------------------------------------------------------------- loc_A884: push (272 shl 16) or 330 les bx, _resident mov al, es:[bx+resident_t.turbo_mode] mov ah, 0 mov dx, 33 sub dx, ax push dx call cdg_put_nocolors mov di, 256 les bx, _resident mov al, es:[bx+resident_t.turbo_mode] mov ah, 0 add ax, 12h jmp loc_A797 ; --------------------------------------------------------------------------- loc_A8B2: push (272 shl 16) or 346 push 31 call cdg_put_nocolors mov di, 256 mov si, 14h jmp short loc_A8DA ; --------------------------------------------------------------------------- loc_A8C7: push (272 shl 16) or 366 push 15 call cdg_put_nocolors mov di, 256 mov si, 15h loc_A8DA: GRCG_OFF_CLOBBERING dx cmp [bp+arg_0], 0Eh jnz short loc_A951 call cdg_put pascal, di, [bp+@@y], 35 cmp di, 256 jnz short loc_A8FD lea ax, [di+96] push ax jmp short loc_A900 ; --------------------------------------------------------------------------- loc_A8FD: push 384 loc_A900: push [bp+@@y] push 36 call cdg_put call egc_copy_rect_1_to_0 pascal, large (0 shl 16) or 384, (RES_X shl 16) or 16 mov _graph_putsa_fx_func, 2 mov bx, si shl bx, 2 pushd _MENU_DESC[bx] call _strlen add sp, 4 shl ax, 3 mov dx, 624 sub dx, ax push dx push (384 shl 16) or 9 mov bx, si shl bx, 2 pushd _MENU_DESC[bx] call graph_putsa_fx loc_A951: pop di pop si leave retn 4 option_put endp ; --------------------------------------------------------------------------- db 0 off_A958 dw offset loc_A764 dw offset loc_A79C dw offset loc_A7C5 dw offset loc_A7EE dw offset loc_A837 dw offset loc_A884 dw offset loc_A8B2 dw offset loc_A8C7 ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public MENU_SEL_MOVE menu_sel_move proc near arg_0 = byte ptr 4 arg_2 = byte ptr 6 push bp mov bp, sp mov al, _menu_sel cbw push ax push 8 call _putfunc mov al, [bp+arg_0] add _menu_sel, al mov al, _menu_sel cbw or ax, ax jge short loc_A98B mov al, [bp+arg_2] mov _menu_sel, al loc_A98B: mov al, _menu_sel cmp al, [bp+arg_2] jle short loc_A998 mov _menu_sel, 0 loc_A998: cmp _extra_unlocked, 0 jnz short loc_A9B6 mov al, _menu_sel cbw cmp ax, 1 jnz short loc_A9B6 cmp _in_option, 0 jnz short loc_A9B6 mov al, [bp+arg_0] add _menu_sel, al loc_A9B6: mov al, _menu_sel cbw push ax push 0Eh call _putfunc call snd_se_reset call snd_se_play pascal, 1 call snd_se_update pop bp retn 4 menu_sel_move endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public MAIN_UPDATE_AND_RENDER main_update_and_render proc near push bp mov bp, sp push si cmp _main_menu_initialized, 0 jnz short loc_AA2B mov _main_menu_unused_1, 0 mov _main_input_allowed, 0 call egc_copy_rect_1_to_0 pascal, (192 shl 16) or 250, (288 shl 16) or 160 xor si, si jmp short loc_AA16 ; --------------------------------------------------------------------------- loc_AA00: push si mov al, _menu_sel cbw cmp ax, si jnz short loc_AA0E mov ax, 0Eh jmp short loc_AA11 ; --------------------------------------------------------------------------- loc_AA0E: mov ax, 8 loc_AA11: push ax call main_put inc si loc_AA16: cmp si, 6 jl short loc_AA00 mov _putfunc, offset main_put mov _main_menu_initialized, 1 mov _main_input_allowed, 0 loc_AA2B: cmp _key_det, INPUT_NONE jnz short loc_AA37 mov _main_input_allowed, 1 loc_AA37: cmp _main_input_allowed, 0 jz loc_ABC0 test _key_det.lo, low INPUT_UP jz short loc_AA4E call menu_sel_move pascal, 5, -1 loc_AA4E: test _key_det.lo, low INPUT_DOWN jz short loc_AA5C call menu_sel_move pascal, 5, 1 loc_AA5C: test _key_det.hi, high INPUT_OK jnz short loc_AA6C test _key_det.lo, low INPUT_SHOT jz loc_ABA8 loc_AA6C: call snd_se_reset call snd_se_play pascal, 11 call snd_se_update mov al, _menu_sel cbw mov bx, ax cmp bx, 5 ja loc_ABA8 add bx, bx jmp cs:off_ABC3[bx] loc_AA91: call start_game graph_accesspage 1 call pi_slot_load pascal, 0, ds, offset aOp1_pi call pi_slot_palette_apply pascal, 0 call pi_slot_put pascal, large 0, 0 call pi_slot_free pascal, 0 call graph_copy_page pascal, 0 mov PaletteTone, 100 call far ptr palette_show mov _main_menu_initialized, 0 mov _in_option, 0 mov _menu_sel, 0 jmp loc_ABC0 ; --------------------------------------------------------------------------- loc_AAE1: call start_extra graph_accesspage 1 call pi_slot_load pascal, 0, ds, offset aOp1_pi call pi_slot_palette_apply pascal, 0 call pi_slot_put pascal, large 0, 0 call pi_slot_free pascal, 0 call graph_copy_page pascal, 0 mov PaletteTone, 100 call far ptr palette_show mov _main_menu_initialized, 0 mov _in_option, 0 mov _menu_sel, 1 jmp loc_ABC0 ; --------------------------------------------------------------------------- loc_AB31: call score_menu mov _main_menu_initialized, 0 jmp short loc_ABA8 ; --------------------------------------------------------------------------- loc_AB3B: call musicroom call main_cdg_load graph_accesspage 1 call pi_slot_load pascal, 0, ds, offset aOp1_pi call pi_slot_palette_apply pascal, 0 call pi_slot_put pascal, large 0, 0 call pi_slot_free pascal, 0 call graph_copy_page pascal, 0 mov PaletteTone, 100 call far ptr palette_show mov _main_menu_initialized, 0 mov _in_option, 0 mov _menu_sel, 3 jmp short loc_ABC0 ; --------------------------------------------------------------------------- loc_AB8D: mov _main_menu_initialized, 0 mov _in_option, 1 mov _menu_sel, 0 jmp short loc_ABA8 ; --------------------------------------------------------------------------- loc_AB9E: mov _main_menu_initialized, 0 mov _quit, 1 loc_ABA8: test _key_det.hi, high INPUT_CANCEL jz short loc_ABB4 mov _quit, 1 loc_ABB4: cmp _key_det, INPUT_NONE jz short loc_ABC0 mov _main_input_allowed, 0 loc_ABC0: pop si pop bp retn main_update_and_render endp ; --------------------------------------------------------------------------- off_ABC3 dw offset loc_AA91 dw offset loc_AAE1 dw offset loc_AB31 dw offset loc_AB3B dw offset loc_AB8D dw offset loc_AB9E ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public OPTION_UPDATE_AND_RENDER option_update_and_render proc near push bp mov bp, sp push si cmp _option_initialized, 0 jnz short loc_AC1F mov _option_input_allowed, 0 call egc_copy_rect_1_to_0 pascal, (272 shl 16) or 250, (160 shl 16) or 144 xor si, si jmp short loc_AC0A ; --------------------------------------------------------------------------- loc_ABF4: push si mov al, _menu_sel cbw cmp ax, si jnz short loc_AC02 mov ax, 0Eh jmp short loc_AC05 ; --------------------------------------------------------------------------- loc_AC02: mov ax, 8 loc_AC05: push ax call option_put inc si loc_AC0A: cmp si, 8 jl short loc_ABF4 mov _putfunc, offset option_put mov _option_initialized, 1 mov _option_input_allowed, 0 loc_AC1F: cmp _key_det, INPUT_NONE jnz short loc_AC2B mov _option_input_allowed, 1 loc_AC2B: cmp _option_input_allowed, 0 jz loc_AF2E test _key_det.lo, low INPUT_UP jz short loc_AC42 call menu_sel_move pascal, 7, -1 loc_AC42: test _key_det.lo, low INPUT_DOWN jz short loc_AC50 call menu_sel_move pascal, 7, 1 loc_AC50: test _key_det.hi, high INPUT_OK jnz short loc_AC60 test _key_det.lo, low INPUT_SHOT jz loc_ACF8 loc_AC60: mov al, _menu_sel cbw cmp ax, 6 jz short loc_AC71 cmp ax, 7 jz short loc_ACD8 jmp loc_AD01 ; --------------------------------------------------------------------------- loc_AC71: les bx, _resident mov es:[bx+resident_t.rank], RANK_NORMAL mov es:[bx+resident_t.cfg_lives], 3 mov es:[bx+resident_t.cfg_bombs], 3 mov es:[bx+resident_t.bgm_mode], SND_BGM_FM86 mov es:[bx+resident_t.se_mode], SND_SE_FM mov es:[bx+resident_t.turbo_mode], 1 kajacall KAJA_SONG_STOP les bx, _resident mov al, es:[bx+resident_t.bgm_mode] mov ah, 0 push ax mov al, es:[bx+resident_t.se_mode] mov ah, 0 push ax call snd_determine_modes call snd_load pascal, ds, offset aMiko, SND_LOAD_SE call snd_load pascal, ds, offset aOp, SND_LOAD_SONG kajacall KAJA_SONG_PLAY mov _option_initialized, 0 jmp short loc_ACF8 ; --------------------------------------------------------------------------- loc_ACD8: call snd_se_reset call snd_se_play pascal, 11 call snd_se_update mov _option_initialized, 0 mov _menu_sel, 4 mov _in_option, 0 loc_ACF8: test _key_det.lo, low INPUT_RIGHT jz loc_ADFF loc_AD01: mov al, _menu_sel cbw mov bx, ax cmp bx, 5 ja loc_ADF5 add bx, bx jmp cs:off_AF3D[bx] loc_AD15: les bx, _resident inc es:[bx+resident_t.rank] cmp es:[bx+resident_t.rank], RANK_LUNATIC jbe loc_ADF5 mov es:[bx+resident_t.rank], RANK_EASY jmp loc_ADF5 ; --------------------------------------------------------------------------- loc_AD2E: les bx, _resident inc es:[bx+resident_t.cfg_lives] cmp es:[bx+resident_t.cfg_lives], 6 jbe loc_ADF5 mov es:[bx+resident_t.cfg_lives], 1 jmp loc_ADF5 ; --------------------------------------------------------------------------- loc_AD47: les bx, _resident inc es:[bx+resident_t.cfg_bombs] cmp es:[bx+resident_t.cfg_bombs], 3 jbe loc_ADF5 mov es:[bx+resident_t.cfg_bombs], 0 jmp loc_ADF5 ; --------------------------------------------------------------------------- loc_AD60: les bx, _resident inc es:[bx+resident_t.bgm_mode] cmp es:[bx+resident_t.bgm_mode], SND_BGM_MODE_COUNT jb short loc_AD74 mov es:[bx+resident_t.bgm_mode], SND_BGM_OFF loc_AD74: kajacall KAJA_SONG_STOP les bx, _resident mov al, es:[bx+resident_t.bgm_mode] mov ah, 0 push ax mov al, es:[bx+resident_t.se_mode] mov ah, 0 push ax call snd_determine_modes call snd_load pascal, ds, offset aOp, SND_LOAD_SONG kajacall KAJA_SONG_PLAY jmp short loc_ADF5 ; --------------------------------------------------------------------------- loc_ADA8: les bx, _resident cmp es:[bx+resident_t.se_mode], SND_SE_OFF jnz short loc_ADBA mov es:[bx+resident_t.se_mode], SND_SE_BEEP jmp short loc_ADC2 ; --------------------------------------------------------------------------- loc_ADBA: les bx, _resident dec es:[bx+resident_t.se_mode] loc_ADC2: les bx, _resident mov al, es:[bx+resident_t.bgm_mode] mov ah, 0 push ax mov al, es:[bx+resident_t.se_mode] mov ah, 0 push ax call snd_determine_modes call snd_load pascal, ds, offset aMiko, SND_LOAD_SE jmp short loc_ADF5 ; --------------------------------------------------------------------------- loc_ADE7: les bx, _resident mov al, 1 sub al, es:[bx+resident_t.turbo_mode] mov es:[bx+resident_t.turbo_mode], al loc_ADF5: mov al, _menu_sel cbw push ax push 0Eh call option_put loc_ADFF: test _key_det.lo, low INPUT_LEFT jz loc_AF0C mov al, _menu_sel cbw mov bx, ax cmp bx, 5 ja loc_AF02 add bx, bx jmp cs:off_AF31[bx] loc_AE1C: les bx, _resident cmp es:[bx+resident_t.rank], RANK_EASY jnz short loc_AE2C mov es:[bx+resident_t.rank], RANK_EXTRA loc_AE2C: les bx, _resident dec es:[bx+resident_t.rank] jmp loc_AF02 ; --------------------------------------------------------------------------- loc_AE37: les bx, _resident cmp es:[bx+resident_t.cfg_lives], 1 jnz short loc_AE47 mov es:[bx+resident_t.cfg_lives], 7 loc_AE47: les bx, _resident dec es:[bx+resident_t.cfg_lives] jmp loc_AF02 ; --------------------------------------------------------------------------- loc_AE52: les bx, _resident cmp es:[bx+resident_t.cfg_bombs], 0 jnz short loc_AE62 mov es:[bx+resident_t.cfg_bombs], 4 loc_AE62: les bx, _resident dec es:[bx+resident_t.cfg_bombs] jmp loc_AF02 ; --------------------------------------------------------------------------- loc_AE6D: les bx, _resident cmp es:[bx+resident_t.bgm_mode], SND_BGM_OFF jnz short loc_AE7F mov es:[bx+resident_t.bgm_mode], SND_BGM_FM86 jmp short loc_AE87 ; --------------------------------------------------------------------------- loc_AE7F: les bx, _resident dec es:[bx+resident_t.bgm_mode] loc_AE87: kajacall KAJA_SONG_STOP les bx, _resident mov al, es:[bx+resident_t.bgm_mode] mov ah, 0 push ax mov al, es:[bx+resident_t.se_mode] mov ah, 0 push ax call snd_determine_modes call snd_load pascal, ds, offset aOp, SND_LOAD_SONG kajacall KAJA_SONG_PLAY jmp short loc_AF02 ; --------------------------------------------------------------------------- loc_AEBB: les bx, _resident inc es:[bx+resident_t.se_mode] cmp es:[bx+resident_t.se_mode], SND_SE_MODE_COUNT jb short loc_AECF mov es:[bx+resident_t.se_mode], SND_SE_OFF loc_AECF: les bx, _resident mov al, es:[bx+resident_t.bgm_mode] mov ah, 0 push ax mov al, es:[bx+resident_t.se_mode] mov ah, 0 push ax call snd_determine_modes call snd_load pascal, ds, offset aMiko, SND_LOAD_SE jmp short loc_AF02 ; --------------------------------------------------------------------------- loc_AEF4: les bx, _resident mov al, 1 sub al, es:[bx+resident_t.turbo_mode] mov es:[bx+resident_t.turbo_mode], al loc_AF02: mov al, _menu_sel cbw push ax push 0Eh call option_put loc_AF0C: test _key_det.hi, high INPUT_CANCEL jz short loc_AF22 mov _option_initialized, 0 mov _menu_sel, 4 mov _in_option, 0 loc_AF22: cmp _key_det, INPUT_NONE jz short loc_AF2E mov _option_input_allowed, 0 loc_AF2E: pop si pop bp retn option_update_and_render endp ; --------------------------------------------------------------------------- off_AF31 dw offset loc_AE1C dw offset loc_AE37 dw offset loc_AE52 dw offset loc_AE6D dw offset loc_AEBB dw offset loc_AEF4 off_AF3D dw offset loc_AD15 dw offset loc_AD2E dw offset loc_AD47 dw offset loc_AD60 dw offset loc_ADA8 dw offset loc_ADE7 ; =============== 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 _argc = word ptr 6 _argv = dword ptr 8 _envp = dword ptr 0Ch push bp mov bp, sp push si xor si, si call text_clear call respal_create mov _mem_assign_paras, MEM_ASSIGN_PARAS_OP call _game_init_op c, offset aKaikidan1_dat0, ds or ax, ax jz short loc_AF7D push ds push offset aNotEnoughMem call dos_puts2 call _getch loc_AF7D: call cfg_load les bx, _resident cmp es:[bx+resident_t.rank], RANK_DEFAULT jnz short loc_AF97 call sub_B5A6 les bx, _resident mov es:[bx+resident_t.rank], 1 loc_AF97: les bx, _resident mov al, es:[bx+resident_t.bgm_mode] mov ah, 0 push ax mov al, es:[bx+resident_t.se_mode] mov ah, 0 push ax call snd_determine_modes call snd_load pascal, ds, offset aMiko, SND_LOAD_SE les bx, _resident cmp es:[bx+resident_t.zunsoft_shown], 0 jnz short loc_AFD1 call zunsoft les bx, _resident mov es:[bx+resident_t.zunsoft_shown], 1 loc_AFD1: les bx, _resident cmp es:[bx+resident_t.demo_num], 5 jnz short loc_AFE1 mov es:[bx+resident_t.demo_num], 0 loc_AFE1: les bx, _resident cmp es:[bx+resident_t.demo_num], 0 jnz short loc_AFF4 kajacall KAJA_SONG_STOP loc_AFF4: call op_animate call main_cdg_load call scoredat_cleared_load mov _in_option, 0 mov _quit, 0 mov _menu_sel, 0 jmp short loc_B058 ; --------------------------------------------------------------------------- loc_B00E: call _input_reset_sense_held mov al, _in_option cbw or ax, ax jz short loc_B022 cmp ax, 1 jz short loc_B032 jmp short loc_B035 ; --------------------------------------------------------------------------- loc_B022: call main_update_and_render cmp si, 640 jl short loc_B035 call start_demo xor si, si jmp short loc_B035 ; --------------------------------------------------------------------------- loc_B032: call option_update_and_render loc_B035: cmp _key_det, INPUT_NONE jz short loc_B043 cmp _key_det, INPUT_LEFT or INPUT_RIGHT jnz short loc_B046 loc_B043: inc si jmp short loc_B048 ; --------------------------------------------------------------------------- loc_B046: xor si, si loc_B048: les bx, _resident inc es:[bx+resident_t.rand] push 1 call frame_delay loc_B058: cmp _quit, 0 jz short loc_B00E call main_cdg_free call cfg_save_exit call text_clear call game_exit_to_dos call respal_free pop si pop bp retf _main endp include th04/setup.asm ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame sub_B36C proc near var_2 = word ptr -2 enter 2, 0 mov _window_tiles.x, (448 / WINDOW_TILE_W) call window_singleline pascal, (96 shl 16) or 80 call graph_putsa_fx pascal, (112 shl 16) or 88, 15, ds, offset aSETUP_BGM_HEAD mov _window_tiles.x, (160 / WINDOW_TILE_W) mov _window_tiles.y, 1 + 3 call window_dropdown_animate pascal, ( 32 shl 16) or 128 mov [bp+var_2], 0 jmp short loc_B3C3 ; --------------------------------------------------------------------------- loc_B3AC: push [bp+var_2] cmp [bp+var_2], 2 jnz short loc_B3BA mov ax, 0Fh jmp short loc_B3BC ; --------------------------------------------------------------------------- loc_B3BA: xor ax, ax loc_B3BC: push ax call setup_bgm_choice_put inc [bp+var_2] loc_B3C3: cmp [bp+var_2], 3 jl short loc_B3AC mov _window_tiles.x, (400 / WINDOW_TILE_W) mov _window_tiles.y, 1 + 9 call window_dropdown_animate pascal, (192 shl 16) or 128 call setup_bgm_help_put mov [bp+var_2], 2 loc_B3E6: call input_wait_for_change pascal, 0 push 1 call frame_delay test _key_det.hi, high INPUT_OK jnz short loc_B452 test _key_det.lo, low INPUT_SHOT jnz short loc_B452 test _key_det.lo, low INPUT_UP jz short loc_B429 call setup_bgm_choice_put pascal, [bp+var_2], 0 cmp [bp+var_2], 2 jnz short loc_B41E mov [bp+var_2], 0 jmp short loc_B421 ; --------------------------------------------------------------------------- loc_B41E: inc [bp+var_2] loc_B421: call setup_bgm_choice_put pascal, [bp+var_2], 0Fh loc_B429: test _key_det.lo, low INPUT_DOWN jz short loc_B3E6 call setup_bgm_choice_put pascal, [bp+var_2], 0 cmp [bp+var_2], 0 jnz short loc_B445 mov [bp+var_2], 2 jmp short loc_B448 ; --------------------------------------------------------------------------- loc_B445: dec [bp+var_2] loc_B448: call setup_bgm_choice_put pascal, [bp+var_2], 0Fh jmp short loc_B3E6 ; --------------------------------------------------------------------------- loc_B452: mov _window_tiles.x, (400 / WINDOW_TILE_W) mov _window_tiles.y, 1 + 9 call window_rollup_animate pascal, (192 shl 16) or 128 mov _window_tiles.x, (160 / WINDOW_TILE_W) mov _window_tiles.y, 1 + 3 call window_rollup_animate pascal, ( 32 shl 16) or 128 les bx, _resident mov al, byte ptr [bp+var_2] mov es:[bx+resident_t.bgm_mode], al leave retn sub_B36C endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame sub_B489 proc near var_2 = word ptr -2 enter 2, 0 mov _window_tiles.x, (448 / WINDOW_TILE_W) call window_singleline pascal, (96 shl 16) or 80 call graph_putsa_fx pascal, (112 shl 16) or 88, 15, ds, offset aSETUP_SE_HEAD mov _window_tiles.x, (160 / WINDOW_TILE_W) mov _window_tiles.y, 1 + 3 call window_dropdown_animate pascal, ( 32 shl 16) or 128 mov [bp+var_2], 0 jmp short loc_B4E0 ; --------------------------------------------------------------------------- loc_B4C9: push [bp+var_2] cmp [bp+var_2], 1 jnz short loc_B4D7 mov ax, 15 jmp short loc_B4D9 ; --------------------------------------------------------------------------- loc_B4D7: xor ax, ax loc_B4D9: push ax call setup_se_choice_put inc [bp+var_2] loc_B4E0: cmp [bp+var_2], 3 jl short loc_B4C9 mov _window_tiles.x, (400 / WINDOW_TILE_W) mov _window_tiles.y, 1 + 9 call window_dropdown_animate pascal, (192 shl 16) or 128 call setup_se_help_put mov [bp+var_2], 1 loc_B503: call input_wait_for_change pascal, 0 push 1 call frame_delay test _key_det.hi, high INPUT_OK jnz short loc_B56F test _key_det.lo, low INPUT_SHOT jnz short loc_B56F test _key_det.lo, low INPUT_DOWN jz short loc_B546 call setup_se_choice_put pascal, [bp+var_2], 0 cmp [bp+var_2], 2 jnz short loc_B53B mov [bp+var_2], 0 jmp short loc_B53E ; --------------------------------------------------------------------------- loc_B53B: inc [bp+var_2] loc_B53E: call setup_se_choice_put pascal, [bp+var_2], 15 loc_B546: test _key_det.lo, low INPUT_UP jz short loc_B503 call setup_se_choice_put pascal, [bp+var_2], 0 cmp [bp+var_2], 0 jnz short loc_B562 mov [bp+var_2], 2 jmp short loc_B565 ; --------------------------------------------------------------------------- loc_B562: dec [bp+var_2] loc_B565: call setup_se_choice_put pascal, [bp+var_2], 15 jmp short loc_B503 ; --------------------------------------------------------------------------- loc_B56F: mov _window_tiles.x, (400 / WINDOW_TILE_W) mov _window_tiles.y, 1 + 9 call window_rollup_animate pascal, (192 shl 16) or 128 mov _window_tiles.x, (160 / WINDOW_TILE_W) mov _window_tiles.y, 1 + 3 call window_rollup_animate pascal, ( 32 shl 16) or 128 les bx, _resident mov al, byte ptr [bp+var_2] mov es:[bx+resident_t.se_mode], al leave retn sub_B489 endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame sub_B5A6 proc near push bp mov bp, sp mov PaletteTone, 0 call far ptr palette_show push ds push offset aMswin_bft ; "mswin.bft" call super_entry_bfnt graph_accesspage 1 call pi_slot_load pascal, 0, ds, offset aMs_pi call pi_slot_palette_apply pascal, 0 call pi_slot_put pascal, large 0, 0 call pi_slot_free pascal, 0 call graph_copy_page pascal, 0 push 1 call palette_black_in call sub_B36C push 1 call frame_delay call graph_copy_page pascal, 0 call sub_B489 push 1 call palette_black_out call super_free pop bp retn sub_B5A6 endp include th04/zunsoft.asm ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public CFG_LOAD cfg_load proc near var_C = word ptr -0Ch var_A = byte ptr -0Ah var_4 = word ptr -4 enter 0Ch, 0 push ds push offset aMiko_cfg ; "MIKO.CFG" call file_ropen push ss lea ax, [bp+var_A] push ax push 0Ah call file_read call file_close mov ax, [bp+var_4] mov [bp+var_C], ax mov word ptr _resident+2, ax mov word ptr _resident, 0 les bx, _resident cmp es:[bx+resident_t.cfg_lives], 6 ja short loc_BAD3 cmp es:[bx+resident_t.cfg_lives], 0 jnz short loc_BADC loc_BAD3: les bx, _resident mov es:[bx+resident_t.cfg_lives], 3 loc_BADC: les bx, _resident cmp es:[bx+resident_t.cfg_bombs], 3 jbe short loc_BAEC mov es:[bx+resident_t.cfg_bombs], 3 loc_BAEC: les bx, _resident cmp es:[bx+resident_t.bgm_mode], SND_BGM_MODE_COUNT jb short loc_BAFC mov es:[bx+resident_t.bgm_mode], SND_BGM_OFF loc_BAFC: les bx, _resident cmp es:[bx+resident_t.se_mode], SND_SE_MODE_COUNT jb short locret_BB0C mov es:[bx+resident_t.se_mode], SND_SE_OFF locret_BB0C: leave retn cfg_load endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public CFG_SAVE cfg_save proc near 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 = byte ptr -3 var_2 = byte ptr -2 enter 8, 0 push ds push offset aMiko_cfg ; "MIKO.CFG" call file_append pushd 0 push 0 call file_seek les bx, _resident mov al, es:[bx+resident_t.rank] mov [bp+var_8], al mov al, es:[bx+resident_t.cfg_lives] mov [bp+var_7], al mov al, es:[bx+resident_t.cfg_bombs] mov [bp+var_6], al mov al, es:[bx+resident_t.bgm_mode] mov [bp+var_5], al mov al, es:[bx+resident_t.se_mode] mov [bp+var_4], al mov al, es:[bx+resident_t.turbo_mode] mov [bp+var_3], al push ss lea ax, [bp+var_8] push ax push 6 call file_write pushd 9 push 0 call file_seek mov al, [bp+var_8] add al, [bp+var_7] add al, [bp+var_6] add al, [bp+var_5] add al, [bp+var_4] add al, [bp+var_3] mov [bp+var_2], al push ss lea ax, [bp+var_2] push ax push 1 call file_write call file_close leave retn cfg_save endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public CFG_SAVE_EXIT cfg_save_exit proc near var_A = byte ptr -0Ah var_9 = byte ptr -9 var_8 = byte ptr -8 var_7 = byte ptr -7 var_6 = byte ptr -6 var_5 = byte ptr -5 var_1 = byte ptr -1 enter 0Ah, 0 lea ax, [bp+var_A] push ss push ax push ds push offset unk_FF00 mov cx, 0Ah call SCOPY@ push ds push offset aMiko_cfg ; "MIKO.CFG" call file_append pushd 0 push 0 call file_seek les bx, _resident mov al, es:[bx+resident_t.rank] mov [bp+var_A], al mov al, es:[bx+resident_t.cfg_lives] mov [bp+var_9], al mov al, es:[bx+resident_t.cfg_bombs] mov [bp+var_8], al mov al, es:[bx+resident_t.bgm_mode] mov [bp+var_7], al mov al, es:[bx+resident_t.se_mode] mov [bp+var_6], al mov al, es:[bx+resident_t.turbo_mode] mov [bp+var_5], al mov al, [bp+var_A] add al, [bp+var_9] add al, [bp+var_8] add al, [bp+var_7] add al, [bp+var_6] add al, [bp+var_5] mov [bp+var_1], al push ss lea ax, [bp+var_A] push ax push 0Ah call file_write call file_close leave retn cfg_save_exit endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame main_cdg_load proc near push bp mov bp, sp call cdg_load_all pascal, 0, ds, offset aSft1_cd2 call cdg_load_all pascal, 10, ds, offset aSft2_cd2 call cdg_load_all pascal, 35, ds, offset aCar_cd2 call cdg_load_single_noalpha pascal, 40, ds, offset aSl00_cdg, 0 call cdg_load_single_noalpha pascal, 41, ds, offset aSl01_cdg, 0 call cdg_load_single_noalpha pascal, 42, ds, offset aSl02_cdg, 0 call cdg_load_single_noalpha pascal, 43, ds, offset aSl03_cdg, 0 call cdg_load_single pascal, 44, ds, offset aSlcl_cdg, 0 call cdg_load_single_noalpha pascal, 45, ds, offset aSl04_cdg, 0 pop bp retn main_cdg_load endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame main_cdg_free proc near push bp mov bp, sp call cdg_freeall pop bp retn main_cdg_free endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame op_animate proc near @@page_show = byte ptr -2 @@page_access = byte ptr -1 enter 2, 0 push si mov PaletteTone, 0 call far ptr palette_show call pi_slot_load pascal, 0, ds, offset aOp2a_pi call pi_slot_load pascal, 1, ds, offset aOp2b_pi call pi_slot_load pascal, 2, ds, offset aOp2c_pi call pi_slot_load pascal, 3, ds, offset aOp2d_pi call pi_slot_load pascal, 4, ds, offset aOp2e_pi call pi_slot_load pascal, 5, ds, offset aOp2f_pi call pi_slot_load pascal, 6, ds, offset aOp2g_pi call pi_slot_load pascal, 7, ds, offset aOp2h_pi graph_accesspage 0 graph_showpage al call grcg_setcolor pascal, (GC_RMW shl 16) + 1 graph_accesspage 1 call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) graph_accesspage 0 call grcg_byteboxfill_x pascal, large 0, (((RES_X - 1) / 8) shl 16) or (RES_Y - 1) GRCG_OFF_CLOBBERING dx call graph_copy_page pascal, 1 mov [bp+@@page_access], 1 mov [bp+var_2], 0 graph_accesspage 0 graph_showpage al xor si, si jmp short loc_BDAD ; --------------------------------------------------------------------------- loc_BD55: mov ax, si mov bx, 8 cwd idiv bx cmp dx, 1 jg short loc_BD81 mov ax, si cwd idiv bx call pi_slot_palette_apply pascal, ax pushd (0 shl 16) or 278 mov ax, si mov bx, 8 cwd idiv bx push ax call pi_slot_put loc_BD81: push 1 call frame_delay graph_accesspage [bp+@@page_access] graph_showpage [bp+var_2] mov [bp+@@page_access], al mov al, 1 sub al, [bp+var_2] mov [bp+var_2], al lea ax, [si+36] mov PaletteTone, ax call far ptr palette_show inc si loc_BDAD: cmp si, 40h jl short loc_BD55 mov si, 1 jmp short loc_BDBE ; --------------------------------------------------------------------------- loc_BDB7: call pi_slot_free pascal, si inc si loc_BDBE: cmp si, 8 jl short loc_BDB7 call graph_copy_page pascal, 1 les bx, _resident cmp es:[bx+resident_t.demo_num], 0 jnz short loc_BDE8 call snd_load pascal, ds, offset aOp_0, SND_LOAD_SONG kajacall KAJA_SONG_PLAY loc_BDE8: call pi_slot_load pascal, 0, ds, offset aOp1_pi_0 graph_accesspage 0 graph_showpage al push 16 call frame_delay xor si, si jmp short loc_BE46 ; --------------------------------------------------------------------------- loc_BE08: mov ax, si mov bx, 4 cwd idiv bx cmp dx, 1 jg short loc_BE25 pushd 0 push 0 mov ax, si cwd idiv bx push ax call pi_slot_put_mask loc_BE25: push 1 call frame_delay graph_accesspage [bp+@@page_access] graph_showpage [bp+var_2] mov [bp+@@page_access], al mov al, 1 sub al, [bp+var_2] mov [bp+var_2], al inc si loc_BE46: cmp si, 10h jl short loc_BE08 graph_accesspage 1 graph_showpage 0 call pi_slot_palette_apply pascal, 0 call pi_slot_put pascal, large 0, 0 call pi_slot_free pascal, 0 call graph_copy_page pascal, 0 pop si leave retn op_animate endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public DRAW_TRACK draw_track proc near var_5 = byte ptr -5 var_4 = word ptr -4 var_2 = word ptr -2 arg_0 = word ptr 4 arg_2 = byte ptr 6 enter 6, 0 push si mov [bp+var_5], 5 mov al, [bp+arg_2] mov ah, 0 sub ax, word_1403A shl ax, 4 mov si, ax or si, si jl loc_BF48 cmp si, 192 jge loc_BF48 cmp [bp+arg_0], 0 jz short loc_BEF4 call grcg_setcolor pascal, (GC_RMW shl 16) + 5 push (12 shl 16) or 300 lea ax, [si+96] push ax call grcg_hline push (12 shl 16) or 300 lea ax, [si+111] push ax call grcg_hline push 12 lea ax, [si+96] push ax lea ax, [si+111] push ax call grcg_vline push 300 lea ax, [si+96] push ax lea ax, [si+111] push ax call grcg_vline GRCG_OFF_CLOBBERING dx jmp short loc_BF05 ; --------------------------------------------------------------------------- loc_BEF4: push 0 lea ax, [si+96] push ax push (320 shl 16) or 16 call bgimage_put_rect loc_BF05: mov al, [bp+arg_2] mov ah, 0 cmp ax, word_1403C jnz short loc_BF14 mov [bp+var_5], 3 loc_BF14: mov bx, music_game imul bx, 78h mov al, [bp+arg_2] mov ah, 0 shl ax, 2 add bx, ax mov ax, word ptr _MUSIC_TITLES+2[bx] mov dx, word ptr _MUSIC_TITLES[bx] mov [bp+var_2], ax mov [bp+var_4], dx add si, 96 push 12 push si mov al, [bp+var_5] mov ah, 0 push ax push [bp+var_2] push dx call graph_putsa_fx loc_BF48: pop si leave retn 4 draw_track endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public DRAW_TRACKS draw_tracks proc near @@sel = byte ptr 4 push bp mov bp, sp push si xor si, si jmp short loc_BF6B ; --------------------------------------------------------------------------- loc_BF55: push si mov al, [bp+@@sel] mov ah, 0 cmp ax, si jnz short loc_BF64 mov ax, 1 jmp short loc_BF66 ; --------------------------------------------------------------------------- loc_BF64: xor ax, ax loc_BF66: push ax call draw_track inc si loc_BF6B: mov ax, musicroom_trackcount add ax, 2 cmp ax, si jg short loc_BF55 call graph_putsa_fx pascal, (12 shl 16) or 80, 5, large [MUSICROOM_UP] call graph_putsa_fx pascal, (12 shl 16) or 288, 5, large [MUSICROOM_DOWN] push (12 shl 16) or 32 push 3 mov bx, music_game shl bx, 2 pushd dword ptr MUSICROOM_GAME[bx] call graph_putsa_fx pop si pop bp retn 2 draw_tracks endp include th02/music/music.asm include th05/music/music_cmt_load.asm ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public DRAW_CMT_LINES draw_cmt_lines proc pascal near local @@y:word push si push di call graph_putsa_fx pascal, (320 shl 16) or 32, 7, ds, offset _music_cmt mov si, offset _music_cmt + MUSIC_CMT_LINE_LEN mov di, 1 mov @@y, 180 jmp short loc_C36D ; --------------------------------------------------------------------------- loc_C351: cmp byte ptr [si], ';' jz short loc_C365 call graph_putsa_fx pascal, 320, @@y, 7, ds, si loc_C365: inc di add @@y, 16 add si, MUSIC_CMT_LINE_LEN loc_C36D: cmp di, MUSIC_CMT_LINE_COUNT jl short loc_C351 pop di pop si ret draw_cmt_lines endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame sub_C376 proc near push bp mov bp, sp push si mov si, 4 jmp short loc_C390 ; --------------------------------------------------------------------------- loc_C37F: mov _graph_putsa_fx_func, si call draw_cmt_lines call music_flip call draw_cmt_lines call music_flip inc si loc_C390: cmp si, 8 jl short loc_C37F mov _graph_putsa_fx_func, 2 call draw_cmt_lines call music_flip call draw_cmt_lines pop si pop bp retn sub_C376 endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame sub_C3A7 proc near push bp mov bp, sp mov _graph_putsa_fx_func, 2 call bgimage_put_rect pascal, (320 shl 16) or 32, (320 shl 16) or 16 call bgimage_put_rect pascal, (320 shl 16) or 180, (320 shl 16) or 144 call music_flip call bgimage_put_rect pascal, (320 shl 16) or 32, (320 shl 16) or 16 call bgimage_put_rect pascal, (320 shl 16) or 180, (320 shl 16) or 144 pop bp retn sub_C3A7 endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public DRAW_CMT draw_cmt proc near @@track = word ptr 4 push bp mov bp, sp cmp byte_13E96, 0 jz short loc_C406 call sub_C3A7 loc_C406: call music_cmt_load pascal, [bp+@@track] call screen_back_B_put call bgimage_put_rect pascal, (320 shl 16) or 64, (320 shl 16) or 256 cmp byte_13E96, 0 jz short loc_C42C call sub_C376 jmp short loc_C43A ; --------------------------------------------------------------------------- loc_C42C: mov byte_13E96, 1 call draw_cmt_lines call music_flip call draw_cmt_lines loc_C43A: call screen_back_B_put pop bp retn 2 draw_cmt endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame sub_C441 proc near arg_0 = word ptr 4 push bp mov bp, sp push si mov si, [bp+arg_0] call bgimage_put_rect pascal, large (0 shl 16) or 32, (320 shl 16) or 16 call bgimage_put_rect pascal, large (0 shl 16) or 96, (320 shl 16) or 192 call draw_tracks pascal, si call music_flip call bgimage_put_rect pascal, large (0 shl 16) or 32, (320 shl 16) or 16 call bgimage_put_rect pascal, large (0 shl 16) or 96, (320 shl 16) or 192 call draw_tracks pascal, si pop si pop bp retn 2 sub_C441 endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public MUSICROOM musicroom proc near @@sel = byte ptr -1 enter 2, 0 push si xor si, si mov word_1403A, 0 mov word_1403C, 0 mov _music_sel, 0 mov bx, music_game add bx, bx mov ax, MUSICROOM_TRACKCOUNTS[bx] mov musicroom_trackcount, ax mov byte_13E96, 0 call cdg_freeall call text_clear mov _music_page, 1 mov PaletteTone, 0 call far ptr palette_show graph_showpage 0 graph_accesspage al call graph_clear graph_accesspage 1 call pi_slot_load pascal, 0, ds, offset aMusic_pi call pi_slot_palette_apply pascal, 0 call pi_slot_put pascal, large 0, 0 call pi_slot_free pascal, 0 call _piano_setup call screen_back_B_snap call bgimage_snap call draw_tracks pascal, word ptr _music_sel call graph_copy_page pascal, 0 graph_accesspage 1 graph_showpage 0 call pfend push ds push offset aMusic_dat ; "music.dat" call pfstart mov al, _music_sel mov ah, 0 call draw_cmt pascal, ax mov PaletteTone, 100 call far ptr palette_show loc_C555: call _input_reset_sense_held cmp _key_det, INPUT_NONE jz short loc_C57F cmp si, 18h jl short loc_C579 cmp _key_det, INPUT_UP jz short loc_C574 cmp _key_det, INPUT_DOWN jnz short loc_C579 loc_C574: mov si, 14h jmp short loc_C57F ; --------------------------------------------------------------------------- loc_C579: inc si call music_flip jmp short loc_C555 ; --------------------------------------------------------------------------- loc_C57F: call _input_reset_sense_held test _key_det.lo, low INPUT_UP jz short loc_C5EB mov al, _music_sel mov [bp+@@sel], al cmp _music_sel, 0 jbe short loc_C5D5 dec _music_sel mov al, _music_sel mov ah, 0 cmp ax, word_1403A jge short loc_C5AE mov al, _music_sel mov ah, 0 jmp short loc_C61C ; --------------------------------------------------------------------------- loc_C5AE: call draw_track pascal, word ptr [bp+@@sel], 0 call draw_track pascal, word ptr _music_sel, 1 call music_flip call draw_track pascal, word ptr [bp+@@sel], 0 call draw_track pascal, word ptr _music_sel, 1 jmp short loc_C5EB ; --------------------------------------------------------------------------- loc_C5D5: mov al, byte ptr musicroom_trackcount mov _music_sel, al mov ax, musicroom_trackcount add ax, 0FFF5h mov word_1403A, ax push musicroom_trackcount call sub_C441 loc_C5EB: test _key_det.lo, low INPUT_DOWN jz short loc_C666 mov al, _music_sel mov [bp+@@sel], al mov ah, 0 cmp ax, musicroom_trackcount jge short loc_C652 inc _music_sel mov al, _music_sel mov ah, 0 mov dx, word_1403A add dx, 0Ch cmp ax, dx jl short loc_C62B mov al, _music_sel mov ah, 0 add ax, 0FFF5h loc_C61C: mov word_1403A, ax mov al, _music_sel mov ah, 0 push ax call sub_C441 jmp loc_C6E3 ; --------------------------------------------------------------------------- loc_C62B: call draw_track pascal, word ptr [bp+@@sel], 0 call draw_track pascal, word ptr _music_sel, 1 call music_flip call draw_track pascal, word ptr [bp+@@sel], 0 call draw_track pascal, word ptr _music_sel, 1 jmp short loc_C666 ; --------------------------------------------------------------------------- loc_C652: mov _music_sel, 0 mov word_1403A, 0 mov al, _music_sel mov ah, 0 push ax call sub_C441 loc_C666: test _key_det.lo, low INPUT_LEFT jz short loc_C680 dec music_game cmp music_game, 0 jge short loc_C698 mov music_game, 4 jmp short loc_C698 ; --------------------------------------------------------------------------- loc_C680: test _key_det.lo, low INPUT_RIGHT jz short loc_C6E3 inc music_game cmp music_game, 5 jl short loc_C698 mov music_game, 0 loc_C698: mov _music_sel, 0 mov word_1403C, 0 mov word_1403A, 0 mov bx, music_game add bx, bx mov ax, MUSICROOM_TRACKCOUNTS[bx] mov musicroom_trackcount, ax push 0 call sub_C441 kajacall KAJA_SONG_FADE, 32 call draw_cmt pascal, 0 mov bx, music_game imul bx, 78h call snd_load pascal, dword ptr _MUSIC_FILES[bx], SND_LOAD_SONG kajacall KAJA_SONG_PLAY loc_C6E3: test _key_det.lo, low INPUT_SHOT jnz short loc_C6F1 test _key_det.hi, high INPUT_OK jz short loc_C767 loc_C6F1: mov al, _music_sel mov ah, 0 cmp ax, musicroom_trackcount jz loc_C77F kajacall KAJA_SONG_FADE, 32 mov al, byte ptr word_1403C mov [bp+@@sel], al mov al, _music_sel mov ah, 0 mov word_1403C, ax call draw_track pascal, word ptr [bp+@@sel], 0 call draw_track pascal, word ptr _music_sel, 1 call music_flip call draw_track pascal, word ptr [bp+@@sel], 0 call draw_track pascal, word ptr _music_sel, 1 mov al, _music_sel mov ah, 0 call draw_cmt pascal, ax mov bx, music_game imul bx, 78h mov al, _music_sel mov ah, 0 shl ax, 2 add bx, ax call snd_load pascal, dword ptr _MUSIC_FILES[bx], SND_LOAD_SONG kajacall KAJA_SONG_PLAY loc_C767: test _key_det.hi, high INPUT_CANCEL jnz short loc_C77F cmp _key_det, INPUT_NONE jnz loc_C555 xor si, si call music_flip jmp loc_C57F ; --------------------------------------------------------------------------- loc_C77F: call _input_reset_sense_held cmp _key_det, INPUT_NONE jz short loc_C790 call music_flip jmp short loc_C77F ; --------------------------------------------------------------------------- loc_C790: call pfend push ds push offset aKaikidan1_dat1 call pfstart kajacall KAJA_SONG_FADE, 16 call screen_back_B_free graph_showpage 0 graph_accesspage al push 1 call palette_black_out call bgimage_free call snd_load pascal, ds, offset aH_op+2, SND_LOAD_SONG kajacall KAJA_SONG_PLAY pop si leave retn musicroom endp include th04/formats/scoredat_decode_both.asm include th04/formats/scoredat_encode.asm include th05/formats/scoredat_recreate_op.asm ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public SCOREDAT_LOAD scoredat_load proc near arg_0 = word ptr 4 push bp mov bp, sp push ds push offset aGensou_scr ; "GENSOU.SCR" call file_exist or ax, ax jz short loc_CA0C push ds push offset aGensou_scr ; "GENSOU.SCR" call file_ropen mov ax, [bp+arg_0] imul ax, 5 mov dl, _hiscore_rank mov dh, 0 add ax, dx imul ax, size scoredat_section_t movzx eax, ax call file_seek pascal, large eax, 0 call file_read pascal, ds, offset _hi, size scoredat_section_t call file_close call scoredat_decode_func or al, al jz short loc_CA15 loc_CA0C: call scoredat_recreate_op mov al, 1 pop bp retn 2 ; --------------------------------------------------------------------------- loc_CA15: mov al, 0 pop bp retn 2 scoredat_load endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame sub_CA1B proc near var_2 = word ptr -2 arg_0 = word ptr 4 @@y = word ptr 6 arg_4 = word ptr 8 enter 2, 0 push si push di mov si, [bp+arg_4] mov di, [bp+arg_0] mov bx, di shl bx, 3 mov al, _hi.score.g_points[bx][SCORE_DIGITS - 1] mov ah, 0 add ax, -gb_0_ cmp ax, 10 jl short loc_CA5B lea ax, [si-16] push ax push [bp+@@y] mov bx, di shl bx, 3 mov al, _hi.score.g_points[bx][SCORE_DIGITS - 1] mov ah, 0 add ax, -gb_0_ mov bx, 10 cwd idiv bx push ax call super_put loc_CA5B: push si push [bp+@@y] mov bx, di shl bx, 3 mov al, _hi.score.g_points[bx][SCORE_DIGITS - 1] mov ah, 0 add ax, -gb_0_ mov bx, 10 cwd idiv bx push dx call super_put add si, 16 mov [bp+var_2], 6 jmp short loc_CAA4 ; --------------------------------------------------------------------------- loc_CA83: push si push [bp+@@y] mov bx, di shl bx, 3 add bx, [bp+var_2] mov al, _hi.score.g_points[bx] mov ah, 0 add ax, -gb_0_ push ax call super_put dec [bp+var_2] add si, 16 loc_CAA4: cmp [bp+var_2], 0 jge short loc_CA83 pop di pop si leave retn 6 sub_CA1B endp include th04/hiscore/hiscore_stage_put.asm ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame sub_CB00 proc near @@color = word ptr -2 arg_0 = word ptr 4 arg_2 = word ptr 6 enter 2, 0 push si push di cmp [bp+arg_0], 0 jnz short loc_CB3A mov bx, [bp+arg_2] cmp bx, 3 ja short loc_CB33 add bx, bx jmp cs:off_CBD4[bx] loc_CB1B: mov si, 8 jmp short loc_CB23 ; --------------------------------------------------------------------------- loc_CB20: mov si, 328 loc_CB23: mov di, 88 jmp short loc_CB33 ; --------------------------------------------------------------------------- loc_CB28: mov si, 8 jmp short loc_CB30 ; --------------------------------------------------------------------------- loc_CB2D: mov si, 328 loc_CB30: mov di, 224 loc_CB33: mov [bp+@@color], 7 jmp short loc_CB74 ; --------------------------------------------------------------------------- loc_CB3A: mov bx, [bp+arg_2] cmp bx, 3 ja short loc_CB6F add bx, bx jmp cs:off_CBCC[bx] loc_CB49: mov si, 8 jmp short loc_CB51 ; --------------------------------------------------------------------------- loc_CB4E: mov si, 328 loc_CB51: mov ax, [bp+arg_0] shl ax, 4 add ax, 96 jmp short loc_CB6D ; --------------------------------------------------------------------------- loc_CB5C: mov si, 8 jmp short loc_CB64 ; --------------------------------------------------------------------------- loc_CB61: mov si, 328 loc_CB64: mov ax, [bp+arg_0] shl ax, 4 add ax, 232 loc_CB6D: mov di, ax loc_CB6F: mov [bp+@@color], 2 loc_CB74: lea ax, [si+2] push ax lea ax, [di+2] push ax push GAIJI_W mov ax, [bp+arg_0] imul ax, (SCOREDAT_NAME_LEN + 1) add ax, offset _hi.score.g_name push ds push ax push 14 call graph_gaiji_puts push si push di push GAIJI_W mov ax, [bp+arg_0] imul ax, (SCOREDAT_NAME_LEN + 1) add ax, offset _hi.score.g_name push ds push ax push [bp+@@color] call graph_gaiji_puts lea ax, [si+150] call sub_CA1B pascal, ax, di, [bp+arg_0] lea ax, [si+286] push ax push di mov bx, [bp+arg_0] mov al, _hi.score.g_stage[bx] mov ah, 0 push ax call hiscore_stage_put pop di pop si leave retn 4 sub_CB00 endp ; --------------------------------------------------------------------------- off_CBCC dw offset loc_CB49 dw offset loc_CB4E dw offset loc_CB5C dw offset loc_CB61 off_CBD4 dw offset loc_CB1B dw offset loc_CB20 dw offset loc_CB28 dw offset loc_CB2D ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame score_render proc near push bp mov bp, sp push si push di graph_accesspage 1 call pi_slot_palette_apply pascal, 0 call pi_slot_put pascal, large 0, 0 graph_accesspage 0 call pi_slot_palette_apply pascal, 0 call pi_slot_put pascal, large 0, 0 xor si, si jmp short loc_CC27 ; --------------------------------------------------------------------------- loc_CC13: push si call scoredat_load xor di, di jmp short loc_CC21 ; --------------------------------------------------------------------------- loc_CC1B: push si push di call sub_CB00 inc di loc_CC21: cmp di, 5 jl short loc_CC1B inc si loc_CC27: cmp si, 4 jl short loc_CC13 push (496 shl 16) or 376 mov al, _hiscore_rank mov ah, 0 add ax, ax add ax, 20 push ax call super_put push (560 shl 16) or 376 mov al, _hiscore_rank mov ah, 0 add ax, ax add ax, 21 push ax call super_put pop di pop si pop bp retn score_render endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public SCORE_MENU score_menu proc near push bp mov bp, sp kajacall KAJA_SONG_STOP call snd_load pascal, ds, offset aName, SND_LOAD_SONG kajacall KAJA_SONG_PLAY kajacall KAJA_SONG_FADE, -128 push 1 call palette_black_out les bx, _resident mov al, es:[bx+resident_t.rank] mov _hiscore_rank, al call pi_slot_load pascal, 0, ds, offset aHi01_pi loc_CC9F: call score_render call palette_black_in pascal, 1 loc_CCA9: call _input_reset_sense_held call frame_delay pascal, 1 test _key_det.hi, high INPUT_OK jnz short loc_CD17 test _key_det.lo, low INPUT_SHOT jnz short loc_CD17 test _key_det.hi, high INPUT_CANCEL jnz short loc_CD17 test _key_det.hi, high INPUT_OK jnz short loc_CD17 test _key_det.lo, low INPUT_LEFT jz short loc_CCF8 cmp _hiscore_rank, RANK_EASY jz short loc_CCF8 dec _hiscore_rank mov PaletteTone, 0 call far ptr palette_show call score_render call palette_black_in pascal, 1 loc_CCF8: test _key_det.lo, low INPUT_RIGHT jz short loc_CCA9 cmp _hiscore_rank, RANK_EXTRA jnb short loc_CCA9 inc _hiscore_rank mov PaletteTone, 0 call far ptr palette_show jmp short loc_CC9F ; --------------------------------------------------------------------------- loc_CD17: kajacall KAJA_SONG_FADE, 1 call palette_black_out pascal, 1 call pi_slot_free pascal, 0 graph_accesspage 1 call pi_slot_load pascal, 0, ds, offset aOp1_pi_1 call pi_slot_palette_apply pascal, 0 call pi_slot_put pascal, large 0, 0 call pi_slot_free pascal, 0 call graph_copy_page pascal, 0 call palette_black_in pascal, 1 loc_CD64: call _input_reset_sense_held call frame_delay pascal, 1 cmp _key_det, INPUT_NONE jnz short loc_CD64 kajacall KAJA_SONG_STOP call snd_load pascal, ds, offset aOp_1, SND_LOAD_SONG kajacall KAJA_SONG_PLAY pop bp retn score_menu endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame public SCOREDAT_CLEARED_LOAD scoredat_cleared_load proc near push bp mov bp, sp push si mov _extra_unlocked, 0 xor si, si jmp short loc_CE0E ; --------------------------------------------------------------------------- loc_CDA1: mov _hiscore_rank, RANK_EASY jmp short loc_CE06 ; --------------------------------------------------------------------------- loc_CDA8: push si call scoredat_load or al, al jnz short loc_CE0D mov bx, si imul bx, RANK_COUNT mov al, _hiscore_rank mov ah, 0 add bx, ax mov al, _hi.score.cleared mov _cleared_with[bx], al mov bx, si imul bx, RANK_COUNT mov al, _hiscore_rank mov ah, 0 add bx, ax cmp _cleared_with[bx], SCOREDAT_CLEARED jz short loc_CDE7 mov bx, si imul bx, RANK_COUNT mov al, _hiscore_rank mov ah, 0 add bx, ax mov _cleared_with[bx], 0 loc_CDE7: cmp _hiscore_rank, RANK_EXTRA jnb short loc_CE02 mov bx, si imul bx, RANK_COUNT mov al, _hiscore_rank mov ah, 0 add bx, ax mov al, _cleared_with[bx] or _extra_unlocked, al loc_CE02: inc _hiscore_rank loc_CE06: cmp _hiscore_rank, RANK_COUNT jb short loc_CDA8 loc_CE0D: inc si loc_CE0E: cmp si, 4 jl short loc_CDA1 les bx, _resident mov al, es:[bx+resident_t.rank] mov _hiscore_rank, al push ds push offset aScnum_bft ; "scnum.bft" call super_entry_bfnt push ds push offset aHi_m_bft ; "hi_m.bft" call super_entry_bfnt xor si, si jmp short loc_CE5D ; --------------------------------------------------------------------------- loc_CE34: mov bx, si imul bx, RANK_COUNT mov al, _cleared_with[bx].RANK_EASY mov bx, si imul bx, RANK_COUNT or al, _cleared_with[bx].RANK_NORMAL mov bx, si imul bx, RANK_COUNT or al, _cleared_with[bx].RANK_HARD mov bx, si imul bx, RANK_COUNT or al, _cleared_with[bx].RANK_LUNATIC mov _extra_playable_with[si], al inc si loc_CE5D: cmp si, PLAYCHAR_COUNT jl short loc_CE34 pop si pop bp retn scoredat_cleared_load endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame darken_pic proc near var_6 = dword ptr -6 var_2 = word ptr -2 arg_0 = byte ptr 4 enter 6, 0 push si push di mov al, [bp+arg_0] mov ah, 0 mov bx, ax cmp bx, 3 ja short loc_CE90 add bx, bx jmp cs:off_CEF7[bx] loc_CE7E: mov si, ( 48 * ROW_SIZE) + ( 16 / 8) jmp short loc_CE90 ; --------------------------------------------------------------------------- loc_CE83: mov si, ( 48 * ROW_SIZE) + (272 / 8) jmp short loc_CE90 ; --------------------------------------------------------------------------- loc_CE88: mov si, (224 * ROW_SIZE) + (160 / 8) jmp short loc_CE90 ; --------------------------------------------------------------------------- loc_CE8D: mov si, (224 * ROW_SIZE) + (400 / 8) loc_CE90: call grcg_setcolor pascal, (GC_RMW shl 16) + 1 mov [bp+var_6], 0AAAAAAAAh xor di, di jmp short loc_CEE5 ; --------------------------------------------------------------------------- loc_CEA7: test di, 1 jnz short loc_CEB5 mov eax, 0AAAAAAAAh jmp short loc_CEBB ; --------------------------------------------------------------------------- loc_CEB5: mov eax, 55555555h loc_CEBB: mov [bp+var_6], eax mov [bp+var_2], 0 jmp short loc_CEDB ; --------------------------------------------------------------------------- loc_CEC6: les bx, _VRAM_PLANE_B add bx, si mov eax, [bp+var_6] mov es:[bx], eax add [bp+var_2], 4 add si, 4 loc_CEDB: cmp [bp+var_2], (224 / 8) jl short loc_CEC6 inc di add si, ROW_SIZE - (224 / 8) loc_CEE5: cmp di, 160 jl short loc_CEA7 GRCG_OFF_CLOBBERING dx pop di pop si leave retn 2 darken_pic endp ; --------------------------------------------------------------------------- off_CEF7 dw offset loc_CE7E dw offset loc_CE83 dw offset loc_CE88 dw offset loc_CE8D ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame put_pic proc near @@y = word ptr -4 @@x = word ptr -2 @@highlight = word ptr 4 enter 4, 0 push si push di mov al, _playchar_menu_sel mov ah, 0 mov bx, ax cmp bx, PLAYCHAR_COUNT - 1 ja short loc_CF59 add bx, bx jmp cs:off_D08D[bx] @@reimu: mov si, 16 mov di, 48 mov [bp+@@x], 176 mov [bp+@@y], 192 jmp short loc_CF59 ; --------------------------------------------------------------------------- @@marisa: mov si, 272 mov di, 48 mov [bp+@@x], 432 mov [bp+@@y], 192 jmp short loc_CF59 ; --------------------------------------------------------------------------- @@mima: mov si, 160 mov di, 224 mov [bp+@@x], 320 jmp short loc_CF54 ; --------------------------------------------------------------------------- @@yuuka: mov si, 400 mov di, 224 mov [bp+@@x], 560 loc_CF54: mov [bp+@@y], 368 loc_CF59: cmp [bp+@@highlight], 0 jnz loc_D012 mov al, _playchar_menu_sel mov ah, 0 mov bx, ax cmp _selectable_with[bx], 0 jz short loc_CF82 lea ax, [si-8] push ax lea ax, [di-8] push ax mov al, _playchar_menu_sel mov ah, 0 add ax, 40 push ax jmp short loc_CF8C ; --------------------------------------------------------------------------- loc_CF82: lea ax, [si-8] push ax lea ax, [di-8] push ax push 45 loc_CF8C: call cdg_put_noalpha call grcg_setcolor pascal, (GC_RMW shl 16) + 1 lea ax, [si+216] mov bx, 8 cwd idiv bx push ax push di lea ax, [si+223] cwd idiv bx push ax lea ax, [di+151] push ax call grcg_byteboxfill_x mov ax, si mov bx, 8 cwd idiv bx push ax lea ax, [di+152] push ax lea ax, [si+223] cwd idiv bx push ax lea ax, [di+159] push ax call grcg_byteboxfill_x GRCG_OFF_CLOBBERING dx mov al, _playchar_menu_sel mov ah, 0 imul ax, RANK_COUNT mov dl, _rank mov dh, 0 add ax, dx mov bx, ax cmp _cleared_with[bx], 0 jz loc_D086 mov ax, [bp+@@x] add ax, -8 push ax mov ax, [bp+@@y] add ax, -8 push ax push 44 call cdg_put jmp short loc_D086 ; --------------------------------------------------------------------------- loc_D012: lea ax, [si-8] push ax lea ax, [di-8] push ax push (224 shl 16) or 8 call bgimage_put_rect lea ax, [si-8] call bgimage_put_rect pascal, ax, di, (8 shl 16) or 160 mov al, _playchar_menu_sel mov ah, 0 mov bx, ax cmp _selectable_with[bx], 0 jz short loc_D050 push si push di mov al, _playchar_menu_sel mov ah, 0 add ax, 40 push ax jmp short loc_D054 ; --------------------------------------------------------------------------- loc_D050: push si push di push 45 loc_D054: call cdg_put_noalpha mov al, _playchar_menu_sel mov ah, 0 imul ax, RANK_COUNT mov dl, _rank mov dh, 0 add ax, dx mov bx, ax cmp _cleared_with[bx], 0 jz short loc_D07F call cdg_put pascal, [bp+@@x], [bp+@@y], 44 loc_D07F: call darken_pic pascal, word ptr _playchar_menu_sel loc_D086: pop di pop si leave retn 2 db 0 off_D08D dw offset @@reimu dw offset @@marisa dw offset @@mima dw offset @@yuuka put_pic endp ; --------------------------------------------------------------------------- ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame playchar_menu_init proc near @@i = word ptr -2 enter 2, 0 push si mov al, _playchar_menu_sel mov ah, 0 mov [bp+@@i], ax mov PaletteTone, 0 call far ptr palette_show graph_accesspage 1 call pi_slot_load pascal, 0, ds, offset aSlb1_pi call pi_slot_palette_apply pascal, 0 call pi_slot_put pascal, large 0, 0 call pi_slot_free pascal, 0 call graph_copy_page pascal, 0 call bgimage_snap graph_accesspage 1 graph_showpage 0 xor si, si mov _playchar_menu_sel, PLAYCHAR_REIMU jmp short loc_D111 ; --------------------------------------------------------------------------- loc_D0F7: mov al, _playchar_menu_sel mov ah, 0 cmp ax, [bp+@@i] jz short loc_D106 mov ax, 1 jmp short loc_D108 ; --------------------------------------------------------------------------- loc_D106: xor ax, ax loc_D108: push ax call put_pic inc si inc _playchar_menu_sel loc_D111: cmp si, PLAYCHAR_COUNT jl short loc_D0F7 mov al, byte ptr [bp+@@i] mov _playchar_menu_sel, al call graph_copy_page pascal, 0 push 1 call palette_black_in pop si leave retn playchar_menu_init endp ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame playchar_menu proc near @@i = word ptr -4 @@input_locked = byte ptr -1 enter 4, 0 mov [bp+@@i], 0 jmp short loc_D146 ; --------------------------------------------------------------------------- loc_D138: mov bx, [bp+@@i] mov al, _extra_playable_with[bx] mov _selectable_with[bx], al inc [bp+@@i] loc_D146: cmp [bp+@@i], PLAYCHAR_COUNT jl short loc_D138 les bx, _resident cmp es:[bx+resident_t.stage], STAGE_EXTRA jnz short @@not_extra mov _rank, RANK_EXTRA mov _playchar_menu_sel, -1 mov [bp+@@i], 0 jmp short loc_D182 ; --------------------------------------------------------------------------- loc_D168: cmp _playchar_menu_sel, -1 jnz short loc_D17F mov bx, [bp+@@i] cmp _selectable_with[bx], 0 jz short loc_D17F mov al, byte ptr [bp+@@i] mov _playchar_menu_sel, al loc_D17F: inc [bp+@@i] loc_D182: cmp [bp+@@i], PLAYCHAR_COUNT jl short loc_D168 jmp short loc_D1B2 ; --------------------------------------------------------------------------- @@not_extra: mov [bp+@@i], 0 jmp short loc_D19C ; --------------------------------------------------------------------------- loc_D191: mov bx, [bp+@@i] mov _selectable_with[bx], 1 inc [bp+@@i] loc_D19C: cmp [bp+@@i], PLAYCHAR_COUNT jl short loc_D191 les bx, _resident mov al, es:[bx+resident_t.rank] mov _rank, al mov _playchar_menu_sel, PLAYCHAR_REIMU loc_D1B2: call playchar_menu_init loc_D1B5: call _input_reset_sense_held cmp [bp+@@input_locked], 0 jnz loc_D2EC test _key_det.lo, low INPUT_LEFT jnz short @@left_or_right_pressed test _key_det.lo, low INPUT_RIGHT jz short loc_D223 @@left_or_right_pressed: call snd_se_reset call snd_se_play pascal, 1 call snd_se_update graph_accesspage 1 call put_pic pascal, 1 xor _playchar_menu_sel, 1 ; 0<->1 2<->3 call put_pic pascal, 0 mov vsync_Count1, 0 call frame_delay pascal, 1 graph_showpage 1 call graph_copy_page pascal, 0 mov vsync_Count1, 0 call frame_delay pascal, 1 graph_showpage 0 loc_D223: test _key_det.lo, low INPUT_UP jnz short @@up_or_down_pressed test _key_det.lo, low INPUT_DOWN jz short loc_D284 @@up_or_down_pressed: call snd_se_reset call snd_se_play pascal, 1 call snd_se_update graph_accesspage 1 call put_pic pascal, 1 xor _playchar_menu_sel, 2 ; 0<->2 1<->3 call put_pic pascal, 0 mov vsync_Count1, 0 call frame_delay pascal, 1 graph_showpage 1 call graph_copy_page pascal, 0 mov vsync_Count1, 0 call frame_delay pascal, 1 graph_showpage 0 loc_D284: test _key_det.hi, high INPUT_OK jnz short @@z_pressed test _key_det.lo, low INPUT_SHOT jz short @@unable_to_select @@z_pressed: mov al, _playchar_menu_sel mov ah, 0 mov bx, ax cmp _selectable_with[bx], 0 jz short @@unable_to_select call snd_se_reset call snd_se_play pascal, 11 call snd_se_update les bx, _resident mov al, _playchar_menu_sel mov es:[bx+resident_t.playchar], al push 1 call palette_black_out call bgimage_free xor ax, ax leave retn @@unable_to_select: test _key_det.hi, high INPUT_CANCEL jz short loc_D2E4 call palette_black_out pascal, 1 call bgimage_free mov ax, 1 leave retn ; --------------------------------------------------------------------------- loc_D2E4: mov al, _key_det.lo mov [bp+@@input_locked], al jmp short loc_D2F7 ; --------------------------------------------------------------------------- loc_D2EC: cmp _key_det, INPUT_NONE jnz short loc_D2F7 mov [bp+@@input_locked], 0 loc_D2F7: call frame_delay pascal, 1 jmp loc_D1B5 ; --------------------------------------------------------------------------- leave retn playchar_menu endp ; --------------------------------------------------------------------------- db 0 op_01_TEXT ends ; =========================================================================== ; Segment type: Pure code op_02_TEXT segment word public 'CODE' use16 assume cs:op_02_TEXT ; org 4 assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing include th03/formats/hfliplut.asm include th04/snd/pmd_res.asm include th02/snd/mmd_res.asm include th04/snd/detmodes.asm include th02/exit_dos.asm db 0 include th04/hardware/grppsafx.asm include th04/formats/cdg_put_noalpha.asm include th04/snd/se.asm include th04/bgimage.asm include th04/formats/cdg_put.asm include th02/exit.asm include th04/math/vector1_at.asm include th04/math/vector2_at.asm include th05/music/piano.asm GRCG_SETCOLOR_DIRECT_NOINT_DEF 1 db 0 include th04/bgimage_put_rect.asm include th05/snd/load.asm include th05/snd/kajaint.asm include th05/formats/pi_slot_put_mask.asm include th05/formats/pi_slot_load.asm include th05/formats/pi_slot_put.asm include th05/formats/pi_slot_palette_apply.asm include th05/formats/pi_slot_free.asm include th02/initop.asm include th04/hardware/input_sense.asm include th05/hardware/input_held.asm include th05/hardware/input_wait.asm include th05/snd/measure.asm include th05/snd/delaymea.asm include th04/formats/cdg_put_nocolors.asm include th05/hardware/frame_delay.asm db 0 include th04/formats/cdg_load.asm include th04/hardware/egccopyr.asm even op_02_TEXT ends .data db 0 _menu_sel db 0 _quit db 0 _main_menu_unused_1 db 1 public _MENU_DESC _MENU_DESC dd aMENU_START ; "ゲームを開始します" dd aMENU_START_EXTRA ; "エキストラステージを開始します" dd aMENU_HISCORE ; "現在のハイスコアを表\示します" dd aMENU_MUSICROOM ; "音楽室に入ります" dd aMENU_OPTION ; "各種設定を変更出来ます" dd aMENU_QUIT ; "DOSに戻ります" dd aMENU_EASY ; "難易度をやさしくします  (初心者向"... dd aMENU_NORMAL ; "難易度を標準にします    (一般向・... dd aMENU_HARD ; "難易度を難しくします   (アーケーダ・... dd aMENU_LUNATIC ; "難易度を非常に難しくします (シュータ・... dd aMENU_LIVES ; "ゲームスタート時の人数を変更出来ます(・... dd aMENU_BOMBS ; "ボムの使用回数を変更出来ます(除くエキ・... dd aMENU_BGM_OFF ; "BGMは流れません" dd aMENU_BGM_26K ; "BGMに26K音源互換を使用します" dd aMENU_BGM_86K ; "BGMに86音源互換を使用します" dd aMENU_SFX_OFF ; "効果音は流れません" dd aMENU_SFX_FM ; "効果音にFM音源を使用します" dd aMENU_SFX_BEEP ; "効果音にBeep音源を使用します" dd aMENU_SLOW ; "敵弾の多い場所で、わざと処理落ち(スロ・... dd aMENU_TURBO ; "処理落ちをマシンのスピードに任せます(・... dd aMENU_RESET ; "このオプションを全て標準に戻します" dd aMENU_OPTION_QUIT ; "オプションを終了します" dd aMENU_START_EASY ; "ゲームを開始します(イージー)" dd aMENU_START_NORMAL ; "ゲームを開始します(ノーマル)" dd aMENU_START_HARD ; "ゲームを開始します(ハード)" dd aMENU_START_LUNATIC ; "ゲームを開始します(ルナティック)" _main_menu_initialized db 0 _option_initialized db 0 ; char aMain[] aMain db 'main',0 ; char path[] path db 'deb',0 aMENU_START db 'ゲームを開始します',0 aMENU_START_EXTRA db 'エキストラステージを開始します',0 aMENU_HISCORE db '現在のハイスコアを表示します',0 aMENU_MUSICROOM db '音楽室に入ります',0 aMENU_OPTION db '各種設定を変更出来ます',0 aMENU_QUIT db 'DOSに戻ります',0 aMENU_EASY db '難易度をやさしくします  (初心者向け)  ',0 aMENU_NORMAL db '難易度を標準にします    (一般向け)  ',0 aMENU_HARD db '難易度を難しくします   (アーケーダー向け)',0 aMENU_LUNATIC db '難易度を非常に難しくします (シューター向け)',0 aMENU_LIVES db 'ゲームスタート時の人数を変更出来ます(除くエキストラ)',0 aMENU_BOMBS db 'ボムの使用回数を変更出来ます(除くエキストラ)',0 aMENU_BGM_OFF db 'BGMは流れません',0 aMENU_BGM_26K db 'BGMに26K音源互換を使用します',0 aMENU_BGM_86K db 'BGMに86音源互換を使用します',0 aMENU_SFX_OFF db '効果音は流れません',0 aMENU_SFX_FM db '効果音にFM音源を使用します',0 aMENU_SFX_BEEP db '効果音にBeep音源を使用します',0 aMENU_SLOW db '敵弾の多い場所で、わざと処理落ち(スロー)させます(初心者用)',0 aMENU_TURBO db '処理落ちをマシンのスピードに任せます(標準)',0 aMENU_RESET db 'このオプションを全て標準に戻します',0 aMENU_OPTION_QUIT db 'オプションを終了します',0 aMENU_START_EASY db 'ゲームを開始します(イージー)',0 aMENU_START_NORMAL db 'ゲームを開始します(ノーマル)',0 aMENU_START_HARD db 'ゲームを開始します(ハード)',0 aMENU_START_LUNATIC db 'ゲームを開始します(ルナティック)',0 aOp1_pi db 'op1.pi',0 aMiko db 'miko',0 aOp db 'op',0 aKaikidan1_dat0 db '怪綺談1.dat',0 aNotEnoughMem db 0Ah db '空きメモリ不足です。メモリ空きを増やしてから実行してね',0Ah,0 db 0 include libs/master.lib/atrtcmod[data].asm include libs/master.lib/bfnt_id[data].asm include libs/master.lib/clip[data].asm include libs/master.lib/edges[data].asm include libs/master.lib/fil[data].asm include libs/master.lib/dos_ropen[data].asm include libs/master.lib/get_machine_98[data].asm include libs/master.lib/get_machine_at[data].asm include libs/master.lib/grp[data].asm include libs/master.lib/js[data].asm include libs/master.lib/machine[data].asm include libs/master.lib/pal[data].asm include libs/master.lib/pf[data].asm include libs/master.lib/rand[data].asm include libs/master.lib/sin8[data].asm include libs/master.lib/tx[data].asm include libs/master.lib/vs[data].asm include libs/master.lib/wordmask[data].asm include libs/master.lib/mem[data].asm include libs/master.lib/super_entry_bfnt[data].asm include libs/master.lib/superpa[data].asm include libs/master.lib/respal_exist[data].asm include libs/master.lib/draw_trapezoid[data].asm include libs/master.lib/bgm_timerhook[data].asm include libs/master.lib/bgm[data].asm include th04/snd/se_priority[data].asm include th04/hardware/grppsafx[data].asm include th03/snd/se_state[data].asm include th04/bgimage[data].asm include th05/mem[data].asm include th05/music/piano[data].asm include th05/snd/load[data].asm include th04/snd/snd[data].asm include th03/formats/pi_slot_put_mask[data].asm include th05/formats/pi_slot_buffers[bss].asm include th05/hardware/vram_planes[data].asm include th03/formats/cdg[data].asm include th04/setup[data].asm include th04/zunsoft[data].asm unk_FF00 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 db 0 aMiko_cfg db 'MIKO.CFG',0 db 0 aSft1_cd2 db 'sft1.cd2',0 aSft2_cd2 db 'sft2.cd2',0 aCar_cd2 db 'car.cd2',0 aSl00_cdg db 'sl00.cdg',0 aSl01_cdg db 'sl01.cdg',0 aSl02_cdg db 'sl02.cdg',0 aSl03_cdg db 'sl03.cdg',0 aSlcl_cdg db 'slcl.cdg',0 aSl04_cdg db 'sl04.cdg',0 aOp2a_pi db 'op2a.pi',0 aOp2b_pi db 'op2b.pi',0 aOp2c_pi db 'op2c.pi',0 aOp2d_pi db 'op2d.pi',0 aOp2e_pi db 'op2e.pi',0 aOp2f_pi db 'op2f.pi',0 aOp2g_pi db 'op2g.pi',0 aOp2h_pi db 'op2h.pi',0 aOp_0 db 'op',0 aOp1_pi_0 db 'op1.pi',0 MUSICROOM_UP dd aMUSICROOM_UP ; " ------ ▲ ------ " MUSICROOM_DOWN dd aMUSICROOM_DOWN ; " ------ ▼ ------ " dd asc_104D5 ; " ---------------- " MUSICROOM_GAME dd aMUSICROOM_TH01 dd aMUSICROOM_TH02 dd aMUSICROOM_TH03 dd aMUSICROOM_TH04 dd aMUSICROOM_TH05 public _MUSIC_TITLES _MUSIC_TITLES label dword dd aTH01_01 ; "No.1 A Sacred Lot " dd aTH01_02 ; "No.2 永遠の巫女 " dd aTH01_03 ; "No.3 The Positive and Negative " dd aTH01_04 ; "No.4 Highly Responsive to Prayers " dd aTH01_05 dd aTH01_06 ; "No.6 天使伝説 " dd aTH01_07 ; "No.7 Oriental Magician " dd aTH01_08 ; "No.8 破邪の小太刀 " dd aTH01_09 ; "No.9 魔鏡 " dd aTH01_10 ; "No.10 the Legend of KAGE " dd aTH01_11 ; "No.11 いざ、倒れ逝くその時まで " dd aTH01_12 ; "No.12 Civilization of Magic " dd aTH01_13 ; "No.13 星幽天使 " dd aTH01_14 ; "No.14 アイリス " dd aMUSICROOM_QUIT1 ; " タイトルに戻る " dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd aTH02_01 dd aTH02_02 ; "No.2   博麗 〜Eastern Wind " dd aTH02_03 ; "No.3   She's in a temper!! " dd aTH02_04 ; "No.4   End of Daylight  " dd aTH02_05 ; "No.5     やみのちから   " dd aTH02_06 ; "No.6      幻夢界     " dd aTH02_07 dd aTH02_08 ; "No.8 ひもろぎ、むらさきにもえ " dd aTH02_09 dd aTH02_10 dd aTH02_11 ; "No.11 Complete Darkness " dd aTH02_12 ; "No.12   エキストララブ " dd aTH02_13 ; "No.13 戦車むすめのみるゆめ " dd aTH02_14 ; "No.14   遠野の森    " dd aTH02_15 dd aTH02_16 ; "未使用.1 博麗神社境内 " dd aTH02_17 ; "未使用.2  陽落ちて   " dd aTH02_18 ; "未使用.3  封魔終演   " dd aMUSICROOM_QUIT1 ; " タイトルに戻る " dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd aTH03_01 dd aTH03_02 ; "No.2     Selection " dd aTH03_03 dd aTH03_04 ; "No.4 Reincarnation " dd aTH03_05 ; "No.5 Dim. Dream " dd aTH03_06 dd aTH03_07 ; "No.7   Maniacal Princess " dd aTH03_08 ; "No.8 夢消失 〜Lost Dream " dd aTH03_09 ; "No.9 夢幻遊戯 〜Dream War " dd aTH03_10 ; "No.10 魔法決戦!〜Fight it out! " dd aTH03_11 ; "No.11   Sailor of Time " dd aTH03_12 ; "No.12 Strawberry Crisis!! " dd aTH03_13 dd aTH03_14 ; "No.14  魔法鐘愛 " dd aTH03_15 ; "No.15  久遠の夢 " dd aTH03_16 dd aTH03_17 ; "No.17 永遠の満月 " dd aTH03_18 ; "No.18 Maple Dream... " dd aTH03_19 dd aTH03_20 ; "No.20 勝利デモ " dd aTH03_21 ; "No.21 ゲームオーバー " dd aTH03_22 ; "未使用.1 時の風 " dd aTH03_23 ; "未使用.2 スターボウドリーム " dd aTH03_24 ; "未使用.3 Phantasmagoria " dd aMUSICROOM_QUIT2 ; " タイトルに戻る " dd 0 dd 0 dd 0 dd 0 dd 0 dd aTH04_01 ; "No.1 幻想郷 〜 Lotus Land Story " dd aTH04_02 ; "No.2 Witching Dream " dd aTH04_03 ; "No.3 Selene's light " dd aTH04_04 dd aTH04_05 ; "No.5 Break the Sabbath " dd aTH04_06 ; "No.6 紅響曲 〜 Scarlet Phoneme " dd aTH04_07 ; "No.7 Bad Apple!! " dd aTH04_08 ; "No.8 霊戦 〜 Perdition crisis " dd aTH04_09 ; "No.9 アリスマエステラ " dd aTH04_10 ; "No.10 少女綺想曲 〜 Capriccio " dd aTH04_11 ; "No.11 星の器 〜 Casket of Star " dd aTH04_12 ; "No.12 Lotus Love " dd aTH04_13 ; "No.13 眠れる恐怖 〜Sleeping Terror " dd aTH04_14 ; "No.14 Dream Land " dd aTH04_15 ; "No.15 幽夢 〜 Inanimate Dream " dd aTH04_16 dd aTH04_17 ; "No.17 メイド幻想 〜 Icemilk Magic " dd aTH04_18 ; "No.18 かわいい悪魔 〜 Innocence " dd aTH04_19 ; "No.19 Days " dd aTH04_20 ; "No.20 Peaceful " dd aTH04_21 ; "No.21 Arcadian Dream " dd aTH04_22 ; "No.22 幻想の住人 " dd aTH04_23 ; "未使用.1 Lotus Road " dd aTH04_24 ; "未使用.2 Dreamy pilot " dd aTH04_25 ; "未使用.3 Incomplete Plot " dd aTH04_26 ; "未使用.4 Border Land " dd aTH04_27 ; "未使用.5 Magic Shop of Raspberry " dd aTH04_28 ; "未使用.6 Crescent Dream " dd aMUSICROOM_QUIT1 ; " タイトルに戻る " dd 0 dd aTH05_01 dd aTH05_02 ; "No.2 Dream Express " dd aTH05_03 ; "No.3 魔法陣 〜 Magic Square " dd aTH05_04 dd aTH05_05 ; "No.5 霊天 〜 Spiritual Heaven " dd aTH05_06 ; "No.6 Romantic Children " dd aTH05_07 ; "No.7 プラスチックマインド " dd aTH05_08 ; "No.8 メイプルワイズ " dd aTH05_09 ; "No.9 禁断の魔法 〜 Forbidden Magic" dd aTH05_10 ; "No.10 真紅の少女 〜 Crimson Dead!!" dd aTH05_11 ; "No.11 裏切りの少女 〜 Judas Kiss " dd aTH05_12 ; "No.12 the Last Judgement " dd aTH05_13 ; "No.13 悲しき人形 〜 Doll of Misery" dd aTH05_14 ; "No.14 世界の果て 〜 World's End " dd aTH05_15 ; "No.15 神話幻想 〜 Infinite Being " dd aTH05_16 ; "No.16 不思議の国のアリス " dd aTH05_17 ; "No.17 the Grimoire of Alice " dd aTH05_18 ; "No.18 神社 " dd aTH05_19 ; "No.19 Endless " dd aTH05_20 ; "No.20 久遠の楽園 " dd aTH05_21 ; "No.21 Mystic Dream " dd aTH05_22 ; "No.22 Peaceful Romancer " dd aTH05_23 ; "No.23 魂の休らむ所 " dd aMUSICROOM_QUIT1 ; " タイトルに戻る " dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 public _MUSIC_FILES _MUSIC_FILES label dword dd aR_00 ; "r_00" dd aR_01 ; "r_01" dd aR_02 ; "r_02" dd aR_03 ; "r_03" dd aR_04 ; "r_04" dd aR_05 ; "r_05" dd aR_06 ; "r_06" dd aR_07 ; "r_07" dd aR_08 ; "r_08" dd aR_09 ; "r_09" dd aR_10 ; "r_10" dd aR_11 ; "r_11" dd aR_12 ; "r_12" dd aR_13 ; "r_13" dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd aH_op ; "h_op" dd aH_st00 ; "h_st00" dd aH_st00b ; "h_st00b" dd aH_st01 ; "h_st01" dd aH_st01b ; "h_st01b" dd aH_st02 ; "h_st02" dd aH_st02b ; "h_st02b" dd aH_st03 ; "h_st03" dd aH_st03b ; "h_st03b" dd aH_st04 ; "h_st04" dd aH_st04b ; "h_st04b" dd aH_st05 ; "h_st05" dd aH_st05b ; "h_st05b" dd aH_end ; "h_end" dd aH_staff ; "h_staff" dd aH_ng00 ; "h_ng00" dd aH_ng01 ; "h_ng01" dd aH_ng02 ; "h_ng02" dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd aY_op ; "y_op" dd aY_select ; "y_select" dd aY_00mm ; "y_00mm" dd aY_01mm ; "y_01mm" dd aY_02mm ; "y_02mm" dd aY_03mm ; "y_03mm" dd aY_04mm ; "y_04mm" dd aY_05mm ; "y_05mm" dd aY_06mm ; "y_06mm" dd aY_dec ; "y_dec" dd aY_07mm ; "y_07mm" dd aY_08mm ; "y_08mm" dd aY_demo1 ; "y_demo1" dd aY_demo2 ; "y_demo2" dd aY_demo3 ; "y_demo3" dd aY_demo4 ; "y_demo4" dd aY_demo5 ; "y_demo5" dd aY_ed ; "y_ed" dd aY_score ; "y_score" dd aY_win ; "y_win" dd aY_over ; "y_over" dd aY_ng00 ; "y_ng00" dd aY_ng01 ; "y_ng01" dd aY_ng02 ; "y_ng02" dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd aG_op ; "g_op" dd aG_st00 ; "g_st00" dd aG_st10 ; "g_st10" dd aG_st00b ; "g_st00b" dd aG_st01 ; "g_st01" dd aG_st01b ; "g_st01b" dd aG_st02 ; "g_st02" dd aG_st02b ; "g_st02b" dd aG_st03 ; "g_st03" dd aG_st03c ; "g_st03c" dd aG_st03b ; "g_st03b" dd aG_st04 ; "g_st04" dd aG_st04b ; "g_st04b" dd aG_st05 ; "g_st05" dd aG_st05b ; "g_st05b" dd aG_st06 ; "g_st06" dd aG_st06b ; "g_st06b" dd aG_st06c ; "g_st06c" dd aG_end1 ; "g_end1" dd aG_end2 ; "g_end2" dd aG_staff ; "g_staff" dd aG_name ; "g_name" dd aG_ng00 ; "g_ng00" dd aG_ng01 ; "g_ng01" dd aG_ng02 ; "g_ng02" dd aG_ng03 ; "g_ng03" dd aG_ng04 ; "g_ng04" dd aG_ng05 ; "g_ng05" dd 0 dd 0 dd aH_op+2 dd aH_st00+2 dd aH_st00b+2 dd aH_st01+2 dd aH_st01b+2 dd aH_st02+2 dd aH_st02b+2 dd aH_st03+2 dd aH_st03b+2 dd aG_st03c+2 dd aSt03d ; "st03d" dd aH_st04+2 dd aH_st04b+2 dd aH_st05+2 dd aH_st05b+2 dd aG_st06+2 dd aG_st06b+2 dd aEd00 ; "ed00" dd aEd01 ; "ed01" dd aEd02 ; "ed02" dd aH_staff+2 dd aExed ; "exed" dd aG_name+2 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 dd 0 music_game dw 4 MUSICROOM_TRACKCOUNTS dw 14,18,24,28,23 include th02/music/polygons[data].asm aMUSICROOM_UP db ' ------ ▲ ------ ',0 aMUSICROOM_DOWN db ' ------ ▼ ------ ',0 asc_104D5 db ' ---------------- ',0 aMUSICROOM_TH01 db ' 第1弾 東方靈異伝 Arrange ver ',0 aMUSICROOM_TH02 db ' 第2弾 東方封魔録 Special MIX ',0 aMUSICROOM_TH03 db ' 第3弾 東方夢時空 Special MIX ',0 aMUSICROOM_TH04 db ' 第4弾 東方幻想郷 Special MIX ',0 aMUSICROOM_TH05 db ' 第5弾 東方怪綺談 MysticSquare ',0 aTH01_01 db 'No.1 A Sacred Lot ',0 aTH01_02 db 'No.2 永遠の巫女 ',0 aTH01_03 db 'No.3 The Positive and Negative ',0 aTH01_04 db 'No.4 Highly Responsive to Prayers ',0 aTH01_05 db 'No.5 東方怪奇談 ',0 aTH01_06 db 'No.6 天使伝説 ',0 aTH01_07 db 'No.7 Oriental Magician ',0 aTH01_08 db 'No.8 破邪の小太刀 ',0 aTH01_09 db 'No.9 魔鏡 ',0 aTH01_10 db 'No.10 the Legend of KAGE ',0 aTH01_11 db 'No.11 いざ、倒れ逝くその時まで ',0 aTH01_12 db 'No.12 Civilization of Magic ',0 aTH01_13 db 'No.13 星幽天使 ',0 aTH01_14 db 'No.14 アイリス ',0 aMUSICROOM_QUIT1 db ' タイトルに戻る ',0 aTH02_01 db 'No.1 東方封魔録 〜浄土曼荼羅 ',0 aTH02_02 db 'No.2   博麗 〜Eastern Wind ',0 aTH02_03 db 'No.3   She',27h,'s in a temper!! ',0 aTH02_04 db 'No.4   End of Daylight  ',0 aTH02_05 db 'No.5     やみのちから   ',0 aTH02_06 db 'No.6      幻夢界     ',0 aTH02_07 db 'No.7     死を賭して    ',0 aTH02_08 db 'No.8 ひもろぎ、むらさきにもえ ',0 aTH02_09 db 'No.9     恋色マジック   ',0 aTH02_10 db 'No.10  東方封魔録 〜幽幻乱舞 ',0 aTH02_11 db 'No.11 Complete Darkness ',0 aTH02_12 db 'No.12   エキストララブ ',0 aTH02_13 db 'No.13 戦車むすめのみるゆめ ',0 aTH02_14 db 'No.14   遠野の森    ',0 aTH02_15 db 'No.15 昔話わんだーらんど ',0 aTH02_16 db '未使用.1 博麗神社境内 ',0 aTH02_17 db '未使用.2  陽落ちて   ',0 aTH02_18 db '未使用.3  封魔終演   ',0 aTH03_01 db 'No.1  夢は時空を越えて ',0 aTH03_02 db 'No.2     Selection ',0 aTH03_03 db 'No.3 東方妖恋談 ',0 aTH03_04 db 'No.4 Reincarnation ',0 aTH03_05 db 'No.5 Dim. Dream ',0 aTH03_06 db 'No.6 Tabula rasa 〜空白少女 ',0 aTH03_07 db 'No.7   Maniacal Princess ',0 aTH03_08 db 'No.8 夢消失 〜Lost Dream ',0 aTH03_09 db 'No.9 夢幻遊戯 〜Dream War ',0 aTH03_10 db 'No.10 魔法決戦!〜Fight it out! ',0 aTH03_11 db 'No.11   Sailor of Time ',0 aTH03_12 db 'No.12 Strawberry Crisis!! ',0 aTH03_13 db 'No.13 非統一魔法世界論 ',0 aTH03_14 db 'No.14  魔法鐘愛 ',0 aTH03_15 db 'No.15  久遠の夢 ',0 aTH03_16 db 'No.16 東方の青い空 ',0 aTH03_17 db 'No.17 永遠の満月 ',0 aTH03_18 db 'No.18 Maple Dream... ',0 aTH03_19 db 'No.19 霊人の休日 ',0 aTH03_20 db 'No.20 勝利デモ ',0 aTH03_21 db 'No.21 ゲームオーバー ',0 aTH03_22 db '未使用.1 時の風 ',0 aTH03_23 db '未使用.2 スターボウドリーム ',0 aTH03_24 db '未使用.3 Phantasmagoria ',0 aMUSICROOM_QUIT2 db ' タイトルに戻る ',0 aTH04_01 db 'No.1 幻想郷 〜 Lotus Land Story ',0 aTH04_02 db 'No.2 Witching Dream ',0 aTH04_03 db 'No.3 Selene',27h,'s light ',0 aTH04_04 db 'No.4 装飾戦 〜 Decoration Battle ',0 aTH04_05 db 'No.5 Break the Sabbath ',0 aTH04_06 db 'No.6 紅響曲 〜 Scarlet Phoneme ',0 aTH04_07 db 'No.7 Bad Apple!! ',0 aTH04_08 db 'No.8 霊戦 〜 Perdition crisis ',0 aTH04_09 db 'No.9 アリスマエステラ ',0 aTH04_10 db 'No.10 少女綺想曲 〜 Capriccio ',0 aTH04_11 db 'No.11 星の器 〜 Casket of Star ',0 aTH04_12 db 'No.12 Lotus Love ',0 aTH04_13 db 'No.13 眠れる恐怖 〜Sleeping Terror ',0 aTH04_14 db 'No.14 Dream Land ',0 aTH04_15 db 'No.15 幽夢 〜 Inanimate Dream ',0 aTH04_16 db 'No.16 禁じざるをえない遊戯 ',0 aTH04_17 db 'No.17 メイド幻想 〜 Icemilk Magic ',0 aTH04_18 db 'No.18 かわいい悪魔 〜 Innocence ',0 aTH04_19 db 'No.19 Days ',0 aTH04_20 db 'No.20 Peaceful ',0 aTH04_21 db 'No.21 Arcadian Dream ',0 aTH04_22 db 'No.22 幻想の住人 ',0 aTH04_23 db '未使用.1 Lotus Road ',0 aTH04_24 db '未使用.2 Dreamy pilot ',0 aTH04_25 db '未使用.3 Incomplete Plot ',0 aTH04_26 db '未使用.4 Border Land ',0 aTH04_27 db '未使用.5 Magic Shop of Raspberry ',0 aTH04_28 db '未使用.6 Crescent Dream ',0 aTH05_01 db 'No.1 怪綺談 〜 Mystic Square ',0 aTH05_02 db 'No.2 Dream Express ',0 aTH05_03 db 'No.3 魔法陣 〜 Magic Square ',0 aTH05_04 db 'No.4 夢想時空 ',0 aTH05_05 db 'No.5 霊天 〜 Spiritual Heaven ',0 aTH05_06 db 'No.6 Romantic Children ',0 aTH05_07 db 'No.7 プラスチックマインド ',0 aTH05_08 db 'No.8 メイプルワイズ ',0 aTH05_09 db 'No.9 禁断の魔法 〜 Forbidden Magic',0 aTH05_10 db 'No.10 真紅の少女 〜 Crimson Dead!!',0 aTH05_11 db 'No.11 裏切りの少女 〜 Judas Kiss ',0 aTH05_12 db 'No.12 the Last Judgement ',0 aTH05_13 db 'No.13 悲しき人形 〜 Doll of Misery',0 aTH05_14 db 'No.14 世界の果て 〜 World',27h,'s End ',0 aTH05_15 db 'No.15 神話幻想 〜 Infinite Being ',0 aTH05_16 db 'No.16 不思議の国のアリス ',0 aTH05_17 db 'No.17 the Grimoire of Alice ',0 aTH05_18 db 'No.18 神社 ',0 aTH05_19 db 'No.19 Endless ',0 aTH05_20 db 'No.20 久遠の楽園 ',0 aTH05_21 db 'No.21 Mystic Dream ',0 aTH05_22 db 'No.22 Peaceful Romancer ',0 aTH05_23 db 'No.23 魂の休らむ所 ',0 aR_00 db 'r_00',0 aR_01 db 'r_01',0 aR_02 db 'r_02',0 aR_03 db 'r_03',0 aR_04 db 'r_04',0 aR_05 db 'r_05',0 aR_06 db 'r_06',0 aR_07 db 'r_07',0 aR_08 db 'r_08',0 aR_09 db 'r_09',0 aR_10 db 'r_10',0 aR_11 db 'r_11',0 aR_12 db 'r_12',0 aR_13 db 'r_13',0 aH_op db 'h_op',0 aH_st00 db 'h_st00',0 aH_st00b db 'h_st00b',0 aH_st01 db 'h_st01',0 aH_st01b db 'h_st01b',0 aH_st02 db 'h_st02',0 aH_st02b db 'h_st02b',0 aH_st03 db 'h_st03',0 aH_st03b db 'h_st03b',0 aH_st04 db 'h_st04',0 aH_st04b db 'h_st04b',0 aH_st05 db 'h_st05',0 aH_st05b db 'h_st05b',0 aH_end db 'h_end',0 aH_staff db 'h_staff',0 aH_ng00 db 'h_ng00',0 aH_ng01 db 'h_ng01',0 aH_ng02 db 'h_ng02',0 aY_op db 'y_op',0 aY_select db 'y_select',0 aY_00mm db 'y_00mm',0 aY_01mm db 'y_01mm',0 aY_02mm db 'y_02mm',0 aY_03mm db 'y_03mm',0 aY_04mm db 'y_04mm',0 aY_05mm db 'y_05mm',0 aY_06mm db 'y_06mm',0 aY_dec db 'y_dec',0 aY_07mm db 'y_07mm',0 aY_08mm db 'y_08mm',0 aY_demo1 db 'y_demo1',0 aY_demo2 db 'y_demo2',0 aY_demo3 db 'y_demo3',0 aY_demo4 db 'y_demo4',0 aY_demo5 db 'y_demo5',0 aY_ed db 'y_ed',0 aY_score db 'y_score',0 aY_win db 'y_win',0 aY_over db 'y_over',0 aY_ng00 db 'y_ng00',0 aY_ng01 db 'y_ng01',0 aY_ng02 db 'y_ng02',0 aG_op db 'g_op',0 aG_st00 db 'g_st00',0 aG_st10 db 'g_st10',0 aG_st00b db 'g_st00b',0 aG_st01 db 'g_st01',0 aG_st01b db 'g_st01b',0 aG_st02 db 'g_st02',0 aG_st02b db 'g_st02b',0 aG_st03 db 'g_st03',0 aG_st03c db 'g_st03c',0 aG_st03b db 'g_st03b',0 aG_st04 db 'g_st04',0 aG_st04b db 'g_st04b',0 aG_st05 db 'g_st05',0 aG_st05b db 'g_st05b',0 aG_st06 db 'g_st06',0 aG_st06b db 'g_st06b',0 aG_st06c db 'g_st06c',0 aG_end1 db 'g_end1',0 aG_end2 db 'g_end2',0 aG_staff db 'g_staff',0 aG_name db 'g_name',0 aG_ng00 db 'g_ng00',0 aG_ng01 db 'g_ng01',0 aG_ng02 db 'g_ng02',0 aG_ng03 db 'g_ng03',0 aG_ng04 db 'g_ng04',0 aG_ng05 db 'g_ng05',0 aSt03d db 'st03d',0 aEd00 db 'ed00',0 aEd01 db 'ed01',0 aEd02 db 'ed02',0 aExed db 'exed',0 include th05/music/music_cmt_load[data].asm aMusic_pi db 'music.pi',0 aMusic_dat db 'music.dat',0 aKaikidan1_dat1 db '怪綺談1.dat',0 db 0 aGensou_scr db 'GENSOU.SCR',0 aName db 'name',0 aHi01_pi db 'hi01.pi',0 aOp1_pi_1 db 'op1.pi',0 aOp_1 db 'op',0 aScnum_bft db 'scnum.bft',0 aHi_m_bft db 'hi_m.bft',0 db 0 aSlb1_pi db 'slb1.pi',0 .data? public _resident _resident dd ? _in_option db ? db ? _putfunc dw ? _main_input_allowed db ? _option_input_allowed db ? include libs/master.lib/clip[bss].asm include libs/master.lib/fil[bss].asm include libs/master.lib/js[bss].asm include libs/master.lib/pal[bss].asm include libs/master.lib/vs[bss].asm include libs/master.lib/vsync[bss].asm include libs/master.lib/mem[bss].asm include libs/master.lib/superpa[bss].asm include libs/master.lib/super_put_rect[bss].asm include th03/formats/hfliplut[bss].asm include th04/snd/interrupt[bss].asm include libs/master.lib/bgm[bss].asm include th05/music/piano[bss].asm include th02/snd/load[bss].asm include th05/formats/pi_slot_put_mask[bss].asm include th05/formats/pi_slot_headers[bss].asm include th04/hardware/input[bss].asm include th04/formats/cdg[bss].asm include libs/master.lib/pfint21[bss].asm include th04/hardware/egccopyr[bss].asm include th04/setup[bss].asm include th04/zunsoft[bss].asm dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; dd ? ; include th02/music/music[bss].asm byte_13E96 db ? db ? include th03/music/cmt_back[bss].asm include th02/music/music_cmt[bss].asm word_1403A dw ? word_1403C dw ? musicroom_trackcount dw ? extern _hi:scoredat_section_t extern _hi2:scoredat_section_t extern _hiscore_rank:byte extern _cleared_with:byte extern _extra_unlocked:byte extern _playchar_menu_sel:byte extern _rank:byte extern _extra_playable_with:byte extern _selectable_with:byte end