summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/tunhunt.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/tunhunt.c')
-rw-r--r--src/mame/drivers/tunhunt.c44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/mame/drivers/tunhunt.c b/src/mame/drivers/tunhunt.c
index 20520ce03a2..8050e71205b 100644
--- a/src/mame/drivers/tunhunt.c
+++ b/src/mame/drivers/tunhunt.c
@@ -103,39 +103,33 @@ static READ8_HANDLER( tunhunt_button_r )
}
-static READ8_HANDLER( dsw1_r )
+static READ8_DEVICE_HANDLER( dsw2_0r )
{
- return input_port_read(space->machine, "DSW")&0xff;
+ return (input_port_read(device->machine, "DSW")&0x0100)?0x80:0x00;
}
-static READ8_HANDLER( dsw2_0r )
+static READ8_DEVICE_HANDLER( dsw2_1r )
{
- return (input_port_read(space->machine, "DSW")&0x0100)?0x80:0x00;
+ return (input_port_read(device->machine, "DSW")&0x0200)?0x80:0x00;
}
-static READ8_HANDLER( dsw2_1r )
+static READ8_DEVICE_HANDLER( dsw2_2r )
{
- return (input_port_read(space->machine, "DSW")&0x0200)?0x80:0x00;
+ return (input_port_read(device->machine, "DSW")&0x0400)?0x80:0x00;
}
-static READ8_HANDLER( dsw2_2r )
+static READ8_DEVICE_HANDLER( dsw2_3r )
{
- return (input_port_read(space->machine, "DSW")&0x0400)?0x80:0x00;
+ return (input_port_read(device->machine, "DSW")&0x0800)?0x80:0x00;
}
-static READ8_HANDLER( dsw2_3r )
+static READ8_DEVICE_HANDLER( dsw2_4r )
{
- return (input_port_read(space->machine, "DSW")&0x0800)?0x80:0x00;
-}
-
-
-static READ8_HANDLER( dsw2_4r )
-{
- return (input_port_read(space->machine, "DSW")&0x1000)?0x80:0x00;
+ return (input_port_read(device->machine, "DSW")&0x1000)?0x80:0x00;
}
@@ -161,8 +155,8 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 )
AM_RANGE(0x2400, 0x2400) AM_WRITE(SMH_NOP) /* INT ACK */
AM_RANGE(0x2800, 0x2800) AM_WRITE(tunhunt_control_w)
AM_RANGE(0x2c00, 0x2fff) AM_WRITE(SMH_RAM) AM_BASE(&spriteram)
- AM_RANGE(0x3000, 0x300f) AM_READWRITE(pokey1_r, pokey1_w)
- AM_RANGE(0x4000, 0x400f) AM_READWRITE(pokey2_r, pokey2_w)
+ AM_RANGE(0x3000, 0x300f) AM_DEVREADWRITE(SOUND, "pokey1", pokey_r, pokey_w)
+ AM_RANGE(0x4000, 0x400f) AM_DEVREADWRITE(SOUND, "pokey2", pokey_r, pokey_w)
AM_RANGE(0x5000, 0x7fff) AM_READ(SMH_ROM)
AM_RANGE(0xfffa, 0xffff) AM_READ(SMH_ROM)
AM_RANGE(0x5000, 0xffff) AM_WRITE(SMH_ROM)
@@ -291,13 +285,21 @@ GFXDECODE_END
static const pokey_interface pokey_interface_1 =
{
- { 0 },
- dsw1_r
+ { DEVCB_NULL },
+ DEVCB_INPUT_PORT("DSW")
};
static const pokey_interface pokey_interface_2 =
{
- { input_port_1_r,input_port_2_r,dsw2_0r,dsw2_1r,dsw2_2r,dsw2_3r,dsw2_4r }
+ {
+ DEVCB_INPUT_PORT("IN1"),
+ DEVCB_INPUT_PORT("IN2"),
+ DEVCB_HANDLER(dsw2_0r),
+ DEVCB_HANDLER(dsw2_1r),
+ DEVCB_HANDLER(dsw2_2r),
+ DEVCB_HANDLER(dsw2_3r),
+ DEVCB_HANDLER(dsw2_4r)
+ }
};