From 1568121f05cb44273feb663bb9ad4ea5ade484a1 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sun, 2 Feb 2020 12:40:25 +0100 Subject: [PATCH] [Position independence] [th04/th05] Remaining switch jump tables Part of P0072, funded by [Anonymous] and -Tom-. --- th04_main.asm | 12 ++++++------ th05_main.asm | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/th04_main.asm b/th04_main.asm index 9168cde2..f83097cf 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -28929,7 +28929,7 @@ loc_1B533: mov ah, 0 mov [bp+var_2], ax mov cx, 4 - mov bx, 7E98h + mov bx, offset word_1B928 loc_1B541: mov ax, cs:[bx] @@ -29101,7 +29101,7 @@ loc_1B6CC: mov ah, 0 mov [bp+var_4], ax mov cx, 4 - mov bx, 7E88h + mov bx, offset word_1B918 loc_1B6DA: mov ax, cs:[bx] @@ -29219,7 +29219,7 @@ loc_1B7C1: mov ah, 0 mov [bp+var_6], ax mov cx, 4 - mov bx, 7E78h + mov bx, offset word_1B908 loc_1B7CF: mov ax, cs:[bx] @@ -29360,17 +29360,17 @@ loc_1B8EA: yuuka6_update endp ; --------------------------------------------------------------------------- - dw 0, 1, 2, 0FFh ; value table for switch statement +word_1B908 dw 0, 1, 2, 0FFh ; value table for switch statement dw offset loc_1B7E2 ; jump table for switch statement dw offset loc_1B7E7 dw offset loc_1B7EC dw offset loc_1B7F1 - dw 0, 1, 2, 0FFh ; value table for switch statement +word_1B918 dw 0, 1, 2, 0FFh ; value table for switch statement dw offset loc_1B6ED ; jump table for switch statement dw offset loc_1B6F2 dw offset loc_1B6F7 dw offset loc_1B6FC - dw 0, 1, 2, 0FFh ; value table for switch statement +word_1B928 dw 0, 1, 2, 0FFh ; value table for switch statement dw offset loc_1B554 ; jump table for switch statement dw offset loc_1B559 dw offset loc_1B55E diff --git a/th05_main.asm b/th05_main.asm index 22df507e..be082b6e 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -14656,7 +14656,7 @@ sub_15DE6 proc near cmp bl, 0Dh ja short locret_15E1C sub bl, 2 - mov cx, 0B9Eh + mov cx, offset off_15E1E jmp short loc_15E44 ; --------------------------------------------------------------------------- @@ -14705,7 +14705,7 @@ sub_15E2A proc near cmp bl, 0Dh ja short locret_15E73 sub bl, 4 - mov cx, 0BF8h + mov cx, offset off_15E78 loc_15E44: mov ax, word ptr dword_26002 @@ -14759,7 +14759,7 @@ sub_15E82 proc near movzx bx, byte_26000 cmp bl, 0Dh ja short locret_15EBE - mov cx, 0C40h + mov cx, offset off_15EC0 jmp short loc_15E44 ; --------------------------------------------------------------------------- @@ -14799,6 +14799,7 @@ sub_15E82 endp ; --------------------------------------------------------------------------- nop ; --------------------------------------------------------------------------- +off_15EC0 label word dw offset loc_15E91 dw offset loc_15EA8 dw offset loc_15EAE