From e6601fb27f2ce5d61b8d4c3a3c5c8e4e55e01682 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Tue, 21 Jan 2020 20:37:39 +0100 Subject: [PATCH] [Reverse-engineering] [th03] Stage-dependent additional CPU damage per hit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Yup, in the first 6 stages, the CPU always takes more damage per hit than P1. 1½ hearts in stages 1 and 2, 1 heart in stages 3 and 4, and ½ heart in stages 5 and 6. Part of P0071, funded by KirbyComment and -Tom-. --- th03_main.asm | 53 ++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/th03_main.asm b/th03_main.asm index 12ca66bf..9ec3b83e 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -650,27 +650,27 @@ loc_9B8E: mov ah, 0 mov bx, ax cmp bx, 5 - ja short loc_9BC0 + ja short @@cpu_additional_hit_damage_in_stage_7_8_9 add bx, bx - jmp cs:off_9EB3[bx] + jmp cs:@@cpu_additional_hit_damage[bx] -loc_9BAB: - mov byte_23AEA, 3 +@@cpu_additional_hit_damage_in_stage_1_2: + mov _cpu_hit_damage_additional, 3 jmp short loc_9BC5 ; --------------------------------------------------------------------------- -loc_9BB2: - mov byte_23AEA, 2 +@@cpu_additional_hit_damage_in_stage_3_4: + mov _cpu_hit_damage_additional, 2 jmp short loc_9BC5 ; --------------------------------------------------------------------------- -loc_9BB9: - mov byte_23AEA, 1 +@@cpu_additional_hit_damage_in_stage_5_6: + mov _cpu_hit_damage_additional, 1 jmp short loc_9BC5 ; --------------------------------------------------------------------------- -loc_9BC0: - mov byte_23AEA, 0 +@@cpu_additional_hit_damage_in_stage_7_8_9: + mov _cpu_hit_damage_additional, 0 loc_9BC5: les bx, _resident @@ -741,7 +741,7 @@ loc_9C51: mov byte_202B6, 1 mov byte_202B7, 1 mov byte_220DC, 0FFh - mov byte_23AEA, 0 + mov _cpu_hit_damage_additional, 0 push 3 loc_9C70: @@ -957,7 +957,6 @@ loc_9E24: pop si leave retn -sub_9B14 endp ; --------------------------------------------------------------------------- db 0 @@ -974,12 +973,13 @@ off_9EAB dw offset loc_9C2B dw offset loc_9C35 dw offset loc_9C3F dw offset loc_9C49 -off_9EB3 dw offset loc_9BAB - dw offset loc_9BAB - dw offset loc_9BB2 - dw offset loc_9BB2 - dw offset loc_9BB9 - dw offset loc_9BB9 +@@cpu_additional_hit_damage dw offset @@cpu_additional_hit_damage_in_stage_1_2 + dw offset @@cpu_additional_hit_damage_in_stage_1_2 + dw offset @@cpu_additional_hit_damage_in_stage_3_4 + dw offset @@cpu_additional_hit_damage_in_stage_3_4 + dw offset @@cpu_additional_hit_damage_in_stage_5_6 + dw offset @@cpu_additional_hit_damage_in_stage_5_6 +sub_9B14 endp ; =============== S U B R O U T I N E ======================================= @@ -8331,7 +8331,7 @@ sub_E0F7 endp sub_E1D5 proc near var_2 = byte ptr -2 -var_1 = byte ptr -1 +@@damage = byte ptr -1 arg_0 = word ptr 4 push bp @@ -8350,11 +8350,11 @@ arg_0 = word ptr 4 loc_E1F3: mov al, [si+73h] - mov [bp+var_1], al - add al, byte_23AEA + mov [bp+@@damage], al + add al, _cpu_hit_damage_additional loc_E1FD: - mov [bp+var_1], al + mov [bp+@@damage], al mov byte ptr [si+73h], 3 mov al, [bp+var_2] cbw @@ -8372,7 +8372,7 @@ loc_E221: mov al, [si+7] cbw push ax - mov al, [bp+var_1] + mov al, [bp+@@damage] cbw pop dx sub dx, ax @@ -8383,11 +8383,11 @@ loc_E221: jle short loc_E240 mov al, [si+7] dec al - mov [bp+var_1], al + mov [bp+@@damage], al loc_E240: call sub_E24B - mov al, [bp+var_1] + mov al, [bp+@@damage] pop si leave retn 2 @@ -41170,7 +41170,8 @@ byte_23AE5 db ? byte_23AE6 db ? byte_23AE7 db ? word_23AE8 dw ? -byte_23AEA db ? +public _cpu_hit_damage_additional +_cpu_hit_damage_additional db ? db ? ; db ? ; db ? ;