|
|
| version 1.10, 2004/08/14 12:16:17 | version 1.13, 2004/08/20 23:01:16 |
|---|---|
| Line 4 | Line 4 |
| #include "iocore.h" | #include "iocore.h" |
| #include "nevent.h" | #include "nevent.h" |
| #include "vram.h" | #include "vram.h" |
| #include "makescrn.h" | |
| #include "font.h" | #include "font.h" |
| static void waithsync(void) { | |
| SINT32 clock; | |
| SINT32 h; | |
| // 必ず hsyncを待つ? | |
| // if (corestat.vsync) { | |
| // return; | |
| // } | |
| clock = nevent_getwork(NEVENT_FRAMES) << 8; | |
| h = clock % crtc.e.rasterclock8; | |
| h = crtc.e.rasterdisp8 - h; | |
| if (h < 0) { | |
| h += crtc.e.rasterclock8; | |
| } | |
| CPU_REMCLOCK -= (h >> 8); | |
| } | |
| static UINT pcg_offset(void) { | static UINT pcg_offset(void) { |
| if (tram[TRAM_ATR + 0x07ff] & 0x20) { | if (tram[TRAM_ATR + 0x07ff] & 0x20) { |
| Line 76 void IOOUTCALL pcg_o(UINT port, REG8 val | Line 96 void IOOUTCALL pcg_o(UINT port, REG8 val |
| UINT line; | UINT line; |
| if (crtc.s.SCRN_BITS & SCRN_PCGMODE) { | if (crtc.s.SCRN_BITS & SCRN_PCGMODE) { |
| waithsync(); | |
| off = pcg_offset(); | off = pcg_offset(); |
| chr = tram[TRAM_ANK + off]; | chr = tram[TRAM_ANK + off]; |
| if (tram[TRAM_KNJ + off] & 0x90) { | if (tram[TRAM_KNJ + off] & 0x90) { |
| Line 91 void IOOUTCALL pcg_o(UINT port, REG8 val | Line 112 void IOOUTCALL pcg_o(UINT port, REG8 val |
| chr = tram[TRAM_ANK + off]; | chr = tram[TRAM_ANK + off]; |
| } | } |
| chr += (port & 0x0300) - 0x100; | chr += (port & 0x0300) - 0x100; |
| pcg.d[(chr << 3) + line] = value; | if (pcg.d[(chr << 3) + line] != value) { |
| pcg.d[(chr << 3) + line] = value; | |
| scrnallflash = TRUE; | |
| } | |
| } | } |
| REG8 IOINPCALL pcg_i(UINT port) { | REG8 IOINPCALL pcg_i(UINT port) { |
| Line 105 REG8 IOINPCALL pcg_i(UINT port) { | Line 129 REG8 IOINPCALL pcg_i(UINT port) { |
| upper = port & 0x0300; | upper = port & 0x0300; |
| if (crtc.s.SCRN_BITS & SCRN_PCGMODE) { | if (crtc.s.SCRN_BITS & SCRN_PCGMODE) { |
| waithsync(); | |
| line = port & 0x0f; | line = port & 0x0f; |
| if (!upper) { | if (!upper) { |
| off = knj_offset(); | off = knj_offset(); |