|
|
| version 1.11, 2004/08/12 13:32:52 | version 1.14, 2004/08/13 02:16:33 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #include "pccore.h" | #include "pccore.h" |
| #include "iocore.h" | #include "iocore.h" |
| #include "nevent.h" | |
| #include "makescrn.h" | #include "makescrn.h" |
| Line 9 | Line 10 |
| static REG8 getportb(void) { | static REG8 getportb(void) { |
| REG8 ret; | REG8 ret; |
| UINT v; | SINT32 clock; |
| ret = cmt_test(); // | cmt_read(); // THUNDER BALL | ret = cmt_test(); // | cmt_read(); // THUNDER BALL |
| v = pccore_getraster(NULL); | clock = nevent_getwork(NEVENT_FRAMES); |
| if (v < crtc.e.dl) { | if (corestat.vsync) { |
| clock += corestat.dispclock; | |
| } | |
| if (clock < crtc.e.dispclock) { | |
| ret |= 0x80; // 1:DISP | ret |= 0x80; // 1:DISP |
| } | } |
| clock -= crtc.e.vsyncstart; | |
| if ((clock >= 0) && (clock < crtc.e.vpulseclock)) { | |
| ret |= 0x04; // 1:V-SYNC | |
| } | |
| if (subcpu.IBF) { | if (subcpu.IBF) { |
| subcpu.IBF = 0; | subcpu.IBF = 0; |
| ret |= 0x40; // 1:SUB-CPU BUSY | ret |= 0x40; // 1:SUB-CPU BUSY |
| Line 27 static REG8 getportb(void) { | Line 36 static REG8 getportb(void) { |
| if (memio.ram) { | if (memio.ram) { |
| ret |= 0x10; // 1:RAM | ret |= 0x10; // 1:RAM |
| } | } |
| #if 1 | |
| if (!(v < crtc.e.vs)) { | |
| ret |= 0x04; // V-SYNC | |
| } | |
| #else // ラプラステスト…VYSNCが長すぎるらしい | |
| if (v_cnt == crtc.e.vs) { | |
| ret |= 0x04; | |
| } | |
| #endif | |
| return(ret); | return(ret); |
| } | } |
| Line 45 static void setportc(REG8 dat) { | Line 45 static void setportc(REG8 dat) { |
| UINT8 xl; | UINT8 xl; |
| oldc = ppi.portc; | oldc = ppi.portc; |
| if (crtc.s.TXT_XL == 40) { | if (crtc.s.reg[CRTCREG_HDISP] == 40) { |
| oldc |= 0x40; | oldc |= 0x40; |
| } | } |
| else { | else { |
| Line 58 static void setportc(REG8 dat) { | Line 58 static void setportc(REG8 dat) { |
| iocore.s.mode = 1; | iocore.s.mode = 1; |
| } | } |
| xl = ((dat & 0x40)?40:80); | xl = ((dat & 0x40)?40:80); |
| if (crtc.s.TXT_XL != xl) { | if (crtc.s.reg[CRTCREG_HDISP] != xl) { |
| crtc.s.TXT_XL = (UINT8)xl; | crtc.s.reg[CRTCREG_HDISP] = (UINT8)xl; |
| // crtc.s.GRP_XL = xl << 3; | crtc_bankupdate(); |
| vrambank_patch(); | |
| scrnallflash = 1; | scrnallflash = 1; |
| } | } |
| } | } |
| Line 121 REG8 IOINPCALL ppi_i(UINT port) { | Line 120 REG8 IOINPCALL ppi_i(UINT port) { |
| case 2: | case 2: |
| #if 1 | #if 1 |
| if (crtc.s.TXT_XL == 40) { | if (crtc.s.reg[CRTCREG_HDISP] == 40) { |
| ppi.portc |= 0x40; | ppi.portc |= 0x40; |
| } | } |
| else { | else { |
| Line 144 void ppi_initialize(void) { | Line 143 void ppi_initialize(void) { |
| ppi.porta = 0x00; | ppi.porta = 0x00; |
| ppi.portb = 0xff; | ppi.portb = 0xff; |
| ppi.portc = 0xff; | ppi.portc = 0xff; |
| ppi.mode = 0x9b; | ppi.mode = 0x82; |
| } | } |
| void ppi_reset(void) { | void ppi_reset(void) { |