From 6b2a54d8d26f463704a9942b721eff59fb4df172 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Thu, 28 May 2020 21:52:18 +0200 Subject: [PATCH] [Position independence] [th01] Final false positives in OP.EXE and FUUIN.EXE MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 100% PI for both! Now, where are all the modders who wanted to replace MDRV2 with PMD… because you can now prototype that, without worring about x86 instruction lengths, at least inside the main menu. Part of P0095, funded by Yanga. --- th01_fuuin.asm | 2 +- th01_op.asm | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/th01_fuuin.asm b/th01_fuuin.asm index b86cec89..d54c2e92 100644 --- a/th01_fuuin.asm +++ b/th01_fuuin.asm @@ -1499,7 +1499,7 @@ loc_C6A1: loc_C6B1: mov ax, si inc si - cmp ax, 7D0h + cmp ax, 2000 jge short loc_C6C7 cmp _input_ok, 0 jnz short loc_C6C7 diff --git a/th01_op.asm b/th01_op.asm index eb5b7c43..2ed94dd3 100644 --- a/th01_op.asm +++ b/th01_op.asm @@ -1096,7 +1096,7 @@ _main proc far outregs = REGS ptr -2Ch inregs = REGS ptr -1Ch -var_C = word ptr -0Ch +@@kb_buf = word ptr -0Ch var_9 = byte ptr -9 var_8 = dword ptr -8 var_4 = dword ptr -4 @@ -1201,13 +1201,13 @@ loc_B0D6: call sub_A719 xor ax, ax mov es, ax - mov al, es:0500h - or al, 20h + mov al, es:((50h shl 4) + 00h) ; BIOS_FLAG + or al, 20h ; Do not beep when key buffer overflows mov [bp+var_9], al xor ax, ax mov dl, [bp+var_9] mov es, ax - mov es:0500h, dl + mov es:((50h shl 4) + 00h), dl ; BIOS_FLAG jmp short loc_B135 ; --------------------------------------------------------------------------- @@ -1311,14 +1311,14 @@ loc_B1D8: loc_B1EE: xor ax, ax mov es, ax - mov ax, word ptr es:[0524h] - mov [bp+var_C], ax + mov ax, word ptr es:[((50h shl 4) + 24h)] ; KB_BUF_HEAD + mov [bp+@@kb_buf], ax xor ax, ax - mov dx, [bp+var_C] + mov dx, [bp+@@kb_buf] mov es, ax - mov word ptr es:[0526h], dx + mov word ptr es:[((50h shl 4) + 26h)], dx ; KB_BUF_TAIL mov es, ax - mov byte ptr es:[0528h], 0 + mov byte ptr es:[((50h shl 4) + 28h)], 0 ; KB_COUNT inc _rand push 1 call _frame_delay