2014-06-26 20:33:22 +00:00
|
|
|
;
|
|
|
|
; +-------------------------------------------------------------------------+
|
|
|
|
; | This file has been generated by The Interactive Disassembler (IDA) |
|
|
|
|
; | Copyright (c) 2009 by Hex-Rays, <support@hex-rays.com> |
|
|
|
|
; +-------------------------------------------------------------------------+
|
|
|
|
;
|
|
|
|
; 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
|
|
|
|
|
2021-03-29 17:16:49 +00:00
|
|
|
.386
|
2023-11-25 14:08:19 +00:00
|
|
|
.model use16 large _TEXT
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2019-12-27 20:02:26 +00:00
|
|
|
BINARY = 'O'
|
|
|
|
|
2014-08-22 15:06:33 +00:00
|
|
|
include ReC98.inc
|
2019-09-20 19:02:20 +00:00
|
|
|
include th05/th05.inc
|
2023-11-28 14:32:14 +00:00
|
|
|
include th04/sprites/op_cdg.inc
|
Include RULES.ASI from every executable's dump file.
Having thought this over for a while, I've decided to stay with the "include
slice" model for now, due to various bugs and other reasons.
We need to compile for the 386 CPU, but this causes TASM to automatically
default every segment to 32-bit mode, which of course is not what we want (and
no, .MODEL USE16 sadly does not help either). Appending USE16 to every segment
declaration in all included files seems to work, but for some reason, this
messes up certain jump instructions. WTF? And even if it did work, we would
still have to do this for every single file we include.
The alternative would be to build proper libraries and let the linker merge
all the code. This would add a lot of unwarranted complexity to the build
process. Not to mention all the EXTERN statements we'd have to maintain.
Ultimately, all of the C runtime ASM code is going to vanish anyway once we've
completed the reduction step. Once we're there, we can simply link to the
original version of the library. These initial dumps are not pretty, and I see
no point in wasting time on making intermediary stages of development look
pretty.
Since including RULES.ASI from every slice seems a bit inefficient (and even
potentiall harmful, considering the age of the development tools we have to
work with), we'll only include it once at the top of every main dump file.
[Binary change] Relocations in TH01's REIIDEN.EXE, again.
2014-08-14 06:01:36 +00:00
|
|
|
|
2023-11-30 11:33:25 +00:00
|
|
|
op_01 group OP_SETUP_TEXT, op_01_TEXT, HI_VIEW_TEXT
|
2020-09-05 17:03:48 +00:00
|
|
|
|
2014-06-26 20:33:22 +00:00
|
|
|
; ===========================================================================
|
|
|
|
|
2023-11-28 19:48:14 +00:00
|
|
|
_TEXT segment word public 'CODE' use16
|
|
|
|
extern PALETTE_BLACK_IN:proc
|
|
|
|
extern PALETTE_BLACK_OUT:proc
|
|
|
|
extern FILE_CLOSE:proc
|
|
|
|
extern FILE_CREATE:proc
|
|
|
|
extern FILE_EXIST:proc
|
|
|
|
extern FILE_READ:proc
|
|
|
|
extern FILE_ROPEN:proc
|
|
|
|
extern FILE_SEEK:proc
|
|
|
|
extern FILE_WRITE:proc
|
|
|
|
extern GRCG_BYTEBOXFILL_X:proc
|
|
|
|
extern GRAPH_CLEAR:proc
|
|
|
|
extern GRAPH_COPY_PAGE:proc
|
|
|
|
extern PALETTE_SHOW:proc
|
|
|
|
extern IRAND:proc
|
|
|
|
extern HMEM_FREE:proc
|
|
|
|
extern SUPER_FREE:proc
|
|
|
|
extern SUPER_ENTRY_BFNT:proc
|
|
|
|
extern SUPER_PUT_RECT:proc
|
|
|
|
extern SUPER_PUT:proc
|
|
|
|
extern GRAPH_GAIJI_PUTS:proc
|
|
|
|
extern GRAPH_GAIJI_PUTC:proc
|
|
|
|
_TEXT ends
|
2014-06-26 20:33:22 +00:00
|
|
|
|
|
|
|
; ===========================================================================
|
|
|
|
|
|
|
|
; Segment type: Pure code
|
2023-11-30 11:33:25 +00:00
|
|
|
OP_SETUP_TEXT segment byte public 'CODE' use16
|
2023-10-28 19:43:11 +00:00
|
|
|
assume cs:op_01
|
2015-02-18 11:07:37 +00:00
|
|
|
assume es:nothing, ss:nothing, ds:_DATA, fs:nothing, gs:nothing
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2018-03-21 22:20:04 +00:00
|
|
|
include th04/zunsoft.asm
|
2023-11-30 11:33:25 +00:00
|
|
|
OP_SETUP_TEXT ends
|
2023-10-28 22:19:17 +00:00
|
|
|
|
|
|
|
op_01_TEXT segment byte public 'CODE' use16
|
2019-12-27 21:28:54 +00:00
|
|
|
include th04/formats/scoredat_decode_both.asm
|
|
|
|
include th04/formats/scoredat_encode.asm
|
|
|
|
include th05/formats/scoredat_recreate_op.asm
|
2020-09-20 13:57:10 +00:00
|
|
|
include th05/formats/scoredat_load_for.asm
|
2014-06-26 20:33:22 +00:00
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
sub_CA1B proc near
|
2014-06-26 20:33:22 +00:00
|
|
|
|
|
|
|
var_2 = word ptr -2
|
|
|
|
arg_0 = word ptr 4
|
2019-12-22 13:04:34 +00:00
|
|
|
@@y = word ptr 6
|
2014-06-26 20:33:22 +00:00
|
|
|
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
|
2021-12-17 21:19:17 +00:00
|
|
|
mov al, _hi.score.g_score[bx][SCORE_DIGITS - 1]
|
2014-06-26 20:33:22 +00:00
|
|
|
mov ah, 0
|
2019-12-26 16:19:44 +00:00
|
|
|
add ax, -gb_0_
|
2019-12-22 13:04:34 +00:00
|
|
|
cmp ax, 10
|
2014-06-26 20:33:22 +00:00
|
|
|
jl short loc_CA5B
|
2019-12-22 13:04:34 +00:00
|
|
|
lea ax, [si-16]
|
2014-06-26 20:33:22 +00:00
|
|
|
push ax
|
2019-12-22 13:04:34 +00:00
|
|
|
push [bp+@@y]
|
2014-06-26 20:33:22 +00:00
|
|
|
mov bx, di
|
|
|
|
shl bx, 3
|
2021-12-17 21:19:17 +00:00
|
|
|
mov al, _hi.score.g_score[bx][SCORE_DIGITS - 1]
|
2014-06-26 20:33:22 +00:00
|
|
|
mov ah, 0
|
2019-12-26 16:19:44 +00:00
|
|
|
add ax, -gb_0_
|
2019-12-22 13:04:34 +00:00
|
|
|
mov bx, 10
|
2014-06-26 20:33:22 +00:00
|
|
|
cwd
|
|
|
|
idiv bx
|
|
|
|
push ax
|
2014-08-28 00:13:13 +00:00
|
|
|
call super_put
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CA5B:
|
2014-06-26 20:33:22 +00:00
|
|
|
push si
|
2019-12-22 13:04:34 +00:00
|
|
|
push [bp+@@y]
|
2014-06-26 20:33:22 +00:00
|
|
|
mov bx, di
|
|
|
|
shl bx, 3
|
2021-12-17 21:19:17 +00:00
|
|
|
mov al, _hi.score.g_score[bx][SCORE_DIGITS - 1]
|
2014-06-26 20:33:22 +00:00
|
|
|
mov ah, 0
|
2019-12-26 16:19:44 +00:00
|
|
|
add ax, -gb_0_
|
2019-12-22 13:04:34 +00:00
|
|
|
mov bx, 10
|
2014-06-26 20:33:22 +00:00
|
|
|
cwd
|
|
|
|
idiv bx
|
|
|
|
push dx
|
2014-08-28 00:13:13 +00:00
|
|
|
call super_put
|
2019-12-22 13:04:34 +00:00
|
|
|
add si, 16
|
2014-06-26 20:33:22 +00:00
|
|
|
mov [bp+var_2], 6
|
|
|
|
jmp short loc_CAA4
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CA83:
|
2014-06-26 20:33:22 +00:00
|
|
|
push si
|
2019-12-22 13:04:34 +00:00
|
|
|
push [bp+@@y]
|
2014-06-26 20:33:22 +00:00
|
|
|
mov bx, di
|
|
|
|
shl bx, 3
|
|
|
|
add bx, [bp+var_2]
|
2021-12-17 21:19:17 +00:00
|
|
|
mov al, _hi.score.g_score[bx]
|
2014-06-26 20:33:22 +00:00
|
|
|
mov ah, 0
|
2019-12-26 16:19:44 +00:00
|
|
|
add ax, -gb_0_
|
2014-06-26 20:33:22 +00:00
|
|
|
push ax
|
2014-08-28 00:13:13 +00:00
|
|
|
call super_put
|
2014-06-26 20:33:22 +00:00
|
|
|
dec [bp+var_2]
|
2019-12-22 13:04:34 +00:00
|
|
|
add si, 16
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CAA4:
|
2014-06-26 20:33:22 +00:00
|
|
|
cmp [bp+var_2], 0
|
|
|
|
jge short loc_CA83
|
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
leave
|
|
|
|
retn 6
|
|
|
|
sub_CA1B endp
|
|
|
|
|
2019-12-29 16:47:23 +00:00
|
|
|
include th04/hiscore/hiscore_stage_put.asm
|
2014-06-26 20:33:22 +00:00
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
sub_CB00 proc near
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2019-12-28 21:05:25 +00:00
|
|
|
@@color = word ptr -2
|
2014-06-26 20:33:22 +00:00
|
|
|
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]
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB1B:
|
2014-06-26 20:33:22 +00:00
|
|
|
mov si, 8
|
|
|
|
jmp short loc_CB23
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB20:
|
2019-12-28 21:05:25 +00:00
|
|
|
mov si, 328
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB23:
|
2019-12-28 21:05:25 +00:00
|
|
|
mov di, 88
|
2014-06-26 20:33:22 +00:00
|
|
|
jmp short loc_CB33
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB28:
|
2014-06-26 20:33:22 +00:00
|
|
|
mov si, 8
|
|
|
|
jmp short loc_CB30
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB2D:
|
2019-12-28 21:05:25 +00:00
|
|
|
mov si, 328
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB30:
|
2019-12-28 21:05:25 +00:00
|
|
|
mov di, 224
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB33:
|
2019-12-28 21:05:25 +00:00
|
|
|
mov [bp+@@color], 7
|
2014-06-26 20:33:22 +00:00
|
|
|
jmp short loc_CB74
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB3A:
|
2014-06-26 20:33:22 +00:00
|
|
|
mov bx, [bp+arg_2]
|
|
|
|
cmp bx, 3
|
|
|
|
ja short loc_CB6F
|
|
|
|
add bx, bx
|
|
|
|
jmp cs:off_CBCC[bx]
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB49:
|
2014-06-26 20:33:22 +00:00
|
|
|
mov si, 8
|
|
|
|
jmp short loc_CB51
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB4E:
|
2019-12-28 21:05:25 +00:00
|
|
|
mov si, 328
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB51:
|
2014-06-26 20:33:22 +00:00
|
|
|
mov ax, [bp+arg_0]
|
|
|
|
shl ax, 4
|
2019-12-28 21:05:25 +00:00
|
|
|
add ax, 96
|
2014-06-26 20:33:22 +00:00
|
|
|
jmp short loc_CB6D
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB5C:
|
2014-06-26 20:33:22 +00:00
|
|
|
mov si, 8
|
|
|
|
jmp short loc_CB64
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB61:
|
2019-12-28 21:05:25 +00:00
|
|
|
mov si, 328
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB64:
|
2014-06-26 20:33:22 +00:00
|
|
|
mov ax, [bp+arg_0]
|
|
|
|
shl ax, 4
|
2019-12-28 21:05:25 +00:00
|
|
|
add ax, 232
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB6D:
|
2014-06-26 20:33:22 +00:00
|
|
|
mov di, ax
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB6F:
|
2019-12-28 21:05:25 +00:00
|
|
|
mov [bp+@@color], 2
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CB74:
|
2014-06-26 20:33:22 +00:00
|
|
|
lea ax, [si+2]
|
|
|
|
push ax
|
|
|
|
lea ax, [di+2]
|
|
|
|
push ax
|
2019-12-28 21:05:25 +00:00
|
|
|
push GAIJI_W
|
2014-06-26 20:33:22 +00:00
|
|
|
mov ax, [bp+arg_0]
|
2019-12-28 21:05:25 +00:00
|
|
|
imul ax, (SCOREDAT_NAME_LEN + 1)
|
2019-12-26 16:19:44 +00:00
|
|
|
add ax, offset _hi.score.g_name
|
2014-06-26 20:33:22 +00:00
|
|
|
push ds
|
|
|
|
push ax
|
2019-12-28 21:05:25 +00:00
|
|
|
push 14
|
2014-09-15 01:03:52 +00:00
|
|
|
call graph_gaiji_puts
|
2014-06-26 20:33:22 +00:00
|
|
|
push si
|
|
|
|
push di
|
2019-12-28 21:05:25 +00:00
|
|
|
push GAIJI_W
|
2014-06-26 20:33:22 +00:00
|
|
|
mov ax, [bp+arg_0]
|
2019-12-28 21:05:25 +00:00
|
|
|
imul ax, (SCOREDAT_NAME_LEN + 1)
|
2019-12-26 16:19:44 +00:00
|
|
|
add ax, offset _hi.score.g_name
|
2014-06-26 20:33:22 +00:00
|
|
|
push ds
|
|
|
|
push ax
|
2019-12-28 21:05:25 +00:00
|
|
|
push [bp+@@color]
|
2014-09-15 01:03:52 +00:00
|
|
|
call graph_gaiji_puts
|
2019-12-29 15:10:44 +00:00
|
|
|
lea ax, [si+150]
|
|
|
|
call sub_CA1B pascal, ax, di, [bp+arg_0]
|
|
|
|
lea ax, [si+286]
|
2014-06-26 20:33:22 +00:00
|
|
|
push ax
|
|
|
|
push di
|
|
|
|
mov bx, [bp+arg_0]
|
2019-12-26 16:19:44 +00:00
|
|
|
mov al, _hi.score.g_stage[bx]
|
2014-06-26 20:33:22 +00:00
|
|
|
mov ah, 0
|
|
|
|
push ax
|
2019-12-29 16:47:23 +00:00
|
|
|
call hiscore_stage_put
|
2014-06-26 20:33:22 +00:00
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
leave
|
|
|
|
retn 4
|
|
|
|
sub_CB00 endp
|
|
|
|
|
|
|
|
; ---------------------------------------------------------------------------
|
2014-08-10 01:44:54 +00:00
|
|
|
off_CBCC dw offset loc_CB49
|
2014-06-26 20:33:22 +00:00
|
|
|
dw offset loc_CB4E
|
|
|
|
dw offset loc_CB5C
|
|
|
|
dw offset loc_CB61
|
2014-08-10 01:44:54 +00:00
|
|
|
off_CBD4 dw offset loc_CB1B
|
2014-06-26 20:33:22 +00:00
|
|
|
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
|
2020-09-20 21:14:04 +00:00
|
|
|
public _score_render
|
|
|
|
_score_render proc near
|
2014-06-26 20:33:22 +00:00
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
push di
|
2018-12-29 19:08:52 +00:00
|
|
|
graph_accesspage 1
|
[Maintenance] Remove `extern "C"` from more areas of code
Much more than usual, now that we've got a snappy build system! This
commit covers
• All .PI functions across all games
• TH02's High Score entry functions
• TH03's shots_update() and shots_render()
• All functions declared in `th04/op/op.hpp`
• TH04/TH05's bb_txt_put_8_raw(), bullet_template_clip(),
player_pos_update_and_clamp(), score_update_and_render(), and
slowdown_frame_delay()
• TH05's reimu_stars_update_and_render(), score_delta_commit(),
stage2_invalidate(), stage2_update(), and space_window_set()
Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-05-23 20:04:35 +00:00
|
|
|
call @pi_palette_apply$qi pascal, 0
|
|
|
|
call @pi_put_8$qiii pascal, large 0, 0
|
2018-12-29 19:08:52 +00:00
|
|
|
graph_accesspage 0
|
[Maintenance] Remove `extern "C"` from more areas of code
Much more than usual, now that we've got a snappy build system! This
commit covers
• All .PI functions across all games
• TH02's High Score entry functions
• TH03's shots_update() and shots_render()
• All functions declared in `th04/op/op.hpp`
• TH04/TH05's bb_txt_put_8_raw(), bullet_template_clip(),
player_pos_update_and_clamp(), score_update_and_render(), and
slowdown_frame_delay()
• TH05's reimu_stars_update_and_render(), score_delta_commit(),
stage2_invalidate(), stage2_update(), and space_window_set()
Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-05-23 20:04:35 +00:00
|
|
|
call @pi_palette_apply$qi pascal, 0
|
|
|
|
call @pi_put_8$qiii pascal, large 0, 0
|
2014-06-26 20:33:22 +00:00
|
|
|
xor si, si
|
|
|
|
jmp short loc_CC27
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CC13:
|
2020-09-20 13:57:10 +00:00
|
|
|
call scoredat_load_for pascal, si
|
2014-06-26 20:33:22 +00:00
|
|
|
xor di, di
|
|
|
|
jmp short loc_CC21
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CC1B:
|
2014-06-26 20:33:22 +00:00
|
|
|
push si
|
|
|
|
push di
|
|
|
|
call sub_CB00
|
|
|
|
inc di
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CC21:
|
2014-06-26 20:33:22 +00:00
|
|
|
cmp di, 5
|
|
|
|
jl short loc_CC1B
|
|
|
|
inc si
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CC27:
|
2014-06-26 20:33:22 +00:00
|
|
|
cmp si, 4
|
|
|
|
jl short loc_CC13
|
2019-12-22 13:04:34 +00:00
|
|
|
push (496 shl 16) or 376
|
2020-09-20 13:57:10 +00:00
|
|
|
mov al, _rank
|
2014-06-26 20:33:22 +00:00
|
|
|
mov ah, 0
|
|
|
|
add ax, ax
|
2019-12-22 13:04:34 +00:00
|
|
|
add ax, 20
|
2014-06-26 20:33:22 +00:00
|
|
|
push ax
|
2014-08-28 00:13:13 +00:00
|
|
|
call super_put
|
2019-12-22 13:04:34 +00:00
|
|
|
push (560 shl 16) or 376
|
2020-09-20 13:57:10 +00:00
|
|
|
mov al, _rank
|
2014-06-26 20:33:22 +00:00
|
|
|
mov ah, 0
|
|
|
|
add ax, ax
|
2019-12-22 13:04:34 +00:00
|
|
|
add ax, 21
|
2014-06-26 20:33:22 +00:00
|
|
|
push ax
|
2014-08-28 00:13:13 +00:00
|
|
|
call super_put
|
2014-06-26 20:33:22 +00:00
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
pop bp
|
|
|
|
retn
|
2020-09-20 21:14:04 +00:00
|
|
|
_score_render endp
|
2014-06-26 20:33:22 +00:00
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
[Maintenance] Remove `extern "C"` from more areas of code
Much more than usual, now that we've got a snappy build system! This
commit covers
• All .PI functions across all games
• TH02's High Score entry functions
• TH03's shots_update() and shots_render()
• All functions declared in `th04/op/op.hpp`
• TH04/TH05's bb_txt_put_8_raw(), bullet_template_clip(),
player_pos_update_and_clamp(), score_update_and_render(), and
slowdown_frame_delay()
• TH05's reimu_stars_update_and_render(), score_delta_commit(),
stage2_invalidate(), stage2_update(), and space_window_set()
Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-05-23 20:04:35 +00:00
|
|
|
public @regist_view_menu$qv
|
|
|
|
@regist_view_menu$qv proc near
|
2014-06-26 20:33:22 +00:00
|
|
|
push bp
|
|
|
|
mov bp, sp
|
2014-11-27 18:35:54 +00:00
|
|
|
kajacall KAJA_SONG_STOP
|
2014-11-29 23:18:40 +00:00
|
|
|
call snd_load pascal, ds, offset aName, SND_LOAD_SONG
|
2014-11-27 18:35:54 +00:00
|
|
|
kajacall KAJA_SONG_PLAY
|
|
|
|
kajacall KAJA_SONG_FADE, -128
|
2014-06-26 20:33:22 +00:00
|
|
|
push 1
|
2014-08-26 22:33:43 +00:00
|
|
|
call palette_black_out
|
2019-12-30 14:48:17 +00:00
|
|
|
les bx, _resident
|
2020-01-02 19:55:22 +00:00
|
|
|
mov al, es:[bx+resident_t.rank]
|
2020-09-20 13:57:10 +00:00
|
|
|
mov _rank, al
|
[Maintenance] Remove `extern "C"` from more areas of code
Much more than usual, now that we've got a snappy build system! This
commit covers
• All .PI functions across all games
• TH02's High Score entry functions
• TH03's shots_update() and shots_render()
• All functions declared in `th04/op/op.hpp`
• TH04/TH05's bb_txt_put_8_raw(), bullet_template_clip(),
player_pos_update_and_clamp(), score_update_and_render(), and
slowdown_frame_delay()
• TH05's reimu_stars_update_and_render(), score_delta_commit(),
stage2_invalidate(), stage2_update(), and space_window_set()
Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-05-23 20:04:35 +00:00
|
|
|
call @pi_load$qinxc pascal, 0, ds, offset aHi01_pi
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CC9F:
|
2020-09-20 21:14:04 +00:00
|
|
|
call _score_render
|
2019-12-07 10:37:53 +00:00
|
|
|
call palette_black_in pascal, 1
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CCA9:
|
2024-03-28 20:45:59 +00:00
|
|
|
call @input_reset_sense_held$qv
|
2024-01-07 17:18:10 +00:00
|
|
|
call @frame_delay$qi pascal, 1
|
2019-11-30 15:15:03 +00:00
|
|
|
test _key_det.hi, high INPUT_OK
|
2014-06-26 20:33:22 +00:00
|
|
|
jnz short loc_CD17
|
2019-11-30 15:15:03 +00:00
|
|
|
test _key_det.lo, low INPUT_SHOT
|
2014-06-26 20:33:22 +00:00
|
|
|
jnz short loc_CD17
|
2019-11-30 15:15:03 +00:00
|
|
|
test _key_det.hi, high INPUT_CANCEL
|
2014-06-26 20:33:22 +00:00
|
|
|
jnz short loc_CD17
|
2019-11-30 15:15:03 +00:00
|
|
|
test _key_det.hi, high INPUT_OK
|
2014-06-26 20:33:22 +00:00
|
|
|
jnz short loc_CD17
|
2019-11-30 15:15:03 +00:00
|
|
|
test _key_det.lo, low INPUT_LEFT
|
2014-06-26 20:33:22 +00:00
|
|
|
jz short loc_CCF8
|
2020-09-20 13:57:10 +00:00
|
|
|
cmp _rank, RANK_EASY
|
2014-06-26 20:33:22 +00:00
|
|
|
jz short loc_CCF8
|
2020-09-20 13:57:10 +00:00
|
|
|
dec _rank
|
2014-08-23 13:47:05 +00:00
|
|
|
mov PaletteTone, 0
|
2014-08-23 14:11:16 +00:00
|
|
|
call far ptr palette_show
|
2020-09-20 21:14:04 +00:00
|
|
|
call _score_render
|
2019-12-07 10:37:53 +00:00
|
|
|
call palette_black_in pascal, 1
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CCF8:
|
2019-11-30 15:15:03 +00:00
|
|
|
test _key_det.lo, low INPUT_RIGHT
|
2014-06-26 20:33:22 +00:00
|
|
|
jz short loc_CCA9
|
2020-09-20 13:57:10 +00:00
|
|
|
cmp _rank, RANK_EXTRA
|
2014-06-26 20:33:22 +00:00
|
|
|
jnb short loc_CCA9
|
2020-09-20 13:57:10 +00:00
|
|
|
inc _rank
|
2014-08-23 13:47:05 +00:00
|
|
|
mov PaletteTone, 0
|
2014-08-23 14:11:16 +00:00
|
|
|
call far ptr palette_show
|
2014-06-26 20:33:22 +00:00
|
|
|
jmp short loc_CC9F
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CD17:
|
2014-11-27 18:35:54 +00:00
|
|
|
kajacall KAJA_SONG_FADE, 1
|
2019-12-07 10:37:53 +00:00
|
|
|
call palette_black_out pascal, 1
|
[Maintenance] Remove `extern "C"` from more areas of code
Much more than usual, now that we've got a snappy build system! This
commit covers
• All .PI functions across all games
• TH02's High Score entry functions
• TH03's shots_update() and shots_render()
• All functions declared in `th04/op/op.hpp`
• TH04/TH05's bb_txt_put_8_raw(), bullet_template_clip(),
player_pos_update_and_clamp(), score_update_and_render(), and
slowdown_frame_delay()
• TH05's reimu_stars_update_and_render(), score_delta_commit(),
stage2_invalidate(), stage2_update(), and space_window_set()
Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-05-23 20:04:35 +00:00
|
|
|
call @pi_free$qi pascal, 0
|
2018-12-29 19:08:52 +00:00
|
|
|
graph_accesspage 1
|
[Maintenance] Remove `extern "C"` from more areas of code
Much more than usual, now that we've got a snappy build system! This
commit covers
• All .PI functions across all games
• TH02's High Score entry functions
• TH03's shots_update() and shots_render()
• All functions declared in `th04/op/op.hpp`
• TH04/TH05's bb_txt_put_8_raw(), bullet_template_clip(),
player_pos_update_and_clamp(), score_update_and_render(), and
slowdown_frame_delay()
• TH05's reimu_stars_update_and_render(), score_delta_commit(),
stage2_invalidate(), stage2_update(), and space_window_set()
Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-05-23 20:04:35 +00:00
|
|
|
call @pi_load$qinxc pascal, 0, ds, offset aOp1_pi_1
|
|
|
|
call @pi_palette_apply$qi pascal, 0
|
|
|
|
call @pi_put_8$qiii pascal, large 0, 0
|
|
|
|
call @pi_free$qi pascal, 0
|
2019-12-07 10:37:53 +00:00
|
|
|
call graph_copy_page pascal, 0
|
|
|
|
call palette_black_in pascal, 1
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_CD64:
|
2024-03-28 20:45:59 +00:00
|
|
|
call @input_reset_sense_held$qv
|
2024-01-07 17:18:10 +00:00
|
|
|
call @frame_delay$qi pascal, 1
|
2019-11-30 15:15:03 +00:00
|
|
|
cmp _key_det, INPUT_NONE
|
2014-06-26 20:33:22 +00:00
|
|
|
jnz short loc_CD64
|
2014-11-27 18:35:54 +00:00
|
|
|
kajacall KAJA_SONG_STOP
|
2014-11-29 23:18:40 +00:00
|
|
|
call snd_load pascal, ds, offset aOp_1, SND_LOAD_SONG
|
2014-11-27 18:35:54 +00:00
|
|
|
kajacall KAJA_SONG_PLAY
|
2014-06-26 20:33:22 +00:00
|
|
|
pop bp
|
|
|
|
retn
|
[Maintenance] Remove `extern "C"` from more areas of code
Much more than usual, now that we've got a snappy build system! This
commit covers
• All .PI functions across all games
• TH02's High Score entry functions
• TH03's shots_update() and shots_render()
• All functions declared in `th04/op/op.hpp`
• TH04/TH05's bb_txt_put_8_raw(), bullet_template_clip(),
player_pos_update_and_clamp(), score_update_and_render(), and
slowdown_frame_delay()
• TH05's reimu_stars_update_and_render(), score_delta_commit(),
stage2_invalidate(), stage2_update(), and space_window_set()
Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-05-23 20:04:35 +00:00
|
|
|
@regist_view_menu$qv endp
|
2023-10-28 19:43:11 +00:00
|
|
|
op_01_TEXT ends
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2023-10-28 19:43:11 +00:00
|
|
|
HI_VIEW_TEXT segment byte public 'CODE' use16
|
|
|
|
HI_VIEW_TEXT ends
|
|
|
|
|
2014-06-26 20:33:22 +00:00
|
|
|
; ===========================================================================
|
|
|
|
|
2024-01-24 09:18:02 +00:00
|
|
|
SHARED segment byte public 'CODE' use16
|
2023-11-28 18:44:34 +00:00
|
|
|
include th02/snd/snd.inc
|
2021-03-12 17:05:51 +00:00
|
|
|
extern SND_SE_PLAY:proc
|
|
|
|
extern _snd_se_update:proc
|
2021-03-10 21:13:50 +00:00
|
|
|
extern _bgimage_snap:proc
|
|
|
|
extern _bgimage_put:proc
|
|
|
|
extern _bgimage_free:proc
|
2023-06-08 15:55:57 +00:00
|
|
|
extern @POLAR$QIII:proc
|
2021-02-23 16:46:23 +00:00
|
|
|
extern SND_LOAD:proc
|
2021-02-22 14:11:05 +00:00
|
|
|
extern SND_KAJA_INTERRUPT:proc
|
[Maintenance] Remove `extern "C"` from more areas of code
Much more than usual, now that we've got a snappy build system! This
commit covers
• All .PI functions across all games
• TH02's High Score entry functions
• TH03's shots_update() and shots_render()
• All functions declared in `th04/op/op.hpp`
• TH04/TH05's bb_txt_put_8_raw(), bullet_template_clip(),
player_pos_update_and_clamp(), score_update_and_render(), and
slowdown_frame_delay()
• TH05's reimu_stars_update_and_render(), score_delta_commit(),
stage2_invalidate(), stage2_update(), and space_window_set()
Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-05-23 20:04:35 +00:00
|
|
|
extern @PI_LOAD$QINXC:proc
|
|
|
|
extern @PI_PUT_8$QIII:proc
|
|
|
|
extern @PI_PALETTE_APPLY$QI:proc
|
|
|
|
extern @PI_FREE$QI:proc
|
2024-03-28 20:45:59 +00:00
|
|
|
extern @input_reset_sense_held$qv:proc
|
[Decompilation] [th05] snd_bgm_measure(), snd_delay_until_measure()
Umm… but this can't be in the same translation unit as frame_delay(),
because OP.EXE has cdg_put_nocolors() inbetween, which means we'd have
to compile it twice.
What probably happened there: ZUN originally wrote this in C when
frame_delay() was still next to it, then generated ASM from it,
tinkered with that, and ultimately only linked that ASM into the final
game, with the NOPCALL still in there. That might very well be the one
temporary NOPCALL workaround we can never get rid of…
Oh well, at least we got lucky with the padding, and can keep the
cdg_put_nocolors() decompilation from the last commit.
Part of P0133, funded by [Anonymous].
2021-01-08 18:20:04 +00:00
|
|
|
extern SND_DELAY_UNTIL_MEASURE:proc
|
2024-01-07 17:18:10 +00:00
|
|
|
extern @FRAME_DELAY$QI:proc
|
2023-11-28 19:48:14 +00:00
|
|
|
SHARED ends
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2015-02-18 11:07:37 +00:00
|
|
|
.data
|
2014-08-19 20:33:43 +00:00
|
|
|
|
2023-11-28 19:48:14 +00:00
|
|
|
; libs/master.lib/pal[data].asm
|
|
|
|
extern PaletteTone:word
|
|
|
|
|
|
|
|
; libs/master.lib/sin8[data].asm
|
|
|
|
extern _SinTable8:word:256
|
|
|
|
extern _CosTable8:word:256
|
|
|
|
|
2019-12-01 11:03:31 +00:00
|
|
|
include th04/zunsoft[data].asm
|
2020-09-20 13:57:10 +00:00
|
|
|
include th05/formats/scoredat_load_for[data].asm
|
2014-08-10 01:44:54 +00:00
|
|
|
aName db 'name',0
|
|
|
|
aHi01_pi db 'hi01.pi',0
|
|
|
|
aOp1_pi_1 db 'op1.pi',0
|
|
|
|
aOp_1 db 'op',0
|
2014-08-17 21:55:59 +00:00
|
|
|
|
2015-02-18 11:07:37 +00:00
|
|
|
.data?
|
|
|
|
|
2023-11-25 19:28:17 +00:00
|
|
|
extern _resident:dword
|
2023-11-26 20:34:37 +00:00
|
|
|
|
2023-11-28 19:48:14 +00:00
|
|
|
; libs/master.lib/pal[bss].asm
|
|
|
|
extern Palettes:byte:48
|
|
|
|
|
|
|
|
; libs/master.lib/vs[bss].asm
|
|
|
|
extern vsync_Count1:word
|
|
|
|
|
|
|
|
; th02/hardware/input_sense[bss].asm
|
|
|
|
extern _key_det:word
|
|
|
|
|
2018-03-21 22:20:04 +00:00
|
|
|
include th04/zunsoft[bss].asm
|
2019-12-26 16:19:44 +00:00
|
|
|
extern _hi:scoredat_section_t
|
|
|
|
extern _hi2:scoredat_section_t
|
2020-09-20 13:57:10 +00:00
|
|
|
extern _rank:byte
|
2014-06-26 20:33:22 +00:00
|
|
|
|
2015-02-19 06:46:36 +00:00
|
|
|
end
|