--- np2/io/egc.c 2003/10/25 10:19:57 1.4 +++ np2/io/egc.c 2007/11/03 00:00:20 1.10 @@ -1,8 +1,8 @@ #include "compiler.h" -#include "memory.h" -#include "egcmem.h" +#include "cpucore.h" #include "pccore.h" #include "iocore.h" +#include "memegc.h" #include "vram.h" @@ -19,9 +19,9 @@ static const UINT16 maskword[16][4] = { {0x0000,0xffff,0xffff,0xffff}, {0xffff,0xffff,0xffff,0xffff}}; -static void IOOUTCALL egc_o4a0(UINT port, BYTE value) { +static void IOOUTCALL egc_o4a0(UINT port, REG8 value) { - if (!(vramop.operate & VOP_EGCBIT)) { + if (!(vramop.operate & (1 << VOPBIT_EGC))) { return; } @@ -91,27 +91,31 @@ static void IOOUTCALL egc_o4a0(UINT port egc.sft &= 0xff00; egc.sft |= value; egcshift(); + egc.srcmask.w = 0xffff; break; case 0x0d: egc.sft &= 0x00ff; egc.sft |= value << 8; egcshift(); + egc.srcmask.w = 0xffff; break; case 0x0e: egc.leng &= 0xff00; egc.leng |= value; egcshift(); + egc.srcmask.w = 0xffff; break; case 0x0f: egc.leng &= 0x00ff; egc.leng |= value << 8; egcshift(); + egc.srcmask.w = 0xffff; break; } } -void egc_reset(void) { +void egc_reset(const NP2CFG *pConfig) { ZeroMemory(&egc, sizeof(egc)); egc.access = 0xfff0; @@ -119,6 +123,9 @@ void egc_reset(void) { egc.mask.w = 0xffff; egc.leng = 0x000f; egcshift(); + egc.srcmask.w = 0xffff; + + (void)pConfig; } void egc_bind(void) { @@ -130,9 +137,9 @@ void egc_bind(void) { } } -void IOOUTCALL egc_w16(UINT port, UINT16 value) { +void IOOUTCALL egc_w16(UINT port, REG16 value) { - if (!(vramop.operate & VOP_EGCBIT)) { + if (!(vramop.operate & (1 << VOPBIT_EGC))) { return; } @@ -171,11 +178,13 @@ void IOOUTCALL egc_w16(UINT port, UINT16 case 0x0c: egc.sft = value; egcshift(); + egc.srcmask.w = 0xffff; break; case 0x0e: egc.leng = value; egcshift(); + egc.srcmask.w = 0xffff; break; } }