|
|
| version 1.3, 2004/08/04 15:18:26 | version 1.7, 2004/08/12 20:09:42 |
|---|---|
| Line 2 | Line 2 |
| #include "z80core.h" | #include "z80core.h" |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "x1_io.h" | #include "nevent.h" |
| #include "x1_crtc.h" | |
| #include "vram.h" | #include "vram.h" |
| #include "font.h" | #include "font.h" |
| Line 50 static UINT knj_offset(void) { | Line 49 static UINT knj_offset(void) { |
| static UINT nowsyncoffset(void) { | static UINT nowsyncoffset(void) { |
| SINT32 clock; | |
| UINT h; | |
| UINT v; | |
| UINT ret; | UINT ret; |
| UINT line; | |
| ret = (((v_cnt - crtc.CRT_YL) / crtc.fnty) + crtc.TXT_YL) * crtc.TXT_XL | clock = nevent_getwork(NEVENT_FRAMES); |
| + crtc.TXT_TOP; | if (corestat.vsync) { |
| if (pccore.HSYNC_CLK) { | clock += corestat.dispclock; |
| ret += (h_cnt * crtc.TXT_XL) / pccore.HSYNC_CLK; | } |
| } | v = clock / RASTER_CLOCK; |
| h = clock - (v * RASTER_CLOCK); | |
| ret = v / crtc.e.fonty; | |
| line = v - (ret * crtc.e.fonty); | |
| ret = (ret * crtc.s.reg[CRTCREG_HDISP]) + crtc.e.pos; | |
| ret += (h * crtc.s.reg[CRTCREG_HDISP]) / RASTER_CLOCK; | |
| if (ret >= 0x0800) { | if (ret >= 0x0800) { |
| ret = 0x07ff; // オーバーフロー | ret = 0x07ff; // オーバーフロー |
| } | } |
| Line 71 void IOOUTCALL pcg_o(UINT port, REG8 val | Line 78 void IOOUTCALL pcg_o(UINT port, REG8 val |
| UINT off; | UINT off; |
| UINT l; | UINT l; |
| if (crtc.SCRN_BITS & SCRN_PCGMODE) { | if (crtc.s.SCRN_BITS & SCRN_PCGMODE) { |
| 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 127 REG8 IOINPCALL pcg_i(UINT port) { | Line 134 REG8 IOINPCALL pcg_i(UINT port) { |
| BYTE chr,knj,val; | BYTE chr,knj,val; |
| val = 0xff; | val = 0xff; |
| if (crtc.SCRN_BITS & SCRN_PCGMODE) { | if (crtc.s.SCRN_BITS & SCRN_PCGMODE) { |
| l = port & 0x0f; | l = port & 0x0f; |
| if ((port & 0xff00) == 0x1400) { | if ((port & 0xff00) == 0x1400) { |
| off = knj_offset(); | off = knj_offset(); |
| Line 143 REG8 IOINPCALL pcg_i(UINT port) { | Line 150 REG8 IOINPCALL pcg_i(UINT port) { |
| val = font_knjx1t[p + l]; | val = font_knjx1t[p + l]; |
| } | } |
| } | } |
| else if (crtc.SCRN_BITS & SCRN_CPUFONT) { | else if (crtc.s.SCRN_BITS & SCRN_CPUFONT) { |
| val = font_txt[(chr << 4) + l]; | val = font_txt[(chr << 4) + l]; |
| } | } |
| else { | else { |