|
|
| version 1.12, 2004/03/19 00:30:01 | version 1.18, 2011/01/15 18:04:43 |
|---|---|
| Line 30 void mouseif_sync(void) { | Line 30 void mouseif_sync(void) { |
| static void calc_mousexy(void) { | static void calc_mousexy(void) { |
| UINT32 clock; | UINT32 clk; |
| SINT32 diff; | SINT32 diff; |
| clock = CPU_CLOCK + CPU_BASECLOCK + CPU_REMCLOCK; | clk = CPU_CLOCK + CPU_BASECLOCK + CPU_REMCLOCK; |
| diff = clock - mouseif.lastc; | diff = clk - mouseif.lastc; |
| if (diff >= 2000) { | if (diff >= 2000) { |
| SINT32 dx; | SINT32 dx; |
| SINT32 dy; | SINT32 dy; |
| Line 114 static void setportc(REG8 value) { | Line 114 static void setportc(REG8 value) { |
| if ((value ^ mouseif.upd8255.portc) & 0x10) { | if ((value ^ mouseif.upd8255.portc) & 0x10) { |
| if (!(value & 0x10)) { | if (!(value & 0x10)) { |
| if (!nevent_iswork(NEVENT_MOUSE)) { | if (!nevent_iswork(NEVENT_MOUSE)) { |
| // 割り込みを入れとく | |
| pic_setirq(0x0d); | |
| nevent_set(NEVENT_MOUSE, mouseif.intrclock << mouseif.timing, | nevent_set(NEVENT_MOUSE, mouseif.intrclock << mouseif.timing, |
| mouseint, NEVENT_ABSOLUTE); | mouseint, NEVENT_ABSOLUTE); |
| } | } |
| Line 151 static void IOOUTCALL mouseif_o7fdf(UINT | Line 153 static void IOOUTCALL mouseif_o7fdf(UINT |
| portc = 0; | portc = 0; |
| if (dat & uPD8255_CTRL) { | if (dat & uPD8255_CTRL) { |
| mouseif.upd8255.mode = (UINT8)dat; | mouseif.upd8255.mode = (UINT8)dat; |
| #if 0 | |
| pic_resetirq(0x0d); | pic_resetirq(0x0d); |
| nevent_set(NEVENT_MOUSE, mouseif.intrclock << mouseif.timing, | nevent_set(NEVENT_MOUSE, mouseif.intrclock << mouseif.timing, |
| mouseint, NEVENT_ABSOLUTE); | mouseint, NEVENT_ABSOLUTE); |
| #endif | |
| } | } |
| else { | else { |
| sft = (dat >> 1) & 7; | sft = (dat >> 1) & 7; |
| Line 179 static REG8 IOINPCALL mouseif_i7fd9(UINT | Line 183 static REG8 IOINPCALL mouseif_i7fd9(UINT |
| ret |= mouseif.rapid; | ret |= mouseif.rapid; |
| } | } |
| ret &= 0xf0; | ret &= 0xf0; |
| #if 1 | |
| ret |= 0x40; // for shizuku | |
| #else | |
| ret |= 0x50; | ret |= 0x50; |
| #endif | |
| portc = mouseif.upd8255.portc; | portc = mouseif.upd8255.portc; |
| if (portc & 0x80) { | if (portc & 0x80) { |
| x = mouseif.latch_x; | x = mouseif.latch_x; |
| Line 230 static REG8 IOINPCALL mouseif_i7fdd(UINT | Line 238 static REG8 IOINPCALL mouseif_i7fdd(UINT |
| if (mode & uPD8255_PORTCL) { | if (mode & uPD8255_PORTCL) { |
| ret &= 0xf0; | ret &= 0xf0; |
| ret |= 0x08; | ret |= 0x08; |
| ret |= (np2cfg.dipsw[2] >> 5) & 0x04; | ret |= (pccore.dipsw[2] >> 5) & 0x04; |
| ret |= ((~np2cfg.dipsw[0]) >> 4) & 0x03; | ret |= ((~pccore.dipsw[0]) >> 4) & 0x03; |
| } | } |
| (void)port; | (void)port; |
| return(ret); | return(ret); |
| Line 246 static void IOOUTCALL mouseif_obfdb(UINT | Line 254 static void IOOUTCALL mouseif_obfdb(UINT |
| // ---- I/F | // ---- I/F |
| void mouseif_reset(void) { | void mouseif_reset(const NP2CFG *pConfig) { |
| ZeroMemory(&mouseif, sizeof(mouseif)); | ZeroMemory(&mouseif, sizeof(mouseif)); |
| mouseif.upd8255.porta = 0x00; | mouseif.upd8255.porta = 0x00; |
| mouseif.upd8255.portb = 0x00; | mouseif.upd8255.portb = 0x00; |
| mouseif.upd8255.portc = 0x10; | mouseif.upd8255.portc = 0xf0; // ver0.82 |
| mouseif.upd8255.mode = 0x93; | mouseif.upd8255.mode = 0x93; |
| mouseif.intrclock = pccore.realclock / 120; | mouseif.intrclock = pccore.realclock / 120; |
| mouseif.moveclock = pccore.realclock / 56400; | mouseif.moveclock = pccore.realclock / 56400; |
| mouseif.latch_x = -1; | |
| mouseif.latch_y = -1; | |
| (void)pConfig; | |
| } | } |
| void mouseif_bind(void) { | void mouseif_bind(void) { |