From a06996af3e475d97483debae6d61876fe07790f0 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Sun, 15 Oct 2023 05:04:56 +0200 Subject: [PATCH] [Decompilation] [th04/th05] Dialog: Face unblitting Part of P0258, funded by [Anonymous] and Blue Bolt. --- th04/main/dialog/face_unput_8.asm | 43 ------------------------------- th04/main/dialog/shared.cpp | 17 ++++++++++++ th04_main.asm | 3 ++- th05_main.asm | 2 -- 4 files changed, 19 insertions(+), 46 deletions(-) delete mode 100644 th04/main/dialog/face_unput_8.asm diff --git a/th04/main/dialog/face_unput_8.asm b/th04/main/dialog/face_unput_8.asm deleted file mode 100644 index 7510ea70..00000000 --- a/th04/main/dialog/face_unput_8.asm +++ /dev/null @@ -1,43 +0,0 @@ -public @DIALOG_FACE_UNPUT_8$QUIUI -@dialog_face_unput_8$quiui proc near - -@@top = word ptr 4 -@@left = word ptr 6 - - push bp - mov bp, sp - push di - call @egc_start_copy_noframe$qv - mov ax, [bp+@@top] - mov bx, ax - shl ax, 2 - add ax, bx - add ax, GRAM_400 - mov es, ax ; ES = (GRAM_400 + (top * (ROW_SIZE / 16))) - assume es:nothing - mov di, ((FACE_H - 1) * ROW_SIZE) - mov ax, [bp+@@left] - shr ax, 3 - add di, ax - mov dx, 0A6h - mov al, _page_back - -@@y_loop: - mov cx, (FACE_W / (2 * BYTE_DOTS)) - -@@x_loop: - out dx, al ; graph_accesspage(page_back) - xor al, 1 - mov bx, es:[di] - out dx, al ; graph_accesspage(page_back ^ 1) - xor al, 1 - mov es:[di], bx - add di, 2 - loop @@x_loop - sub di, (ROW_SIZE + (FACE_W / BYTE_DOTS)) - jge short @@y_loop - call egc_off - pop di - pop bp - retn 4 -@dialog_face_unput_8$quiui endp diff --git a/th04/main/dialog/shared.cpp b/th04/main/dialog/shared.cpp index 8f5949c3..416771cb 100644 --- a/th04/main/dialog/shared.cpp +++ b/th04/main/dialog/shared.cpp @@ -139,3 +139,20 @@ void near playfield_copy_front_to_back(void) egc_off(); } + +void pascal near dialog_face_unput_8(uscreen_x_t left, uvram_y_t top) +{ + egc_start_copy_noframe(); + + // ZUN bloat: _ES = grcg_segment(0, top); + _AX = top; + _BX = _AX; + _ES = (SEG_PLANE_B + ((_AX * 4) + _BX)); + + _DI = ((FACE_H - 1) * ROW_SIZE); + _DI += (left / BYTE_DOTS); + egc_rect_interpage_16( + reinterpret_cast(_DI), FACE_W, page_back + ); + egc_off(); +} diff --git a/th04_main.asm b/th04_main.asm index b6b332ed..2f2a550b 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -1909,8 +1909,9 @@ DIALOG_TEXT segment byte public 'CODE' use16 @DIALOG_BOX_PUT$QUIUII procdesc pascal near \ left_and_top:dword, tile:word @playfield_copy_front_to_back$qv procdesc near + @DIALOG_FACE_UNPUT_8$QUIUI procdesc pascal near \ + left_and_top:dword -include th04/main/dialog/face_unput_8.asm include th04/main/dialog/box_fade_in.asm ; =============== S U B R O U T I N E ======================================= diff --git a/th05_main.asm b/th05_main.asm index 1f976544..f3b3e9e0 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -3188,8 +3188,6 @@ DIALOG_TEXT segment byte public 'CODE' use16 left_and_top:dword, tile:word @playfield_copy_front_to_back$qv procdesc near -include th04/main/dialog/face_unput_8.asm - ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame