summaryrefslogtreecommitdiffstatshomepage
path: root/src/mess/machine/coleco.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mess/machine/coleco.c')
-rw-r--r--src/mess/machine/coleco.c92
1 files changed, 0 insertions, 92 deletions
diff --git a/src/mess/machine/coleco.c b/src/mess/machine/coleco.c
index 82deef9aa8e..e95e6786903 100644
--- a/src/mess/machine/coleco.c
+++ b/src/mess/machine/coleco.c
@@ -3,98 +3,6 @@
#include "emu.h"
#include "machine/coleco.h"
-UINT8 coleco_scan_paddles(running_machine &machine, UINT8 *joy_status0, UINT8 *joy_status1)
-{
- UINT8 ctrl_sel = machine.root_device().ioport("CTRLSEL")->read_safe(0);
-
- /* which controller shall we read? */
- if ((ctrl_sel & 0x07) == 0x02) // Super Action Controller P1
- *joy_status0 = machine.root_device().ioport("SAC_SLIDE1")->read_safe(0);
- else if ((ctrl_sel & 0x07) == 0x03) // Driving Controller P1
- *joy_status0 = machine.root_device().ioport("DRIV_WHEEL1")->read_safe(0);
-
- if ((ctrl_sel & 0x70) == 0x20) // Super Action Controller P2
- *joy_status1 = machine.root_device().ioport("SAC_SLIDE2")->read_safe(0);
- else if ((ctrl_sel & 0x70) == 0x30) // Driving Controller P2
- *joy_status1 = machine.root_device().ioport("DRIV_WHEEL2")->read_safe(0);
-
- /* In principle, even if not supported by any game, I guess we could have two Super
- Action Controllers plugged into the Roller controller ports. Since I found no info
- about the behavior of sliders in such a configuration, we overwrite SAC sliders with
- the Roller trackball inputs and actually use the latter ones, when both are selected. */
- if (ctrl_sel & 0x80) // Roller controller
- {
- *joy_status0 = machine.root_device().ioport("ROLLER_X")->read_safe(0);
- *joy_status1 = machine.root_device().ioport("ROLLER_Y")->read_safe(0);
- }
-
- return *joy_status0 | *joy_status1;
-}
-
-
-UINT8 coleco_paddle_read(running_machine &machine, int port, int joy_mode, UINT8 joy_status)
-{
- UINT8 ctrl_sel = machine.root_device().ioport("CTRLSEL")->read_safe(0);
- UINT8 ctrl_extra = ctrl_sel & 0x80;
- ctrl_sel = ctrl_sel >> (port*4) & 7;
-
- /* Keypad and fire 1 (SAC Yellow Button) */
- if (joy_mode == 0)
- {
- /* No key pressed by default */
- UINT8 data = 0x0f;
- UINT16 ipt = 0xffff;
-
- if (ctrl_sel == 0) // ColecoVision Controller
- ipt = machine.root_device().ioport(port ? "STD_KEYPAD2" : "STD_KEYPAD1")->read();
- else if (ctrl_sel == 2) // Super Action Controller
- ipt = machine.root_device().ioport(port ? "SAC_KEYPAD2" : "SAC_KEYPAD1")->read();
-
- /* Numeric pad buttons are not independent on a real ColecoVision, if you push more
- than one, a real ColecoVision think that it is a third button, so we are going to emulate
- the right behaviour */
- /* Super Action Controller additional buttons are read in the same way */
- if (!(ipt & 0x0001)) data &= 0x0a; /* 0 */
- if (!(ipt & 0x0002)) data &= 0x0d; /* 1 */
- if (!(ipt & 0x0004)) data &= 0x07; /* 2 */
- if (!(ipt & 0x0008)) data &= 0x0c; /* 3 */
- if (!(ipt & 0x0010)) data &= 0x02; /* 4 */
- if (!(ipt & 0x0020)) data &= 0x03; /* 5 */
- if (!(ipt & 0x0040)) data &= 0x0e; /* 6 */
- if (!(ipt & 0x0080)) data &= 0x05; /* 7 */
- if (!(ipt & 0x0100)) data &= 0x01; /* 8 */
- if (!(ipt & 0x0200)) data &= 0x0b; /* 9 */
- if (!(ipt & 0x0400)) data &= 0x06; /* # */
- if (!(ipt & 0x0800)) data &= 0x09; /* * */
- if (!(ipt & 0x1000)) data &= 0x04; /* Blue Action Button */
- if (!(ipt & 0x2000)) data &= 0x08; /* Purple Action Button */
-
- return ((ipt & 0x4000) >> 8) | 0x30 | data;
- }
- /* Joystick and fire 2 (SAC Red Button) */
- else
- {
- UINT8 data = 0x7f;
-
- if (ctrl_sel == 0) // ColecoVision Controller
- data = machine.root_device().ioport(port ? "STD_JOY2" : "STD_JOY1")->read();
- else if (ctrl_sel == 2) // Super Action Controller
- data = machine.root_device().ioport(port ? "SAC_JOY2" : "SAC_JOY1")->read();
- else if (ctrl_sel == 3) // Driving Controller
- data = machine.root_device().ioport(port ? "DRIV_PEDAL2" : "DRIV_PEDAL1")->read();
-
- /* If any extra analog contoller enabled */
- if (ctrl_extra || ctrl_sel == 2 || ctrl_sel == 3)
- {
- if (joy_status & 0x80) data ^= 0x30;
- else if (joy_status) data ^= 0x10;
- }
-
- return data & 0x7f;
- }
-}
-
-
// ColecoVision Controller
static INPUT_PORTS_START( ctrl1 )
PORT_START("STD_KEYPAD1")