From a3bba96a267b110307e5db4eac6fd2ac7ea52348 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sat, 4 Jan 2020 23:32:03 +0100 Subject: [PATCH] [Reverse-engineering] [th01] Main color palette Part of P0066, funded by Keyblade Wiedling Neko and Splashman. --- th01/hardware/palette.hpp | 1 + th01/hardware/palette[data].asm | 18 ++++ th01_fuuin.asm | 102 ++++++------------ th01_op.asm | 84 ++++----------- th01_reiiden.asm | 168 +++++++++++------------------- th01_reiiden_2.inc | 178 ++++++++++++++++---------------- 6 files changed, 219 insertions(+), 332 deletions(-) create mode 100644 th01/hardware/palette.hpp create mode 100644 th01/hardware/palette[data].asm diff --git a/th01/hardware/palette.hpp b/th01/hardware/palette.hpp new file mode 100644 index 00000000..3feab7f6 --- /dev/null +++ b/th01/hardware/palette.hpp @@ -0,0 +1 @@ +extern Palette4 z_Palettes; diff --git a/th01/hardware/palette[data].asm b/th01/hardware/palette[data].asm new file mode 100644 index 00000000..e13c46b1 --- /dev/null +++ b/th01/hardware/palette[data].asm @@ -0,0 +1,18 @@ +public _z_Palettes +label _z_Palettes byte + rgb_t <00h, 00h, 00h> + rgb_t <00h, 00h, 0Fh> + rgb_t <00h, 0Fh, 00h> + rgb_t <00h, 0Fh, 0Fh> + rgb_t <0Fh, 00h, 00h> + rgb_t <0Fh, 00h, 0Fh> + rgb_t <0Fh, 0Fh, 00h> + rgb_t <0Fh, 0Fh, 0Fh> + rgb_t <08h, 08h, 08h> + rgb_t <00h, 00h, 0Ah> + rgb_t <00h, 0Ah, 00h> + rgb_t <00h, 0Ah, 0Ah> + rgb_t <0Ah, 00h, 00h> + rgb_t <0Ah, 00h, 0Ah> + rgb_t <0Ah, 0Ah, 00h> + rgb_t <0Ch, 0Ch, 0Ch> diff --git a/th01_fuuin.asm b/th01_fuuin.asm index e67ce51a..5c8a24b4 100644 --- a/th01_fuuin.asm +++ b/th01_fuuin.asm @@ -5133,14 +5133,14 @@ loc_C6C7: pop cx push 32h ; '2' call sub_C842 - mov byte_134C3, 7 - mov byte_134C4, 0Fh - mov byte_134C5, 7 - mov byte_134CF, 0Fh - mov byte_134D0, 0Fh - mov byte_134D1, 0Fh + mov _z_Palettes[3 * 3].r, 07h + mov _z_Palettes[3 * 3].g, 0Fh + mov _z_Palettes[3 * 3].b, 07h + mov _z_Palettes[7 * 3].r, 0Fh + mov _z_Palettes[7 * 3].g, 0Fh + mov _z_Palettes[7 * 3].b, 0Fh push ds - push offset unk_134BA + push offset _z_Palettes call sub_D1D9 add sp, 4 cmp byte_14021, 1 @@ -5395,7 +5395,7 @@ loc_C8A9: loc_C8DE: mov bx, si imul bx, 3 - mov [bx+di+0A1Ah], al + mov _z_Palettes[bx+di], al inc di loc_C8E8: @@ -5417,7 +5417,7 @@ loc_C8F9: mov ax, [bp+arg_0] mov word_13507, ax push ds - push offset unk_134BA + push offset _z_Palettes call sub_D1D9 add sp, 4 pop di @@ -5945,7 +5945,7 @@ inregs = REGS ptr -10h out dx, al ; PC-98 GDC (6a): ; push ds - push offset unk_134BA + push offset _z_Palettes nopcall sub_D1D9 push 0 nopcall _graph_accesspage_func @@ -6262,15 +6262,15 @@ loc_D29B: mov bx, si imul bx, 3 mov al, byte ptr [bp+arg_2] - mov [bx+0A1Ah], al + mov _z_Palettes[bx].r, al mov bx, si imul bx, 3 mov al, byte ptr [bp+arg_4] - mov [bx+0A1Bh], al + mov _z_Palettes[bx].g, al mov bx, si imul bx, 3 mov al, byte ptr [bp+arg_6] - mov [bx+0A1Ch], al + mov _z_Palettes[bx].b, al push [bp+arg_6] push [bp+arg_4] push [bp+arg_2] @@ -6519,7 +6519,7 @@ loc_D47D: mov al, ss:[bx] mov bx, si imul bx, 3 - cmp al, [bx+di+0A1Ah] + cmp al, _z_Palettes[bx+di] jge short loc_D4A6 mov bx, si imul bx, 3 @@ -6594,7 +6594,7 @@ var_2 = word ptr -2 push di push 30h ; '0' ; n push ds - push offset unk_134BA ; src + push offset _z_Palettes ; src push ss lea ax, [bp+dest] push ax ; dest @@ -6752,7 +6752,7 @@ loc_D5EE: mov al, ss:[bx] mov bx, si imul bx, 3 - cmp al, [bx+di+0A1Ah] + cmp al, _z_Palettes[bx+di] jle short loc_D617 mov bx, si imul bx, 3 @@ -6827,7 +6827,7 @@ var_2 = word ptr -2 push di push 30h ; '0' ; n push ds - push offset unk_134BA ; src + push offset _z_Palettes ; src push ss lea ax, [bp+dest] push ax ; dest @@ -6927,17 +6927,17 @@ sub_D710 proc far loc_D718: mov bx, si imul bx, 3 - mov al, [bx+0A1Ch] + mov al, _z_Palettes[bx].b cbw push ax mov bx, si imul bx, 3 - mov al, [bx+0A1Bh] + mov al, _z_Palettes[bx].g cbw push ax mov bx, si imul bx, 3 - mov al, [bx+0A1Ah] + mov al, _z_Palettes[bx].r cbw push ax push si @@ -8969,7 +8969,7 @@ loc_E77E: add bx, ax mov si, di imul si, 3 - mov al, [si+0A1Ah] + mov al, _z_Palettes[si].r mov ss:[bx], al mov bx, di imul bx, 3 @@ -8977,7 +8977,7 @@ loc_E77E: add bx, ax mov si, di imul si, 3 - mov al, [si+0A1Bh] + mov al, _z_Palettes[si].g mov ss:[bx], al mov bx, di imul bx, 3 @@ -8985,7 +8985,7 @@ loc_E77E: add bx, ax mov si, di imul si, 3 - mov al, [si+0A1Ch] + mov al, _z_Palettes[si].b loc_E7BD: mov ss:[bx], al @@ -9019,7 +9019,7 @@ loc_E7E1: mov bx, [bp+var_2] imul bx, 3 add bx, [bp+var_4] - cmp al, [bx+0A1Ah] + cmp al, _z_Palettes[bx] jz short loc_E846 mov bx, [bp+var_2] imul bx, 3 @@ -9030,7 +9030,7 @@ loc_E7E1: mov bx, [bp+var_2] imul bx, 3 add bx, [bp+var_4] - cmp al, [bx+0A1Ah] + cmp al, _z_Palettes[bx] jge short loc_E825 mov al, 1 jmp short loc_E827 @@ -9273,17 +9273,17 @@ var_4 = dword ptr -4 loc_E9A0: mov bx, si imul bx, 3 - mov al, [bx+0A1Bh] + mov al, _z_Palettes[bx].g les bx, [bp+var_4] mov es:[bx], al mov bx, si imul bx, 3 - mov al, [bx+0A1Ah] + mov al, _z_Palettes[bx].r mov bx, word ptr [bp+var_4] mov es:[bx+1], al mov bx, si imul bx, 3 - mov al, [bx+0A1Ch] + mov al, _z_Palettes[bx].b mov bx, word ptr [bp+var_4] mov es:[bx+2], al add word ptr [bp+var_4], 3 @@ -10035,51 +10035,7 @@ include th01/ztext[data].asm public _game_initialized _game_initialized db 0 db 0 -unk_134BA db 0 - dd 0 - db 0Fh - db 0 - db 0Fh - db 0 -byte_134C3 db 0 -byte_134C4 db 0Fh -byte_134C5 db 0Fh - db 0Fh - db 0 - db 0 - db 0Fh - db 0 - db 0Fh - db 0Fh - db 0Fh - db 0 -byte_134CF db 0Fh -byte_134D0 db 0Fh -byte_134D1 db 0Fh - db 8 - db 8 - db 8 - db 0 - db 0 - db 0Ah - db 0 - db 0Ah - db 0 - db 0 - db 0Ah - db 0Ah - db 0Ah - db 0 - db 0 - db 0Ah - db 0 - db 0Ah - db 0Ah - db 0Ah - db 0 - db 0Ch - db 0Ch - db 0Ch +include th01/hardware/palette[data].asm byte_134EA db 0 word_134EB dw 80h aPal98Grb db 'pal98 grb',0 diff --git a/th01_op.asm b/th01_op.asm index af72ebaf..c241a391 100644 --- a/th01_op.asm +++ b/th01_op.asm @@ -2359,7 +2359,7 @@ op_06_TEXT segment byte public 'CODE' use16 out dx, al ; PC-98 GDC (6a): ; push ds - push offset unk_1297A + push offset _z_Palettes nopcall sub_BA15 push 0 nopcall _graph_accesspage_func @@ -2664,15 +2664,15 @@ loc_BAD7: mov bx, si imul bx, 3 mov al, byte ptr [bp+arg_2] - mov [bx+6EAh], al + mov _z_Palettes[bx].r, al mov bx, si imul bx, 3 mov al, byte ptr [bp+arg_4] - mov [bx+6EBh], al + mov _z_Palettes[bx].g, al mov bx, si imul bx, 3 mov al, byte ptr [bp+arg_6] - mov [bx+6ECh], al + mov _z_Palettes[bx].b, al push [bp+arg_6] push [bp+arg_4] push [bp+arg_2] @@ -2910,7 +2910,7 @@ loc_BCB9: mov al, ss:[bx] mov bx, si imul bx, 3 - cmp al, [bx+di+6EAh] + cmp al, _z_Palettes[bx+di] jge short loc_BCE2 mov bx, si imul bx, 3 @@ -2985,7 +2985,7 @@ var_2 = word ptr -2 push di push 30h ; '0' ; n push ds - push offset unk_1297A ; src + push offset _z_Palettes ; src push ss lea ax, [bp+dest] push ax ; dest @@ -3125,7 +3125,7 @@ loc_BE2A: mov al, ss:[bx] mov bx, si imul bx, 3 - cmp al, [bx+di+6EAh] + cmp al, _z_Palettes[bx+di] jle short loc_BE53 mov bx, si imul bx, 3 @@ -3187,7 +3187,7 @@ loc_BE9F: push di push 30h ; '0' push ds - push offset unk_1297A + push offset _z_Palettes push ss lea ax, [bp-32h] push ax @@ -3280,17 +3280,17 @@ loc_BF42: loc_BF54: mov bx, si imul bx, 3 - mov al, [bx+6ECh] + mov al, _z_Palettes[bx].b cbw push ax mov bx, si imul bx, 3 - mov al, [bx+6EBh] + mov al, _z_Palettes[bx].g cbw push ax mov bx, si imul bx, 3 - mov al, [bx+6EAh] + mov al, _z_Palettes[bx].r cbw push ax push si @@ -5182,7 +5182,7 @@ loc_CFBA: add bx, ax mov si, di imul si, 3 - mov al, [si+6EAh] + mov al, _z_Palettes[si].r mov ss:[bx], al mov bx, di imul bx, 3 @@ -5190,7 +5190,7 @@ loc_CFBA: add bx, ax mov si, di imul si, 3 - mov al, [si+6EBh] + mov al, _z_Palettes[si].g mov ss:[bx], al mov bx, di imul bx, 3 @@ -5198,7 +5198,7 @@ loc_CFBA: add bx, ax mov si, di imul si, 3 - mov al, [si+6ECh] + mov al, _z_Palettes[si].b loc_CFF9: mov ss:[bx], al @@ -5232,7 +5232,7 @@ loc_D01D: mov bx, [bp-2] imul bx, 3 add bx, [bp-4] - cmp al, [bx+6EAh] + cmp al, _z_Palettes[bx] jz short palette_show2 mov bx, [bp-2] imul bx, 3 @@ -5243,7 +5243,7 @@ loc_D01D: mov bx, [bp-2] imul bx, 3 add bx, [bp-4] - cmp al, [bx+6EAh] + cmp al, _z_Palettes[bx] jge short loc_D061 mov al, 1 jmp short loc_D063 @@ -5474,17 +5474,17 @@ var_4 = dword ptr -4 loc_D1DC: mov bx, si imul bx, 3 - mov al, [bx+6EBh] + mov al, _z_Palettes[bx].g les bx, [bp+var_4] mov es:[bx], al mov bx, si imul bx, 3 - mov al, [bx+6EAh] + mov al, _z_Palettes[bx].r mov bx, word ptr [bp+var_4] mov es:[bx+1], al mov bx, si imul bx, 3 - mov al, [bx+6ECh] + mov al, _z_Palettes[bx].b mov bx, word ptr [bp+var_4] mov es:[bx+2], al add word ptr [bp+var_4], 3 @@ -7731,51 +7731,7 @@ include th01/ztext[data].asm public _game_initialized _game_initialized db 0 db 0 -unk_1297A db 0 - dd 0 - db 0Fh - db 0 - db 0Fh - db 0 - db 0 - db 0Fh - db 0Fh - db 0Fh - db 0 - db 0 - db 0Fh - db 0 - db 0Fh - db 0Fh - db 0Fh - db 0 - db 0Fh - db 0Fh - db 0Fh - db 8 - db 8 - db 8 - db 0 - db 0 - db 0Ah - db 0 - db 0Ah - db 0 - db 0 - db 0Ah - db 0Ah - db 0Ah - db 0 - db 0 - db 0Ah - db 0 - db 0Ah - db 0Ah - db 0Ah - db 0 - db 0Ch - db 0Ch - db 0Ch +include th01/hardware/palette[data].asm byte_129AA db 0 word_129AB dw 80h aPal98Grb db 'pal98 grb',0 diff --git a/th01_reiiden.asm b/th01_reiiden.asm index f9e41559..fda5c918 100644 --- a/th01_reiiden.asm +++ b/th01_reiiden.asm @@ -1217,7 +1217,7 @@ loc_BD43: loc_BD75: push ds - push offset unk_35090 + push offset _z_Palettes nopcall sub_C433 add sp, 4 call sub_EC80 @@ -1378,7 +1378,7 @@ loc_BF1C: mov bx, si imul bx, 3 add bx, [bp+var_2] - mov al, [bx+6F0h] + mov al, _z_Palettes[bx] mov bx, si imul bx, 3 add bx, [bp+var_2] @@ -1406,7 +1406,7 @@ loc_BF50: mov bx, si imul bx, 3 add bx, [bp+var_2] - mov al, [bx+6F0h] + mov al, _z_Palettes[bx] add al, byte ptr [bp+var_2] loc_BF5F: @@ -2556,7 +2556,7 @@ loc_C8D0: loc_C8D9: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] cbw imul [bp+arg_0] mov bx, 64h ; 'd' @@ -2564,27 +2564,27 @@ loc_C8D9: idiv bx mov bx, si imul bx, 3 - mov [bx+di+6F0h], al + mov _z_Palettes[bx+di], al mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] cbw or ax, ax jge short loc_C90D mov bx, si imul bx, 3 - mov byte ptr [bx+di+6F0h], 0 + mov byte ptr _z_Palettes[bx+di], 0 loc_C90D: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] cbw cmp ax, 0Fh jle short loc_C926 mov bx, si imul bx, 3 - mov byte ptr [bx+di+6F0h], 0Fh + mov byte ptr _z_Palettes[bx+di], 0Fh loc_C926: inc di @@ -2600,7 +2600,7 @@ loc_C92D: cmp si, 10h jl short loc_C8D0 push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 pop di @@ -5539,7 +5539,7 @@ inregs = REGS ptr -10h out dx, al ; PC-98 GDC (6a): ; push ds - push offset unk_35090 + push offset _z_Palettes nopcall sub_EB10 push 0 nopcall _graph_accesspage_func @@ -5856,15 +5856,15 @@ loc_EBD2: mov bx, si imul bx, 3 mov al, byte ptr [bp+arg_2] - mov [bx+6F0h], al + mov _z_Palettes[bx].r, al mov bx, si imul bx, 3 mov al, byte ptr [bp+arg_4] - mov [bx+6F1h], al + mov _z_Palettes[bx].g, al mov bx, si imul bx, 3 mov al, byte ptr [bp+arg_6] - mov [bx+6F2h], al + mov _z_Palettes[bx].b, al push [bp+arg_6] push [bp+arg_4] push [bp+arg_2] @@ -6113,7 +6113,7 @@ loc_EDB4: mov al, ss:[bx] mov bx, si imul bx, 3 - cmp al, [bx+di+6F0h] + cmp al, _z_Palettes[bx+di] jge short loc_EDDD mov bx, si imul bx, 3 @@ -6188,7 +6188,7 @@ var_2 = word ptr -2 push di push 30h ; '0' ; n push ds - push offset unk_35090 ; src + push offset _z_Palettes ; src push ss lea ax, [bp+dest] push ax ; dest @@ -6346,7 +6346,7 @@ loc_EF25: mov al, ss:[bx] mov bx, si imul bx, 3 - cmp al, [bx+di+6F0h] + cmp al, _z_Palettes[bx+di] jle short loc_EF4E mov bx, si imul bx, 3 @@ -6421,7 +6421,7 @@ var_2 = word ptr -2 push di push 30h ; '0' ; n push ds - push offset unk_35090 ; src + push offset _z_Palettes ; src push ss lea ax, [bp+dest] push ax ; dest @@ -6521,17 +6521,17 @@ sub_F047 proc far loc_F04F: mov bx, si imul bx, 3 - mov al, [bx+6F2h] + mov al, _z_Palettes[bx].b cbw push ax mov bx, si imul bx, 3 - mov al, [bx+6F1h] + mov al, _z_Palettes[bx].g cbw push ax mov bx, si imul bx, 3 - mov al, [bx+6F0h] + mov al, _z_Palettes[bx].r cbw push ax push si @@ -8563,7 +8563,7 @@ loc_100B5: add bx, ax mov si, di imul si, 3 - mov al, [si+6F0h] + mov al, _z_Palettes[si].r mov ss:[bx], al mov bx, di imul bx, 3 @@ -8571,7 +8571,7 @@ loc_100B5: add bx, ax mov si, di imul si, 3 - mov al, [si+6F1h] + mov al, _z_Palettes[si].g mov ss:[bx], al mov bx, di imul bx, 3 @@ -8579,7 +8579,7 @@ loc_100B5: add bx, ax mov si, di imul si, 3 - mov al, [si+6F2h] + mov al, _z_Palettes[si].b loc_100F4: mov ss:[bx], al @@ -8613,7 +8613,7 @@ loc_10118: mov bx, [bp+var_2] imul bx, 3 add bx, [bp+var_4] - cmp al, [bx+6F0h] + cmp al, _z_Palettes[bx] jz short loc_1017D mov bx, [bp+var_2] imul bx, 3 @@ -8624,14 +8624,14 @@ loc_10118: mov bx, [bp+var_2] imul bx, 3 add bx, [bp+var_4] - cmp al, [bx+6F0h] + cmp al, _z_Palettes[bx] jge short loc_1015C mov al, 1 jmp short loc_1015E ; --------------------------------------------------------------------------- loc_1015C: - mov al, 0FFh + mov al, -1 loc_1015E: mov bx, [bp+var_2] @@ -8867,17 +8867,17 @@ var_4 = dword ptr -4 loc_102D7: mov bx, si imul bx, 3 - mov al, [bx+6F1h] + mov al, _z_Palettes[bx].g les bx, [bp+var_4] mov es:[bx], al mov bx, si imul bx, 3 - mov al, [bx+6F0h] + mov al, _z_Palettes[bx].r mov bx, word ptr [bp+var_4] mov es:[bx+1], al mov bx, si imul bx, 3 - mov al, [bx+6F2h] + mov al, _z_Palettes[bx].b mov bx, word ptr [bp+var_4] mov es:[bx+2], al add word ptr [bp+var_4], 3 @@ -11814,9 +11814,9 @@ arg_0 = word ptr 6 push bp mov bp, sp push ds - push offset unk_35090 + push offset _z_Palettes push ds - push offset unk_35090 + push offset _z_Palettes push [bp+arg_0] nopcall sub_11A94 add sp, 0Ah @@ -12589,13 +12589,13 @@ loc_12684: loc_12688: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] cbw cmp ax, 0Fh jge short loc_126A0 mov bx, si imul bx, 3 - inc byte ptr [bx+di+6F0h] + inc byte ptr _z_Palettes[bx+di] loc_126A0: inc di @@ -12609,7 +12609,7 @@ loc_126A7: cmp si, 10h jl short loc_12684 push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -12634,7 +12634,7 @@ loc_126CC: loc_126D0: mov bx, si imul bx, 3 - mov byte ptr [bx+di+6F0h], 0Fh + mov byte ptr _z_Palettes[bx+di], 0Fh inc di loc_126DB: @@ -12646,7 +12646,7 @@ loc_126E1: cmp si, 10h jl short loc_126CC push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 push 1 call _graph_accesspage_func @@ -12679,14 +12679,14 @@ loc_1272D: loc_12731: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] mov bx, si imul bx, 3 cmp al, [bx+di+5414h] jle short loc_12750 mov bx, si imul bx, 3 - dec byte ptr [bx+di+6F0h] + dec byte ptr _z_Palettes[bx+di] jmp short loc_12753 ; --------------------------------------------------------------------------- @@ -12705,7 +12705,7 @@ loc_1275A: cmp si, 10h jl short loc_1272D push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -12731,17 +12731,17 @@ loc_1277F: loc_12783: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] cbw or ax, ax jle short loc_127A5 mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] - add al, 0FCh + mov al, _z_Palettes[bx+di] + add al, -4 mov bx, si imul bx, 3 - mov [bx+di+6F0h], al + mov _z_Palettes[bx+di], al loc_127A5: inc di @@ -12754,11 +12754,11 @@ loc_127A6: loc_127AC: cmp si, 10h jl short loc_1277F - mov byte_350A5, 0Fh - mov byte_350A6, 0Fh - mov byte_350A7, 0Fh + mov _z_Palettes[7 * 3].r, 0Fh + mov _z_Palettes[7 * 3].g, 0Fh + mov _z_Palettes[7 * 3].b, 0Fh push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 push 1 call _graph_accesspage_func @@ -13010,13 +13010,13 @@ loc_12AA5: loc_12AA9: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] cbw cmp ax, 0Fh jge short loc_12AC1 mov bx, si imul bx, 3 - inc byte ptr [bx+di+6F0h] + inc byte ptr _z_Palettes[bx+di] loc_12AC1: inc di @@ -13030,7 +13030,7 @@ loc_12AC8: cmp si, 10h jl short loc_12AA5 push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -13055,7 +13055,7 @@ loc_12AED: loc_12AF1: mov bx, si imul bx, 3 - mov byte ptr [bx+di+6F0h], 0Fh + mov byte ptr _z_Palettes[bx+di], 0Fh inc di loc_12AFC: @@ -13067,7 +13067,7 @@ loc_12B02: cmp si, 10h jl short loc_12AED push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 push 1 call _graph_accesspage_func @@ -13100,14 +13100,14 @@ loc_12B4E: loc_12B52: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] mov bx, si imul bx, 3 cmp al, [bx+di+5414h] jle short loc_12B71 mov bx, si imul bx, 3 - dec byte ptr [bx+di+6F0h] + dec byte ptr _z_Palettes[bx+di] jmp short loc_12B74 ; --------------------------------------------------------------------------- @@ -13126,7 +13126,7 @@ loc_12B7B: cmp si, 10h jl short loc_12B4E push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -13525,7 +13525,7 @@ loc_12EC7: mov bx, [bp+var_C] imul bx, 3 add bx, [bp+var_E] - mov al, [bx+6F0h] + mov al, _z_Palettes[bx] mov bx, [bp+var_C] imul bx, 3 add bx, [bp+var_E] @@ -13544,17 +13544,17 @@ loc_12EC7: ; --------------------------------------------------------------------------- loc_12EFF: - mov al, 0FFh + mov al, -1 loc_12F01: mov bx, [bp+var_C] imul bx, 3 add bx, [bp+var_E] - add al, [bx+6F0h] + add al, _z_Palettes[bx] mov bx, [bp+var_C] imul bx, 3 add bx, [bp+var_E] - mov [bx+6F0h], al + mov _z_Palettes[bx], al loc_12F1B: inc [bp+var_E] @@ -13568,7 +13568,7 @@ loc_12F27: cmp [bp+var_C], 10h jb short loc_12EC0 push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -29103,51 +29103,7 @@ include th01/ztext[data].asm public _game_initialized _game_initialized db 0 db 0 -unk_35090 db 0 - dd 0 - db 0Fh - db 0 - db 0Fh - db 0 - db 0 - db 0Fh - db 0Fh - db 0Fh - db 0 - db 0 -byte_3509F db 0Fh - db 0 -byte_350A1 db 0Fh -byte_350A2 db 0Fh -byte_350A3 db 0Fh -byte_350A4 db 0 -byte_350A5 db 0Fh -byte_350A6 db 0Fh -byte_350A7 db 0Fh - db 8 - db 8 - db 8 -byte_350AB db 0 -byte_350AC db 0 -byte_350AD db 0Ah - db 0 - db 0Ah - db 0 - db 0 - db 0Ah - db 0Ah - db 0Ah - db 0 - db 0 - db 0Ah - db 0 - db 0Ah - db 0Ah - db 0Ah - db 0 -byte_350BD db 0Ch -byte_350BE db 0Ch - db 0Ch +include th01/hardware/palette[data].asm byte_350C0 db 0 word_350C1 dw 80h aPal98Grb db 'pal98 grb',0 diff --git a/th01_reiiden_2.inc b/th01_reiiden_2.inc index 056c66ec..5ee3c8af 100644 --- a/th01_reiiden_2.inc +++ b/th01_reiiden_2.inc @@ -431,7 +431,7 @@ loc_1B3BB: loc_1B3BF: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] mov bx, si imul bx, 3 mov [bx+di+5414h], al @@ -1135,8 +1135,8 @@ loc_1BA6C: idiv bx or dx, dx jnz short loc_1BAFD - inc byte_350BD - inc byte_350BE + inc _z_Palettes[15 * 3].r + inc _z_Palettes[15 * 3].g inc byte_39BB9 inc byte_39BBA push ds @@ -5184,7 +5184,7 @@ loc_1E385: loc_1E389: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] mov bx, si imul bx, 3 mov [bx+di+5414h], al @@ -6863,21 +6863,21 @@ loc_1F154: loc_1F158: mov bx, si imul bx, 3 - mov al, [bx+6F2h] + mov al, _z_Palettes[bx].b cbw - add ax, 0FFFCh + add ax, -4 push ax mov bx, si imul bx, 3 - mov al, [bx+6F1h] + mov al, _z_Palettes[bx].g cbw - add ax, 0FFFCh + add ax, -4 push ax mov bx, si imul bx, 3 - mov al, [bx+6F0h] + mov al, _z_Palettes[bx].r cbw - add ax, 0FFFCh + add ax, -4 push ax push si call sub_EB59 @@ -7928,7 +7928,7 @@ loc_1FAF6: mov word_39E78, 0 mov byte_39E7A, 0 push ds - push offset unk_35090 + push offset _z_Palettes call sub_C433 add sp, 4 call sub_232A4 @@ -13248,7 +13248,7 @@ loc_226FA: loc_226FE: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] mov bx, si imul bx, 3 mov [bx+di+5414h], al @@ -13283,7 +13283,7 @@ sub_22731 proc far mov bp, sp call sub_232A4 push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 push 1300040h push 2E00000h @@ -14424,7 +14424,7 @@ loc_23013: cmp si, 3 jl short loc_22FE8 push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -14444,7 +14444,7 @@ loc_2302C: mov word_35CE6, 0 call sub_232D3 push ds - push offset unk_35090 + push offset _z_Palettes call sub_C433 add sp, 4 call sub_232A4 @@ -14726,7 +14726,7 @@ loc_232AF: mov bx, dx imul bx, 3 add bx, cx - mov al, [bx+6F0h] + mov al, _z_Palettes[bx] mov bx, dx imul bx, 3 add bx, cx @@ -14897,7 +14897,7 @@ loc_2333E: loc_23342: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] mov bx, si imul bx, 3 mov [bx+di+59EEh], al @@ -17425,7 +17425,7 @@ loc_24A66: call sub_232D3 mov byte_3A6C6, 0 push ds - push offset unk_35090 + push offset _z_Palettes call sub_C433 add sp, 4 jmp loc_24DFB @@ -17475,7 +17475,7 @@ loc_24AEE: cmp si, 3 jl short loc_24AB5 push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -17557,8 +17557,8 @@ loc_24BA3: idiv bx cmp dx, 13h jnz short loc_24BDA - inc byte_3509F - dec byte_350A1 + inc _z_Palettes[5 * 3].r + dec _z_Palettes[5 * 3].b inc byte_39B9B dec byte_39B9D push ds @@ -26456,7 +26456,7 @@ loc_29D0E: call sub_10BAE call sub_EC80 push ds - push offset unk_35090 + push offset _z_Palettes call sub_C433 push 0 call _graph_accesspage_func @@ -30193,7 +30193,7 @@ loc_2C117: mov word_3B431, 0 call sub_232A4 push ds - push offset unk_35090 + push offset _z_Palettes call sub_C433 add sp, 4 mov eax, _rand @@ -31026,7 +31026,7 @@ loc_2C9DA: push ds push offset unk_38988 push ds - push offset unk_35090 + push offset _z_Palettes push 0 call sub_11A94 add sp, 0Ah @@ -31062,7 +31062,7 @@ loc_2C9DA: mov word_34A78, 0 call sub_232A4 push ds - push offset unk_35090 + push offset _z_Palettes call sub_C433 add sp, 4 mov word_3A6C8, 6 @@ -31234,11 +31234,11 @@ loc_2CBC2: call sub_232D3 cmp word_35E97, 0 jnz short loc_2CC3F - mov al, byte_350A2 + mov al, _z_Palettes[6 * 3].r cbw cmp ax, 0Ah jge short loc_2CC1D - inc byte_350A2 + inc _z_Palettes[6 * 3].r jmp short loc_2CC23 ; --------------------------------------------------------------------------- @@ -31246,27 +31246,27 @@ loc_2CC1D: mov word_35E97, 1 loc_2CC23: - mov al, byte_350A3 + mov al, _z_Palettes[6 * 3].g cbw cmp ax, 0Ah jge short loc_2CC30 - inc byte_350A3 + inc _z_Palettes[6 * 3].g loc_2CC30: - mov al, byte_350A4 + mov al, _z_Palettes[6 * 3].b cbw cmp ax, 6 jge short loc_2CC6B - inc byte_350A4 + inc _z_Palettes[6 * 3].b jmp short loc_2CC6B ; --------------------------------------------------------------------------- loc_2CC3F: - mov al, byte_350A2 + mov al, _z_Palettes[6 * 3].r cbw or ax, ax jle short loc_2CC4D - dec byte_350A2 + dec _z_Palettes[6 * 3].r jmp short loc_2CC53 ; --------------------------------------------------------------------------- @@ -31274,22 +31274,22 @@ loc_2CC4D: mov word_35E97, 0 loc_2CC53: - mov al, byte_350A3 + mov al, _z_Palettes[6 * 3].g cbw or ax, ax jle short loc_2CC5F - dec byte_350A3 + dec _z_Palettes[6 * 3].g loc_2CC5F: - mov al, byte_350A4 + mov al, _z_Palettes[6 * 3].b cbw or ax, ax jle short loc_2CC6B - dec byte_350A4 + dec _z_Palettes[6 * 3].b loc_2CC6B: push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 call sub_232A4 @@ -31390,9 +31390,9 @@ loc_2CD59: loc_2CD5D: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] push ax - mov ax, 6F0h + mov ax, offset _z_Palettes or ax, ax jbe short loc_2CD72 mov al, 1 @@ -31407,7 +31407,7 @@ loc_2CD74: sub dl, al mov bx, si imul bx, 3 - mov [bx+di+6F0h], dl + mov _z_Palettes[bx+di], dl inc di loc_2CD81: @@ -31419,7 +31419,7 @@ loc_2CD87: cmp si, 10h jb short loc_2CD59 push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -31623,7 +31623,7 @@ var_2 = word ptr -2 push offset aBoss7_d1_grp ; "boss7_d1.grp" call sub_10BAE push ds - push offset unk_35090 + push offset _z_Palettes call sub_C433 push 4 call sub_2091E @@ -31666,7 +31666,7 @@ loc_2CF26: cmp di, 10h jl short loc_2CF11 push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 call text_fillca pascal, (' ' shl 16) + TX_WHITE mov word_39854, 1 @@ -31762,7 +31762,7 @@ loc_2D011: mov bx, [bp+var_4] imul bx, 3 add bx, [bp+var_6] - cmp al, [bx+6F0h] + cmp al, _z_Palettes[bx] jle short loc_2D031 mov al, 1 jmp short loc_2D033 @@ -31775,11 +31775,11 @@ loc_2D033: mov bx, [bp+var_4] imul bx, 3 add bx, [bp+var_6] - add al, [bx+6F0h] + add al, _z_Palettes[bx] mov bx, [bp+var_4] imul bx, 3 add bx, [bp+var_6] - mov [bx+6F0h], al + mov _z_Palettes[bx], al inc [bp+var_6] loc_2D050: @@ -31791,7 +31791,7 @@ loc_2D059: cmp [bp+var_4], 10h jl short loc_2D00A push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -31942,29 +31942,29 @@ loc_2D16E: ; --------------------------------------------------------------------------- loc_2D1B6: - mov al, byte_350AB + mov al, _z_Palettes[9 * 3].r cbw or ax, ax jle short loc_2D1C2 - dec byte_350AB + dec _z_Palettes[9 * 3].r loc_2D1C2: - mov al, byte_350AC + mov al, _z_Palettes[9 * 3].g cbw cmp ax, 9 jle short loc_2D1CF - dec byte_350AC + dec _z_Palettes[9 * 3].g loc_2D1CF: - mov al, byte_350AD + mov al, _z_Palettes[9 * 3].b cbw cmp ax, 0Ah jle short loc_2D1DC - dec byte_350AD + dec _z_Palettes[9 * 3].b loc_2D1DC: push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 push 0Ah call _frame_delay @@ -35242,29 +35242,29 @@ loc_2F07F: idiv bx or dx, dx jnz short loc_2F0C5 - mov al, byte_350AB + mov al, _z_Palettes[9 * 3].r cbw or ax, ax jle short loc_2F09F - dec byte_350AB + dec _z_Palettes[9 * 3].r loc_2F09F: - mov al, byte_350AC + mov al, _z_Palettes[9 * 3].g cbw cmp ax, 9 jle short loc_2F0AC - dec byte_350AC + dec _z_Palettes[9 * 3].g loc_2F0AC: - mov al, byte_350AD + mov al, _z_Palettes[9 * 3].b cbw cmp ax, 0Ah jle short loc_2F0B9 - dec byte_350AD + dec _z_Palettes[9 * 3].b loc_2F0B9: push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -35492,29 +35492,29 @@ loc_2F2CF: idiv bx or dx, dx jnz short loc_2F315 - mov al, byte_350AB + mov al, _z_Palettes[9 * 3].r cbw or ax, ax jle short loc_2F2EF - dec byte_350AB + dec _z_Palettes[9 * 3].r loc_2F2EF: - mov al, byte_350AC + mov al, _z_Palettes[9 * 3].g cbw cmp ax, 9 jle short loc_2F2FC - dec byte_350AC + dec _z_Palettes[9 * 3].g loc_2F2FC: - mov al, byte_350AD + mov al, _z_Palettes[9 * 3].b cbw cmp ax, 0Ah jle short loc_2F309 - dec byte_350AD + dec _z_Palettes[9 * 3].b loc_2F309: push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -35741,29 +35741,29 @@ loc_2F52A: idiv bx or dx, dx jnz short loc_2F570 - mov al, byte_350AB + mov al, _z_Palettes[9 * 3].r cbw or ax, ax jle short loc_2F54A - dec byte_350AB + dec _z_Palettes[9 * 3].r loc_2F54A: - mov al, byte_350AC + mov al, _z_Palettes[9 * 3].g cbw cmp ax, 9 jle short loc_2F557 - dec byte_350AC + dec _z_Palettes[9 * 3].g loc_2F557: - mov al, byte_350AD + mov al, _z_Palettes[9 * 3].b cbw cmp ax, 0Ah jle short loc_2F564 - dec byte_350AD + dec _z_Palettes[9 * 3].b loc_2F564: push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 @@ -36184,7 +36184,7 @@ loc_2F9AF: loc_2F9B3: mov bx, si imul bx, 3 - mov al, [bx+di+6F0h] + mov al, _z_Palettes[bx+di] push ax mov bx, si imul bx, 3 @@ -36203,7 +36203,7 @@ loc_2F9CD: sub dl, al mov bx, si imul bx, 3 - mov [bx+di+6F0h], dl + mov _z_Palettes[bx+di], dl inc di loc_2F9DA: @@ -36215,7 +36215,7 @@ loc_2F9E0: cmp si, 10h jl short loc_2F9AF push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 push 7 @@ -36294,7 +36294,7 @@ loc_2FA77: loc_2FA7B: mov bx, si imul bx, 3 - mov byte ptr [bx+di+6F0h], 0 + mov byte ptr _z_Palettes[bx+di], 0 inc di loc_2FA86: @@ -36306,7 +36306,7 @@ loc_2FA8C: cmp si, 10h jl short loc_2FA77 push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 push ds @@ -36384,7 +36384,7 @@ loc_2FB22: mov bx, [bp+var_2] imul bx, 3 add bx, [bp+var_4] - cmp al, [bx+6F0h] + cmp al, _z_Palettes[bx] jle short loc_2FB42 mov al, 1 jmp short loc_2FB44 @@ -36397,11 +36397,11 @@ loc_2FB44: mov bx, [bp+var_2] imul bx, 3 add bx, [bp+var_4] - add al, [bx+6F0h] + add al, _z_Palettes[bx] mov bx, [bp+var_2] imul bx, 3 add bx, [bp+var_4] - mov [bx+6F0h], al + mov _z_Palettes[bx], al inc [bp+var_4] loc_2FB61: @@ -36413,7 +36413,7 @@ loc_2FB6A: cmp [bp+var_2], 10h jl short loc_2FB1B push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 jmp loc_2FC06 @@ -36444,7 +36444,7 @@ loc_2FBA8: mov bx, [bp+var_2] imul bx, 3 add bx, [bp+var_4] - mov al, [bx+6F0h] + mov al, _z_Palettes[bx] push ax mov bx, [bp+var_2] imul bx, 3 @@ -36465,7 +36465,7 @@ loc_2FBCA: mov bx, [bp+var_2] imul bx, 3 add bx, [bp+var_4] - mov [bx+6F0h], dl + mov _z_Palettes[bx], dl inc [bp+var_4] loc_2FBDD: @@ -36477,10 +36477,10 @@ loc_2FBE6: cmp [bp+var_2], 10h jl short loc_2FBA1 push ds - push offset unk_35090 + push offset _z_Palettes call sub_EB10 add sp, 4 - cmp byte_350A5, 0 + cmp _z_Palettes[7 * 3].r, 0 jz short loc_2FC1C cmp [bp+var_6], 0DCh ; '?' jge short loc_2FC0E