From 550bba9b3c0e6843cdd348bdb3a2b5cb04a08b53 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sat, 16 Nov 2019 21:59:23 +0100 Subject: [PATCH] [Position independence] False positives in master.lib EGC function calls Mostly used for screen shaking. Part of P0059, funded by [Anonymous] and -Tom-. --- th02_maine.asm | 11 ++++------- th03_op.asm | 6 ++---- th04_main.asm | 16 ++++++++-------- th05_main.asm | 28 ++++++++++++++-------------- 4 files changed, 28 insertions(+), 33 deletions(-) diff --git a/th02_maine.asm b/th02_maine.asm index 19c3edf3..eaa8dac4 100644 --- a/th02_maine.asm +++ b/th02_maine.asm @@ -923,10 +923,10 @@ sub_9AD4 proc near loc_9B1B: push si - push 64h ; 'd' - lea ax, [si+13Fh] + push 100 + lea ax, [si+319] push ax - push 12B0004h + push (299 shl 16) or 4 call egc_shift_left call grcg_setcolor pascal, (GC_RMW shl 16) + 0 lea ax, [si+312] @@ -1089,10 +1089,7 @@ loc_9C91: loc_9CDE: graph_accesspage 0 - push 0A00064h - push 1DF0129h - push 2 - call egc_shift_down + call egc_shift_down pascal, (160 shl 16) or 100, (479 shl 16) or 297, 2 push 3 mov ax, si add ax, ax diff --git a/th03_op.asm b/th03_op.asm index 73c6ba0a..309075bc 100644 --- a/th03_op.asm +++ b/th03_op.asm @@ -2349,8 +2349,7 @@ var_2 = word ptr -2 graph_accesspage 0 call pi_slot_palette_apply pascal, 0 call pi_slot_put pascal, large 0, 0 - push 2 - call egc_shift_left_all + call egc_shift_left_all pascal, 2 mov Palettes+45, 0 mov Palettes+46, 0 mov Palettes+47, 0 @@ -2396,8 +2395,7 @@ loc_AEE1: sub al, [bp+@@page] mov [bp+@@page], al graph_accesspage al - push 4 - call egc_shift_left_all + call egc_shift_left_all pascal, 4 sub si, 2 loc_AF02: diff --git a/th04_main.asm b/th04_main.asm index 0c8b1d09..22c1330f 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -3564,8 +3564,8 @@ loc_CD61: loc_CD68: cmp word_255BE, 0 jge short loc_CD88 - push 200000h - push 19F018Fh + push (PLAYFIELD_X shl 16) or 0 + push ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) mov ax, word_255BE neg ax push ax @@ -3576,8 +3576,8 @@ loc_CD68: loc_CD88: cmp word_255BE, 0 jle short loc_CDA9 - push 200000h - push 19F018Fh + push (PLAYFIELD_X shl 16) or 0 + push ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) push word_255BE call egc_shift_right @@ -3587,8 +3587,8 @@ loc_CDA4: loc_CDA9: cmp word_255C0, 0 jge short loc_CDC9 - push 200000h - push 19F018Fh + push (PLAYFIELD_X shl 16) or 0 + push ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) mov ax, word_255C0 neg ax push ax @@ -3599,8 +3599,8 @@ loc_CDA9: loc_CDC9: cmp word_255C0, 0 jle short loc_CDEA - push 200000h - push 19F018Fh + push (PLAYFIELD_X shl 16) or 0 + push ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) push word_255C0 call egc_shift_down diff --git a/th05_main.asm b/th05_main.asm index 8cb969cf..3e450320 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -9106,14 +9106,14 @@ loc_102B2: loc_102B9: cmp word_2CE02, 0 jge short loc_102F0 - push 200000h - push 19F018Fh + push (PLAYFIELD_X shl 16) or 0 + push ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) mov ax, word_2CE02 neg ax push ax call egc_shift_left - push 200000h - push 19F018Fh + push (PLAYFIELD_X shl 16) or 0 + push ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) mov ax, word_2CE02 neg ax push ax @@ -9124,8 +9124,8 @@ loc_102B9: loc_102F0: cmp word_2CE02, 0 jle short loc_10311 - push 200000h - push 19F018Fh + push (PLAYFIELD_X shl 16) or 0 + push ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) push word_2CE02 call egc_shift_right @@ -9137,14 +9137,14 @@ loc_10311: jge short loc_10346 cmp _scroll_line, 0 jnz short loc_1032D - push 200010h - push 19F017Fh + push (PLAYFIELD_X shl 16) or PLAYFIELD_Y + push ((PLAYFIELD_RIGHT - 1) shl 16) or (PLAYFIELD_BOTTOM - 1) jmp short loc_10339 ; --------------------------------------------------------------------------- loc_1032D: - push 200000h - push 19F018Fh + push (PLAYFIELD_X shl 16) or 0 + push ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) loc_10339: mov ax, word_2CE04 @@ -9159,14 +9159,14 @@ loc_10346: jle short loc_1037C cmp _scroll_line, 0 jnz short loc_10362 - push 200010h - push 19F017Fh + push (PLAYFIELD_X shl 16) or PLAYFIELD_Y + push ((PLAYFIELD_RIGHT - 1) shl 16) or (PLAYFIELD_BOTTOM - 1) jmp short loc_1036E ; --------------------------------------------------------------------------- loc_10362: - push 200000h - push 19F018Fh + push (PLAYFIELD_X shl 16) or 0 + push ((PLAYFIELD_RIGHT - 1) shl 16) or (RES_Y - 1) loc_1036E: push word_2CE04