Previous 15994 Revisions Next

r1307 Tuesday 20th November, 2007 at 10:18:12 UTC by Curt Coder
[QL] Added joystick ports.
[src/mess/drivers]ql.c

src/mess/drivers/ql.c
r1306r1307
1717
1818   TODO:
1919
20   - joystick connections
20   - RTC register write
21   - proper pound key code (£)
2122   - speaker sound
2223   - microdrive simulation
2324   - M68008 opcode reading interface
r1306r1307
189190
190191   zx8302.tcr = data;
191192
192   /*
193   switch (data & ZX8302_MODE_MASK)
194   {
195   case ZX8302_MODE_SER1:
196      logerror("ZX8302 Mode : SER1\n");
197      break;
198   case ZX8302_MODE_SER2:
199      logerror("ZX8302 Mode : SER2\n");
200      break;
201   case ZX8302_MODE_MDV:
202      logerror("ZX8302 Mode : MDV\n");
203      break;
204   case ZX8302_MODE_NET:
205      logerror("ZX8302 Mode : NET\n");
206      break;
207   }
208   */
209
210193   timer_adjust(zx8302_txd_timer, attotime_zero, 0, ATTOTIME_IN_HZ(baud));
211194   timer_adjust(zx8302_ipc_timer, attotime_zero, 0, ATTOTIME_IN_HZ(baudx4));
212
213   //logerror("ZX8302 Baud Rate : %u\n", baud);
214195}
215196
216197static READ8_HANDLER( zx8302_status_r )
r1306r1307
284265
285266static WRITE8_HANDLER( zx8302_irq_acknowledge_w )
286267{
287   //logerror("ZX8302 Interrupt Acknowledge : %x\n", data);
288
289268   zx8302.irq &= ~data;
290269
291270   if (!zx8302.irq)
r1306r1307
306285
307286static WRITE8_HANDLER( zx8302_data_w )
308287{
309   //logerror("ZX8302 Data Write : %x\n", data);
310
311288   zx8302.tdr = data;
312289   zx8302.status |= ZX8302_STATUS_BUFFER_FULL;
313290}
r1306r1307
356333   switch (activecpu_get_pc())
357334   {
358335   case 0x759:
359      // transmit data bit from ZX8302
336      // transmit data bit to IPC
360337      zx8302.comdata = BIT(zx8302.idr, 1);
361338      break;
362339
363340   case 0x75b:
364      // end bit transfer from ZX8302
341      // end transmit
365342      zx8302.comdata = 1;
366343      zx8302.comctl = 0;
367344      break;
r1306r1307
487464
488465   */
489466
490   if (BIT(ipc.keylatch, 0)) return readinputportbytag("ROW0");// | readinputportbytag("JOY0");
491   if (BIT(ipc.keylatch, 1)) return readinputportbytag("ROW1");// | readinputportbytag("JOY1");
467   if (BIT(ipc.keylatch, 0)) return readinputportbytag("ROW0") | readinputportbytag("JOY0");
468   if (BIT(ipc.keylatch, 1)) return readinputportbytag("ROW1") | readinputportbytag("JOY1");
492469   if (BIT(ipc.keylatch, 2)) return readinputportbytag("ROW2");
493470   if (BIT(ipc.keylatch, 3)) return readinputportbytag("ROW3");
494471   if (BIT(ipc.keylatch, 4)) return readinputportbytag("ROW4");
r1306r1307
617594   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('<')
618595
619596   PORT_START_TAG("JOY0")
620   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )   PORT_PLAYER(1) PORT_8WAY
621   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )   PORT_PLAYER(1) PORT_8WAY
597   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )   PORT_PLAYER(1) PORT_8WAY PORT_CODE(KEYCODE_F4)
598   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )   PORT_PLAYER(1) PORT_8WAY PORT_CODE(KEYCODE_F1)
622599   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED )
623   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )   PORT_PLAYER(1) PORT_8WAY
624   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )PORT_PLAYER(1) PORT_8WAY
625   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )      PORT_PLAYER(1)
600   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )   PORT_PLAYER(1) PORT_8WAY PORT_CODE(KEYCODE_F2)
601   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )PORT_PLAYER(1) PORT_8WAY PORT_CODE(KEYCODE_F3)
602   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_BUTTON1 )      PORT_PLAYER(1) PORT_CODE(KEYCODE_F5)
626603   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
627604   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED )
628605
629606   PORT_START_TAG("JOY1")
630607   PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
631   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )   PORT_PLAYER(2) PORT_8WAY
632   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )   PORT_PLAYER(2) PORT_8WAY
608   PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT )   PORT_PLAYER(2) PORT_8WAY PORT_CODE(KEYCODE_LEFT)
609   PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_UP )   PORT_PLAYER(2) PORT_8WAY PORT_CODE(KEYCODE_UP)
633610   PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED )
634   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )PORT_PLAYER(2) PORT_8WAY
611   PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_JOYSTICK_RIGHT )PORT_PLAYER(2) PORT_8WAY PORT_CODE(KEYCODE_RIGHT)
635612   PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED )
636   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )      PORT_PLAYER(2)
637   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )   PORT_PLAYER(2) PORT_8WAY
613   PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_BUTTON1 )      PORT_PLAYER(2) PORT_CODE(KEYCODE_SPACE)
614   PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_JOYSTICK_DOWN )   PORT_PLAYER(2) PORT_8WAY PORT_CODE(KEYCODE_DOWN)
638615INPUT_PORTS_END
639616
640617/* Machine Drivers */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team