mirror of https://github.com/nmlgc/ReC98.git
[Maintenance] Move the EGC copy setup function to a separate file
Too bad we still have to bother with renaming the function via #define in the few cases where an executable contains two or more copies of this function. We can't just make it `static`, since TH02 MAINE.EXE actually does far-call it from a different segment (and thus, translation unit). Part of P0094, funded by Yanga.
This commit is contained in:
parent
5c77db08ca
commit
a7230ba26a
|
@ -1,21 +1,4 @@
|
|||
// Alternate version that sets the value first
|
||||
#define OUTW2(port, val) __asm { \
|
||||
mov ax, val; \
|
||||
mov dx, port; \
|
||||
out dx, ax; \
|
||||
}
|
||||
|
||||
void pascal egc_start_copy(void)
|
||||
{
|
||||
egc_on();
|
||||
OUTW2(EGC_ACTIVEPLANEREG, 0xFFF0);
|
||||
OUTW2(EGC_READPLANEREG, 0x00FF);
|
||||
// EGC_COMPAREREAD | EGC_WS_PATREG | EGC_RL_MEMREAD
|
||||
OUTW2(EGC_MODE_ROP_REG, 0x3100);
|
||||
OUTW2(EGC_MASKREG, 0xFFFF);
|
||||
OUTW2(EGC_ADDRRESSREG, 0);
|
||||
OUTW2(EGC_BITLENGTHREG, 0xF);
|
||||
}
|
||||
#include "th01/hardware/egcscopy.c"
|
||||
|
||||
void egc_copy_rect_1_to_0(int x, int y, int w, int h)
|
||||
{
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
// Alternate version that sets the value first
|
||||
#define OUTW2(port, val) __asm { \
|
||||
mov ax, val; \
|
||||
mov dx, port; \
|
||||
out dx, ax; \
|
||||
}
|
||||
|
||||
void pascal egc_start_copy(void)
|
||||
{
|
||||
egc_on();
|
||||
OUTW2(EGC_ACTIVEPLANEREG, 0xFFF0);
|
||||
OUTW2(EGC_READPLANEREG, 0x00FF);
|
||||
// EGC_COMPAREREAD | EGC_WS_PATREG | EGC_RL_MEMREAD
|
||||
OUTW2(EGC_MODE_ROP_REG, 0x3100);
|
||||
OUTW2(EGC_MASKREG, 0xFFFF);
|
||||
OUTW2(EGC_ADDRRESSREG, 0);
|
||||
OUTW2(EGC_BITLENGTHREG, 0xF);
|
||||
}
|
Loading…
Reference in New Issue