From 746681db22346b643ae568c2ebbae1d3412e9667 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sun, 2 Sep 2018 16:32:22 +0200 Subject: [PATCH] [Reverse-engineering] [th04/th05] Enemy drop table TH02 just seems to use a sequence of branches in sub_D6CA. I thought about keeping variable and function names consistent with uth05win (on which most upcoming reverse-engineering commits will be based). But as it will turn out, it ignored a certain very important substructure, so I don't think it's worth introducing this naming style clash. Funded by zorg. --- th04/enemy_drops[data].asm | 9 +++++ th04_main.asm | 67 ++------------------------------------ th05/enemy_drops[data].asm | 9 +++++ th05_main.asm | 13 ++------ 4 files changed, 22 insertions(+), 76 deletions(-) create mode 100644 th04/enemy_drops[data].asm create mode 100644 th05/enemy_drops[data].asm diff --git a/th04/enemy_drops[data].asm b/th04/enemy_drops[data].asm new file mode 100644 index 00000000..32ec4b45 --- /dev/null +++ b/th04/enemy_drops[data].asm @@ -0,0 +1,9 @@ +ENEMY_DROPS label byte + db 0, 1, 0, 0, 1, 1, 0, 1 + db 0, 1, 1, 1, 0, 0, 0, 2 + db 1, 0, 1, 1, 0, 0, 1, 0 + db 1, 0, 0, 0, 1, 1, 1, 2 + db 0, 1, 0, 0, 1, 1, 0, 1 + db 0, 1, 1, 1, 0, 0, 0, 2 + db 1, 0, 1, 1, 0, 0, 1, 0 + db 1, 0, 0, 0, 1, 1, 1, 3 diff --git a/th04_main.asm b/th04_main.asm index c3836f3b..10abea88 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -38008,7 +38008,7 @@ arg_4 = word ptr 8 cwd idiv bx mov bx, dx - mov al, [bx+22E0h] + mov al, ENEMY_DROPS[bx] mov [bp+arg_0], al loc_1DA6F: @@ -46114,70 +46114,7 @@ aPLAYER_REM_30000 db ' aBONUS_POINT_2 db 'POINT Bonus      ×',0 aBONUS_TOTAL_2 db '   TOTAL',0 db 0 - db 0 - db 1 - db 0 - db 0 - db 1 - db 1 - db 0 - db 1 - db 0 - db 1 - db 1 - db 1 - db 0 - db 0 - db 0 - db 2 - db 1 - db 0 - db 1 - db 1 - db 0 - db 0 - db 1 - db 0 - db 1 - db 0 - db 0 - db 0 - db 1 - db 1 - db 1 - db 2 - db 0 - db 1 - db 0 - db 0 - db 1 - db 1 - db 0 - db 1 - db 0 - db 1 - db 1 - db 1 - db 0 - db 0 - db 0 - db 2 - db 1 - db 0 - db 1 - db 1 - db 0 - db 0 - db 1 - db 0 - db 1 - db 0 - db 0 - db 0 - db 1 - db 1 - db 1 - db 3 +include th04/enemy_drops[data].asm byte_23660 db 0 byte_23661 db 0 db 2Ch ; , diff --git a/th05/enemy_drops[data].asm b/th05/enemy_drops[data].asm new file mode 100644 index 00000000..ce432068 --- /dev/null +++ b/th05/enemy_drops[data].asm @@ -0,0 +1,9 @@ +ENEMY_DROPS label byte + db 0, 1, 0, 0, 1, 1, 0, 1 + db 0, 1, 1, 1, 0, 0, 0, 1 + db 0, 1, 1, 0, 0, 1, 0, 1 + db 0, 1, 1, 1, 1, 0, 1, 1 + db 0, 0, 1, 1, 0, 1, 0, 1 + db 1, 1, 0, 0, 1, 1, 0, 1 + db 1, 0, 0, 1, 0, 1, 1, 0 + db 0, 1, 1, 1, 0, 1, 0, 3 diff --git a/th05_main.asm b/th05_main.asm index 0ee2e0f8..b92cd8eb 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -25283,7 +25283,7 @@ loc_16DA0: cwd idiv bx mov bx, dx - mov al, [bx+1BACh] + mov al, ENEMY_DROPS[bx] mov [bp+arg_0], al loc_16DCA: @@ -44416,16 +44416,7 @@ word_22586 dw 180h word_22588 dw 800h db 0 db 0 -;unsigned char -;byte_enemyDropTable;form uth0twin/Game/Stage/Enemy/Enemy.cpp - db 0,1,0,0,1,1,0,1 - db 0,1,1,1,0,0,0,1 - db 0,1,1,0,0,1,0,1 - db 0,1,1,1,1,0,1,1 - db 0,0,1,1,0,1,0,1 - db 1,1,0,0,1,1,0,1 - db 1,0,0,1,0,1,1,0 - db 0,1,1,1,0,1,0,3 +include th05/enemy_drops[data].asm byte_225CC db 0 db 0 db 24h ; $