|
|
| version 1.4, 2004/08/04 17:09:25 | version 1.8, 2004/08/13 04:08:33 |
|---|---|
| Line 2 | Line 2 |
| #include "z80core.h" | #include "z80core.h" |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "nevent.h" | |
| #include "vram.h" | #include "vram.h" |
| #include "font.h" | #include "font.h" |
| Line 48 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.s.CRT_YL) / crtc.s.fnty) + crtc.s.TXT_YL) | clock = nevent_getwork(NEVENT_FRAMES); |
| * crtc.s.TXT_XL + crtc.s.TXT_TOP; | if (corestat.vsync) { |
| if (pccore.HSYNC_CLK) { | clock += corestat.dispclock; |
| ret += (h_cnt * crtc.s.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 122 REG8 IOINPCALL pcg_i(UINT port) { | Line 131 REG8 IOINPCALL pcg_i(UINT port) { |
| UINT off; | UINT off; |
| int l; | int l; |
| BYTE chr,knj,val; | UINT8 chr,knj,val; |
| val = 0xff; | val = 0xff; |
| if (crtc.s.SCRN_BITS & SCRN_PCGMODE) { | if (crtc.s.SCRN_BITS & SCRN_PCGMODE) { |
| Line 132 REG8 IOINPCALL pcg_i(UINT port) { | Line 141 REG8 IOINPCALL pcg_i(UINT port) { |
| chr = tram[TRAM_ANK + off]; | chr = tram[TRAM_ANK + off]; |
| knj = tram[TRAM_KNJ + off]; | knj = tram[TRAM_KNJ + off]; |
| if (knj & 0x80) { | if (knj & 0x80) { |
| DWORD p; | UINT p; |
| p = ((((DWORD)knj << 8) | chr) & 0x1fff) << 4; | p = (((knj << 8) | chr) & 0x1fff) << 4; |
| if (knj & 0x40) { | if (knj & 0x40) { |
| val = font_knjx1t[p + l + FONTX1T_LR]; | val = font_knjx1t[p + l + FONTX1T_LR]; |
| } | } |