|
|
| version 1.6, 2004/08/12 13:32:52 | 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 "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) { |
| UINT ret; | SINT32 clock; |
| UINT h; | UINT h; |
| UINT v; | UINT v; |
| UINT ret; | |
| UINT line; | |
| v = pccore_getraster(&h); | clock = nevent_getwork(NEVENT_FRAMES); |
| if (corestat.vsync) { | |
| ret = ((v / crtc.e.fonty) * crtc.s.TXT_XL) + crtc.s.TXT_TOP; | clock += corestat.dispclock; |
| ret += (h * crtc.s.TXT_XL) / 250; | } |
| 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; // オーバーフロー |
| } | } |