--- np2/io/cgrom.c 2004/02/07 21:23:22 1.8 +++ np2/io/cgrom.c 2007/11/03 00:00:20 1.15 @@ -27,11 +27,16 @@ static void cgwindowset(CGROM cr) { cgwindow.writable |= 1; high += cr->lr; } + else if ((code >= 0x09) && (code < 0x0c)) { // ver0.78 + if (cr->lr) { + high = low; + } + } else if (((code >= 0x0c) && (code < 0x10)) || ((code >= 0x58) && (code < 0x60))) { high += cr->lr; } - else if ((code < 0x08) || (code >= 0x10)) { + else { low = high; high += 0x800; } @@ -57,6 +62,7 @@ static void IOOUTCALL cgrom_oa1(UINT por CGROM cr; +// TRACEOUT(("%.4x:%.2x [%.4x:%.4x]", port, dat, CPU_CS, CPU_IP)); cr = &cgrom; cr->code = (dat << 8) | (cr->code & 0xff); cgwindowset(cr); @@ -68,6 +74,7 @@ static void IOOUTCALL cgrom_oa3(UINT por CGROM cr; +// TRACEOUT(("%.4x:%.2x [%.4x:%.4x]", port, dat, CPU_CS, CPU_IP)); cr = &cgrom; cr->code = (cr->code & 0xff00) | dat; cgwindowset(cr); @@ -80,7 +87,7 @@ static void IOOUTCALL cgrom_oa5(UINT por CGROM cr; cr = &cgrom; - cr->line = dat & 0x0f; + cr->line = dat & 0x1f; cr->lr = ((~dat) & 0x20) << 6; cgwindowset(cr); (void)port; @@ -94,7 +101,7 @@ static void IOOUTCALL cgrom_oa9(UINT por cr = &cgrom; if ((cr->code & 0x007e) == 0x0056) { fontrom[((cr->code & 0x7f7f) << 4) + - cr->lr + cr->line] = (UINT8)dat; + cr->lr + (cr->line & 0x0f)] = (UINT8)dat; cgwindow.writable |= 0x80; } (void)port; @@ -103,20 +110,30 @@ static void IOOUTCALL cgrom_oa9(UINT por static REG8 IOINPCALL cgrom_ia9(UINT port) { CGROM cr; -const BYTE *ptr; +const UINT8 *ptr; + int type; cr = &cgrom; ptr = fontrom; - if (cr->code & 0xff00) { + type = cr->code & 0x00ff; + if ((type >= 0x09) && (type < 0x0c)) { // ver0.78 + if (!cr->lr) { + ptr += (cr->code & 0x7f7f) << 4; + return(ptr[cr->line & 0x0f]); + } + } + else if (cr->code & 0xff00) { ptr += (cr->code & 0x7f7f) << 4; ptr += cr->lr; + return(ptr[cr->line & 0x0f]); } - else { + else if (!(cr->line & 0x10)) { // Ⱦ³Ñ ptr += 0x80000; ptr += cr->code << 4; + return(ptr[cr->line]); } (void)port; - return(ptr[cr->line]); + return(0); } @@ -130,7 +147,7 @@ static const IOINP cgromia1[8] = { NULL, NULL, NULL, NULL, cgrom_ia9, NULL, NULL, NULL}; -void cgrom_reset(void) { +void cgrom_reset(const NP2CFG *pConfig) { CGWINDOW cgw; @@ -144,6 +161,8 @@ void cgrom_reset(void) { cgw->fonthigh = fontrom + 0x7fff0; #endif cgw->writable = 0; + + (void)pConfig; } void cgrom_bind(void) {