ReC98/th02_maine.asm

376 lines
10 KiB
NASM

;
; +-------------------------------------------------------------------------+
; | This file has been generated by The Interactive Disassembler (IDA) |
; | Copyright (c) 2009 by Hex-Rays, <support@hex-rays.com> |
; +-------------------------------------------------------------------------+
;
; Input MD5 : E6F971B37336C0F9FCE53F895780031E
; File Name : th02/MAINE.EXE
; Format : MS-DOS executable (EXE)
; Base Address: 0h Range: 0h-FCF0h Loaded length: DE32h
; Entry Point : 0:0
; OS type : MS DOS
; Application type: Executable 16bit
.386
.model use16 large _TEXT
include ReC98.inc
include th02/th02.inc
extern _execl:proc
maine_01 group END_TEXT, maine_01_TEXT
; ===========================================================================
; 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_extend_header_skip.asm
include libs/master.lib/bfnt_header_read.asm
include libs/master.lib/bfnt_header_analysis.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/cutline.asm
include libs/master.lib/dos_axdx.asm
include libs/master.lib/dos_filesize.asm
include libs/master.lib/dos_setvect.asm
include libs/master.lib/egc.asm
include libs/master.lib/egc_shift_down.asm
include libs/master.lib/egc_shift_left.asm
include libs/master.lib/file_append.asm
include libs/master.lib/file_close.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_size.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_boxfill.asm
include libs/master.lib/grcg_line.asm
include libs/master.lib/grcg_setcolor.asm
include libs/master.lib/gaiji_backup.asm
include libs/master.lib/gaiji_entry_bfnt.asm
include libs/master.lib/gaiji_putca.asm
include libs/master.lib/gaiji_putsa.asm
include libs/master.lib/gaiji_read.asm
include libs/master.lib/gaiji_write.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_gaiji_putc.asm
include libs/master.lib/graph_gaiji_puts.asm
include libs/master.lib/graph_pi_free.asm
include libs/master.lib/graph_pi_load_pack.asm
include libs/master.lib/graph_pack_put_8.asm
include libs/master.lib/key_sense.asm
include libs/master.lib/over_put_8.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/palette_entry_rgb.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/text_clear.asm
include libs/master.lib/vsync.asm
include libs/master.lib/vsync_wait.asm
include libs/master.lib/palette_white_in.asm
include libs/master.lib/palette_white_out.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_entry_pat.asm
include libs/master.lib/super_entry_at.asm
include libs/master.lib/super_entry_bfnt.asm
include libs/master.lib/pfint21.asm
db 0
include th02/formats/pfopen.asm
include libs/master.lib/pf_str_ieq.asm
_TEXT ends
; ===========================================================================
END_TEXT segment byte public 'CODE' use16
@end_bad_animate$qv procdesc near
@end_good_animate$qv procdesc near
@staffroll_and_verdict_animate$qv procdesc near
END_TEXT ends
; Segment type: Pure code
maine_01_TEXT segment byte public 'CODE' use16
assume cs:maine_01
;org 3
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 @extra_unlock_animate$qv
@extra_unlock_animate$qv proc far
push bp
mov bp, sp
call @scoredat_is_extra_unlocked$qv
or ax, ax
jz loc_B07D
les bx, _resident
cmp es:[bx+mikoconfig_t.continues_used], 0
jnz short loc_B07D
call @pi_load$qinxc c, 0, offset aAll_pi, ds
call @pi_palette_apply$qi stdcall, 0
pop cx
call @pi_put_8$qiii c, 0, large 0
freePISlotLarge 0
push 2
call palette_black_in
call @frame_delay$qi pascal, 150
call @pi_load$qinxc c, 0, offset aBut_pi, ds
call @pi_palette_apply$qi stdcall, 0
pop cx
call @pi_put_8$qiii c, 0, large 0
freePISlotLarge 0
call @key_delay$qv
push 5
call palette_black_out
loc_B07D:
pop bp
retf
@extra_unlock_animate$qv endp
; =============== S U B R O U T I N E =======================================
; Attributes: bp-based frame
sub_B07F proc far
push bp
mov bp, sp
call @scoredat_is_extra_unlocked$qv
or ax, ax
jz loc_B115
mov PaletteTone, 0
call far ptr palette_show
call @pi_load$qinxc c, 0, offset aAll_pi, ds
call @pi_palette_apply$qi stdcall, 0
pop cx
call @pi_put_8$qiii c, 0, large 0
freePISlotLarge 0
push 2
call palette_black_in
call @frame_delay$qi pascal, 150
call @pi_load$qinxc c, 0, offset aExtra_pi, ds
call @pi_palette_apply$qi stdcall, 0
pop cx
call @pi_put_8$qiii c, 0, large 0
freePISlotLarge 0
call @key_delay$qv
push 5
call palette_black_out
loc_B115:
pop bp
retf
sub_B07F endp
; =============== 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
call @cfg_load$qv
or ax, ax
jz loc_B1FE
les bx, _resident
cmp es:[bx+mikoconfig_t.stage], 7Fh
jnz loc_B1FE
call @game_init_main$qv
call gaiji_backup
push ds
push offset aMikoft_bft ; "MIKOFT.bft"
call gaiji_entry_bfnt
call _snd_pmd_resident
call _snd_mmd_resident
les bx, _resident
cmp es:[bx+mikoconfig_t.bgm_mode], 0
jnz short loc_B161
mov _snd_midi_active, 0
jmp short loc_B189
; ---------------------------------------------------------------------------
loc_B161:
les bx, _resident
cmp es:[bx+mikoconfig_t.bgm_mode], 1
jnz short loc_B173
mov _snd_midi_active, 0
jmp short loc_B184
; ---------------------------------------------------------------------------
loc_B173:
les bx, _resident
cmp es:[bx+mikoconfig_t.bgm_mode], 2
jnz short loc_B189
mov al, _snd_midi_possible
mov _snd_midi_active, al
loc_B184:
call _snd_determine_mode
loc_B189:
graph_accesspage 0
mov dx, 164 ; Port 00A4h: Page display register
out dx, al
call super_entry_bfnt pascal, ds, offset aEndft_bft ; "endft.bft"
call @frame_delay$qi pascal, 100
les bx, _resident
cmp es:[bx+mikoconfig_t.rank], 4
jz short loc_B1C2
cmp es:[bx+mikoconfig_t.continues_used], 0
jz short loc_B1BA
call @end_bad_animate$qv
jmp short loc_B1BD
; ---------------------------------------------------------------------------
loc_B1BA:
call @end_good_animate$qv
loc_B1BD:
call @staffroll_and_verdict_animate$qv
jmp short loc_B1C6
; ---------------------------------------------------------------------------
loc_B1C2:
call sub_B07F
loc_B1C6:
mov PaletteTone, 50
call far ptr palette_show
call @regist_menu$qv
mov PaletteTone, 0
call far ptr palette_show
call gaiji_restore
call @game_exit$qv
pushd 0
push ds
push offset path ; "op"
push ds
push offset path ; "op"
call _execl
add sp, 0Ch
loc_B1FE:
pop bp
retf
_main endp
maine_01_TEXT ends
; ===========================================================================
SHARED segment word public 'CODE' use16
extern @key_delay$qv:proc
extern @pi_load$qinxc:proc
extern @FRAME_DELAY$QI:proc
extern @game_exit$qv:proc
extern _snd_mmd_resident:proc
extern _snd_determine_mode:proc
extern _snd_pmd_resident:proc
extern @game_init_main$qv:proc
extern @pi_palette_apply$qi:proc
extern @pi_put_8$qiii:proc
SHARED ends
; ===========================================================================
maine_03_TEXT segment word public 'CODE' use16
extern @cfg_load$qv:proc
maine_03_TEXT ends
; ===========================================================================
maine_04_TEXT segment byte public 'CODE' use16
extern @scoredat_is_extra_unlocked$qv:proc
extern @regist_menu$qv:proc
maine_04_TEXT ends
.data
aAll_pi = ($ - 7)
aBut_pi db 'but.pi',0
aExtra_pi db 'extra.pi',0
aMikoft_bft db 'MIKOFT.bft',0
aEndft_bft db 'endft.bft',0
; char path[]
path db 'op',0
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/gaiji_backup[data].asm
include libs/master.lib/gaiji_entry_bfnt[data].asm
include libs/master.lib/grp[data].asm
include libs/master.lib/pal[data].asm
include libs/master.lib/pf[data].asm
include libs/master.lib/sin8[data].asm
include libs/master.lib/tx[data].asm
include libs/master.lib/version[data].asm
include libs/master.lib/vs[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
public _key_delay_groups
_key_delay_groups db 5, 3, 0
db 0
include th02/formats/pfopen[data].asm
.data?
include libs/master.lib/clip[bss].asm
include libs/master.lib/fil[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 th01/hardware/vram_planes[bss].asm
include th02/formats/pi_slots[bss].asm
include libs/master.lib/pfint21[bss].asm
include th02/hardware/input_sense[bss].asm
include th02/snd/snd[bss].asm
include th02/snd/load[bss].asm
extern _resident:dword
end