From 83e089cba9d77311a8da8a9d3d5eac3aa17ac7f6 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Tue, 4 Dec 2018 23:08:57 +0100 Subject: [PATCH] [Reverse-engineering] Inlined GRCG mode setting calls Funded by -Tom-. --- libs/master.lib/macros.inc | 38 +++++++++ th01_fuuin.asm | 24 ++---- th01_op.asm | 24 ++---- th01_reiiden.asm | 24 ++---- th01_reiiden_2.inc | 8 +- th02_main.asm | 6 +- th03_main.asm | 18 ++--- th03_zunsp.asm | 8 +- th04_main.asm | 133 +++++++++---------------------- th04_maine.asm | 31 ++------ th04_op.asm | 52 +++--------- th05_main.asm | 157 +++++++++++-------------------------- th05_maine.asm | 66 ++++------------ th05_op.asm | 52 ++++-------- 14 files changed, 200 insertions(+), 441 deletions(-) diff --git a/libs/master.lib/macros.inc b/libs/master.lib/macros.inc index e1efecb9..54f298c5 100644 --- a/libs/master.lib/macros.inc +++ b/libs/master.lib/macros.inc @@ -1,3 +1,6 @@ +; ReC98 +; ASM equivalents of relevant #defines from master.h + Point struc x dw ? y dw ? @@ -42,3 +45,38 @@ GC_OFF equ 0 GC_TDW equ 080h ; 書き込みデータは無視して、タイルレジスタの内容を書く GC_TCR equ 080h ; タイルレジスタと同じ色のビットが立って読み込まれる GC_RMW equ 0c0h ; 書き込みビットが立っているドットにタイルレジスタから書く + +; GRCG mode setting macros +; ------------------------ +GRCG_SETMODE_CLOBBERING macro port_reg:req, mode:req + mov port_reg, 7Ch + mov al, mode + out port_reg, al +endm + +GRCG_SETMODE_VIA_MOV macro value_reg:req, mode:req + mov value_reg, mode + out 7Ch, value_reg +endm + +GRCG_NOINT_SETMODE_VIA_MOV macro value_reg:req, mode:req + mov value_reg, mode + pushf + cli + out 7Ch, al + popf +endm + +GRCG_OFF_CLOBBERING macro port_reg:req + GRCG_SETMODE_CLOBBERING dx, GC_OFF +endm + +GRCG_OFF_VIA_MOV macro value_reg:req + GRCG_SETMODE_VIA_MOV value_reg, GC_OFF +endm + +GRCG_OFF_VIA_XOR macro value_reg:req + xor value_reg, value_reg + out 7Ch, value_reg +endm +; ------------------------ diff --git a/th01_fuuin.asm b/th01_fuuin.asm index 1f10798c..90769d19 100644 --- a/th01_fuuin.asm +++ b/th01_fuuin.asm @@ -6023,9 +6023,7 @@ inregs = REGS ptr -10h mov dx, 68h ; 'h' mov al, 0Ah out dx, al - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx nopcall sub_D0C5 leave retf @@ -6063,9 +6061,7 @@ inregs = REGS ptr -10h mov dx, 68h ; 'h' mov al, 0Ah out dx, al - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx nopcall sub_D0C5 leave retf @@ -6090,9 +6086,7 @@ sub_D094 proc far mov dx, 68h ; 'h' mov al, 0Ah out dx, al - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop bp retf sub_D094 endp @@ -6223,9 +6217,7 @@ arg_0 = word ptr 6 push bp mov bp, sp mov bx, [bp+arg_0] - mov dx, 7Ch - mov al, GC_RMW - out dx, al + GRCG_SETMODE_CLOBBERING dx, GC_RMW test bl, 1 jz short loc_D14F mov al, 0FFh @@ -6290,9 +6282,7 @@ arg_0 = word ptr 6 push bp mov bp, sp mov bx, [bp+arg_0] - mov dx, 7Ch - mov al, GC_TDW - out dx, al + GRCG_SETMODE_CLOBBERING dx, GC_TDW test bl, 1 jz short loc_D199 mov al, 0FFh @@ -6353,9 +6343,7 @@ public _grcg_off_func _grcg_off_func proc far push bp mov bp, sp - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop bp retf _grcg_off_func endp diff --git a/th01_op.asm b/th01_op.asm index d8f03d1d..0053e4c4 100644 --- a/th01_op.asm +++ b/th01_op.asm @@ -2379,9 +2379,7 @@ op_06_TEXT segment byte public 'CODE' use16 mov dx, 68h ; 'h' mov al, 0Ah out dx, al - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx nopcall sub_B901 leave retf @@ -2409,9 +2407,7 @@ op_06_TEXT segment byte public 'CODE' use16 mov dx, 68h ; 'h' mov al, 0Ah out dx, al - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx nopcall sub_B901 leave retf @@ -2434,9 +2430,7 @@ sub_B8D0 proc far mov dx, 68h ; 'h' mov al, 0Ah out dx, al - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop bp retf sub_B8D0 endp @@ -2567,9 +2561,7 @@ arg_0 = word ptr 6 push bp mov bp, sp mov bx, [bp+arg_0] - mov dx, 7Ch - mov al, GC_RMW - out dx, al + GRCG_SETMODE_CLOBBERING dx, GC_RMW test bl, 1 jz short loc_B98B mov al, 0FFh @@ -2634,9 +2626,7 @@ arg_0 = word ptr 6 push bp mov bp, sp mov bx, [bp+arg_0] - mov dx, 7Ch - mov al, GC_TDW - out dx, al + GRCG_SETMODE_CLOBBERING dx, GC_TDW test bl, 1 jz short loc_B9D5 mov al, 0FFh @@ -2697,9 +2687,7 @@ sub_B9C0 endp sub_BA0A proc far push bp mov bp, sp - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop bp retf sub_BA0A endp diff --git a/th01_reiiden.asm b/th01_reiiden.asm index 54cd98dd..cf2ef41b 100644 --- a/th01_reiiden.asm +++ b/th01_reiiden.asm @@ -5672,9 +5672,7 @@ inregs = REGS ptr -10h mov dx, 68h ; 'h' mov al, 0Ah out dx, al - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx nopcall sub_E9FC leave retf @@ -5712,9 +5710,7 @@ inregs = REGS ptr -10h mov dx, 68h ; 'h' mov al, 0Ah out dx, al - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx nopcall sub_E9FC leave retf @@ -5739,9 +5735,7 @@ sub_E9CB proc far mov dx, 68h ; 'h' mov al, 0Ah out dx, al - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop bp retf sub_E9CB endp @@ -5872,9 +5866,7 @@ arg_0 = word ptr 6 push bp mov bp, sp mov bx, [bp+arg_0] - mov dx, 7Ch - mov al, GC_RMW - out dx, al + GRCG_SETMODE_CLOBBERING dx, GC_RMW test bl, 1 jz short loc_EA86 mov al, 0FFh @@ -5939,9 +5931,7 @@ arg_0 = word ptr 6 push bp mov bp, sp mov bx, [bp+arg_0] - mov dx, 7Ch - mov al, GC_TDW - out dx, al + GRCG_SETMODE_CLOBBERING dx, GC_TDW test bl, 1 jz short loc_EAD0 mov al, 0FFh @@ -6002,9 +5992,7 @@ public _grcg_off_func _grcg_off_func proc far push bp mov bp, sp - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop bp retf _grcg_off_func endp diff --git a/th01_reiiden_2.inc b/th01_reiiden_2.inc index cd6d32b3..bb7d64c7 100644 --- a/th01_reiiden_2.inc +++ b/th01_reiiden_2.inc @@ -11459,9 +11459,7 @@ sub_21884 endp sub_21889 proc far push bp mov bp, sp - mov dx, 7Ch ; '|' - mov al, 0C0h ; '?' - out dx, al + GRCG_SETMODE_CLOBBERING dx, GC_RMW mov dx, 7Eh ; '~' mov al, 55h ; 'U' out dx, al @@ -13158,9 +13156,7 @@ loc_22652: loc_22655: cmp [bp+var_1], 28h ; '(' jb short loc_2261D - mov dx, 7Ch ; '|' - mov al, 0 - out dx, al + GRCG_OFF_CLOBBERING dx loc_22661: pop si diff --git a/th02_main.asm b/th02_main.asm index ffc3de53..78b8e639 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -2860,8 +2860,7 @@ loc_BD26: mov al, 4 out 6Ah, al ; PC-98 GDC (6a): ; - mov al, GC_OFF - out 7Ch, al + GRCG_OFF_VIA_MOV al mov al, 6 out 6Ah, al ; PC-98 GDC (6a): ; @@ -2967,8 +2966,7 @@ loc_BE3B: mov al, 4 out 6Ah, al ; PC-98 GDC (6a): ; - mov al, 0 - out 7Ch, al + GRCG_OFF_VIA_MOV al mov al, 6 out 6Ah, al ; PC-98 GDC (6a): ; diff --git a/th03_main.asm b/th03_main.asm index 83ff1529..849cf9ba 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -5144,8 +5144,7 @@ loc_C86E: call grcg_setcolor pascal, GC_RMW, si mov bx, 232h call sub_B398 - xor ax, ax - out 7Ch, ax + GRCG_OFF_VIA_XOR ax loc_C881: cmp byte_23BA4, 0 @@ -5175,8 +5174,7 @@ loc_C8AE: call grcg_setcolor pascal, GC_RMW, si mov bx, 25Ah call sub_B398 - xor ax, ax - out 7Ch, ax + GRCG_OFF_VIA_XOR ax loc_C8C1: pop si @@ -5348,8 +5346,7 @@ loc_C9E0: call sub_B3F6 loc_C9F6: - xor ax, ax - out 7Ch, ax + GRCG_OFF_VIA_XOR ax pop di pop si leave @@ -6103,8 +6100,7 @@ loc_D00D: loc_D013: cmp [bp+var_2], 0Ch jl loc_CEFC - xor ax, ax - out 7Ch, ax + GRCG_OFF_VIA_XOR ax pushd 0 push 27F00C7h call grc_setclip @@ -9499,8 +9495,7 @@ loc_EF8A: rep movsd sub di, 74h ; 't' jnb short loc_EF8A - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al xor si, si add di, 3980h mov ax, gs @@ -26634,8 +26629,7 @@ loc_17D9C: inc di cmp di, 140h jb short loc_17D71 - xor ax, ax - out 7Ch, ax + GRCG_OFF_VIA_XOR ax pop di pop si leave diff --git a/th03_zunsp.asm b/th03_zunsp.asm index d8a06276..42934154 100644 --- a/th03_zunsp.asm +++ b/th03_zunsp.asm @@ -17,6 +17,8 @@ .386 ; ... then switch to what we actually need. ; And yes, we can't move this to an include file for some reason. +include libs/master.lib/macros.inc + ; =========================================================================== ; Segment type: Pure code @@ -1960,8 +1962,7 @@ sub_BD0 proc near mov al, 6 out 6Ah, al ; PC-98 GDC (6a): ; - mov al, 80h - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov dx, 4A0h mov ax, 0FFF0h out dx, ax @@ -2012,8 +2013,7 @@ sub_C10 proc near mov al, 6 out 6Ah, al ; PC-98 GDC (6a): ; - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al sti pop dx pop ax diff --git a/th04_main.asm b/th04_main.asm index 4e26d36a..148bbbe4 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -393,9 +393,7 @@ loc_ABD8: call loc_BD64 call sub_12CE5 call sub_C718 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx call fp_259DC call fp_259DE call sub_CD36 @@ -2639,9 +2637,7 @@ loc_BF7A: add [bp+var_6], 10h cmp [bp+var_6], 180h jb short loc_BF39 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di leave retn 2 @@ -2942,8 +2938,7 @@ sub_C148 endp sub_C156 proc near - mov al, GC_RMW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_RMW retn sub_C156 endp @@ -2954,8 +2949,7 @@ sub_C156 endp sub_C15C proc near - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW retn sub_C15C endp @@ -4662,16 +4656,14 @@ sub_CBB8 endp sub_CBFA proc near - mov al, GC_OFF - out 7Ch, al + GRCG_OFF_VIA_MOV al mov al, 7 out 6Ah, al ; PC-98 GDC (6a): ; mov al, 5 out 6Ah, al ; PC-98 GDC (6a): ; - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov al, 6 out 6Ah, al ; PC-98 GDC (6a): ; @@ -5197,9 +5189,7 @@ loc_D005: add di, 28h ; '(' dec dx jnz short loc_CFF0 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop bp retn 6 @@ -6374,9 +6364,7 @@ loc_D93D: loc_D943: cmp [bp+var_6], 2 jl loc_D8A5 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si leave @@ -7929,9 +7917,7 @@ loc_E449: loc_E44F: cmp [bp+var_2], 2 jl loc_E2D6 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si leave @@ -8572,9 +8558,7 @@ loc_E98E: push ax push dx call grcg_circlefill - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push si push di push 80h @@ -8632,9 +8616,7 @@ loc_EA0D: call super_put loc_EA55: - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx loc_EA5B: call sub_D88C @@ -9017,9 +8999,7 @@ loc_ECC7: call grcg_line loc_ECF4: - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx mov si, 0B204h xor di, di jmp short loc_ED68 @@ -11674,9 +11654,7 @@ var_1 = byte ptr -1 mov ah, 0Fh call sub_C162 call sub_1200A - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push (32 shl 16) or 56 push 0 call _cdg_put_noalpha @@ -11731,9 +11709,7 @@ loc_100FE: call sub_C162 push 0 call sub_1030D - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx leave retn sub_1004D endp @@ -11753,9 +11729,7 @@ var_2 = word ptr -2 mov ah, 1 call sub_C162 call sub_1200A - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push (32 shl 16) or 56 push 0 call _cdg_put_noalpha @@ -11839,9 +11813,7 @@ loc_101F4: call sub_C162 push 1 call sub_1030D - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop si leave retn @@ -12348,9 +12320,7 @@ loc_105A6: loc_105AA: cmp di, 44h ; 'D' jl short loc_10570 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si pop bp @@ -13175,9 +13145,7 @@ loc_10C6F: mov dx, [bp+var_2] push word_259B4 call sub_C546 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp loc_10D47 ; --------------------------------------------------------------------------- @@ -13643,9 +13611,7 @@ loc_10FA1: push 0C80h push stage_title_len call sub_10EA5 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp loc_1118F ; --------------------------------------------------------------------------- @@ -13788,9 +13754,7 @@ loc_11128: push 0C80h push stage_title_len call sub_10EA5 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx test byte_259E0, 3 jnz short loc_1118F cmp byte_259E0, 0 @@ -13856,9 +13820,7 @@ loc_111D8: push 1680h push word_259C6 call sub_10EA5 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp loc_112D2 ; --------------------------------------------------------------------------- @@ -13912,9 +13874,7 @@ loc_1127E: push 1680h push word_259C6 call sub_10EA5 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx test byte_22EA3, 3 jnz short loc_112D2 cmp byte_22EA3, 0 @@ -14575,9 +14535,7 @@ var_2 = word ptr -2 add ax, 0Ch push ax call grcg_circle - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp loc_11961 ; --------------------------------------------------------------------------- @@ -14791,9 +14749,7 @@ var_2 = word ptr -2 add ax, 0Ch push ax call grcg_circle - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp short loc_11A90 ; --------------------------------------------------------------------------- @@ -15044,9 +15000,7 @@ loc_11BD1: add ax, [si+10h] push ax call grcg_circle - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx loc_11C16: pop di @@ -15570,8 +15524,7 @@ sub_1200A endp sub_12024 proc near cli - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov dx, 7Eh ; '~' mov al, 0FFh out dx, al @@ -15595,8 +15548,7 @@ sub_12024 proc near xor di, di rep stosd pop di - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al retn sub_12024 endp @@ -15764,9 +15716,7 @@ arg_0 = byte ptr 4 mov ah, [bp+arg_0] call sub_C162 call fp_2CDCC - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop bp retn 6 sub_12157 endp @@ -16006,9 +15956,7 @@ loc_12309: mov ah, 1 call sub_C162 call sub_BEDA - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push (96 shl 16) or 72 push 16 call _cdg_put_noalpha @@ -16088,9 +16036,7 @@ loc_12396: mov ah, 0 call sub_C162 call sub_BFF8 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push (128 shl 16) or 128 push 16 call _cdg_put_noalpha @@ -16703,9 +16649,7 @@ loc_1284C: loc_1286D: cmp di, 38h ; '8' jl short loc_12834 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si leave @@ -16762,9 +16706,7 @@ var_1 = byte ptr -1 mov ah, 1 call sub_C162 call sub_1205A - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx cmp word_2671A, 2 jnz loc_12975 mov si, 0BA92h @@ -16834,9 +16776,7 @@ loc_12964: mov ah, 1 call sub_C162 call sub_1205A - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx loc_12972: call sub_12461 @@ -16889,9 +16829,7 @@ loc_129B4: mov ah, 1 call sub_C162 call sub_C148 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push (32 shl 16) or 16 push 16 call _cdg_put_noalpha @@ -18851,8 +18789,7 @@ sub_13EF6 endp sub_13F10 proc near - mov al, 0C0h - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_RMW retn sub_13F10 endp diff --git a/th04_maine.asm b/th04_maine.asm index 1b4dd541..d68dd958 100644 --- a/th04_maine.asm +++ b/th04_maine.asm @@ -1608,9 +1608,7 @@ loc_AC70: push 140040h push 3B0107h call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp short loc_ACF0 ; --------------------------------------------------------------------------- @@ -2025,9 +2023,7 @@ loc_AEF1: mov al, byte_124C7 add al, 40h mov byte_124C7, al - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx loc_B027: pop di @@ -2157,9 +2153,7 @@ loc_B04E: push ax push 3 call _cdg_put_plane - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx loc_B13E: pop di @@ -2289,9 +2283,7 @@ loc_B165: push ax push 3 call _cdg_put_plane - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx loc_B255: pop di @@ -5140,16 +5132,14 @@ off_CB9E dw offset loc_CA9A sub_CBB0 proc near push bp mov bp, sp - mov al, GC_OFF - out 7Ch, al + GRCG_OFF_VIA_MOV al mov al, 7 out 6Ah, al ; PC-98 GDC (6a): ; mov al, 5 out 6Ah, al ; PC-98 GDC (6a): ; - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov al, 6 out 6Ah, al ; PC-98 GDC (6a): ; @@ -5335,11 +5325,7 @@ loc_D1FC: push di push ds mov dx, [bp+0Ah] - mov al, GC_RMW - pushf - cli - out 7Ch, al - popf + GRCG_NOINT_SETMODE_VIA_MOV al, GC_RMW shr dx, 1 sbb al, al out 7Eh, al @@ -5452,8 +5438,7 @@ loc_D2DC: loc_D2E5: mov al, 0Ah out 68h, al - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al pop ds pop di pop si diff --git a/th04_op.asm b/th04_op.asm index 104b065b..9eed31f5 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -608,9 +608,7 @@ loc_AB54: call _cdg_put_nocolors loc_AB59: - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx cmp [bp+arg_0], 8 jnz short loc_ABC4 call _cdg_put pascal, 256, di, 35 @@ -831,9 +829,7 @@ loc_AD87: mov si, 15h loc_AD9A: - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx cmp [bp+arg_0], 8 jnz short loc_AE11 call _cdg_put pascal, di, [bp+var_4], 35 @@ -2804,9 +2800,7 @@ sub_C244 proc near call sub_BFA7 call grcg_setcolor pascal, ((GC_RMW or GC_B) shl 16) + 15 call polygons_update_and_render - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx mov dx, 0A4h ; '' mov al, byte ptr word_12DBC+1 out dx, al @@ -4020,9 +4014,7 @@ var_2 = word ptr -2 pushd 0 push 4F018Fh call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push 0 call graph_copy_page call pi_slot_load pascal, 0, ds, offset aOp5b_pi @@ -4584,9 +4576,7 @@ loc_D269: loc_D273: cmp di, 0F4h jl short loc_D235 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si leave @@ -4741,9 +4731,7 @@ loc_D353: push ax push 8 call grcg_round_boxfill - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si pop bp @@ -4777,9 +4765,7 @@ sub_D3A2 proc near push 60120h push 250127h call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push 0 jmp short loc_D460 ; --------------------------------------------------------------------------- @@ -4802,9 +4788,7 @@ loc_D407: push 2A0120h push 490127h call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push 1 loc_D460: @@ -5028,9 +5012,7 @@ sub_D595 proc near push ax push 8 call grcg_round_boxfill - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push 98h lea ax, [si+4] push ax @@ -5072,9 +5054,7 @@ loc_D66C: push 180120h push 370127h call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx call sub_D595 mov al, byte_132B9 mov ah, 0 @@ -5568,11 +5548,7 @@ arg_8 = word ptr 0Eh push di push ds mov dx, [bp+arg_4] - mov al, GC_RMW - pushf - cli - out 7Ch, al - popf + GRCG_NOINT_SETMODE_VIA_MOV al, GC_RMW shr dx, 1 sbb al, al out 7Eh, al @@ -5685,8 +5661,7 @@ loc_DF94: loc_DF9D: mov al, 0Ah out 68h, al - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al pop ds pop di pop si @@ -5949,8 +5924,7 @@ sub_E3E8 proc near pop es pushf cli - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov byte ptr es:[495h], al popf pop es diff --git a/th05_main.asm b/th05_main.asm index d55a16e5..db28f4f9 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -443,9 +443,7 @@ loc_AF2D: call sub_C346 call sub_100C6 call sub_ED54 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx call fp_2CE88 call fp_2CE8A call sub_10287 @@ -1882,16 +1880,14 @@ sub_BBE8 endp sub_BC2A proc near - mov al, GC_OFF - out 7Ch, al + GRCG_OFF_VIA_MOV al mov al, 7 out 6Ah, al ; PC-98 GDC (6a): ; mov al, 5 out 6Ah, al ; PC-98 GDC (6a): ; - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov al, 6 out 6Ah, al ; PC-98 GDC (6a): ; @@ -3720,9 +3716,7 @@ loc_C989: loc_C98D: cmp di, 8 jl loc_C8E4 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si leave @@ -3981,9 +3975,7 @@ sub_CB30 proc near call grcg_circle loc_CBE4: - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx mov al, byte_2429B mov ah, 0 add ax, 64h ; 'd' @@ -4359,8 +4351,7 @@ sub_CEC2 proc near push di pushf cli - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov dx, 7Eh ; '~' mov al, 0FFh out dx, al @@ -4381,8 +4372,7 @@ loc_CEDB: sub di, 56h ; 'V' jge short loc_CEDB pop di - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al retn sub_CEC2 endp @@ -4394,8 +4384,7 @@ sub_CEF2 proc near push di pushf cli - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov dx, 7Eh ; '~' mov al, 0FFh out dx, al @@ -4418,8 +4407,7 @@ loc_CF0D: sub di, 5Ah ; 'Z' jge short loc_CF0D pop di - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al retn sub_CEF2 endp @@ -4459,8 +4447,7 @@ sub_CF50 proc near push di pushf cli - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov dx, 7Eh ; '~' mov al, 0FFh out dx, al @@ -4515,8 +4502,7 @@ loc_CFAC: sub di, 54h ; 'T' jge short loc_CFAC pop di - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al retn sub_CF50 endp @@ -4530,8 +4516,7 @@ sub_CFBA proc near push di pushf cli - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov dx, 7Eh ; '~' xor al, al out dx, al @@ -4552,8 +4537,7 @@ loc_CFD5: sub di, 58h ; 'X' jge short loc_CFD5 pop di - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al retn sub_CFBA endp @@ -4563,8 +4547,7 @@ sub_CFBA endp sub_CFEE proc near cli - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov dx, 7Eh ; '~' mov al, 0FFh out dx, al @@ -4588,8 +4571,7 @@ sub_CFEE proc near xor di, di rep stosd pop di - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al retn sub_CFEE endp @@ -4652,9 +4634,7 @@ arg_4 = word ptr 8 mov ah, [bp+arg_0] call sub_E6EE call fp_2449A - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop bp retn 6 sub_D065 endp @@ -4756,9 +4736,7 @@ loc_D124: mov ah, 1 call sub_E6EE call sub_DEA6 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push (32 shl 16) or 16 push 16 call _cdg_put_noalpha @@ -4836,9 +4814,7 @@ loc_D1B0: mov ah, 1 call sub_E6EE call sub_DEB4 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push (32 shl 16) or 221 push 16 call _cdg_put_noalpha @@ -4917,9 +4893,7 @@ loc_D23E: mov ah, 1 call sub_E6EE call sub_DEC2 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push (96 shl 16) or 72 push 16 call _cdg_put_noalpha @@ -4994,9 +4968,7 @@ loc_D2C7: mov ah, 1 call sub_E6EE call sub_E01E - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push (32 shl 16) or 16 push 16 call _cdg_put_noalpha @@ -5486,9 +5458,7 @@ loc_D630: push 3B4Eh push 0 call sub_D4F8 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si pop bp @@ -5752,9 +5722,7 @@ loc_D82E: push 3B4Eh push 0 call sub_D4F8 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si leave @@ -5980,9 +5948,7 @@ loc_D9C6: push 3B4Eh push 0 call sub_D4F8 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si leave @@ -6136,9 +6102,7 @@ loc_DB0A: call sub_DA25 call grcg_setcolor pascal, (GC_RMW shl 16) + 6 call sub_D327 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx leave retn sub_DA86 endp @@ -6317,9 +6281,7 @@ loc_DCC5: mov ah, 0 push ax call sub_DB33 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si pop bp @@ -6814,9 +6776,7 @@ loc_DFA1: add [bp+var_6], 10h cmp [bp+var_6], 180h jb short loc_DF59 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di leave retn 2 @@ -7918,8 +7878,7 @@ sub_E696 endp sub_E6E2 proc near - mov al, GC_RMW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_RMW retn sub_E6E2 endp @@ -7930,8 +7889,7 @@ sub_E6E2 endp sub_E6E8 proc near - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW retn sub_E6E8 endp @@ -8352,8 +8310,7 @@ sub_E914 endp sub_E92E proc near pushf cli - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov dx, 7Eh ; '~' xor al, al out dx, al @@ -8367,8 +8324,7 @@ sub_E92E proc near assume es:nothing mov di, 72B4h call sub_D024 - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al pop di retn sub_E92E endp @@ -8380,8 +8336,7 @@ sub_E92E endp sub_E950 proc near pushf cli - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov dx, 7Eh ; '~' xor al, al out dx, al @@ -8394,8 +8349,7 @@ sub_E950 proc near mov es, ax mov di, 4AB4h call sub_D024 - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al pop di retn sub_E950 endp @@ -9135,9 +9089,7 @@ loc_EEE1: add di, 28h ; '(' dec dx jnz short loc_EECC - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop bp retn 6 @@ -10014,9 +9966,7 @@ loc_F5D2: loc_F5D8: cmp [bp+var_6], 2 jl loc_F539 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si leave @@ -12778,9 +12728,7 @@ loc_10BFD: call grcg_circlefill loc_10C1F: - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx loc_10C25: mov bx, [bp+var_2] @@ -12805,9 +12753,7 @@ loc_10C3E: push [bp+var_8] push di call grcg_hline - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp short loc_10C96 ; --------------------------------------------------------------------------- @@ -14086,9 +14032,7 @@ loc_115CE: loc_115D4: cmp [bp+var_2], 40h jl short loc_11568 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx cmp frame_mod4, 0 jnz short loc_1162C cmp byte_2CE4C, 0 @@ -14864,9 +14808,7 @@ loc_11B19: push 0C80h push word_2CE6A call sub_11A1D - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp loc_11CB5 ; --------------------------------------------------------------------------- @@ -14970,9 +14912,7 @@ loc_11C4E: push 0C80h push word_2CE6A call sub_11A1D - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx test byte_2CE8C, 3 jnz short loc_11CB5 cmp byte_2CE8C, 0 @@ -15038,9 +14978,7 @@ loc_11CFE: push 1680h push word_2CE6E call sub_11A1D - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp loc_11DE4 ; --------------------------------------------------------------------------- @@ -15082,9 +15020,7 @@ loc_11D90: push 1680h push word_2CE6E call sub_11A1D - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx test byte_2288B, 3 jnz short loc_11DE4 cmp byte_2288B, 0 @@ -15642,9 +15578,7 @@ loc_122D5: mov dx, [bp+var_2] push 1Ah call sub_E148 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp loc_123A9 ; --------------------------------------------------------------------------- @@ -16079,9 +16013,7 @@ loc_12631: loc_12637: cmp [bp+var_2], 18h jl short loc_12609 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si leave @@ -22061,8 +21993,7 @@ sub_15A04 proc near sub_15A04 endp ; --------------------------------------------------------------------------- - mov al, 0C0h - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_RMW retn ; --------------------------------------------------------------------------- nop diff --git a/th05_maine.asm b/th05_maine.asm index 72c136fb..e3a7bed7 100644 --- a/th05_maine.asm +++ b/th05_maine.asm @@ -157,11 +157,7 @@ arg_4 = word ptr 0Ah lodsw cmp al, 80h jnz short loc_2E3F - mov al, GC_RMW - pushf - cli - out 7Ch, al - popf + GRCG_NOINT_SETMODE_VIA_MOV al, GC_RMW push ax mov dx, bp mov al, 50h ; 'P' @@ -1336,9 +1332,7 @@ loc_ADE3: push 140040h push 3B0107h call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp short loc_AE64 ; --------------------------------------------------------------------------- @@ -1891,9 +1885,7 @@ arg_2 = word ptr 6 push 4F018Fh call grcg_byteboxfill_x call sub_B37C - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx mov PaletteTone, 64h ; 'd' call far ptr palette_show call pi_slot_palette_apply pascal, 0 @@ -2029,9 +2021,7 @@ sub_B3CB proc near pushd 0 push 4F018Fh call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx mov allcast_screen_plus_one, 0 push 0 mov al, byte_15018 @@ -3073,9 +3063,7 @@ loc_BB00: lea ax, [di+10h] push ax call grcg_hline - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si pop bp @@ -6929,9 +6917,7 @@ loc_DBFF: dec ax push ax call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx mov al, 2 jmp loc_DCF6 ; --------------------------------------------------------------------------- @@ -7457,9 +7443,7 @@ var_2 = word ptr -2 dec ax push ax call grcg_boxfill - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx xor di, di jmp short loc_E098 ; --------------------------------------------------------------------------- @@ -7528,9 +7512,7 @@ loc_E0A6: push [bp+var_4] push 10h call grcg_circlefill - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx loc_E0F6: inc di @@ -7585,9 +7567,7 @@ loc_E161: mov ah, 0 push ax call grcg_circlefill - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx loc_E18B: sub si, 14h @@ -7770,9 +7750,7 @@ loc_E21D: add ax, 7 push ax call grcg_boxfill - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si leave @@ -7898,9 +7876,7 @@ loc_E406: add di, 28h ; '(' dec dx jnz short loc_E406 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si pop bp @@ -7933,9 +7909,7 @@ var_2 = word ptr -2 pushd 0 push 4F018Fh call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx call sub_D21D push 3700h call sub_E39F @@ -7949,9 +7923,7 @@ var_2 = word ptr -2 pushd 0 push 4F018Fh call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx call snd_load pascal, ds, offset aStaff, SND_LOAD_SONG kajacall KAJA_SONG_PLAY call _cdg_load_all_noalpha pascal, 0, ds, offset aStf00_cdg @@ -8302,11 +8274,7 @@ arg_8 = word ptr 0Eh push di push ds mov dx, [bp+arg_4] - mov al, GC_RMW - pushf - cli - out 7Ch, al - popf + GRCG_NOINT_SETMODE_VIA_MOV al, GC_RMW shr dx, 1 sbb al, al out 7Eh, al @@ -8419,8 +8387,7 @@ loc_E9F4: loc_E9FD: mov al, 0Ah out 68h, al - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al pop ds pop di pop si @@ -9112,8 +9079,7 @@ sub_F478 proc near pop es pushf cli - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov es:[495h], al popf pop es diff --git a/th05_op.asm b/th05_op.asm index d2e28f51..1409fe1a 100644 --- a/th05_op.asm +++ b/th05_op.asm @@ -512,9 +512,7 @@ loc_A695: call _cdg_put_nocolors loc_A69A: - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx cmp [bp+arg_0], 0Eh jnz short loc_A705 call _cdg_put pascal, 256, di, 35 @@ -734,9 +732,7 @@ loc_A8C7: mov si, 15h loc_A8DA: - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx cmp [bp+arg_0], 0Eh jnz short loc_A951 call _cdg_put pascal, di, [bp+var_4], 35 @@ -2815,9 +2811,7 @@ var_1 = byte ptr -1 pushd 0 push 4F018Fh call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push 1 call graph_copy_page mov [bp+var_1], 1 @@ -3000,9 +2994,7 @@ arg_2 = byte ptr 6 lea ax, [si+6Fh] push ax call grcg_vline - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx jmp short loc_BF05 ; --------------------------------------------------------------------------- @@ -3191,9 +3183,7 @@ sub_C293 proc near call sub_D96E call grcg_setcolor pascal, ((GC_RMW or GC_B) shl 16) + 15 call polygons_update_and_render - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx push 1 call frame_delay mov dx, 0A4h @@ -4626,9 +4616,7 @@ loc_CEDB: loc_CEE5: cmp di, 0A0h jl short loc_CEA7 - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx pop di pop si leave @@ -4749,9 +4737,7 @@ loc_CF8C: lea ax, [di+9Fh] push ax call grcg_byteboxfill_x - mov dx, 7Ch - mov al, GC_OFF - out dx, al + GRCG_OFF_CLOBBERING dx mov al, byte ptr word_14118 mov ah, 0 imul ax, 5 @@ -5152,11 +5138,7 @@ arg_8 = word ptr 0Eh push di push ds mov dx, [bp+arg_4] - mov al, GC_RMW - pushf - cli - out 7Ch, al - popf + GRCG_NOINT_SETMODE_VIA_MOV al, GC_RMW shr dx, 1 sbb al, al out 7Eh, al @@ -5269,8 +5251,7 @@ loc_D516: loc_D51F: mov al, 0Ah out 68h, al - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al pop ds pop di pop si @@ -5509,8 +5490,7 @@ include th04/math/vector2_at.asm sub_D894 proc far push si push di - mov al, GC_RMW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_RMW mov ax, 0A800h mov es, ax assume es:nothing @@ -5582,8 +5562,7 @@ sub_D894 proc far mov al, 8 mov di, 318Eh call sub_DB0D - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al push ds mov ah, PMD_GET_WORKAREA_ADDRESS int 60h @@ -5606,8 +5585,7 @@ sub_D96E proc far push ds push ds pop fs - mov al, GC_RMW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_RMW mov ax, 0A800h mov es, ax mov di, 3020h @@ -5641,8 +5619,7 @@ sub_D96E proc far add bx, 2 call sub_DA12 call near ptr sub_DA6B - xor al, al - out 7Ch, al + GRCG_OFF_VIA_XOR al pop ds pop di pop si @@ -6374,8 +6351,7 @@ sub_E354 proc near pop es pushf cli - mov al, GC_TDW - out 7Ch, al + GRCG_SETMODE_VIA_MOV al, GC_TDW mov es:[495h], al popf pop es