[Maintenance] master.hpp: Remove `egc_selectpat()` and `egc_setrop()`

egc_setrop() delivers nothing of value, just obscures the single thing
it does, and disrupts the visual flow of the code.
egc_selectpat() isn't much better, is used a total of two times, says
almost nothing from its name alone, and MASTER.MAN's documentation adds
so little of value that you'd want to consult hardware documentation
anyway once you try to understand it.
Not to mention that both add a dependency on master.hpp for what are
actually PC-98 hardware constants.

Part of P0284, funded by [Anonymous] and Blue Bolt.
This commit is contained in:
nmlgc 2024-05-25 19:20:06 +02:00
parent bb419fa649
commit a9c3825ce3
5 changed files with 10 additions and 21 deletions

View File

@ -150,14 +150,6 @@ EGC_SHIFT_VRAM equ 00000h ; cpu write, vram read
EGC_RL_MEMWRITE equ 00200h ; RL = pattern Register Load
EGC_RL_MEMREAD equ 00100h ; ^at mem write, <-at mem read
EGC_RL_NONE equ 00000h ; no touch
egc_selectpat macro
outw2 EGC_READPLANEREG, 000FFh
endm
egc_setrop macro mode_rop:rest
outw2 EGC_MODE_ROP_REG, mode_rop
endm
; ---
; .PI

View File

@ -114,17 +114,12 @@ long MASTER_RET dos_axdx(int axval, const char MASTER_PTR *strval);
#define EGC_RL_MEMREAD 0x0100 /* ^at mem write, <-at mem read */
#define EGC_RL_NONE 0x0000 /* no touch */
// TODO: Document and add helpful macros for the EGC raster ops
void MASTER_RET egc_on(void);
void MASTER_RET egc_off(void);
void MASTER_RET egc_start(void);
#define egc_selectpat() \
outport(EGC_READPLANEREG, 0x00ff)
// TODO: Document and add helpful macros for the EGC raster ops
#define egc_setrop(mode_rop) \
outport(EGC_MODE_ROP_REG, mode_rop)
#ifdef PC98_H
typedef void MASTER_RET egc_shift_func_t(
screen_x_t x1, vram_y_t y1, screen_x_t x2, vram_y_t y2, pixel_t dots

View File

@ -19,8 +19,8 @@ endm
EGC_SETUP_COPY macro
outw2 EGC_ACTIVEPLANEREG, 0FFF0h
egc_selectpat
egc_setrop EGC_COMPAREREAD or EGC_WS_PATREG or EGC_RL_MEMREAD
outw2 EGC_READPLANEREG, 000FFh
outw2 EGC_MODE_ROP_REG, (EGC_COMPAREREAD or EGC_WS_PATREG or EGC_RL_MEMREAD)
outw2 EGC_MASKREG, 0FFFFh
outw2 EGC_ADDRRESSREG, 0
outw2 EGC_BITLENGTHREG, 0Fh

View File

@ -23710,10 +23710,10 @@ sub_19E2F proc far
outw2 EGC_MASKREG, 0FFFFh
outw2 EGC_ADDRRESSREG, 0
outw2 EGC_BITLENGTHREG, 0Fh
egc_setrop EGC_WS_PATREG or EGC_RL_MEMREAD
outw2 EGC_MODE_ROP_REG, (EGC_WS_PATREG or EGC_RL_MEMREAD)
call @tiles_invalidate_rect$qiiii pascal, (176 shl 16) or 156, (96 shl 16) or 96
call @tiles_egc_render$qv
egc_setrop EGC_WS_ROP or 0FCh
outw2 EGC_MODE_ROP_REG, (EGC_WS_ROP or 0FCh)
mov word_26D54, 152
mov ax, _scroll_line
add word_26D54, ax

View File

@ -36,7 +36,9 @@ void DEFCONV egc_copy_rect_1_to_0_16(
_asm { cld; }
#endif
egc_start_copy();
egc_setrop(EGC_COMPAREREAD | EGC_WS_ROP | EGC_RL_MEMREAD | 0xF0);
// (EGC_COMPAREREAD | EGC_WS_ROP | EGC_RL_MEMREAD | 0xF0)
outport(EGC_MODE_ROP_REG, 0x29F0);
// Using inline assembly rather than register pseudovariables to prevent
// parameters from being moved to the SI register
@ -116,7 +118,7 @@ static void near egc_start_copy(void)
}
graph_egc_on();
outport(EGC_ACTIVEPLANEREG, 0xFFF0);
egc_selectpat();
outport(EGC_READPLANEREG, 0x00FF);
outport(EGC_MASKREG, 0xFFFF);
_DX = EGC_ADDRRESSREG;
outport(_DX, (_AX - _AX)); // :zunpet: