From b7d204aeecca64259fe3d0254dd31bdb4b77329b Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sun, 22 Sep 2019 23:50:13 +0200 Subject: [PATCH] [Reverse-engineering] [th02/th04/th05] Player option sprite number Part of P0034, funded by zorg. --- th02_main.asm | 15 ++++++++------- th04/player/option[bss].asm | 3 +++ th04_main.asm | 10 +++++----- th05/th05.inc | 2 ++ th05_main.asm | 4 ++-- 5 files changed, 20 insertions(+), 14 deletions(-) create mode 100644 th04/player/option[bss].asm diff --git a/th02_main.asm b/th02_main.asm index 4a9f8248..b61329b8 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -3587,7 +3587,7 @@ loc_C5C2: mov byte_205E0, 0 mov _player_is_hit, 0 mov byte_1E517, 0 - mov byte_1E51B, 48h ; 'H' + mov _player_option_patnum, 72 mov word_205D8, 0FFFFh mov word_205DC, 0FFFFh mov word_205DA, 0FFFFh @@ -3625,7 +3625,7 @@ loc_C655: mov _playchar_speed_diagonal_y, 3 mov byte_2060E, 34h ; '4' mov byte_2060F, 37h ; '7' - inc byte_1E51B + inc _player_option_patnum pop bp retn ; --------------------------------------------------------------------------- @@ -3639,9 +3639,9 @@ loc_C67F: mov byte_1E518, 3 mov byte_2060E, 7Dh ; '}' mov byte_2060F, 3Bh ; ';' - mov al, byte_1E51B + mov al, _player_option_patnum add al, 2 - mov byte_1E51B, al + mov _player_option_patnum, al pop bp retn sub_C5B0 endp @@ -8907,7 +8907,7 @@ loc_EFC7: mov bx, word_205F2 push word ptr [bx] push si - mov al, byte_1E51B + mov al, _player_option_patnum mov ah, 0 push ax call super_roll_put_tiny @@ -8916,7 +8916,7 @@ loc_EFC7: add ax, 30h ; '0' push ax push si - mov al, byte_1E51B + mov al, _player_option_patnum mov ah, 0 push ax call super_roll_put_tiny @@ -34411,7 +34411,8 @@ byte_1E517 db 0 byte_1E518 db 4 byte_1E519 db 40h byte_1E51A db 4Ch -byte_1E51B db 48h +public _PLAYER_OPTION_PATNUM +_player_option_patnum db 72 power_overflow_level dw 0 word_1E51E dw 0 db 0 diff --git a/th04/player/option[bss].asm b/th04/player/option[bss].asm new file mode 100644 index 00000000..44fa8dfe --- /dev/null +++ b/th04/player/option[bss].asm @@ -0,0 +1,3 @@ +if GAME eq 4 + _player_option_patnum dw ? +endif diff --git a/th04_main.asm b/th04_main.asm index 5c70315d..2bbd007b 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -525,7 +525,7 @@ loc_AD3B: call main_01:bb_txt_load cmp playchar, 0 jnz short loc_AD90 - mov word_259B4, 26h ; '&' + mov _player_option_patnum, 38 les bx, _humaconfig cmp byte ptr es:[bx+19h], 0 jnz short loc_AD7C @@ -543,7 +543,7 @@ loc_AD82: ; --------------------------------------------------------------------------- loc_AD90: - mov word_259B4, 27h ; ''' + mov _player_option_patnum, 39 les bx, _humaconfig cmp byte ptr es:[bx+19h], 0 jnz short loc_ADA9 @@ -11484,11 +11484,11 @@ loc_10C6F: mov [bp+var_2], ax mov ax, di mov dx, [bp+var_2] - push word_259B4 + push _player_option_patnum call main_01:z_super_roll_put_tiny lea ax, [di+30h] mov dx, [bp+var_2] - push word_259B4 + push _player_option_patnum call main_01:z_super_roll_put_tiny GRCG_OFF_CLOBBERING dx jmp loc_10D47 @@ -41439,7 +41439,7 @@ byte_259AA db ? byte_259AB db ? dword_259AC dd ? dword_259B0 dd ? -word_259B4 dw ? +include th04/player/option[bss].asm dream_items_collected db ? db ? ; db ? ; diff --git a/th05/th05.inc b/th05/th05.inc index 2c726abb..213f56ce 100644 --- a/th05/th05.inc +++ b/th05/th05.inc @@ -2,3 +2,5 @@ GAME = 5 include th04/shared.inc include th05/shot_types.inc + +_player_option_patnum = 26 diff --git a/th05_main.asm b/th05_main.asm index 7c12d521..bb451171 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -13137,11 +13137,11 @@ loc_122D5: mov [bp+var_2], ax mov ax, di mov dx, [bp+var_2] - push 1Ah + push _player_option_patnum call z_super_roll_put_tiny lea ax, [di+30h] mov dx, [bp+var_2] - push 1Ah + push _player_option_patnum call z_super_roll_put_tiny GRCG_OFF_CLOBBERING dx jmp loc_123A9