2015-02-27 22:11:47 +00:00
|
|
|
// Alternate version that sets the value first
|
|
|
|
#define OUTW2(port, val) __asm { \
|
|
|
|
mov ax, val; \
|
|
|
|
mov dx, port; \
|
|
|
|
out dx, ax; \
|
|
|
|
}
|
|
|
|
|
2015-02-28 21:37:40 +00:00
|
|
|
void pascal egc_start_copy(void)
|
2015-02-27 22:11:47 +00:00
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2015-03-10 12:59:12 +00:00
|
|
|
void egc_copy_rect_1_to_0(int x, int y, int w, int h)
|
2015-02-27 22:11:47 +00:00
|
|
|
{
|
|
|
|
register int x_end = x;
|
|
|
|
register int x_floor = x_end;
|
|
|
|
int row;
|
|
|
|
int col;
|
|
|
|
int row_p;
|
2019-12-12 14:01:13 +00:00
|
|
|
planar16_t bits;
|
2015-02-27 22:11:47 +00:00
|
|
|
int p;
|
2015-09-07 13:44:02 +00:00
|
|
|
|
2015-02-27 22:11:47 +00:00
|
|
|
x_end += w;
|
|
|
|
x_floor &= 0xFFF0;
|
|
|
|
row_p = VRAM_OFFSET(x_floor, y);
|
|
|
|
egc_start_copy();
|
|
|
|
for(row = 0; row < h; row++) {
|
|
|
|
for(col = x_floor, p = row_p; col < x_end; p += 2, col += 16) {
|
2020-01-12 19:34:42 +00:00
|
|
|
graph_accesspage_func(1); VRAM_SNAP(bits, B, p, 16);
|
|
|
|
graph_accesspage_func(0); VRAM_PUT(B, p, bits, 16);
|
2015-02-27 22:11:47 +00:00
|
|
|
}
|
|
|
|
row_p += 640 / 8;
|
|
|
|
}
|
|
|
|
egc_off();
|
|
|
|
}
|