[Position independence] [th04/th05] Final data references in TH05's MAIN.EXE

And that's it, actual position dependence achieved! 🎉 Again, the
website won't quite show 100% PI, but that (again) are all false
positives, to be covered in an upcoming push…

Completes P0112, funded by [Anonymous] and Blue Bolt.
This commit is contained in:
nmlgc 2020-08-27 00:15:37 +02:00
parent db206f9d41
commit e447a2d687
3 changed files with 23 additions and 16 deletions

View File

@ -1016,7 +1016,7 @@ var_4 = dword ptr -4
mov word ptr _DemoBuf+2, ax mov word ptr _DemoBuf+2, ax
mov word ptr _DemoBuf, 0 mov word ptr _DemoBuf, 0
mov word ptr [bp+var_4+2], ds mov word ptr [bp+var_4+2], ds
mov word ptr [bp+var_4], 1EDh mov word ptr [bp+var_4], offset aDemo0_rec
les bx, _resident les bx, _resident
mov al, es:[bx+resident_t.demo_num] mov al, es:[bx+resident_t.demo_num]
add al, '0' add al, '0'
@ -3470,7 +3470,7 @@ var_1 = byte ptr -1
push si push si
push di push di
mov word ptr [bp+var_6+2], ds mov word ptr [bp+var_6+2], ds
mov word ptr [bp+var_6], 18A0h mov word ptr [bp+var_6], offset _dialog_kanji_buf
loc_D57A: loc_D57A:
les bx, dword_255CC les bx, dword_255CC
@ -29793,7 +29793,7 @@ loc_1D5CB:
push [bp+arg_8] push [bp+arg_8]
mov bx, [bp+arg_6] mov bx, [bp+arg_6]
shl bx, 2 shl bx, 2
pushd dword ptr [bx+1F3Ah] pushd _STAGE_CLEAR_BONUS_DESC[bx]
push ax push ax
call text_putsa call text_putsa
pop si pop si
@ -34951,7 +34951,8 @@ include th04/formats/dialog[data].asm
byte_22BCA db 0 byte_22BCA db 0
a_dm00_txt db '_DM00.TXT',0 a_dm00_txt db '_DM00.TXT',0
a_dm04b_txt db '_DM04B.txt',0 a_dm04b_txt db '_DM04B.txt',0
db ' ',0 public _dialog_kanji_buf
_dialog_kanji_buf db ' ',0
aKao0_cd2_0 db 'KAO0.cd2',0 aKao0_cd2_0 db 'KAO0.cd2',0
aKao1_cd2_0 db 'KAO1.cd2',0 aKao1_cd2_0 db 'KAO1.cd2',0
aBss7_cd2 db 'bss7.cd2',0 aBss7_cd2 db 'bss7.cd2',0
@ -35434,6 +35435,8 @@ aGensou_scr_1 db 'GENSOU.SCR',0
aGensou_scr_2 db 'GENSOU.SCR',0 aGensou_scr_2 db 'GENSOU.SCR',0
byte_23278 db 0 byte_23278 db 0
db 0 db 0
public _STAGE_CLEAR_BONUS_DESC
_STAGE_CLEAR_BONUS_DESC label dword
dd aBOSS_FINAL_TIMEOUT dd aBOSS_FINAL_TIMEOUT
dd aPENALTY_6 dd aPENALTY_6
dd aPENALTY_5 dd aPENALTY_5

View File

@ -147,4 +147,5 @@ b6balls equ <_custom_entities[1 * size b6ball_t]>
; -------------------- ; --------------------
public _custom_entities public _custom_entities
_custom_entities custom_t (CUSTOM_COUNT + 1) dup (<?>) _custom_entities custom_t CUSTOM_COUNT dup (<?>)
custom_t <?> ; 1 additional unused one, for some reason?

View File

@ -192,15 +192,15 @@ mptn_load_inner proc far
mov bx, ax mov bx, ax
mov si, bx mov si, bx
mov ah, 3Fh ; '?' mov ah, 3Fh ; '?'
mov dx, 265Ch mov dx, offset Palettes
mov cx, 6 mov cx, 6
int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE
; BX = file handle, CX = number of bytes to read ; BX = file handle, CX = number of bytes to read
; DS:DX -> buffer ; DS:DX -> buffer
mov di, word ptr Palettes+4 mov di, word ptr Palettes+4
mov ah, 3Fh ; '?' mov ah, 3Fh ; '?'
mov dx, 265Ch mov dx, offset Palettes
mov cx, 30h ; '0' mov cx, size palette_t
int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE int 21h ; DOS - 2+ - READ FROM FILE WITH HANDLE
; BX = file handle, CX = number of bytes to read ; BX = file handle, CX = number of bytes to read
; DS:DX -> buffer ; DS:DX -> buffer
@ -1172,10 +1172,10 @@ loc_B76F:
mov word ptr _DemoBuf+2, ax mov word ptr _DemoBuf+2, ax
mov word ptr _DemoBuf, 0 mov word ptr _DemoBuf, 0
mov word ptr [bp+var_4+2], ds mov word ptr [bp+var_4+2], ds
mov word ptr [bp+var_4], 22Dh mov word ptr [bp+var_4], offset aDemo0_rec
les bx, _resident les bx, _resident
mov al, es:[bx+resident_t.demo_num] mov al, es:[bx+resident_t.demo_num]
add al, 2Fh ; '/' add al, ('0' - 1)
les bx, [bp+var_4] les bx, [bp+var_4]
mov es:[bx+4], al mov es:[bx+4], al
push word ptr [bp+var_4+2] push word ptr [bp+var_4+2]
@ -5386,7 +5386,7 @@ sub_EACE proc near
push (size _pellets + size _bullets16) / 4 push (size _pellets + size _bullets16) / 4
call sub_E708 call sub_E708
push offset _custom_entities push offset _custom_entities
push 1A0h push size _custom_entities / 4
call sub_E708 call sub_E708
push offset _circles push offset _circles
push size _circles / 4 push size _circles / 4
@ -5922,7 +5922,7 @@ var_1 = byte ptr -1
enter 6, 0 enter 6, 0
push si push si
mov word ptr [bp+var_6+2], ds mov word ptr [bp+var_6+2], ds
mov word ptr [bp+var_6], 1817h mov word ptr [bp+var_6], offset _dialog_kanji_buf
loc_F1B3: loc_F1B3:
les bx, dword_2C930 les bx, dword_2C930
@ -12529,7 +12529,7 @@ loc_1641B:
push ds push ds
mov bx, [bp+arg_6] mov bx, [bp+arg_6]
add bx, bx add bx, bx
push word ptr [bx+1896h] push _STAGE_CLEAR_BONUS_DESC[bx]
push ax push ax
call text_putsa call text_putsa
pop si pop si
@ -25459,7 +25459,7 @@ loc_1E732:
mov angle_2D085, 0 mov angle_2D085, 0
mov angle_2D084, 0 mov angle_2D084, 0
mov byte_2D082, 0 mov byte_2D082, 0
mov off_2285A, 938Eh mov off_2285A, offset sub_1E60E
jmp loc_1E864 jmp loc_1E864
; --------------------------------------------------------------------------- ; ---------------------------------------------------------------------------
@ -27829,7 +27829,8 @@ off_221D0 dd a_dm00_tx2
include th04/formats/dialog[data].asm include th04/formats/dialog[data].asm
byte_221EC db 0 byte_221EC db 0
a_dm00_tx2 db '_DM00.TX2',0 a_dm00_tx2 db '_DM00.TX2',0
db ' ',0 public _dialog_kanji_buf
_dialog_kanji_buf db ' ',0
aSt06_bb1 db 'st06.bb1',0 aSt06_bb1 db 'st06.bb1',0
aSt06_bb2 db 'st06.bb2',0 aSt06_bb2 db 'st06.bb2',0
aSt06b db 'st06b',0 aSt06b db 'st06b',0
@ -27849,7 +27850,9 @@ aBomb0_bft_0 db 'bomb0.bft',0
include th04/main/boss/explosions_big[data].asm include th04/main/boss/explosions_big[data].asm
byte_22274 db 0 byte_22274 db 0
byte_22275 db 0 byte_22275 db 0
off_22276 dw offset aBOSS_FINAL_TIMEOUT public _STAGE_CLEAR_BONUS_DESC
_STAGE_CLEAR_BONUS_DESC label word
dw offset aBOSS_FINAL_TIMEOUT
dw offset aPENALTY_6 dw offset aPENALTY_6
dw offset aPENALTY_5 dw offset aPENALTY_5
dw offset aPENALTY_4 dw offset aPENALTY_4