Previous 15994 Revisions Next

r14803 Monday 26th March, 2012 at 06:21:11 UTC by Miodrag Milanović
-a7800: Added controller line pullup signals from the riot chip. Fixes two-button behavior on asteroids etc. [Huygens]
[src/mess/includes]a7800.h
[src/mess/machine]a7800.c

src/mess/machine/a7800.c
r14802r14803
4848   return input_port_read(device->machine(), "console_buttons");
4949}
5050
51static WRITE8_DEVICE_HANDLER( riot_button_pullup_w )
52{
53   a7800_state *state = device->machine().driver_data<a7800_state>();
54   state->m_p1_one_button = data & 0x04; // pin 6 of the controller port is held high by the riot chip when reading two-button controllers (from schematic)
55   state->m_p2_one_button = data & 0x10;
56}
57
5158const riot6532_interface a7800_r6532_interface =
5259{
5360   DEVCB_HANDLER(riot_joystick_r),
5461   DEVCB_HANDLER(riot_console_button_r),
5562   DEVCB_NULL,
63   DEVCB_HANDLER(riot_button_pullup_w),
5664   DEVCB_NULL
5765};
5866
r14802r14803
6876   state->m_ROM = machine.region("maincpu")->base();
6977   state->m_ispal = ispal;
7078   state->m_lines = lines;
79   state->m_p1_one_button = 1;
80   state->m_p2_one_button = 1;
7181
7282   /* standard banks */
7383   memory_set_bankptr(machine, "bank5", &state->m_ROM[0x2040]);      /* RAM0 */
r14802r14803
460470
461471READ8_HANDLER( a7800_TIA_r )
462472{
463   switch(offset)
473   a7800_state *state = space->machine().driver_data<a7800_state>();
474   switch(offset & 0x0f)
464475   {
465476      case 0x00:
466477      case 0x01:
r14802r14803
482493      case 0x0B:
483494           return((input_port_read(space->machine(), "buttons") & 0x04) << 5);
484495      case 0x0c:
485         if((input_port_read(space->machine(), "buttons") & 0x08) ||(input_port_read(space->machine(), "buttons") & 0x02))
496         if(((input_port_read(space->machine(), "buttons") & 0x08) ||(input_port_read(space->machine(), "buttons") & 0x02)) && state->m_p1_one_button)
486497            return 0x00;
487498         else
488499            return 0x80;
489500      case 0x0d:
490         if((input_port_read(space->machine(), "buttons") & 0x01) ||(input_port_read(space->machine(), "buttons") & 0x04))
501         if(((input_port_read(space->machine(), "buttons") & 0x01) ||(input_port_read(space->machine(), "buttons") & 0x04)) && state->m_p2_one_button)
491502            return 0x00;
492503         else
493504            return 0x80;
src/mess/includes/a7800.h
r14802r14803
4949   int m_maria_rm;
5050   unsigned int m_maria_charbase;
5151   bitmap_ind16 m_bitmap;
52
52   int m_p1_one_button;
53   int m_p2_one_button;
54   
5355   required_device<cpu_device> m_maincpu;
5456};
5557

Previous 15994 Revisions Next


© 1998-2018 The MESS Team