--- np2/io/cgrom.c 2003/12/12 01:04:40 1.5 +++ np2/io/cgrom.c 2003/12/21 16:05:25 1.7 @@ -7,34 +7,43 @@ static void cgwindowset(CGROM cr) { + UINT low; + UINT high; int code; - cgwindow.low = 0x7fff0; cgwindow.writable &= ~1; + low = 0x7fff0; if (grcg.chip >= 2) { if (!(cr->code & 0xff00)) { - cgwindow.high = 0x80000 + (cr->code << 4); + high = 0x80000 + (cr->code << 4); } else { code = cr->code & 0x007f; - cgwindow.high = (cr->code & 0x7f7f) << 4; + high = (cr->code & 0x7f7f) << 4; if ((code >= 0x56) && (code < 0x58)) { cgwindow.writable |= 1; - cgwindow.high += cr->lr; + high += cr->lr; } else if (((code >= 0x0c) && (code < 0x10)) || ((code >= 0x58) && (code < 0x60))) { - cgwindow.high += cr->lr; + high += cr->lr; } else if ((code < 0x08) || (code >= 0x10)) { - cgwindow.low = cgwindow.high; - cgwindow.high += 0x800; + low = high; + high += 0x800; } } } else { - cgwindow.high = cgwindow.low; + high = low; } +#if !defined(CGWND_FONTPTR) + cgwindow.low = low; + cgwindow.high = high; +#else + cgwindow.fontlow = fontrom + low; + cgwindow.fonthigh = fontrom + high; +#endif } @@ -124,8 +133,13 @@ void cgrom_reset(void) { cgw = &cgwindow; ZeroMemory(cgw, sizeof(cgrom)); +#if !defined(CGWND_FONTPTR) cgw->low = 0x7fff0; cgw->high = 0x7fff0; +#else + cgw->fontlow = fontrom + 0x7fff0; + cgw->fonthigh = fontrom + 0x7fff0; +#endif cgw->writable = 0; }