Replace some *_DEVICE_HANDLER with _MEMBER calls (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2012-09-27 14:33:26 +00:00
parent 52bebe4071
commit 0e1fddec1e
77 changed files with 539 additions and 668 deletions

View File

@ -180,7 +180,7 @@ static const pia6821_interface qixsnd_pia_0_intf =
DEVCB_DEVICE_HANDLER("sndpia1", sync_sndpia1_porta_w), /* port A out */
DEVCB_DEVICE_HANDLER("discrete", qix_vol_w), /* port B out */
DEVCB_DEVICE_LINE_MEMBER("sndpia1", pia6821_device, ca1_w), /* line CA2 out */
DEVCB_HANDLER(qix_flip_screen_w), /* port CB2 out */
DEVCB_DRIVER_MEMBER(qix_state,qix_flip_screen_w), /* port CB2 out */
DEVCB_LINE(qix_pia_dint), /* IRQA */
DEVCB_LINE(qix_pia_dint) /* IRQB */
};
@ -228,7 +228,7 @@ static const pia6821_interface slithersnd_pia_0_intf =
DEVCB_NULL, /* port A out */
DEVCB_HANDLER(slither_coinctl_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_HANDLER(qix_flip_screen_w), /* port CB2 out */
DEVCB_DRIVER_MEMBER(qix_state,qix_flip_screen_w), /* port CB2 out */
DEVCB_LINE(qix_pia_dint), /* IRQA */
DEVCB_LINE(qix_pia_dint) /* IRQB */
};

View File

@ -60,7 +60,7 @@ static ADDRESS_MAP_START( master_map_io, AS_IO, 8, leland_state )
AM_RANGE(0x05, 0x05) AM_DEVWRITE_LEGACY("custom", leland_80186_command_hi_w)
AM_RANGE(0x06, 0x06) AM_DEVWRITE_LEGACY("custom", leland_80186_command_lo_w)
AM_RANGE(0x0c, 0x0c) AM_DEVWRITE_LEGACY("custom", ataxx_80186_control_w)
AM_RANGE(0x20, 0x20) AM_DEVREADWRITE_LEGACY("eeprom", ataxx_eeprom_r, ataxx_eeprom_w)
AM_RANGE(0x20, 0x20) AM_READWRITE(ataxx_eeprom_r, ataxx_eeprom_w)
AM_RANGE(0xd0, 0xef) AM_READWRITE(ataxx_mvram_port_r, ataxx_mvram_port_w)
AM_RANGE(0xf0, 0xff) AM_READWRITE(ataxx_master_input_r, ataxx_master_output_w)
ADDRESS_MAP_END

View File

@ -564,7 +564,7 @@ WRITE8_MEMBER(equites_state::equites_8155_portb_w)
equites_update_dac(machine());
}
static WRITE_LINE_DEVICE_HANDLER( equites_msm5232_gate )
WRITE_LINE_MEMBER(equites_state::equites_msm5232_gate)
{
}
@ -1111,7 +1111,7 @@ GFXDECODE_END
static const msm5232_interface equites_5232intf =
{
{ 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6, 0.47e-6 }, // verified
DEVCB_LINE(equites_msm5232_gate)
DEVCB_DRIVER_LINE_MEMBER(equites_state,equites_msm5232_gate)
};

View File

@ -222,9 +222,9 @@ static ADDRESS_MAP_START( bang_map, AS_PROGRAM, 16, gaelco2_state )
AM_RANGE(0x300000, 0x300001) AM_READ_PORT("P1")
AM_RANGE(0x300002, 0x300003) AM_READNOP /* Random number generator? */
AM_RANGE(0x300000, 0x300003) AM_WRITE(gaelco2_coin2_w) /* Coin Counters */
AM_RANGE(0x300008, 0x300009) AM_DEVWRITE_LEGACY("eeprom", gaelco2_eeprom_data_w) /* EEPROM data */
AM_RANGE(0x30000a, 0x30000b) AM_DEVWRITE_LEGACY("eeprom", gaelco2_eeprom_sk_w) /* EEPROM serial clock */
AM_RANGE(0x30000c, 0x30000d) AM_DEVWRITE_LEGACY("eeprom", gaelco2_eeprom_cs_w) /* EEPROM chip select */
AM_RANGE(0x300008, 0x300009) AM_WRITE(gaelco2_eeprom_data_w) /* EEPROM data */
AM_RANGE(0x30000a, 0x30000b) AM_WRITE(gaelco2_eeprom_sk_w) /* EEPROM serial clock */
AM_RANGE(0x30000c, 0x30000d) AM_WRITE(gaelco2_eeprom_cs_w) /* EEPROM chip select */
AM_RANGE(0x300010, 0x300011) AM_READ_PORT("P2")
AM_RANGE(0x300020, 0x300021) AM_READ_PORT("COIN")
AM_RANGE(0x310000, 0x310001) AM_READ(p1_gun_x) AM_WRITE(bang_clr_gun_int_w) /* Gun 1P X */ /* CLR INT Gun */
@ -913,9 +913,9 @@ static ADDRESS_MAP_START( snowboar_map, AS_PROGRAM, 16, gaelco2_state )
AM_RANGE(0x218004, 0x218009) AM_RAM AM_SHARE("vregs") /* Video Registers */
AM_RANGE(0x300000, 0x300001) AM_READ_PORT("P1")
AM_RANGE(0x300000, 0x300003) AM_WRITE(gaelco2_coin2_w) /* Coin Counters */
AM_RANGE(0x300008, 0x300009) AM_DEVWRITE_LEGACY("eeprom", gaelco2_eeprom_data_w) /* EEPROM data */
AM_RANGE(0x30000a, 0x30000b) AM_DEVWRITE_LEGACY("eeprom", gaelco2_eeprom_sk_w) /* EEPROM serial clock */
AM_RANGE(0x30000c, 0x30000d) AM_DEVWRITE_LEGACY("eeprom", gaelco2_eeprom_cs_w) /* EEPROM chip select */
AM_RANGE(0x300008, 0x300009) AM_WRITE(gaelco2_eeprom_data_w) /* EEPROM data */
AM_RANGE(0x30000a, 0x30000b) AM_WRITE(gaelco2_eeprom_sk_w) /* EEPROM serial clock */
AM_RANGE(0x30000c, 0x30000d) AM_WRITE(gaelco2_eeprom_cs_w) /* EEPROM chip select */
AM_RANGE(0x300010, 0x300011) AM_READ_PORT("P2")
AM_RANGE(0x300020, 0x300021) AM_READ_PORT("COIN")
AM_RANGE(0x310000, 0x31ffff) AM_READWRITE(snowboar_protection_r,snowboar_protection_w) AM_SHARE("snowboar_prot") /* Protection */

View File

@ -178,7 +178,7 @@ static const ay8910_interface ay8910_config =
DEVCB_INPUT_PORT("DSW"),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_HANDLER(hanaawas_portB_w)
DEVCB_DRIVER_MEMBER(hanaawas_state, hanaawas_portB_w)
};

View File

@ -343,7 +343,7 @@ static const ym2203_interface ym2203_config =
DEVCB_INPUT_PORT("DSW"),
DEVCB_NULL,
DEVCB_NULL,
DEVCB_HANDLER(homerun_banking_w)
DEVCB_DRIVER_MEMBER(homerun_state, homerun_banking_w)
},
DEVCB_NULL
};

View File

@ -700,9 +700,9 @@ static const ay8910_interface ay8910_config =
{
AY8910_SINGLE_OUTPUT,
{1000, 0, 0},
DEVCB_HANDLER(leland_sound_port_r),
DEVCB_DRIVER_MEMBER(leland_state, leland_sound_port_r),
DEVCB_NULL,
DEVCB_HANDLER(leland_sound_port_w),
DEVCB_DRIVER_MEMBER(leland_state, leland_sound_port_w),
DEVCB_NULL
};

View File

@ -128,21 +128,19 @@ Notes (couriersud)
#define LOG(x) do { if (DEBUG) printf x; } while (0)
static WRITE8_DEVICE_HANDLER( ic8j1_output_changed )
WRITE8_MEMBER(m10_state::ic8j1_output_changed)
{
m10_state *state = space.machine().driver_data<m10_state>();
LOG(("ic8j1: %d %d\n", data, space.machine().primary_screen->vpos()));
state->m_maincpu->set_input_line(0, !data ? CLEAR_LINE : ASSERT_LINE);
LOG(("ic8j1: %d %d\n", data, machine().primary_screen->vpos()));
m_maincpu->set_input_line(0, !data ? CLEAR_LINE : ASSERT_LINE);
}
static WRITE8_DEVICE_HANDLER( ic8j2_output_changed )
WRITE8_MEMBER(m10_state::ic8j2_output_changed)
{
m10_state *state = space.machine().driver_data<m10_state>();
/* written from /Q to A with slight delight */
LOG(("ic8j2: %d\n", data));
ttl74123_a_w(device, space, 0, data);
ttl74123_a_w(state->m_ic8j1, space, 0, data);
ttl74123_a_w(m_ic8j2, space, 0, data);
ttl74123_a_w(m_ic8j1, space, 0, data);
}
static const ttl74123_interface ic8j1_intf =
@ -154,7 +152,7 @@ static const ttl74123_interface ic8j1_intf =
1, /* A pin - driven by the CRTC */
1, /* B pin - pulled high */
1, /* Clear pin - pulled high */
DEVCB_HANDLER(ic8j1_output_changed)
DEVCB_DRIVER_MEMBER(m10_state,ic8j1_output_changed)
};
static const ttl74123_interface ic8j2_intf =
@ -166,7 +164,7 @@ static const ttl74123_interface ic8j2_intf =
1, /* A pin - driven by the CRTC */
1, /* B pin - pulled high */
1, /* Clear pin - pulled high */
DEVCB_HANDLER(ic8j2_output_changed)
DEVCB_DRIVER_MEMBER(m10_state,ic8j2_output_changed)
};
/*************************************

View File

@ -649,7 +649,7 @@ WRITE8_MEMBER(mcr_state::dotron_op4_w)
*
*************************************/
WRITE16_DEVICE_HANDLER( mcr_ipu_sio_transmit )
WRITE16_MEMBER(mcr_state::mcr_ipu_sio_transmit)
{
logerror("ipu_sio_transmit: %02X\n", data);

View File

@ -1566,7 +1566,7 @@ static ADDRESS_MAP_START( naomi_map, AS_PROGRAM, 64, dc_state )
AM_RANGE(0x005f7c00, 0x005f7cff) AM_MIRROR(0x02000000) AM_READWRITE_LEGACY(pvr_ctrl_r, pvr_ctrl_w )
AM_RANGE(0x005f8000, 0x005f9fff) AM_MIRROR(0x02000000) AM_READWRITE_LEGACY(pvr_ta_r, pvr_ta_w )
AM_RANGE(0x00600000, 0x006007ff) AM_MIRROR(0x02000000) AM_READWRITE_LEGACY(dc_modem_r, dc_modem_w )
AM_RANGE(0x00700000, 0x00707fff) AM_MIRROR(0x02000000) AM_DEVREADWRITE_LEGACY("aica", dc_aica_reg_r, dc_aica_reg_w )
AM_RANGE(0x00700000, 0x00707fff) AM_MIRROR(0x02000000) AM_READWRITE(dc_aica_reg_r, dc_aica_reg_w )
AM_RANGE(0x00710000, 0x0071000f) AM_MIRROR(0x02000000) AM_READWRITE_LEGACY(dc_rtc_r, dc_rtc_w )
AM_RANGE(0x00800000, 0x00ffffff) AM_MIRROR(0x02000000) AM_READWRITE_LEGACY(naomi_arm_r, naomi_arm_w ) // sound RAM (8 MB)
@ -1618,7 +1618,7 @@ static ADDRESS_MAP_START( naomi2_map, AS_PROGRAM, 64, dc_state )
AM_RANGE(0x005f7c00, 0x005f7cff) AM_READWRITE_LEGACY(pvr_ctrl_r, pvr_ctrl_w )
AM_RANGE(0x005f8000, 0x005f9fff) AM_READWRITE_LEGACY(pvr_ta_r, pvr_ta_w )
AM_RANGE(0x00600000, 0x006007ff) AM_MIRROR(0x02000000) AM_READWRITE_LEGACY(dc_modem_r, dc_modem_w )
AM_RANGE(0x00700000, 0x00707fff) AM_MIRROR(0x02000000) AM_DEVREADWRITE_LEGACY("aica", dc_aica_reg_r, dc_aica_reg_w )
AM_RANGE(0x00700000, 0x00707fff) AM_MIRROR(0x02000000) AM_READWRITE(dc_aica_reg_r, dc_aica_reg_w )
AM_RANGE(0x00710000, 0x0071000f) AM_MIRROR(0x02000000) AM_READWRITE_LEGACY(dc_rtc_r, dc_rtc_w )
AM_RANGE(0x00800000, 0x00ffffff) AM_MIRROR(0x02000000) AM_READWRITE_LEGACY(naomi_arm_r, naomi_arm_w ) // sound RAM (8 MB)
@ -1771,7 +1771,7 @@ static ADDRESS_MAP_START( aw_map, AS_PROGRAM, 64, dc_state )
AM_RANGE(0x005f7c00, 0x005f7cff) AM_READWRITE_LEGACY(pvr_ctrl_r, pvr_ctrl_w )
AM_RANGE(0x005f8000, 0x005f9fff) AM_READWRITE_LEGACY(pvr_ta_r, pvr_ta_w )
AM_RANGE(0x00600000, 0x006007ff) AM_READWRITE_LEGACY(aw_modem_r, aw_modem_w )
AM_RANGE(0x00700000, 0x00707fff) AM_DEVREADWRITE_LEGACY("aica", dc_aica_reg_r, dc_aica_reg_w )
AM_RANGE(0x00700000, 0x00707fff) AM_READWRITE(dc_aica_reg_r, dc_aica_reg_w )
AM_RANGE(0x00710000, 0x0071000f) AM_READWRITE_LEGACY(dc_rtc_r, dc_rtc_w )
AM_RANGE(0x00800000, 0x00ffffff) AM_READWRITE_LEGACY(naomi_arm_r, naomi_arm_w ) // sound RAM (8 MB)
@ -1832,7 +1832,7 @@ static const aica_interface aica_config =
static ADDRESS_MAP_START( dc_audio_map, AS_PROGRAM, 32, dc_state )
ADDRESS_MAP_UNMAP_HIGH
AM_RANGE(0x00000000, 0x007fffff) AM_RAM AM_SHARE("dc_sound_ram") /* shared with SH-4 */
AM_RANGE(0x00800000, 0x00807fff) AM_DEVREADWRITE_LEGACY("aica", dc_arm_aica_r, dc_arm_aica_w)
AM_RANGE(0x00800000, 0x00807fff) AM_READWRITE(dc_arm_aica_r, dc_arm_aica_w)
ADDRESS_MAP_END
/*

View File

@ -437,7 +437,7 @@ static const ay8910_interface survival_ay8910_interface =
AY8910_LEGACY_OUTPUT,
AY8910_DEFAULT_LOADS,
DEVCB_NULL,
DEVCB_HANDLER(survival_protection_r),
DEVCB_DRIVER_MEMBER(phoenix_state, survival_protection_r),
DEVCB_NULL,
DEVCB_NULL
};
@ -514,7 +514,7 @@ static I8085_CONFIG( survival_i8085_config )
{
DEVCB_NULL, /* STATUS changed callback */
DEVCB_NULL, /* INTE changed callback */
DEVCB_LINE(survival_sid_callback), /* SID changed callback (8085A only) */
DEVCB_DRIVER_LINE_MEMBER(phoenix_state, survival_sid_callback), /* SID changed callback (8085A only) */
DEVCB_NULL /* SOD changed callback (8085A only) */
};

View File

@ -220,7 +220,7 @@ static ADDRESS_MAP_START( puckpkmn_map, AS_PROGRAM, 16, md_boot_state )
AM_RANGE(0x700016, 0x700017) AM_READ_PORT("DSW1")
AM_RANGE(0x700018, 0x700019) AM_READ_PORT("DSW2")
AM_RANGE(0x700022, 0x700023) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
AM_RANGE(0xa04000, 0xa04003) AM_DEVREADWRITE8_LEGACY("ymsnd", megadriv_68k_YM2612_read, megadriv_68k_YM2612_write, 0xffff)
AM_RANGE(0xa04000, 0xa04003) AM_READWRITE8(megadriv_68k_YM2612_read, megadriv_68k_YM2612_write, 0xffff)
AM_RANGE(0xc00000, 0xc0001f) AM_DEVREADWRITE("gen_vdp", sega_genesis_vdp_device, megadriv_vdp_r,megadriv_vdp_w)
AM_RANGE(0xe00000, 0xe0ffff) AM_RAM AM_MIRROR(0x1f0000)
@ -244,7 +244,7 @@ static ADDRESS_MAP_START( jzth_map, AS_PROGRAM, 16, md_boot_state )
AM_RANGE(0x700016, 0x700017) AM_READ_PORT("DSW1")
AM_RANGE(0x700018, 0x700019) AM_READ_PORT("DSW2")
AM_RANGE(0x700022, 0x700023) AM_DEVREADWRITE8("oki", okim6295_device, read, write, 0x00ff)
AM_RANGE(0xa04000, 0xa04003) AM_DEVREADWRITE8_LEGACY("ymsnd", megadriv_68k_YM2612_read, megadriv_68k_YM2612_write, 0xffff)
AM_RANGE(0xa04000, 0xa04003) AM_READWRITE8( megadriv_68k_YM2612_read, megadriv_68k_YM2612_write, 0xffff)
AM_RANGE(0xc00000, 0xc0001f) AM_DEVREADWRITE("gen_vdp", sega_genesis_vdp_device, megadriv_vdp_r,megadriv_vdp_w)

View File

@ -245,7 +245,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, qix_state )
AM_RANGE(0x8c00, 0x8c00) AM_MIRROR(0x3fe) AM_READWRITE(qix_video_firq_r, qix_video_firq_w)
AM_RANGE(0x8c01, 0x8c01) AM_MIRROR(0x3fe) AM_READWRITE(qix_data_firq_ack_r, qix_data_firq_ack_w)
AM_RANGE(0x9000, 0x93ff) AM_DEVREADWRITE("sndpia0", pia6821_device, read, write)
AM_RANGE(0x9400, 0x97ff) AM_DEVREAD("pia0", pia6821_device, read) AM_DEVWRITE_LEGACY("pia0", qix_pia_w)
AM_RANGE(0x9400, 0x97ff) AM_DEVREAD("pia0", pia6821_device, read) AM_WRITE(qix_pia_w)
AM_RANGE(0x9800, 0x9bff) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
AM_RANGE(0x9c00, 0x9fff) AM_DEVREADWRITE("pia2", pia6821_device, read, write)
AM_RANGE(0xa000, 0xffff) AM_ROM
@ -259,7 +259,7 @@ static ADDRESS_MAP_START( zoo_main_map, AS_PROGRAM, 8, qix_state )
AM_RANGE(0x0c00, 0x0c00) AM_MIRROR(0x3fe) AM_READWRITE(qix_video_firq_r, qix_video_firq_w)
AM_RANGE(0x0c01, 0x0c01) AM_MIRROR(0x3fe) AM_READWRITE(qix_data_firq_ack_r, qix_data_firq_ack_w)
AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("sndpia0", pia6821_device, read, write)
AM_RANGE(0x1400, 0x17ff) AM_DEVREAD("pia0", pia6821_device, read) AM_DEVWRITE_LEGACY("pia0", qix_pia_w)
AM_RANGE(0x1400, 0x17ff) AM_DEVREAD("pia0", pia6821_device, read) AM_WRITE(qix_pia_w)
AM_RANGE(0x1800, 0x1bff) AM_DEVREADWRITE("pia1", pia6821_device, read, write)
AM_RANGE(0x1c00, 0x1fff) AM_DEVREADWRITE("pia2", pia6821_device, read, write)
AM_RANGE(0x8000, 0xffff) AM_ROM

View File

@ -96,7 +96,7 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 8, simpsons_state )
AM_RANGE(0x1fc0, 0x1fc0) AM_WRITE(simpsons_coin_counter_w)
AM_RANGE(0x1fc2, 0x1fc2) AM_WRITE(simpsons_eeprom_w)
AM_RANGE(0x1fc4, 0x1fc4) AM_READ(simpsons_sound_interrupt_r)
AM_RANGE(0x1fc6, 0x1fc7) AM_DEVREADWRITE_LEGACY("k053260", simpsons_sound_r, k053260_w)
AM_RANGE(0x1fc6, 0x1fc7) AM_READ(simpsons_sound_r) AM_DEVWRITE_LEGACY("k053260",k053260_w)
AM_RANGE(0x1fc8, 0x1fc9) AM_DEVREAD_LEGACY("k053246", k053246_r)
AM_RANGE(0x1fca, 0x1fca) AM_READ(watchdog_reset_r)
AM_RANGE(0x2000, 0x3fff) AM_RAMBANK("bank4")

View File

@ -459,11 +459,10 @@ static WRITE_LINE_DEVICE_HANDLER( ymirq_callback_1 )
device->machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),drvstate), YM1IRQ_ASSERT);
}
static WRITE_LINE_DEVICE_HANDLER( ymirq_callback_2 )
WRITE_LINE_MEMBER(snk_state::ymirq_callback_2)
{
snk_state *drvstate = device->machine().driver_data<snk_state>();
if (state)
device->machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),drvstate), YM2IRQ_ASSERT);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(snk_state::sndirq_update_callback),this), YM2IRQ_ASSERT);
}
@ -474,7 +473,7 @@ static const ym3526_interface ym3526_config_1 =
static const ym3526_interface ym3526_config_2 =
{
DEVCB_LINE(ymirq_callback_2)
DEVCB_DRIVER_LINE_MEMBER(snk_state,ymirq_callback_2)
};
static const ym3812_interface ym3812_config_1 =
@ -484,7 +483,7 @@ static const ym3812_interface ym3812_config_1 =
static const y8950_interface y8950_config_2 =
{
DEVCB_LINE(ymirq_callback_2)
DEVCB_DRIVER_LINE_MEMBER(snk_state,ymirq_callback_2)
};

View File

@ -372,9 +372,9 @@ static const pia6821_interface pia_4_intf =
*
*************************************/
static WRITE8_DEVICE_HANDLER( ic60_74123_output_changed)
WRITE8_MEMBER(spiders_state::ic60_74123_output_changed)
{
pia6821_device *pia2 = space.machine().device<pia6821_device>("pia2");
pia6821_device *pia2 = machine().device<pia6821_device>("pia2");
pia2->ca1_w(data);
}
@ -387,7 +387,7 @@ static const ttl74123_interface ic60_intf =
1, /* A pin - driven by the CRTC */
1, /* B pin - pulled high */
1, /* Clear pin - pulled high */
DEVCB_HANDLER(ic60_74123_output_changed)
DEVCB_DRIVER_MEMBER(spiders_state,ic60_74123_output_changed)
};

View File

@ -245,7 +245,7 @@ static ADDRESS_MAP_START( cpu1_map, AS_PROGRAM, 8, stfight_state )
AM_RANGE(0xc203, 0xc204) AM_READ(stfight_dsw_r) /* DS0,1 */
AM_RANGE(0xc205, 0xc205) AM_READ(stfight_coin_r) /* coin mech */
AM_RANGE(0xc500, 0xc500) AM_WRITE(stfight_fm_w) /* play fm sound */
AM_RANGE(0xc600, 0xc600) AM_DEVWRITE_LEGACY("msm", stfight_adpcm_control_w) /* voice control */
AM_RANGE(0xc600, 0xc600) AM_WRITE(stfight_adpcm_control_w) /* voice control */
AM_RANGE(0xc700, 0xc700) AM_WRITE(stfight_coin_w) /* coin mech */
AM_RANGE(0xc804, 0xc806) AM_WRITENOP /* TBD */
AM_RANGE(0xc807, 0xc807) AM_WRITE(stfight_sprite_bank_w)

View File

@ -471,7 +471,6 @@ static void dakkochn_custom_w(running_machine &machine, UINT8 data, UINT8 prevda
WRITE8_MEMBER(system1_state::sound_control_w)
{
device_t *device = machine().device("ppi8255");
/* bit 0 = MUTE (inverted sense on System 2) */
machine().sound().system_mute((data ^ m_mute_xor) & 1);
@ -481,7 +480,7 @@ WRITE8_MEMBER(system1_state::sound_control_w)
machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_NMI, (data & 0x80) ? CLEAR_LINE : ASSERT_LINE);
/* remaining bits are used for video RAM banking */
system1_videoram_bank_w(device, space, offset, data);
system1_videoram_bank_w(space, offset, data);
}

View File

@ -245,8 +245,8 @@ static ADDRESS_MAP_START( apache3_v20_map, AS_PROGRAM, 8, tatsumi_state )
AM_RANGE(0x00000, 0x01fff) AM_RAM
AM_RANGE(0x04000, 0x04003) AM_NOP // piu select .. ?
AM_RANGE(0x06000, 0x06001) AM_READ_PORT("IN0") // esw
AM_RANGE(0x08000, 0x08001) AM_DEVREADWRITE_LEGACY("ymsnd", tatsumi_hack_ym2151_r, ym2151_w)
AM_RANGE(0x0a000, 0x0a000) AM_DEVREAD_LEGACY("oki", tatsumi_hack_oki_r) AM_DEVWRITE("oki", okim6295_device, write)
AM_RANGE(0x08000, 0x08001) AM_READ(tatsumi_hack_ym2151_r) AM_DEVWRITE_LEGACY("ymsnd", ym2151_w)
AM_RANGE(0x0a000, 0x0a000) AM_READ(tatsumi_hack_oki_r) AM_DEVWRITE("oki", okim6295_device, write)
AM_RANGE(0x0e000, 0x0e007) AM_READWRITE(apache3_adc_r, apache3_adc_w) //adc select
AM_RANGE(0xf0000, 0xfffff) AM_ROM
ADDRESS_MAP_END
@ -289,8 +289,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( roundup5_z80_map, AS_PROGRAM, 8, tatsumi_state )
AM_RANGE(0x0000, 0xdfff) AM_ROM
AM_RANGE(0xe000, 0xffef) AM_RAM
AM_RANGE(0xfff0, 0xfff1) AM_DEVREADWRITE_LEGACY("ymsnd", tatsumi_hack_ym2151_r, ym2151_w)
AM_RANGE(0xfff4, 0xfff4) AM_DEVREAD_LEGACY("oki", tatsumi_hack_oki_r) AM_DEVWRITE("oki", okim6295_device, write)
AM_RANGE(0xfff0, 0xfff1) AM_READ(tatsumi_hack_ym2151_r) AM_DEVWRITE_LEGACY("ymsnd", ym2151_w)
AM_RANGE(0xfff4, 0xfff4) AM_READ(tatsumi_hack_oki_r) AM_DEVWRITE("oki", okim6295_device, write)
AM_RANGE(0xfff8, 0xfff8) AM_READ_PORT("IN0")
AM_RANGE(0xfff9, 0xfff9) AM_READ_PORT("IN1")
AM_RANGE(0xfffc, 0xfffc) AM_READ_PORT("STICKX")
@ -346,8 +346,8 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( cyclwarr_z80_map, AS_PROGRAM, 8, tatsumi_state )
AM_RANGE(0x0000, 0xdfff) AM_ROM
AM_RANGE(0xe000, 0xffef) AM_RAM
AM_RANGE(0xfff0, 0xfff1) AM_DEVREADWRITE_LEGACY("ymsnd", tatsumi_hack_ym2151_r, ym2151_w)
AM_RANGE(0xfff4, 0xfff4) AM_DEVREAD_LEGACY("oki", tatsumi_hack_oki_r) AM_DEVWRITE("oki", okim6295_device, write)
AM_RANGE(0xfff0, 0xfff1) AM_READ(tatsumi_hack_ym2151_r) AM_DEVWRITE_LEGACY("ymsnd", ym2151_w)
AM_RANGE(0xfff4, 0xfff4) AM_READ(tatsumi_hack_oki_r) AM_DEVWRITE("oki", okim6295_device, write)
AM_RANGE(0xfffc, 0xfffc) AM_READ(soundlatch_byte_r)
AM_RANGE(0xfffe, 0xfffe) AM_WRITENOP
ADDRESS_MAP_END

View File

@ -419,9 +419,10 @@ WRITE8_MEMBER(topspeed_state::sound_bankswitch_w)/* assumes Z80 sandwiched betwe
reset_sound_region(machine());
}
static WRITE8_DEVICE_HANDLER( topspeed_tc0140syt_comm_w )
WRITE8_MEMBER(topspeed_state::topspeed_tc0140syt_comm_w)
{
space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
device_t *device = machine().device("tc0140syt");
machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
tc0140syt_comm_w(device, space, 0, data);
}
@ -504,7 +505,7 @@ static ADDRESS_MAP_START( topspeed_map, AS_PROGRAM, 16, topspeed_state )
AM_RANGE(0x500000, 0x503fff) AM_RAM_WRITE(paletteram_xBBBBBGGGGGRRRRR_word_w) AM_SHARE("paletteram")
AM_RANGE(0x600002, 0x600003) AM_WRITE(cpua_ctrl_w)
AM_RANGE(0x7e0000, 0x7e0001) AM_READNOP AM_DEVWRITE8_LEGACY("tc0140syt", tc0140syt_port_w, 0x00ff)
AM_RANGE(0x7e0002, 0x7e0003) AM_DEVREADWRITE8_LEGACY("tc0140syt", tc0140syt_comm_r, topspeed_tc0140syt_comm_w, 0x00ff)
AM_RANGE(0x7e0002, 0x7e0003) AM_DEVREAD8_LEGACY("tc0140syt", tc0140syt_comm_r, 0x00ff) AM_WRITE8(topspeed_tc0140syt_comm_w, 0x00ff)
AM_RANGE(0x800000, 0x8003ff) AM_RAM AM_SHARE("raster_ctrl")
AM_RANGE(0x800400, 0x80ffff) AM_RAM
AM_RANGE(0xa00000, 0xa0ffff) AM_DEVREADWRITE_LEGACY("pc080sn_1", pc080sn_word_r, pc080sn_word_w)

View File

@ -273,8 +273,8 @@ static const ym2203_interface ym2203_interface_2 =
AY8910_DEFAULT_LOADS,
DEVCB_NULL,
DEVCB_NULL,
DEVCB_HANDLER(xxmissio_scroll_x_w),
DEVCB_HANDLER(xxmissio_scroll_y_w)
DEVCB_DRIVER_MEMBER(xxmissio_state, xxmissio_scroll_x_w),
DEVCB_DRIVER_MEMBER(xxmissio_state, xxmissio_scroll_y_w)
},
DEVCB_NULL
};

View File

@ -19,6 +19,15 @@ public:
virtual void machine_start();
UINT32 screen_update_beezer(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(beezer_interrupt);
DECLARE_READ_LINE_MEMBER(b_via_0_ca2_r);
DECLARE_READ8_MEMBER(b_via_0_pa_r);
DECLARE_READ8_MEMBER(b_via_0_pb_r);
DECLARE_WRITE8_MEMBER(b_via_0_pa_w);
DECLARE_WRITE8_MEMBER(b_via_0_pb_w);
DECLARE_READ8_MEMBER(b_via_1_pa_r);
DECLARE_READ8_MEMBER(b_via_1_pb_r);
DECLARE_WRITE8_MEMBER(b_via_1_pa_w);
DECLARE_WRITE8_MEMBER(b_via_1_pb_w);
};

View File

@ -69,6 +69,15 @@ public:
UINT32 screen_update_carpolo(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_carpolo(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(carpolo_timer_interrupt);
DECLARE_WRITE_LINE_MEMBER(coin1_interrupt_clear_w);
DECLARE_WRITE_LINE_MEMBER(coin2_interrupt_clear_w);
DECLARE_WRITE_LINE_MEMBER(coin3_interrupt_clear_w);
DECLARE_WRITE_LINE_MEMBER(coin4_interrupt_clear_w);
DECLARE_WRITE8_MEMBER(pia_0_port_a_w);
DECLARE_WRITE8_MEMBER(pia_0_port_b_w);
DECLARE_READ8_MEMBER(pia_0_port_b_r);
DECLARE_READ8_MEMBER(pia_1_port_a_r);
DECLARE_READ8_MEMBER(pia_1_port_b_r);
};

View File

@ -113,6 +113,10 @@ class dc_state : public driver_device
TIMER_CALLBACK_MEMBER(endofrender_video);
TIMER_CALLBACK_MEMBER(endofrender_tsp);
TIMER_CALLBACK_MEMBER(endofrender_isp);
DECLARE_READ64_MEMBER(dc_aica_reg_r);
DECLARE_WRITE64_MEMBER(dc_aica_reg_w);
DECLARE_READ32_MEMBER(dc_arm_aica_r);
DECLARE_WRITE32_MEMBER(dc_arm_aica_w);
};
/*----------- defined in machine/dc.c -----------*/
@ -132,13 +136,6 @@ DECLARE_READ64_HANDLER( dc_modem_r );
DECLARE_WRITE64_HANDLER( dc_modem_w );
DECLARE_READ64_HANDLER( dc_rtc_r );
DECLARE_WRITE64_HANDLER( dc_rtc_w );
DECLARE_READ64_DEVICE_HANDLER( dc_aica_reg_r );
DECLARE_WRITE64_DEVICE_HANDLER( dc_aica_reg_w );
DECLARE_READ32_DEVICE_HANDLER( dc_arm_aica_r );
DECLARE_WRITE32_DEVICE_HANDLER( dc_arm_aica_w );
int dc_compute_interrupt_level(running_machine &machine);

View File

@ -110,4 +110,5 @@ public:
TIMER_CALLBACK_MEMBER(equites_frq_adjuster_callback);
TIMER_DEVICE_CALLBACK_MEMBER(equites_scanline);
TIMER_DEVICE_CALLBACK_MEMBER(splndrbt_scanline);
DECLARE_WRITE_LINE_MEMBER(equites_msm5232_gate);
};

View File

@ -53,11 +53,7 @@ public:
UINT32 screen_update_gaelco2_left(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_gaelco2_right(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_DEVICE_CALLBACK_MEMBER(bang_irq);
DECLARE_WRITE16_MEMBER(gaelco2_eeprom_cs_w);
DECLARE_WRITE16_MEMBER(gaelco2_eeprom_sk_w);
DECLARE_WRITE16_MEMBER(gaelco2_eeprom_data_w);
};
/*----------- defined in machine/gaelco2.c -----------*/
DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_cs_w );
DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_sk_w );
DECLARE_WRITE16_DEVICE_HANDLER( gaelco2_eeprom_data_w );

View File

@ -74,6 +74,11 @@ public:
TIMER_CALLBACK_MEMBER(clear_screen_done_callback);
TIMER_CALLBACK_MEMBER(via_irq_delayed);
TIMER_CALLBACK_MEMBER(via_0_ca1_timer_callback);
DECLARE_WRITE8_MEMBER(video_data_w);
DECLARE_WRITE8_MEMBER(gameplan_video_command_w);
DECLARE_WRITE8_MEMBER(leprechn_video_command_w);
DECLARE_WRITE_LINE_MEMBER(video_command_trigger_w);
DECLARE_READ8_MEMBER(vblank_r);
};
/*----------- defined in video/gameplan.c -----------*/

View File

@ -31,7 +31,5 @@ public:
virtual void video_start();
virtual void palette_init();
UINT32 screen_update_hanaawas(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE8_MEMBER(hanaawas_portB_w);
};
/*----------- defined in video/hanaawas.c -----------*/
DECLARE_WRITE8_DEVICE_HANDLER( hanaawas_portB_w );

View File

@ -53,7 +53,5 @@ public:
virtual void machine_reset();
virtual void video_start();
UINT32 screen_update_homerun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_WRITE8_MEMBER(homerun_banking_w);
};
/*----------- defined in video/homerun.c -----------*/
DECLARE_WRITE8_DEVICE_HANDLER( homerun_banking_w );

View File

@ -147,6 +147,11 @@ public:
TIMER_CALLBACK_MEMBER(ataxx_interrupt_callback);
TIMER_CALLBACK_MEMBER(scanline_callback);
TIMER_CALLBACK_MEMBER(leland_delayed_mvram_w);
DECLARE_READ8_MEMBER(ataxx_eeprom_r);
DECLARE_WRITE8_MEMBER(ataxx_eeprom_w);
DECLARE_READ8_MEMBER(leland_sound_port_r);
DECLARE_WRITE8_MEMBER(leland_sound_port_w);
DECLARE_WRITE8_MEMBER(leland_gfx_port_w);
};
@ -170,18 +175,6 @@ void ataxx_bankswitch(running_machine &machine);
void leland_init_eeprom(running_machine &machine, UINT8 default_val, const UINT16 *data, UINT8 serial_offset, UINT8 serial_type);
void ataxx_init_eeprom(running_machine &machine, const UINT16 *data);
DECLARE_READ8_DEVICE_HANDLER( ataxx_eeprom_r );
DECLARE_WRITE8_DEVICE_HANDLER( ataxx_eeprom_w );
DECLARE_READ8_DEVICE_HANDLER( leland_sound_port_r );
DECLARE_WRITE8_DEVICE_HANDLER( leland_sound_port_w );
void leland_rotate_memory(running_machine &machine, const char *cpuname);

View File

@ -92,5 +92,7 @@ public:
INTERRUPT_GEN_MEMBER(m10_interrupt);
INTERRUPT_GEN_MEMBER(m15_interrupt);
TIMER_CALLBACK_MEMBER(interrupt_callback);
DECLARE_WRITE8_MEMBER(ic8j1_output_changed);
DECLARE_WRITE8_MEMBER(ic8j2_output_changed);
};

View File

@ -106,14 +106,11 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(dpoker_coin_in_callback);
TIMER_DEVICE_CALLBACK_MEMBER(mcr_interrupt);
TIMER_DEVICE_CALLBACK_MEMBER(mcr_ipu_interrupt);
DECLARE_WRITE16_MEMBER(mcr_ipu_sio_transmit);
DECLARE_WRITE_LINE_MEMBER(ipu_ctc_interrupt);
DECLARE_WRITE8_MEMBER(ipu_break_changed);
};
/*----------- defined in drivers/mcr.c -----------*/
DECLARE_WRITE16_DEVICE_HANDLER( mcr_ipu_sio_transmit );
/*----------- defined in machine/mcr.c -----------*/
extern const z80_daisy_config mcr_daisy_chain[];

View File

@ -103,6 +103,12 @@ public:
TIMER_CALLBACK_MEMBER(zwackery_493_off_callback);
TIMER_CALLBACK_MEMBER(zwackery_493_callback);
TIMER_CALLBACK_MEMBER(counter_fired_callback);
DECLARE_READ8_MEMBER(zwackery_port_1_r);
DECLARE_READ8_MEMBER(zwackery_port_3_r);
DECLARE_WRITE8_MEMBER(zwackery_pia0_w);
DECLARE_WRITE8_MEMBER(zwackery_pia1_w);
DECLARE_WRITE_LINE_MEMBER(zwackery_ca2_w);
DECLARE_WRITE_LINE_MEMBER(zwackery_pia_irq);
};
/*----------- defined in machine/mcr68.c -----------*/

View File

@ -72,9 +72,6 @@ void megatech_set_megadrive_z80_as_megadrive_z80(running_machine &machine, const
extern DECLARE_READ16_HANDLER( megadriv_68k_io_read );
extern DECLARE_WRITE16_HANDLER( megadriv_68k_io_write );
/* These handlers are needed by puckpkmn.c for his memory map */
extern DECLARE_READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read);
extern DECLARE_WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write);
/* These are needed to create external input handlers (see e.g. MESS) */
/* Regs are also used by Megaplay! */
@ -122,6 +119,8 @@ public:
TILE_GET_INFO_MEMBER( get_stampmap_32x32_1x1_tile_info );
TILE_GET_INFO_MEMBER( get_stampmap_16x16_16x16_tile_info );
TILE_GET_INFO_MEMBER( get_stampmap_32x32_16x16_tile_info );
DECLARE_READ8_MEMBER(megadriv_68k_YM2612_read);
DECLARE_WRITE8_MEMBER(megadriv_68k_YM2612_write);
};
class md_boot_state : public md_base_state

View File

@ -36,6 +36,8 @@ public:
DECLARE_PALETTE_INIT(survival);
DECLARE_PALETTE_INIT(pleiads);
UINT32 screen_update_phoenix(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
DECLARE_READ8_MEMBER(survival_protection_r);
DECLARE_READ_LINE_MEMBER(survival_sid_callback);
};
@ -81,7 +83,3 @@ private:
};
extern const device_type PHOENIX;
/*----------- defined in video/phoenix.c -----------*/
DECLARE_READ8_DEVICE_HANDLER( survival_protection_r );
READ_LINE_DEVICE_HANDLER( survival_sid_callback );

View File

@ -85,6 +85,18 @@ public:
DECLARE_MACHINE_START(qixmcu);
DECLARE_VIDEO_START(qix);
TIMER_CALLBACK_MEMBER(pia_w_callback);
DECLARE_WRITE_LINE_MEMBER(qix_vsync_changed);
DECLARE_READ8_MEMBER(qixmcu_coin_r);
DECLARE_WRITE8_MEMBER(qixmcu_coin_w);
DECLARE_WRITE8_MEMBER(qixmcu_coinctrl_w);
DECLARE_WRITE8_MEMBER(qix_pia_w);
DECLARE_WRITE8_MEMBER(qix_coinctl_w);
DECLARE_WRITE8_MEMBER(slither_76489_0_w);
DECLARE_WRITE8_MEMBER(slither_76489_1_w);
DECLARE_READ8_MEMBER(slither_trak_lr_r);
DECLARE_READ8_MEMBER(slither_trak_ud_r);
DECLARE_WRITE_LINE_MEMBER(display_enable_changed);
DECLARE_WRITE8_MEMBER(qix_flip_screen_w);
};
@ -98,17 +110,12 @@ extern const pia6821_interface qixmcu_pia_2_intf;
extern const pia6821_interface slither_pia_1_intf;
extern const pia6821_interface slither_pia_2_intf;
DECLARE_WRITE8_DEVICE_HANDLER( qix_pia_w );
WRITE_LINE_DEVICE_HANDLER( qix_vsync_changed );
/*----------- defined in video/qix.c -----------*/
MACHINE_CONFIG_EXTERN( qix_video );
MACHINE_CONFIG_EXTERN( zookeep_video );
MACHINE_CONFIG_EXTERN( slither_video );
DECLARE_WRITE8_DEVICE_HANDLER( qix_flip_screen_w );
/*----------- defined in audio/qix.c -----------*/
MACHINE_CONFIG_EXTERN( qix_audio );

View File

@ -53,6 +53,8 @@ public:
DECLARE_DRIVER_INIT(billiard);
DECLARE_MACHINE_RESET(scramble);
DECLARE_MACHINE_RESET(explorer);
DECLARE_WRITE8_MEMBER(scramble_protection_w);
DECLARE_READ8_MEMBER(scramble_protection_r);
};
@ -68,8 +70,6 @@ DECLARE_READ8_HANDLER( triplep_pap_r );
DECLARE_READ8_HANDLER( hunchbks_mirror_r );
DECLARE_WRITE8_HANDLER( hunchbks_mirror_w );
DECLARE_READ8_DEVICE_HANDLER( scramble_protection_r );
DECLARE_WRITE8_DEVICE_HANDLER( scramble_protection_w );
/*----------- defined in audio/scramble.c -----------*/

View File

@ -43,10 +43,9 @@ public:
INTERRUPT_GEN_MEMBER(simpsons_irq);
TIMER_CALLBACK_MEMBER(nmi_callback);
TIMER_CALLBACK_MEMBER(dmaend_callback);
DECLARE_READ8_MEMBER(simpsons_sound_r);
};
/*----------- defined in machine/simpsons.c -----------*/
DECLARE_READ8_DEVICE_HANDLER( simpsons_sound_r );
/*----------- defined in video/simpsons.c -----------*/
void simpsons_video_banking( running_machine &machine, int select );

View File

@ -551,6 +551,7 @@ public:
TIMER_CALLBACK_MEMBER(snes_update_io);
TIMER_CALLBACK_MEMBER(snes_scanline_tick);
TIMER_CALLBACK_MEMBER(snes_hblank_tick);
DECLARE_WRITE_LINE_MEMBER(snes_extern_irq_w);
};
/* Special chips, checked at init and used in memory handlers */
@ -628,9 +629,6 @@ extern DECLARE_WRITE8_HANDLER( superfx_w_bank1 );
extern DECLARE_WRITE8_HANDLER( superfx_w_bank2 );
extern DECLARE_WRITE8_HANDLER( superfx_w_bank3 );
WRITE_LINE_DEVICE_HANDLER( snes_extern_irq_w );
extern UINT8 *snes_ram; /* Main memory */

View File

@ -171,4 +171,5 @@ public:
UINT32 screen_update_tdfever(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
TIMER_CALLBACK_MEMBER(sgladiat_sndirq_update_callback);
TIMER_CALLBACK_MEMBER(sndirq_update_callback);
DECLARE_WRITE_LINE_MEMBER(ymirq_callback_2);
};

View File

@ -30,6 +30,7 @@ public:
DECLARE_READ8_MEMBER(gfx_rom_r);
virtual void machine_start();
INTERRUPT_GEN_MEMBER(update_pia_1);
DECLARE_WRITE8_MEMBER(ic60_74123_output_changed);
};
/*----------- defined in audio/spiders.c -----------*/

View File

@ -48,10 +48,9 @@ public:
UINT32 screen_update_stfight(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(stfight_vb_interrupt);
TIMER_CALLBACK_MEMBER(stfight_interrupt_1);
DECLARE_WRITE8_MEMBER(stfight_adpcm_control_w);
};
/*----------- defined in machine/stfight.c -----------*/
void stfight_adpcm_int(device_t *device);
DECLARE_WRITE8_DEVICE_HANDLER( stfight_adpcm_control_w );

View File

@ -110,8 +110,6 @@ public:
INTERRUPT_GEN_MEMBER(mcu_irq_assert);
TIMER_DEVICE_CALLBACK_MEMBER(soundirq_gen);
TIMER_DEVICE_CALLBACK_MEMBER(mcu_t0_callback);
DECLARE_WRITE8_MEMBER(system1_videoram_bank_w);
};
/*----------- defined in video/system1.c -----------*/
DECLARE_WRITE8_DEVICE_HANDLER( system1_videoram_bank_w );

View File

@ -125,10 +125,9 @@ public:
UINT32 screen_update_cyclwarr(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
UINT32 screen_update_bigfight(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(roundup5_interrupt);
DECLARE_READ8_MEMBER(tatsumi_hack_ym2151_r);
DECLARE_READ8_MEMBER(tatsumi_hack_oki_r);
};
/*----------- defined in machine/tatsumi.c -----------*/
DECLARE_READ8_DEVICE_HANDLER(tatsumi_hack_ym2151_r);
DECLARE_READ8_DEVICE_HANDLER(tatsumi_hack_oki_r);
void tatsumi_reset(running_machine &machine);

View File

@ -59,4 +59,5 @@ public:
INTERRUPT_GEN_MEMBER(topspeed_cpub_interrupt);
TIMER_CALLBACK_MEMBER(topspeed_interrupt6);
TIMER_CALLBACK_MEMBER(topspeed_cpub_interrupt6);
DECLARE_WRITE8_MEMBER(topspeed_tc0140syt_comm_w);
};

View File

@ -77,6 +77,13 @@ public:
TIMER_CALLBACK_MEMBER(vectrex_refresh);
TIMER_CALLBACK_MEMBER(vectrex_zero_integrators);
TIMER_CALLBACK_MEMBER(update_signal);
DECLARE_READ8_MEMBER(vectrex_via_pb_r);
DECLARE_READ8_MEMBER(vectrex_via_pa_r);
DECLARE_READ8_MEMBER(vectrex_s1_via_pb_r);
DECLARE_WRITE8_MEMBER(v_via_pb_w);
DECLARE_WRITE8_MEMBER(v_via_pa_w);
DECLARE_WRITE8_MEMBER(v_via_ca2_w);
DECLARE_WRITE8_MEMBER(v_via_cb2_w);
};
@ -84,13 +91,8 @@ public:
DEVICE_IMAGE_LOAD( vectrex_cart );
void vectrex_configuration(running_machine &machine);
DECLARE_READ8_DEVICE_HANDLER (vectrex_via_pa_r);
DECLARE_READ8_DEVICE_HANDLER(vectrex_via_pb_r );
void vectrex_via_irq (device_t *device, int level);
/* for spectrum 1+ */
DECLARE_READ8_DEVICE_HANDLER( vectrex_s1_via_pb_r );
/*----------- defined in video/vectrex.c -----------*/
extern const via6522_interface vectrex_via6522_interface;

View File

@ -112,6 +112,8 @@ public:
virtual void machine_reset();
INTERRUPT_GEN_MEMBER(vertigo_interrupt);
TIMER_CALLBACK_MEMBER(sound_command_w);
DECLARE_WRITE_LINE_MEMBER(v_irq4_w);
DECLARE_WRITE_LINE_MEMBER(v_irq3_w);
};
/*----------- defined in machine/vertigo.c -----------*/

View File

@ -116,6 +116,17 @@ public:
TIMER_DEVICE_CALLBACK_MEMBER(williams_count240_callback);
TIMER_DEVICE_CALLBACK_MEMBER(williams2_va11_callback);
TIMER_DEVICE_CALLBACK_MEMBER(williams2_endscreen_callback);
DECLARE_WRITE8_MEMBER(williams_snd_cmd_w);
DECLARE_WRITE8_MEMBER(playball_snd_cmd_w);
DECLARE_WRITE8_MEMBER(blaster_snd_cmd_w);
DECLARE_WRITE8_MEMBER(williams2_snd_cmd_w);
DECLARE_WRITE8_MEMBER(williams_port_select_w);
DECLARE_READ8_MEMBER(williams_49way_port_0_r);
DECLARE_READ8_MEMBER(williams_input_port_49way_0_5_r);
DECLARE_WRITE8_MEMBER(lottofun_coin_lock_w);
DECLARE_READ8_MEMBER(tshoot_input_port_0_3_r);
DECLARE_WRITE8_MEMBER(tshoot_maxvol_w);
DECLARE_WRITE8_MEMBER(tshoot_lamp_w);
};
@ -131,6 +142,8 @@ public:
DECLARE_MACHINE_START(joust2);
DECLARE_MACHINE_RESET(joust2);
TIMER_CALLBACK_MEMBER(joust2_deferred_snd_cmd_w);
DECLARE_WRITE8_MEMBER(joust2_pia_3_cb1_w);
DECLARE_WRITE8_MEMBER(joust2_snd_cmd_w);
};
/*----------- defined in drivers/williams.c -----------*/

View File

@ -31,7 +31,6 @@ public:
UINT32 screen_update_xxmissio(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
INTERRUPT_GEN_MEMBER(xxmissio_interrupt_m);
INTERRUPT_GEN_MEMBER(xxmissio_interrupt_s);
DECLARE_WRITE8_MEMBER(xxmissio_scroll_x_w);
DECLARE_WRITE8_MEMBER(xxmissio_scroll_y_w);
};
DECLARE_WRITE8_DEVICE_HANDLER( xxmissio_scroll_x_w );
DECLARE_WRITE8_DEVICE_HANDLER( xxmissio_scroll_y_w );

View File

@ -4,17 +4,6 @@
#include "includes/beezer.h"
static DECLARE_READ8_DEVICE_HANDLER( b_via_0_pa_r );
static DECLARE_READ8_DEVICE_HANDLER( b_via_0_pb_r );
static DECLARE_WRITE8_DEVICE_HANDLER( b_via_0_pa_w );
static DECLARE_WRITE8_DEVICE_HANDLER( b_via_0_pb_w );
static READ_LINE_DEVICE_HANDLER( b_via_0_ca2_r );
static DECLARE_READ8_DEVICE_HANDLER( b_via_1_pa_r );
static DECLARE_READ8_DEVICE_HANDLER( b_via_1_pb_r );
static DECLARE_WRITE8_DEVICE_HANDLER( b_via_1_pa_w );
static DECLARE_WRITE8_DEVICE_HANDLER( b_via_1_pb_w );
/* VIA 0 (aka "PPCNP74", U6 @1C on schematics)
enabled at CE00-CFFF of main m6809 cpu when bankswitch is set to 0
@ -41,9 +30,9 @@ static DECLARE_WRITE8_DEVICE_HANDLER( b_via_1_pb_w );
*/
const via6522_interface b_via_0_interface =
{
/*inputs : A/B */ DEVCB_HANDLER(b_via_0_pa_r), DEVCB_HANDLER(b_via_0_pb_r),
/*inputs : CA/B1,CA/B2 */ DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("via6522_1", via6522_device, read_ca2), DEVCB_LINE(b_via_0_ca2_r), DEVCB_DEVICE_LINE_MEMBER("via6522_1", via6522_device, read_ca1),
/*outputs: A/B */ DEVCB_HANDLER(b_via_0_pa_w), DEVCB_HANDLER(b_via_0_pb_w),
/*inputs : A/B */ DEVCB_DRIVER_MEMBER(beezer_state,b_via_0_pa_r), DEVCB_DRIVER_MEMBER(beezer_state,b_via_0_pb_r),
/*inputs : CA/B1,CA/B2 */ DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("via6522_1", via6522_device, read_ca2), DEVCB_DRIVER_LINE_MEMBER(beezer_state, b_via_0_ca2_r), DEVCB_DEVICE_LINE_MEMBER("via6522_1", via6522_device, read_ca1),
/*outputs: A/B */ DEVCB_DRIVER_MEMBER(beezer_state,b_via_0_pa_w), DEVCB_DRIVER_MEMBER(beezer_state,b_via_0_pb_w),
/*outputs: CA/B1,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("via6522_1", via6522_device, write_ca1),
/*irq */ DEVCB_CPU_INPUT_LINE("maincpu", M6809_IRQ_LINE)
};
@ -73,85 +62,79 @@ const via6522_interface b_via_0_interface =
*/
const via6522_interface b_via_1_interface =
{
/*inputs : A/B */ DEVCB_HANDLER(b_via_1_pa_r), DEVCB_HANDLER(b_via_1_pb_r),
/*inputs : A/B */ DEVCB_DRIVER_MEMBER(beezer_state,b_via_1_pa_r), DEVCB_DRIVER_MEMBER(beezer_state,b_via_1_pb_r),
/*inputs : CA/B1,CA/B2 */ DEVCB_DEVICE_LINE_MEMBER("via6522_0", via6522_device, read_cb2), DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("via6522_0", via6522_device, read_cb1), DEVCB_NULL,
/*outputs: A/B */ DEVCB_HANDLER(b_via_1_pa_w), DEVCB_HANDLER(b_via_1_pb_w),
/*outputs: A/B */ DEVCB_DRIVER_MEMBER(beezer_state,b_via_1_pa_w), DEVCB_DRIVER_MEMBER(beezer_state,b_via_1_pb_w),
/*outputs: CA/B1,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("via6522_0", via6522_device, write_cb1), DEVCB_NULL,
/*irq */ DEVCB_CPU_INPUT_LINE("audiocpu", M6809_IRQ_LINE)
};
static READ_LINE_DEVICE_HANDLER( b_via_0_ca2_r )
READ_LINE_MEMBER(beezer_state::b_via_0_ca2_r)
{
return 0; // TODO: TDISP on schematic, same as D5 bit of scanline count from 74LS161 counter at 7A; attach properly
}
static READ8_DEVICE_HANDLER( b_via_0_pa_r )
READ8_MEMBER(beezer_state::b_via_0_pa_r)
{
beezer_state *state = space.machine().driver_data<beezer_state>();
return (state->m_banklatch&0x38)<<2; // return X,Y,Z bits TODO: the Z bit connects somewhere else... where?
return (m_banklatch&0x38)<<2; // return X,Y,Z bits TODO: the Z bit connects somewhere else... where?
}
static READ8_DEVICE_HANDLER( b_via_0_pb_r )
READ8_MEMBER(beezer_state::b_via_0_pb_r)
{
beezer_state *state = space.machine().driver_data<beezer_state>();
return state->m_pbus;
return m_pbus;
}
static WRITE8_DEVICE_HANDLER( b_via_0_pa_w )
WRITE8_MEMBER(beezer_state::b_via_0_pa_w)
{
beezer_state *state = space.machine().driver_data<beezer_state>();
if ((data & 0x08) == 0)
space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
else
space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
if ((data & 0x04) == 0)
{
switch (data & 0x03)
{
case 0:
state->m_pbus = state->ioport("IN0")->read();
m_pbus = ioport("IN0")->read();
break;
case 1:
state->m_pbus = state->ioport("IN1")->read() | (state->ioport("IN2")->read() << 4);
m_pbus = ioport("IN1")->read() | (ioport("IN2")->read() << 4);
break;
case 2:
state->m_pbus = state->ioport("DSWB")->read();
m_pbus = ioport("DSWB")->read();
break;
case 3:
state->m_pbus = state->ioport("DSWA")->read(); // Technically DSWA isn't populated on the board and is pulled to 0xFF with resistor pack, but there IS a DSWA port in the driver so we may as well use it.
m_pbus = ioport("DSWA")->read(); // Technically DSWA isn't populated on the board and is pulled to 0xFF with resistor pack, but there IS a DSWA port in the driver so we may as well use it.
break;
}
}
}
static WRITE8_DEVICE_HANDLER( b_via_0_pb_w )
WRITE8_MEMBER(beezer_state::b_via_0_pb_w)
{
beezer_state *state = space.machine().driver_data<beezer_state>();
state->m_pbus = data;
m_pbus = data;
}
static READ8_DEVICE_HANDLER( b_via_1_pa_r )
READ8_MEMBER(beezer_state::b_via_1_pa_r)
{
beezer_state *state = space.machine().driver_data<beezer_state>();
return state->m_pbus;
return m_pbus;
}
static READ8_DEVICE_HANDLER( b_via_1_pb_r )
READ8_MEMBER(beezer_state::b_via_1_pb_r)
{
return 0x1F | (beezer_noise_r(space.machine().device("custom"), space, 0)?0x40:0);
return 0x1F | (beezer_noise_r(machine().device("custom"), space, 0)?0x40:0);
}
static WRITE8_DEVICE_HANDLER( b_via_1_pa_w )
WRITE8_MEMBER(beezer_state::b_via_1_pa_w)
{
beezer_state *state = space.machine().driver_data<beezer_state>();
state->m_pbus = data;
m_pbus = data;
}
static WRITE8_DEVICE_HANDLER( b_via_1_pb_w )
WRITE8_MEMBER(beezer_state::b_via_1_pb_w)
{
beezer_timer1_w(space.machine().device("custom"), space, 0, data&0x80);
beezer_timer1_w(machine().device("custom"), space, 0, data&0x80);
//if ((data&0x1f) != 0x01)
// popmessage("via1 pb low write of 0x%02x is not supported! contact mamedev!", data&0x1f);
}

View File

@ -287,28 +287,24 @@ INTERRUPT_GEN_MEMBER(carpolo_state::carpolo_timer_interrupt)
// FIXME: Remove trampolines
static WRITE_LINE_DEVICE_HANDLER( coin1_interrupt_clear_w )
WRITE_LINE_MEMBER(carpolo_state::coin1_interrupt_clear_w)
{
carpolo_state *drvstate = device->machine().driver_data<carpolo_state>();
drvstate->m_ttl7474_2s_1->clear_w(state);
m_ttl7474_2s_1->clear_w(state);
}
static WRITE_LINE_DEVICE_HANDLER( coin2_interrupt_clear_w )
WRITE_LINE_MEMBER(carpolo_state::coin2_interrupt_clear_w)
{
carpolo_state *drvstate = device->machine().driver_data<carpolo_state>();
drvstate->m_ttl7474_2s_2->clear_w(state);
m_ttl7474_2s_2->clear_w(state);
}
static WRITE_LINE_DEVICE_HANDLER( coin3_interrupt_clear_w )
WRITE_LINE_MEMBER(carpolo_state::coin3_interrupt_clear_w)
{
carpolo_state *drvstate = device->machine().driver_data<carpolo_state>();
drvstate->m_ttl7474_2u_1->clear_w(state);
m_ttl7474_2u_1->clear_w(state);
}
static WRITE_LINE_DEVICE_HANDLER( coin4_interrupt_clear_w )
WRITE_LINE_MEMBER(carpolo_state::coin4_interrupt_clear_w)
{
carpolo_state *drvstate = device->machine().driver_data<carpolo_state>();
drvstate->m_ttl7474_2u_2->clear_w(state);
m_ttl7474_2u_2->clear_w(state);
}
WRITE8_MEMBER(carpolo_state::carpolo_ball_screen_interrupt_clear_w)
@ -354,9 +350,8 @@ WRITE8_MEMBER(carpolo_state::carpolo_timer_interrupt_clear_w)
*
*************************************/
static WRITE8_DEVICE_HANDLER( pia_0_port_a_w )
WRITE8_MEMBER(carpolo_state::pia_0_port_a_w)
{
carpolo_state *state = space.machine().driver_data<carpolo_state>();
/* bit 0 - Coin counter
bit 1 - Player 4 crash sound
bit 2 - Player 3 crash sound
@ -366,19 +361,18 @@ static WRITE8_DEVICE_HANDLER( pia_0_port_a_w )
bit 6 - Player 1 crash sound
bit 7 - Ball hit pulse sound */
coin_counter_w(space.machine(), 0, data & 0x01);
coin_counter_w(machine(), 0, data & 0x01);
state->m_ttl7474_1f_1->clear_w((data & 0x08) >> 3);
state->m_ttl7474_1d_1->clear_w((data & 0x08) >> 3);
state->m_ttl7474_1c_1->clear_w((data & 0x08) >> 3);
state->m_ttl7474_1a_1->clear_w((data & 0x08) >> 3);
m_ttl7474_1f_1->clear_w((data & 0x08) >> 3);
m_ttl7474_1d_1->clear_w((data & 0x08) >> 3);
m_ttl7474_1c_1->clear_w((data & 0x08) >> 3);
m_ttl7474_1a_1->clear_w((data & 0x08) >> 3);
}
static WRITE8_DEVICE_HANDLER( pia_0_port_b_w )
WRITE8_MEMBER(carpolo_state::pia_0_port_b_w)
{
carpolo_state *state = space.machine().driver_data<carpolo_state>();
/* bit 0 - Strobe speed bits sound
bit 1 - Speed bit 0 sound
bit 2 - Speed bit 1 sound
@ -386,26 +380,24 @@ static WRITE8_DEVICE_HANDLER( pia_0_port_b_w )
bit 6 - Select pedal 0
bit 7 - Select pdeal 1 */
ttl74153_a_w(state->m_ttl74153_1k, data & 0x40);
ttl74153_b_w(state->m_ttl74153_1k, data & 0x80);
ttl74153_a_w(m_ttl74153_1k, data & 0x40);
ttl74153_b_w(m_ttl74153_1k, data & 0x80);
ttl74153_update(state->m_ttl74153_1k);
ttl74153_update(m_ttl74153_1k);
}
static READ8_DEVICE_HANDLER( pia_0_port_b_r )
READ8_MEMBER(carpolo_state::pia_0_port_b_r)
{
carpolo_state *state = space.machine().driver_data<carpolo_state>();
/* bit 4 - Pedal bit 0
bit 5 - Pedal bit 1 */
return (ttl74153_output_r(state->m_ttl74153_1k, 0) << 5) |
(ttl74153_output_r(state->m_ttl74153_1k, 1) << 4);
return (ttl74153_output_r(m_ttl74153_1k, 0) << 5) |
(ttl74153_output_r(m_ttl74153_1k, 1) << 4);
}
static READ8_DEVICE_HANDLER( pia_1_port_a_r )
READ8_MEMBER(carpolo_state::pia_1_port_a_r)
{
carpolo_state *state = space.machine().driver_data<carpolo_state>();
UINT8 ret;
/* bit 0 - Player 4 steering input (left or right)
@ -417,19 +409,18 @@ static READ8_DEVICE_HANDLER( pia_1_port_a_r )
bit 6 - Player 2 forward/reverse input
bit 7 - Player 1 forward/reverse input */
ret = (state->m_ttl7474_1a_2->output_r() ? 0x01 : 0x00) |
(state->m_ttl7474_1c_2->output_r() ? 0x02 : 0x00) |
(state->m_ttl7474_1d_2->output_r() ? 0x04 : 0x00) |
(state->m_ttl7474_1f_2->output_r() ? 0x08 : 0x00) |
(state->ioport("IN2")->read() & 0xf0);
ret = (m_ttl7474_1a_2->output_r() ? 0x01 : 0x00) |
(m_ttl7474_1c_2->output_r() ? 0x02 : 0x00) |
(m_ttl7474_1d_2->output_r() ? 0x04 : 0x00) |
(m_ttl7474_1f_2->output_r() ? 0x08 : 0x00) |
(ioport("IN2")->read() & 0xf0);
return ret;
}
static READ8_DEVICE_HANDLER( pia_1_port_b_r )
READ8_MEMBER(carpolo_state::pia_1_port_b_r)
{
carpolo_state *state = space.machine().driver_data<carpolo_state>();
UINT8 ret;
/* bit 4 - Player 4 steering input (wheel moving or stopped)
@ -437,10 +428,10 @@ static READ8_DEVICE_HANDLER( pia_1_port_b_r )
bit 6 - Player 2 steering input (wheel moving or stopped)
bit 7 - Player 1 steering input (wheel moving or stopped) */
ret = (state->m_ttl7474_1a_1->output_r() ? 0x10 : 0x00) |
(state->m_ttl7474_1c_1->output_r() ? 0x20 : 0x00) |
(state->m_ttl7474_1d_1->output_r() ? 0x40 : 0x00) |
(state->m_ttl7474_1f_1->output_r() ? 0x80 : 0x00);
ret = (m_ttl7474_1a_1->output_r() ? 0x10 : 0x00) |
(m_ttl7474_1c_1->output_r() ? 0x20 : 0x00) |
(m_ttl7474_1d_1->output_r() ? 0x40 : 0x00) |
(m_ttl7474_1f_1->output_r() ? 0x80 : 0x00);
return ret;
}
@ -449,15 +440,15 @@ static READ8_DEVICE_HANDLER( pia_1_port_b_r )
const pia6821_interface carpolo_pia0_intf =
{
DEVCB_NULL, /* port A in */
DEVCB_HANDLER(pia_0_port_b_r), /* port B in */
DEVCB_DRIVER_MEMBER(carpolo_state,pia_0_port_b_r), /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_HANDLER(pia_0_port_a_w), /* port A out */
DEVCB_HANDLER(pia_0_port_b_w), /* port B out */
DEVCB_LINE(coin1_interrupt_clear_w), /* line CA2 out */
DEVCB_LINE(coin2_interrupt_clear_w), /* port CB2 out */
DEVCB_DRIVER_MEMBER(carpolo_state,pia_0_port_a_w), /* port A out */
DEVCB_DRIVER_MEMBER(carpolo_state,pia_0_port_b_w), /* port B out */
DEVCB_DRIVER_LINE_MEMBER(carpolo_state,coin1_interrupt_clear_w), /* line CA2 out */
DEVCB_DRIVER_LINE_MEMBER(carpolo_state,coin2_interrupt_clear_w), /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_NULL /* IRQB */
};
@ -465,16 +456,16 @@ const pia6821_interface carpolo_pia0_intf =
const pia6821_interface carpolo_pia1_intf =
{
DEVCB_HANDLER(pia_1_port_a_r), /* port A in */
DEVCB_HANDLER(pia_1_port_b_r), /* port B in */
DEVCB_DRIVER_MEMBER(carpolo_state,pia_1_port_a_r), /* port A in */
DEVCB_DRIVER_MEMBER(carpolo_state,pia_1_port_b_r), /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_NULL, /* port A out */
DEVCB_NULL, /* port B out */
DEVCB_LINE(coin3_interrupt_clear_w), /* line CA2 out */
DEVCB_LINE(coin4_interrupt_clear_w), /* port CB2 out */
DEVCB_DRIVER_LINE_MEMBER(carpolo_state,coin3_interrupt_clear_w), /* line CA2 out */
DEVCB_DRIVER_LINE_MEMBER(carpolo_state,coin4_interrupt_clear_w), /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_NULL /* IRQB */
};

View File

@ -828,27 +828,25 @@ void dc_state::machine_reset()
dc_sysctrl_regs[SB_SBREV] = 0x0b;
}
READ64_DEVICE_HANDLER( dc_aica_reg_r )
READ64_MEMBER(dc_state::dc_aica_reg_r)
{
// dc_state *state = space.machine().driver_data<dc_state>();
//int reg;
UINT64 shift;
/*reg = */decode_reg32_64(space.machine(), offset, mem_mask, &shift);
/*reg = */decode_reg32_64(machine(), offset, mem_mask, &shift);
// mame_printf_verbose("AICA REG: [%08x] read %" I64FMT "x, mask %" I64FMT "x\n", 0x700000+reg*4, (UINT64)offset, mem_mask);
return (UINT64) aica_r(device, space, offset*2, 0xffff)<<shift;
return (UINT64) aica_r(machine().device("aica"), space, offset*2, 0xffff)<<shift;
}
WRITE64_DEVICE_HANDLER( dc_aica_reg_w )
WRITE64_MEMBER(dc_state::dc_aica_reg_w)
{
// dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
UINT32 dat;
reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
reg = decode_reg32_64(machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
if (reg == (0x2c00/4))
@ -856,27 +854,27 @@ WRITE64_DEVICE_HANDLER( dc_aica_reg_w )
if (dat & 1)
{
/* halt the ARM7 */
space.machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
}
else
{
/* it's alive ! */
space.machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
}
}
aica_w(device, space, offset*2, dat, shift ? ((mem_mask>>32)&0xffff) : (mem_mask & 0xffff));
aica_w(machine().device("aica"), space, offset*2, dat, shift ? ((mem_mask>>32)&0xffff) : (mem_mask & 0xffff));
// mame_printf_verbose("AICA REG: [%08x=%x] write %" I64FMT "x to %x, mask %" I64FMT "x\n", 0x700000+reg*4, dat, data, offset, mem_mask);
}
READ32_DEVICE_HANDLER( dc_arm_aica_r )
READ32_MEMBER(dc_state::dc_arm_aica_r)
{
return aica_r(device, space, offset*2, 0xffff) & 0xffff;
return aica_r(machine().device("aica"), space, offset*2, 0xffff) & 0xffff;
}
WRITE32_DEVICE_HANDLER( dc_arm_aica_w )
WRITE32_MEMBER(dc_state::dc_arm_aica_w)
{
aica_w(device, space, offset*2, data, mem_mask&0xffff);
aica_w(machine().device("aica"), space, offset*2, data, mem_mask&0xffff);
}

View File

@ -260,24 +260,24 @@ WRITE16_MEMBER(gaelco2_state::wrally2_adc_cs)
***************************************************************************/
WRITE16_DEVICE_HANDLER( gaelco2_eeprom_cs_w )
WRITE16_MEMBER(gaelco2_state::gaelco2_eeprom_cs_w)
{
/* bit 0 is CS (active low) */
eeprom_device *eeprom = downcast<eeprom_device *>(device);
eeprom_device *eeprom = downcast<eeprom_device *>(machine().device("eeprom"));
eeprom->set_cs_line((data & 0x01) ? CLEAR_LINE : ASSERT_LINE);
}
WRITE16_DEVICE_HANDLER( gaelco2_eeprom_sk_w )
WRITE16_MEMBER(gaelco2_state::gaelco2_eeprom_sk_w)
{
/* bit 0 is SK (active high) */
eeprom_device *eeprom = downcast<eeprom_device *>(device);
eeprom_device *eeprom = downcast<eeprom_device *>(machine().device("eeprom"));
eeprom->set_clock_line((data & 0x01) ? ASSERT_LINE : CLEAR_LINE);
}
WRITE16_DEVICE_HANDLER( gaelco2_eeprom_data_w )
WRITE16_MEMBER(gaelco2_state::gaelco2_eeprom_data_w)
{
/* bit 0 is EEPROM data (DIN) */
eeprom_device *eeprom = downcast<eeprom_device *>(device);
eeprom_device *eeprom = downcast<eeprom_device *>(machine().device("eeprom"));
eeprom->write_bit(data & 0x01);
}

View File

@ -333,7 +333,7 @@ MACHINE_RESET_MEMBER(leland_state,leland)
/* reset globals */
m_gfx_control = 0x00;
address_space &space = generic_space();
leland_sound_port_w(machine().device("ay8910.1"), space, 0, 0xff);
leland_sound_port_w(space, 0, 0xff);
m_wcol_enable = 0;
m_dangerz_x = 512;
@ -817,19 +817,19 @@ void ataxx_init_eeprom(running_machine &machine, const UINT16 *data)
*
*************************************/
READ8_DEVICE_HANDLER( ataxx_eeprom_r )
READ8_MEMBER(leland_state::ataxx_eeprom_r)
{
int port = space.machine().root_device().ioport("IN2")->read();
if (LOG_EEPROM) logerror("%s:EE read\n", space.machine().describe_context());
int port = machine().root_device().ioport("IN2")->read();
if (LOG_EEPROM) logerror("%s:EE read\n", machine().describe_context());
return port;
}
WRITE8_DEVICE_HANDLER( ataxx_eeprom_w )
WRITE8_MEMBER(leland_state::ataxx_eeprom_w)
{
if (LOG_EEPROM) logerror("%s:EE write %d%d%d\n", space.machine().describe_context(),
if (LOG_EEPROM) logerror("%s:EE write %d%d%d\n", machine().describe_context(),
(data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1);
eeprom_device *eeprom = downcast<eeprom_device *>(device);
eeprom_device *eeprom = downcast<eeprom_device *>(machine().device("eeprom"));
eeprom->write_bit ((data & 0x10) >> 4);
eeprom->set_clock_line((data & 0x20) ? ASSERT_LINE : CLEAR_LINE);
eeprom->set_cs_line ((~data & 0x40) ? ASSERT_LINE : CLEAR_LINE);
@ -1302,29 +1302,27 @@ READ8_MEMBER(leland_state::ataxx_paletteram_and_misc_r)
*
*************************************/
READ8_DEVICE_HANDLER( leland_sound_port_r )
READ8_MEMBER(leland_state::leland_sound_port_r)
{
leland_state *state = space.machine().driver_data<leland_state>();
return state->m_gfx_control;
return m_gfx_control;
}
WRITE8_DEVICE_HANDLER( leland_sound_port_w )
WRITE8_MEMBER(leland_state::leland_sound_port_w)
{
leland_state *state = space.machine().driver_data<leland_state>();
/* update the graphics banking */
leland_gfx_port_w(device, space, 0, data);
leland_gfx_port_w(space, 0, data);
/* set the new value */
state->m_gfx_control = data;
state->m_dac_control = data & 3;
m_gfx_control = data;
m_dac_control = data & 3;
/* some bankswitching occurs here */
if (LOG_BANKSWITCHING_M)
if ((state->m_sound_port_bank ^ data) & 0x24)
logerror("%s:sound_port_bank = %02X\n", space.machine().describe_context(), data & 0x24);
state->m_sound_port_bank = data & 0x24;
(*state->m_update_master_bank)(space.machine());
if ((m_sound_port_bank ^ data) & 0x24)
logerror("%s:sound_port_bank = %02X\n", machine().describe_context(), data & 0x24);
m_sound_port_bank = data & 0x24;
(*m_update_master_bank)(machine());
}

View File

@ -33,18 +33,6 @@ UINT32 mcr_sprite_board;
static emu_timer *ipu_watchdog_timer;
/*************************************
*
* Function prototypes
*
*************************************/
static DECLARE_WRITE8_DEVICE_HANDLER( ipu_break_changed );
/*************************************
*
* Graphics declarations
@ -132,19 +120,19 @@ Z80PIO_INTERFACE( nflfoot_pio_intf )
};
static WRITE_LINE_DEVICE_HANDLER( ipu_ctc_interrupt )
WRITE_LINE_MEMBER(mcr_state::ipu_ctc_interrupt)
{
device->machine().device("ipu")->execute().set_input_line(0, state);
machine().device("ipu")->execute().set_input_line(0, state);
}
const z80sio_interface nflfoot_sio_intf =
{
DEVCB_LINE(ipu_ctc_interrupt), /* interrupt handler */
DEVCB_DRIVER_LINE_MEMBER(mcr_state,ipu_ctc_interrupt), /* interrupt handler */
DEVCB_NULL, /* DTR changed handler */
DEVCB_NULL, /* RTS changed handler */
DEVCB_HANDLER(ipu_break_changed), /* BREAK changed handler */
DEVCB_HANDLER(mcr_ipu_sio_transmit)/* transmit handler */
DEVCB_DRIVER_MEMBER(mcr_state,ipu_break_changed), /* BREAK changed handler */
DEVCB_DRIVER_MEMBER16(mcr_state,mcr_ipu_sio_transmit)/* transmit handler */
};
@ -225,14 +213,14 @@ TIMER_DEVICE_CALLBACK_MEMBER(mcr_state::mcr_ipu_interrupt)
*
*************************************/
static WRITE8_DEVICE_HANDLER( ipu_break_changed )
WRITE8_MEMBER(mcr_state::ipu_break_changed)
{
/* channel B is connected to the CED player */
if (offset == 1)
{
logerror("DTR changed -> %d\n", data);
if (data == 1)
downcast<z80sio_device *>(device)->receive_data(1, 0);
downcast<z80sio_device *>(machine().device("ipu_sio"))->receive_data(1, 0);
}
}

View File

@ -21,39 +21,27 @@
static void subtract_from_counter(running_machine &machine, int counter, int count);
static DECLARE_WRITE8_DEVICE_HANDLER( zwackery_pia0_w );
static DECLARE_WRITE8_DEVICE_HANDLER( zwackery_pia1_w );
static WRITE_LINE_DEVICE_HANDLER( zwackery_ca2_w );
static WRITE_LINE_DEVICE_HANDLER( zwackery_pia_irq );
/*************************************
*
* 6821 PIA declarations
*
*************************************/
static READ8_DEVICE_HANDLER( zwackery_port_1_r )
READ8_MEMBER(mcr68_state::zwackery_port_1_r)
{
UINT8 ret = space.machine().root_device().ioport("IN1")->read();
UINT8 ret = machine().root_device().ioport("IN1")->read();
downcast<pia6821_device *>(device)->set_port_a_z_mask(ret);
downcast<pia6821_device *>(machine().device("pia1"))->set_port_a_z_mask(ret);
return ret;
}
static READ8_DEVICE_HANDLER( zwackery_port_3_r )
READ8_MEMBER(mcr68_state::zwackery_port_3_r)
{
UINT8 ret = space.machine().root_device().ioport("IN3")->read();
UINT8 ret = machine().root_device().ioport("IN3")->read();
downcast<pia6821_device *>(device)->set_port_a_z_mask(ret);
downcast<pia6821_device *>(machine().device("pia2"))->set_port_a_z_mask(ret);
return ret;
}
@ -67,26 +55,26 @@ const pia6821_interface zwackery_pia0_intf =
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_HANDLER(zwackery_pia0_w), /* port A out */
DEVCB_DRIVER_MEMBER(mcr68_state,zwackery_pia0_w), /* port A out */
DEVCB_NULL, /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_LINE(zwackery_pia_irq), /* IRQA */
DEVCB_LINE(zwackery_pia_irq) /* IRQB */
DEVCB_DRIVER_LINE_MEMBER(mcr68_state,zwackery_pia_irq), /* IRQA */
DEVCB_DRIVER_LINE_MEMBER(mcr68_state,zwackery_pia_irq) /* IRQB */
};
const pia6821_interface zwackery_pia1_intf =
{
DEVCB_HANDLER(zwackery_port_1_r), /* port A in */
DEVCB_DRIVER_MEMBER(mcr68_state,zwackery_port_1_r), /* port A in */
DEVCB_DRIVER_MEMBER(mcr68_state, zwackery_port_2_r), /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_HANDLER(zwackery_pia1_w), /* port A out */
DEVCB_DRIVER_MEMBER(mcr68_state,zwackery_pia1_w), /* port A out */
DEVCB_NULL, /* port B out */
DEVCB_LINE(zwackery_ca2_w), /* line CA2 out */
DEVCB_DRIVER_LINE_MEMBER(mcr68_state,zwackery_ca2_w), /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_NULL, /* IRQA */
DEVCB_NULL /* IRQB */
@ -95,7 +83,7 @@ const pia6821_interface zwackery_pia1_intf =
const pia6821_interface zwackery_pia2_intf =
{
DEVCB_HANDLER(zwackery_port_3_r), /* port A in */
DEVCB_DRIVER_MEMBER(mcr68_state,zwackery_port_3_r), /* port A in */
DEVCB_INPUT_PORT("DSW"), /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
@ -263,10 +251,10 @@ TIMER_CALLBACK_MEMBER(mcr68_state::mcr68_493_callback)
*
*************************************/
WRITE8_DEVICE_HANDLER( zwackery_pia0_w )
WRITE8_MEMBER(mcr68_state::zwackery_pia0_w)
{
/* bit 7 is the watchdog */
if (!(data & 0x80)) space.machine().watchdog_reset();
if (!(data & 0x80)) machine().watchdog_reset();
/* bits 5 and 6 control hflip/vflip */
/* bits 3 and 4 control coin counters? */
@ -274,27 +262,24 @@ WRITE8_DEVICE_HANDLER( zwackery_pia0_w )
}
WRITE8_DEVICE_HANDLER( zwackery_pia1_w )
WRITE8_MEMBER(mcr68_state::zwackery_pia1_w)
{
mcr68_state *state = space.machine().driver_data<mcr68_state>();
state->m_zwackery_sound_data = (data >> 4) & 0x0f;
m_zwackery_sound_data = (data >> 4) & 0x0f;
}
WRITE_LINE_DEVICE_HANDLER( zwackery_ca2_w )
WRITE_LINE_MEMBER(mcr68_state::zwackery_ca2_w)
{
mcr68_state *drvstate = device->machine().driver_data<mcr68_state>();
address_space &space = device->machine().device("maincpu")->memory().space(AS_PROGRAM);
drvstate->m_chip_squeak_deluxe->write(space, 0, (state << 4) | drvstate->m_zwackery_sound_data);
address_space &space = machine().device("maincpu")->memory().space(AS_PROGRAM);
m_chip_squeak_deluxe->write(space, 0, (state << 4) | m_zwackery_sound_data);
}
static WRITE_LINE_DEVICE_HANDLER( zwackery_pia_irq )
WRITE_LINE_MEMBER(mcr68_state::zwackery_pia_irq)
{
mcr68_state *drvstate = device->machine().driver_data<mcr68_state>();
pia6821_device *pia = downcast<pia6821_device *>(device);
drvstate->m_v493_irq_state = pia->irq_a_state() | pia->irq_b_state();
update_mcr68_interrupts(device->machine());
pia6821_device *pia = machine().device<pia6821_device>("pia0");
m_v493_irq_state = pia->irq_a_state() | pia->irq_b_state();
update_mcr68_interrupts(machine());
}

View File

@ -105,8 +105,9 @@ static DECLARE_WRITE16_HANDLER( megadriv_68k_req_z80_reset );
READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read)
READ8_MEMBER(md_base_state::megadriv_68k_YM2612_read)
{
device_t *device = machine().device("ymsnd");
//mame_printf_debug("megadriv_68k_YM2612_read %02x %04x\n",offset,mem_mask);
if ( (genz80.z80_has_bus==0) && (genz80.z80_is_reset==0) )
{
@ -114,7 +115,7 @@ READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read)
}
else
{
logerror("%s: 68000 attempting to access YM2612 (read) without bus\n", space.machine().describe_context());
logerror("%s: 68000 attempting to access YM2612 (read) without bus\n", machine().describe_context());
return 0;
}
@ -122,8 +123,9 @@ READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read)
}
WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write)
WRITE8_MEMBER(md_base_state::megadriv_68k_YM2612_write)
{
device_t *device = machine().device("ymsnd");
//mame_printf_debug("megadriv_68k_YM2612_write %02x %04x %04x\n",offset,data,mem_mask);
if ( (genz80.z80_has_bus==0) && (genz80.z80_is_reset==0) )
{
@ -131,7 +133,7 @@ WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write)
}
else
{
logerror("%s: 68000 attempting to access YM2612 (write) without bus\n", space.machine().describe_context());
logerror("%s: 68000 attempting to access YM2612 (write) without bus\n", machine().describe_context());
}
}
@ -559,13 +561,13 @@ WRITE16_HANDLER( megadriv_68k_io_write )
static ADDRESS_MAP_START( megadriv_map, AS_PROGRAM, 16, driver_device )
static ADDRESS_MAP_START( megadriv_map, AS_PROGRAM, 16, md_base_state )
AM_RANGE(0x000000, 0x3fffff) AM_ROM
/* (0x000000 - 0x3fffff) == GAME ROM (4Meg Max, Some games have special banking too) */
AM_RANGE(0xa00000, 0xa01fff) AM_READWRITE_LEGACY(megadriv_68k_read_z80_ram,megadriv_68k_write_z80_ram)
AM_RANGE(0xa02000, 0xa03fff) AM_WRITE_LEGACY(megadriv_68k_write_z80_ram)
AM_RANGE(0xa04000, 0xa04003) AM_DEVREADWRITE8_LEGACY("ymsnd", megadriv_68k_YM2612_read,megadriv_68k_YM2612_write, 0xffff)
AM_RANGE(0xa04000, 0xa04003) AM_READWRITE8(megadriv_68k_YM2612_read,megadriv_68k_YM2612_write, 0xffff)
AM_RANGE(0xa06000, 0xa06001) AM_WRITE_LEGACY(megadriv_68k_z80_bank_write)
@ -865,13 +867,13 @@ ADDRESS_MAP_END
/************************************ Megadrive Bootlegs *************************************/
// smaller ROM region because some bootlegs check for RAM there
static ADDRESS_MAP_START( md_bootleg_map, AS_PROGRAM, 16, driver_device )
static ADDRESS_MAP_START( md_bootleg_map, AS_PROGRAM, 16, md_base_state )
AM_RANGE(0x000000, 0x0fffff) AM_ROM /* Cartridge Program Rom */
AM_RANGE(0x200000, 0x2023ff) AM_RAM // tested
AM_RANGE(0xa00000, 0xa01fff) AM_READWRITE_LEGACY(megadriv_68k_read_z80_ram, megadriv_68k_write_z80_ram)
AM_RANGE(0xa02000, 0xa03fff) AM_WRITE_LEGACY(megadriv_68k_write_z80_ram)
AM_RANGE(0xa04000, 0xa04003) AM_DEVREADWRITE8_LEGACY("ymsnd", megadriv_68k_YM2612_read, megadriv_68k_YM2612_write, 0xffff)
AM_RANGE(0xa04000, 0xa04003) AM_READWRITE8(megadriv_68k_YM2612_read, megadriv_68k_YM2612_write, 0xffff)
AM_RANGE(0xa06000, 0xa06001) AM_WRITE_LEGACY(megadriv_68k_z80_bank_write)
AM_RANGE(0xa10000, 0xa1001f) AM_READWRITE_LEGACY(megadriv_68k_io_read, megadriv_68k_io_write)

View File

@ -13,29 +13,6 @@
#include "includes/qix.h"
/*************************************
*
* Static function prototypes
*
*************************************/
static DECLARE_READ8_DEVICE_HANDLER( qixmcu_coin_r );
static DECLARE_WRITE8_DEVICE_HANDLER( qixmcu_coinctrl_w );
static DECLARE_WRITE8_DEVICE_HANDLER( qixmcu_coin_w );
static DECLARE_WRITE8_DEVICE_HANDLER( qix_coinctl_w );
static DECLARE_WRITE8_DEVICE_HANDLER( slither_76489_0_w );
static DECLARE_WRITE8_DEVICE_HANDLER( slither_76489_1_w );
static DECLARE_READ8_DEVICE_HANDLER( slither_trak_lr_r );
static DECLARE_READ8_DEVICE_HANDLER( slither_trak_ud_r );
/***************************************************************************
Qix has 6 PIAs on board:
@ -128,7 +105,7 @@ const pia6821_interface qix_pia_2_intf =
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_NULL, /* port A out */
DEVCB_HANDLER(qix_coinctl_w), /* port B out */
DEVCB_DRIVER_MEMBER(qix_state,qix_coinctl_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_NULL, /* IRQA */
@ -147,13 +124,13 @@ const pia6821_interface qix_pia_2_intf =
const pia6821_interface qixmcu_pia_0_intf =
{
DEVCB_INPUT_PORT("P1"), /* port A in */
DEVCB_HANDLER(qixmcu_coin_r), /* port B in */
DEVCB_DRIVER_MEMBER(qix_state,qixmcu_coin_r), /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_NULL, /* port A out */
DEVCB_HANDLER(qixmcu_coin_w), /* port B out */
DEVCB_DRIVER_MEMBER(qix_state,qixmcu_coin_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_NULL, /* IRQA */
@ -169,7 +146,7 @@ const pia6821_interface qixmcu_pia_2_intf =
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_NULL, /* port A out */
DEVCB_HANDLER(qixmcu_coinctrl_w), /* port B out */
DEVCB_DRIVER_MEMBER(qix_state,qixmcu_coinctrl_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_NULL, /* IRQA */
@ -187,14 +164,14 @@ const pia6821_interface qixmcu_pia_2_intf =
const pia6821_interface slither_pia_1_intf =
{
DEVCB_HANDLER(slither_trak_lr_r), /* port A in */
DEVCB_DRIVER_MEMBER(qix_state,slither_trak_lr_r), /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_NULL, /* port A out */
DEVCB_HANDLER(slither_76489_0_w), /* port B out */
DEVCB_DRIVER_MEMBER(qix_state,slither_76489_0_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_NULL, /* IRQA */
@ -203,14 +180,14 @@ const pia6821_interface slither_pia_1_intf =
const pia6821_interface slither_pia_2_intf =
{
DEVCB_HANDLER(slither_trak_ud_r), /* port A in */
DEVCB_DRIVER_MEMBER(qix_state,slither_trak_ud_r), /* port A in */
DEVCB_NULL, /* port B in */
DEVCB_NULL, /* line CA1 in */
DEVCB_NULL, /* line CB1 in */
DEVCB_NULL, /* line CA2 in */
DEVCB_NULL, /* line CB2 in */
DEVCB_NULL, /* port A out */
DEVCB_HANDLER(slither_76489_1_w), /* port B out */
DEVCB_DRIVER_MEMBER(qix_state,slither_76489_1_w), /* port B out */
DEVCB_NULL, /* line CA2 out */
DEVCB_NULL, /* port CB2 out */
DEVCB_NULL, /* IRQA */
@ -249,9 +226,9 @@ MACHINE_START_MEMBER(qix_state,qixmcu)
*
*************************************/
WRITE_LINE_DEVICE_HANDLER( qix_vsync_changed )
WRITE_LINE_MEMBER(qix_state::qix_vsync_changed)
{
pia6821_device *pia = device->machine().device<pia6821_device>("sndpia0");
pia6821_device *pia = machine().device<pia6821_device>("sndpia0");
pia->cb1_w(state);
}
@ -344,44 +321,41 @@ READ8_MEMBER(qix_state::qix_video_firq_ack_r)
*
*************************************/
READ8_DEVICE_HANDLER( qixmcu_coin_r )
READ8_MEMBER(qix_state::qixmcu_coin_r)
{
qix_state *state = space.machine().driver_data<qix_state>();
logerror("6809:qixmcu_coin_r = %02X\n", state->m_68705_port_out[0]);
return state->m_68705_port_out[0];
logerror("6809:qixmcu_coin_r = %02X\n", m_68705_port_out[0]);
return m_68705_port_out[0];
}
static WRITE8_DEVICE_HANDLER( qixmcu_coin_w )
WRITE8_MEMBER(qix_state::qixmcu_coin_w)
{
qix_state *state = space.machine().driver_data<qix_state>();
logerror("6809:qixmcu_coin_w = %02X\n", data);
/* this is a callback called by pia6821_device::write(), so I don't need to synchronize */
/* the CPUs - they have already been synchronized by qix_pia_w() */
state->m_68705_port_in[0] = data;
m_68705_port_in[0] = data;
}
static WRITE8_DEVICE_HANDLER( qixmcu_coinctrl_w )
WRITE8_MEMBER(qix_state::qixmcu_coinctrl_w)
{
qix_state *state = space.machine().driver_data<qix_state>();
/* if (!(data & 0x04)) */
if (data & 0x04)
{
space.machine().device("mcu")->execute().set_input_line(M68705_IRQ_LINE, ASSERT_LINE);
machine().device("mcu")->execute().set_input_line(M68705_IRQ_LINE, ASSERT_LINE);
/* temporarily boost the interleave to sync things up */
/* note: I'm using 50 because 30 is not enough for space dungeon at game over */
space.machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
}
else
space.machine().device("mcu")->execute().set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
machine().device("mcu")->execute().set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
/* this is a callback called by pia6821_device::write(), so I don't need to synchronize */
/* the CPUs - they have already been synchronized by qix_pia_w() */
state->m_coinctrl = data;
m_coinctrl = data;
logerror("6809:qixmcu_coinctrl_w = %02X\n", data);
}
@ -469,12 +443,11 @@ TIMER_CALLBACK_MEMBER(qix_state::pia_w_callback)
}
WRITE8_DEVICE_HANDLER( qix_pia_w )
WRITE8_MEMBER(qix_state::qix_pia_w)
{
qix_state *state = device->machine().driver_data<qix_state>();
/* make all the CPUs synchronize, and only AFTER that write the command to the PIA */
/* otherwise the 68705 will miss commands */
space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(qix_state::pia_w_callback),state), data | (offset << 8), (void *)downcast<pia6821_device *>(device));
machine().scheduler().synchronize(timer_expired_delegate(FUNC(qix_state::pia_w_callback),this), data | (offset << 8), (void *)downcast<pia6821_device *>(machine().device("pia0")));
}
@ -485,10 +458,10 @@ WRITE8_DEVICE_HANDLER( qix_pia_w )
*
*************************************/
static WRITE8_DEVICE_HANDLER( qix_coinctl_w )
WRITE8_MEMBER(qix_state::qix_coinctl_w)
{
coin_lockout_w(space.machine(), 0, (~data >> 2) & 1);
coin_counter_w(space.machine(), 0, (data >> 1) & 1);
coin_lockout_w(machine(), 0, (~data >> 2) & 1);
coin_counter_w(machine(), 0, (data >> 1) & 1);
}
@ -499,29 +472,26 @@ static WRITE8_DEVICE_HANDLER( qix_coinctl_w )
*
*************************************/
static WRITE8_DEVICE_HANDLER( slither_76489_0_w )
WRITE8_MEMBER(qix_state::slither_76489_0_w)
{
qix_state *state = space.machine().driver_data<qix_state>();
/* write to the sound chip */
state->m_sn1->write(space.machine().device<legacy_cpu_device>("maincpu")->space(), 0, data);
m_sn1->write(space.machine().device<legacy_cpu_device>("maincpu")->space(), 0, data);
/* clock the ready line going back into CB1 */
pia6821_device *pia = downcast<pia6821_device *>(device);
pia6821_device *pia = downcast<pia6821_device *>(machine().device("pia1"));
pia->cb1_w(0);
pia->cb1_w(1);
}
static WRITE8_DEVICE_HANDLER( slither_76489_1_w )
WRITE8_MEMBER(qix_state::slither_76489_1_w)
{
qix_state *state = space.machine().driver_data<qix_state>();
/* write to the sound chip */
state->m_sn2->write(space.machine().device<legacy_cpu_device>("maincpu")->space(), 0, data);
m_sn2->write(machine().device<legacy_cpu_device>("maincpu")->space(), 0, data);
/* clock the ready line going back into CB1 */
pia6821_device *pia = downcast<pia6821_device *>(device);
pia6821_device *pia = downcast<pia6821_device *>(machine().device("pia2"));
pia->cb1_w(0);
pia->cb1_w(1);
}
@ -534,17 +504,15 @@ static WRITE8_DEVICE_HANDLER( slither_76489_1_w )
*
*************************************/
static READ8_DEVICE_HANDLER( slither_trak_lr_r )
READ8_MEMBER(qix_state::slither_trak_lr_r)
{
qix_state *state = space.machine().driver_data<qix_state>();
return state->ioport(state->m_flip ? "AN3" : "AN1")->read();
return ioport(m_flip ? "AN3" : "AN1")->read();
}
static READ8_DEVICE_HANDLER( slither_trak_ud_r )
READ8_MEMBER(qix_state::slither_trak_ud_r)
{
qix_state *state = space.machine().driver_data<qix_state>();
return state->ioport(state->m_flip ? "AN2" : "AN0")->read();
return ioport(m_flip ? "AN2" : "AN0")->read();
}

View File

@ -49,15 +49,14 @@ CUSTOM_INPUT_MEMBER(scramble_state::darkplnt_custom_r)
/* state of the security PAL (6J) */
WRITE8_DEVICE_HANDLER( scramble_protection_w )
WRITE8_MEMBER(scramble_state::scramble_protection_w)
{
scramble_state *state = space.machine().driver_data<scramble_state>();
state->m_xb = data;
m_xb = data;
}
READ8_DEVICE_HANDLER( scramble_protection_r )
READ8_MEMBER(scramble_state::scramble_protection_r)
{
switch (space.machine().device("maincpu")->safe_pc())
switch (machine().device("maincpu")->safe_pc())
{
case 0x00a8: return 0xf0;
case 0x00be: return 0xb0;
@ -68,7 +67,7 @@ READ8_DEVICE_HANDLER( scramble_protection_r )
case 0x1ca2: return 0x00; /* I don't think it's checked */
case 0x1d7e: return 0xb0;
default:
logerror("%s: read protection\n",space.machine().describe_context());
logerror("%s: read protection\n",machine().describe_context());
return 0;
}
}

View File

@ -51,9 +51,9 @@ READ8_MEMBER(simpsons_state::simpsons_sound_interrupt_r)
return 0x00;
}
READ8_DEVICE_HANDLER( simpsons_sound_r )
READ8_MEMBER(simpsons_state::simpsons_sound_r)
{
return k053260_r(device, space, 2 + offset);
return k053260_r(machine().device("k053260"), space, 2 + offset);
}

View File

@ -750,10 +750,9 @@ WRITE8_HANDLER( snes_w_io )
snes_ram[offset] = data;
}
WRITE_LINE_DEVICE_HANDLER( snes_extern_irq_w )
WRITE_LINE_MEMBER(snes_state::snes_extern_irq_w)
{
snes_state *driver_state = device->machine().driver_data<snes_state>();
driver_state->m_maincpu->set_input_line(G65816_LINE_IRQ, state);
m_maincpu->set_input_line(G65816_LINE_IRQ, state);
}
/*************************************

View File

@ -210,16 +210,15 @@ void stfight_adpcm_int(device_t *device)
state->m_toggle ^= 1;
}
WRITE8_DEVICE_HANDLER( stfight_adpcm_control_w )
WRITE8_MEMBER(stfight_state::stfight_adpcm_control_w)
{
stfight_state *state = space.machine().driver_data<stfight_state>();
if( data < 0x08 )
{
state->m_adpcm_data_offs = sampleLimits[data];
state->m_adpcm_data_end = sampleLimits[data+1];
m_adpcm_data_offs = sampleLimits[data];
m_adpcm_data_end = sampleLimits[data+1];
}
msm5205_reset_w( device, data & 0x08 ? 1 : 0 );
msm5205_reset_w( machine().device("msm"), data & 0x08 ? 1 : 0 );
}
WRITE8_MEMBER(stfight_state::stfight_e800_w)

View File

@ -335,9 +335,9 @@ WRITE16_MEMBER(tatsumi_state::tatsumi_v30_68000_w)
// Todo: Current YM2151 doesn't seem to raise the busy flag quickly enough for the
// self-test in Tatsumi games. Needs fixed, but hack it here for now.
READ8_DEVICE_HANDLER(tatsumi_hack_ym2151_r)
READ8_MEMBER(tatsumi_state::tatsumi_hack_ym2151_r)
{
int r=ym2151_status_port_r(device,space,0);
int r=ym2151_status_port_r(machine().device("ymsnd"),space,0);
if (space.device().safe_pc()==0x2aca || space.device().safe_pc()==0x29fe
|| space.device().safe_pc()==0xf9721
@ -348,9 +348,9 @@ READ8_DEVICE_HANDLER(tatsumi_hack_ym2151_r)
// Todo: Tatsumi self-test fails if OKI doesn't respond (when sound off).
// Mame really should emulate the OKI status reads even with Mame sound off.
READ8_DEVICE_HANDLER(tatsumi_hack_oki_r)
READ8_MEMBER(tatsumi_state::tatsumi_hack_oki_r)
{
int r=downcast<okim6295_device *>(device)->read(space,0);
int r=downcast<okim6295_device *>(machine().device("oki"))->read(space,0);
if (space.device().safe_pc()==0x2b70 || space.device().safe_pc()==0x2bb5
|| space.device().safe_pc()==0x2acc

View File

@ -227,42 +227,39 @@ void vectrex_via_irq(device_t *device, int level)
}
READ8_DEVICE_HANDLER(vectrex_via_pb_r)
READ8_MEMBER(vectrex_state::vectrex_via_pb_r)
{
vectrex_state *state = space.machine().driver_data<vectrex_state>();
int pot;
static const char *const ctrlnames[] = { "CONTR1X", "CONTR1Y", "CONTR2X", "CONTR2Y" };
pot = space.machine().root_device().ioport(ctrlnames[(state->m_via_out[PORTB] & 0x6) >> 1])->read() - 0x80;
pot = machine().root_device().ioport(ctrlnames[(m_via_out[PORTB] & 0x6) >> 1])->read() - 0x80;
if (pot > (signed char)state->m_via_out[PORTA])
state->m_via_out[PORTB] |= 0x20;
if (pot > (signed char)m_via_out[PORTA])
m_via_out[PORTB] |= 0x20;
else
state->m_via_out[PORTB] &= ~0x20;
m_via_out[PORTB] &= ~0x20;
return state->m_via_out[PORTB];
return m_via_out[PORTB];
}
READ8_DEVICE_HANDLER(vectrex_via_pa_r)
READ8_MEMBER(vectrex_state::vectrex_via_pa_r)
{
vectrex_state *state = space.machine().driver_data<vectrex_state>();
if ((!(state->m_via_out[PORTB] & 0x10)) && (state->m_via_out[PORTB] & 0x08))
if ((!(m_via_out[PORTB] & 0x10)) && (m_via_out[PORTB] & 0x08))
/* BDIR inactive, we can read the PSG. BC1 has to be active. */
{
device_t *ay = space.machine().device("ay8912");
device_t *ay = machine().device("ay8912");
state->m_via_out[PORTA] = ay8910_r(ay, space, 0)
& ~(state->m_imager_pinlevel & 0x80);
m_via_out[PORTA] = ay8910_r(ay, space, 0)
& ~(m_imager_pinlevel & 0x80);
}
return state->m_via_out[PORTA];
return m_via_out[PORTA];
}
READ8_DEVICE_HANDLER(vectrex_s1_via_pb_r)
READ8_MEMBER(vectrex_state::vectrex_s1_via_pb_r)
{
vectrex_state *state = space.machine().driver_data<vectrex_state>();
return (state->m_via_out[PORTB] & ~0x40) | (state->ioport("COIN")->read() & 0x40);
return (m_via_out[PORTB] & ~0x40) | (ioport("COIN")->read() & 0x40);
}

View File

@ -17,8 +17,8 @@
*
*************************************/
static WRITE_LINE_DEVICE_HANDLER( v_irq4_w );
static WRITE_LINE_DEVICE_HANDLER( v_irq3_w );
@ -43,11 +43,11 @@ const struct pit8253_config vertigo_pit8254_config =
{
240000,
DEVCB_NULL,
DEVCB_LINE(v_irq4_w)
DEVCB_DRIVER_LINE_MEMBER(vertigo_state,v_irq4_w)
}, {
240000,
DEVCB_NULL,
DEVCB_LINE(v_irq3_w)
DEVCB_DRIVER_LINE_MEMBER(vertigo_state,v_irq3_w)
}, {
240000,
DEVCB_NULL,
@ -87,21 +87,20 @@ static void update_irq_encoder(running_machine &machine, int line, int state)
}
static WRITE_LINE_DEVICE_HANDLER( v_irq4_w )
WRITE_LINE_MEMBER(vertigo_state::v_irq4_w)
{
vertigo_state *drvstate = device->machine().driver_data<vertigo_state>();
update_irq_encoder(device->machine(), INPUT_LINE_IRQ4, state);
vertigo_vproc(device->machine(), device->machine().device<cpu_device>("maincpu")->attotime_to_cycles(device->machine().time() - drvstate->m_irq4_time), state);
drvstate->m_irq4_time = device->machine().time();
update_irq_encoder(machine(), INPUT_LINE_IRQ4, state);
vertigo_vproc(machine(), machine().device<cpu_device>("maincpu")->attotime_to_cycles(machine().time() - m_irq4_time), state);
m_irq4_time = machine().time();
}
static WRITE_LINE_DEVICE_HANDLER( v_irq3_w )
WRITE_LINE_MEMBER(vertigo_state::v_irq3_w)
{
if (state)
device->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE);
update_irq_encoder(device->machine(), INPUT_LINE_IRQ3, state);
update_irq_encoder(machine(), INPUT_LINE_IRQ3, state);
}

View File

@ -19,31 +19,11 @@ static void williams_main_irq(device_t *device, int state);
static void williams_main_firq(device_t *device, int state);
static void williams_snd_irq(device_t *device, int state);
static void williams_snd_irq_b(device_t *device, int state);
static DECLARE_WRITE8_DEVICE_HANDLER( williams_snd_cmd_w );
static DECLARE_WRITE8_DEVICE_HANDLER( playball_snd_cmd_w );
static DECLARE_WRITE8_DEVICE_HANDLER( blaster_snd_cmd_w );
/* input port mapping */
static DECLARE_WRITE8_DEVICE_HANDLER( williams_port_select_w );
static DECLARE_READ8_DEVICE_HANDLER( williams_input_port_49way_0_5_r );
static DECLARE_READ8_DEVICE_HANDLER( williams_49way_port_0_r );
/* newer-Williams routines */
static DECLARE_WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w );
static void mysticm_main_irq(device_t *device, int state);
static void tshoot_main_irq(device_t *device, int state);
/* Lotto Fun-specific code */
static DECLARE_WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w );
/* Turkey Shoot-specific code */
static DECLARE_READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r );
static DECLARE_WRITE8_DEVICE_HANDLER( tshoot_lamp_w );
static DECLARE_WRITE8_DEVICE_HANDLER( tshoot_maxvol_w );
/* Joust 2-specific code */
static DECLARE_WRITE8_DEVICE_HANDLER( joust2_snd_cmd_w );
static DECLARE_WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w );
/*************************************
@ -66,14 +46,14 @@ const pia6821_interface williams_pia_0_intf =
const pia6821_interface williams_muxed_pia_0_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN0"), DEVCB_INPUT_PORT("IN1"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(williams_port_select_w),
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(williams_state,williams_port_select_w),
/*irqs : A/B */ DEVCB_NULL, DEVCB_NULL
};
/* Generic 49-way joystick PIA 0 for Sinistar/Blaster */
const pia6821_interface williams_49way_pia_0_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_HANDLER(williams_49way_port_0_r), DEVCB_INPUT_PORT("IN1"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_DRIVER_MEMBER(williams_state,williams_49way_port_0_r), DEVCB_INPUT_PORT("IN1"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*irqs : A/B */ DEVCB_NULL, DEVCB_NULL
};
@ -81,8 +61,8 @@ const pia6821_interface williams_49way_pia_0_intf =
/* Muxing 49-way joystick PIA 0 for Blaster kit */
const pia6821_interface williams_49way_muxed_pia_0_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_HANDLER(williams_input_port_49way_0_5_r), DEVCB_INPUT_PORT("IN1"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(williams_port_select_w),
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_DRIVER_MEMBER(williams_state,williams_input_port_49way_0_5_r), DEVCB_INPUT_PORT("IN1"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(williams_state,williams_port_select_w),
/*irqs : A/B */ DEVCB_NULL, DEVCB_NULL
};
@ -90,7 +70,7 @@ const pia6821_interface williams_49way_muxed_pia_0_intf =
const pia6821_interface williams_pia_1_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(williams_snd_cmd_w), DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DRIVER_MEMBER(williams_state,williams_snd_cmd_w), DEVCB_NULL, DEVCB_NULL,
/*irqs : A/B */ DEVCB_LINE(williams_main_irq), DEVCB_LINE(williams_main_irq)
};
@ -121,7 +101,7 @@ const pia6821_interface williams_snd_pia_b_intf =
const pia6821_interface lottofun_pia_0_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN0"), DEVCB_INPUT_PORT("IN1"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DEVICE_MEMBER("ticket", ticket_dispenser_device, write), DEVCB_HANDLER(lottofun_coin_lock_w), DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DEVICE_MEMBER("ticket", ticket_dispenser_device, write), DEVCB_DRIVER_MEMBER(williams_state,lottofun_coin_lock_w), DEVCB_NULL,
/*irqs : A/B */ DEVCB_NULL, DEVCB_NULL
};
@ -137,7 +117,7 @@ const pia6821_interface sinistar_snd_pia_intf =
const pia6821_interface playball_pia_1_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(playball_snd_cmd_w), DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DRIVER_MEMBER(williams_state,playball_snd_cmd_w), DEVCB_NULL, DEVCB_NULL,
/*irqs : A/B */ DEVCB_LINE(williams_main_irq), DEVCB_LINE(williams_main_irq)
};
@ -145,7 +125,7 @@ const pia6821_interface playball_pia_1_intf =
const pia6821_interface blaster_pia_1_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(blaster_snd_cmd_w), DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DRIVER_MEMBER(williams_state,blaster_snd_cmd_w), DEVCB_NULL, DEVCB_NULL,
/*irqs : A/B */ DEVCB_LINE(williams_main_irq), DEVCB_LINE(williams_main_irq)
};
@ -169,7 +149,7 @@ const pia6821_interface spdball_pia_3_intf =
const pia6821_interface williams2_muxed_pia_0_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN0"), DEVCB_INPUT_PORT("IN1"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(williams_port_select_w), DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(williams_state,williams_port_select_w), DEVCB_NULL,
/*irqs : A/B */ DEVCB_NULL, DEVCB_NULL
};
@ -177,7 +157,7 @@ const pia6821_interface williams2_muxed_pia_0_intf =
const pia6821_interface williams2_pia_1_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("pia_2", pia6821_device, ca1_w),
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DRIVER_MEMBER(williams_state,williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("pia_2", pia6821_device, ca1_w),
/*irqs : A/B */ DEVCB_LINE(williams_main_irq), DEVCB_LINE(williams_main_irq)
};
@ -209,15 +189,15 @@ const pia6821_interface mysticm_pia_0_intf =
const pia6821_interface mysticm_pia_1_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("pia_2", pia6821_device, ca1_w),
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DRIVER_MEMBER(williams_state,williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("pia_2", pia6821_device, ca1_w),
/*irqs : A/B */ DEVCB_LINE(mysticm_main_irq), DEVCB_LINE(mysticm_main_irq)
};
/* Turkey Shoot PIA 0 */
const pia6821_interface tshoot_pia_0_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_HANDLER(tshoot_input_port_0_3_r), DEVCB_INPUT_PORT("IN1"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(tshoot_lamp_w), DEVCB_HANDLER(williams_port_select_w), DEVCB_NULL,
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_DRIVER_MEMBER(williams_state,tshoot_input_port_0_3_r), DEVCB_INPUT_PORT("IN1"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DRIVER_MEMBER(williams_state,tshoot_lamp_w), DEVCB_DRIVER_MEMBER(williams_state,williams_port_select_w), DEVCB_NULL,
/*irqs : A/B */ DEVCB_LINE(tshoot_main_irq), DEVCB_LINE(tshoot_main_irq)
};
@ -225,7 +205,7 @@ const pia6821_interface tshoot_pia_0_intf =
const pia6821_interface tshoot_pia_1_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("pia_2", pia6821_device, ca1_w),
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DRIVER_MEMBER(williams_state,williams2_snd_cmd_w), DEVCB_NULL, DEVCB_DEVICE_LINE_MEMBER("pia_2", pia6821_device, ca1_w),
/*irqs : A/B */ DEVCB_LINE(tshoot_main_irq), DEVCB_LINE(tshoot_main_irq)
};
@ -233,7 +213,7 @@ const pia6821_interface tshoot_pia_1_intf =
const pia6821_interface tshoot_snd_pia_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_DEVICE_MEMBER("pia_1", pia6821_device, portb_w), DEVCB_DEVICE_MEMBER("wmsdac", dac_device, write_unsigned8), DEVCB_DEVICE_LINE_MEMBER("pia_1", pia6821_device, cb1_w), DEVCB_HANDLER(tshoot_maxvol_w),
/*outputs: A/B,CA/B2 */ DEVCB_DEVICE_MEMBER("pia_1", pia6821_device, portb_w), DEVCB_DEVICE_MEMBER("wmsdac", dac_device, write_unsigned8), DEVCB_DEVICE_LINE_MEMBER("pia_1", pia6821_device, cb1_w), DEVCB_DRIVER_MEMBER(williams_state,tshoot_maxvol_w),
/*irqs : A/B */ DEVCB_LINE(williams_snd_irq), DEVCB_LINE(williams_snd_irq)
};
@ -241,7 +221,7 @@ const pia6821_interface tshoot_snd_pia_intf =
const pia6821_interface joust2_pia_1_intf =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_INPUT_PORT("IN2"), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_HANDLER(joust2_snd_cmd_w), DEVCB_HANDLER(joust2_pia_3_cb1_w), DEVCB_DEVICE_LINE_MEMBER("pia_2", pia6821_device, ca1_w),
/*outputs: A/B,CA/B2 */ DEVCB_NULL, DEVCB_DRIVER_MEMBER(joust2_state,joust2_snd_cmd_w), DEVCB_DRIVER_MEMBER(joust2_state,joust2_pia_3_cb1_w), DEVCB_DEVICE_LINE_MEMBER("pia_2", pia6821_device, ca1_w),
/*irqs : A/B */ DEVCB_LINE(williams_main_irq), DEVCB_LINE(williams_main_irq)
};
@ -558,17 +538,15 @@ TIMER_CALLBACK_MEMBER(williams_state::williams_deferred_snd_cmd_w)
pia_2->cb1_w((param == 0xff) ? 0 : 1);
}
WRITE8_DEVICE_HANDLER( williams_snd_cmd_w )
WRITE8_MEMBER(williams_state::williams_snd_cmd_w)
{
williams_state *state = device->machine().driver_data<williams_state>();
/* the high two bits are set externally, and should be 1 */
space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::williams_deferred_snd_cmd_w),state), data | 0xc0);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::williams_deferred_snd_cmd_w),this), data | 0xc0);
}
WRITE8_DEVICE_HANDLER( playball_snd_cmd_w )
WRITE8_MEMBER(williams_state::playball_snd_cmd_w)
{
williams_state *state = device->machine().driver_data<williams_state>();
space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::williams_deferred_snd_cmd_w),state), data);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::williams_deferred_snd_cmd_w),this), data);
}
TIMER_CALLBACK_MEMBER(williams_state::blaster_deferred_snd_cmd_w)
@ -582,10 +560,9 @@ TIMER_CALLBACK_MEMBER(williams_state::blaster_deferred_snd_cmd_w)
pia_2r->portb_w(r_data); pia_2r->cb1_w((r_data == 0xff) ? 0 : 1);
}
WRITE8_DEVICE_HANDLER( blaster_snd_cmd_w )
WRITE8_MEMBER(williams_state::blaster_snd_cmd_w)
{
williams_state *state = device->machine().driver_data<williams_state>();
space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::blaster_deferred_snd_cmd_w),state), data);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::blaster_deferred_snd_cmd_w),this), data);
}
@ -596,10 +573,9 @@ TIMER_CALLBACK_MEMBER(williams_state::williams2_deferred_snd_cmd_w)
pia_2->porta_w(param);
}
static WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w )
WRITE8_MEMBER(williams_state::williams2_snd_cmd_w)
{
williams_state *state = device->machine().driver_data<williams_state>();
space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::williams2_deferred_snd_cmd_w),state), data);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(williams_state::williams2_deferred_snd_cmd_w),this), data);
}
@ -610,10 +586,9 @@ static WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w )
*
*************************************/
WRITE8_DEVICE_HANDLER( williams_port_select_w )
WRITE8_MEMBER(williams_state::williams_port_select_w)
{
williams_state *state = space.machine().driver_data<williams_state>();
state->m_port_select = data;
m_port_select = data;
}
CUSTOM_INPUT_MEMBER(williams_state::williams_mux_r)
@ -651,20 +626,19 @@ CUSTOM_INPUT_MEMBER(williams_state::williams_mux_r)
* 1000 = right/down full
*/
READ8_DEVICE_HANDLER( williams_49way_port_0_r )
READ8_MEMBER(williams_state::williams_49way_port_0_r)
{
static const UINT8 translate49[7] = { 0x0, 0x4, 0x6, 0x7, 0xb, 0x9, 0x8 };
return (translate49[space.machine().root_device().ioport("49WAYX")->read() >> 4] << 4) | translate49[space.machine().root_device().ioport("49WAYY")->read() >> 4];
return (translate49[machine().root_device().ioport("49WAYX")->read() >> 4] << 4) | translate49[machine().root_device().ioport("49WAYY")->read() >> 4];
}
READ8_DEVICE_HANDLER( williams_input_port_49way_0_5_r )
READ8_MEMBER(williams_state::williams_input_port_49way_0_5_r)
{
williams_state *state = space.machine().driver_data<williams_state>();
if (state->m_port_select)
return williams_49way_port_0_r(device, space, 0);
if (m_port_select)
return williams_49way_port_0_r(space, 0);
else
return state->ioport("IN3")->read();
return ioport("IN3")->read();
}
@ -929,9 +903,9 @@ WRITE8_MEMBER(williams_state::blaster_bank_select_w)
*
*************************************/
static WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w )
WRITE8_MEMBER(williams_state::lottofun_coin_lock_w)
{
coin_lockout_global_w(space.machine(), data & 1); /* bit 5 of PIC control port A */
coin_lockout_global_w(machine(), data & 1); /* bit 5 of PIC control port A */
}
@ -942,10 +916,10 @@ static WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w )
*
*************************************/
static READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r )
READ8_MEMBER(williams_state::tshoot_input_port_0_3_r)
{
/* merge in the gun inputs with the standard data */
int data = space.machine().root_device().ioport("IN0")->read();
int data = machine().root_device().ioport("IN0")->read();
int gun = (data & 0x3f) ^ ((data & 0x3f) >> 1);
return (data & 0xc0) | gun;
@ -954,14 +928,14 @@ static READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r )
}
static WRITE8_DEVICE_HANDLER( tshoot_maxvol_w )
WRITE8_MEMBER(williams_state::tshoot_maxvol_w)
{
/* something to do with the sound volume */
logerror("tshoot maxvol = %d (%s)\n", data, space.machine().describe_context());
logerror("tshoot maxvol = %d (%s)\n", data, machine().describe_context());
}
static WRITE8_DEVICE_HANDLER( tshoot_lamp_w )
WRITE8_MEMBER(williams_state::tshoot_lamp_w)
{
/* set the grenade lamp */
output_set_value("Grenade_lamp", (~data & 0x4)>>2 );
@ -1002,18 +976,16 @@ TIMER_CALLBACK_MEMBER(joust2_state::joust2_deferred_snd_cmd_w)
}
static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w )
WRITE8_MEMBER(joust2_state::joust2_pia_3_cb1_w)
{
joust2_state *state = space.machine().driver_data<joust2_state>();
state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100);
state->m_cvsd_sound->write(space.machine().driver_data()->generic_space(), 0, state->m_joust2_current_sound_data);
m_joust2_current_sound_data = (m_joust2_current_sound_data & ~0x100) | ((data << 8) & 0x100);
m_cvsd_sound->write(machine().driver_data()->generic_space(), 0, m_joust2_current_sound_data);
}
static WRITE8_DEVICE_HANDLER( joust2_snd_cmd_w )
WRITE8_MEMBER(joust2_state::joust2_snd_cmd_w)
{
joust2_state *state = space.machine().driver_data<joust2_state>();
state->m_joust2_current_sound_data = (state->m_joust2_current_sound_data & ~0xff) | (data & 0xff);
state->m_cvsd_sound->write(space.machine().driver_data()->generic_space(), 0, state->m_joust2_current_sound_data);
space.machine().scheduler().synchronize(timer_expired_delegate(FUNC(joust2_state::joust2_deferred_snd_cmd_w),state), state->m_joust2_current_sound_data);
m_joust2_current_sound_data = (m_joust2_current_sound_data & ~0xff) | (data & 0xff);
m_cvsd_sound->write(machine().driver_data()->generic_space(), 0, m_joust2_current_sound_data);
machine().scheduler().synchronize(timer_expired_delegate(FUNC(joust2_state::joust2_deferred_snd_cmd_w),this), m_joust2_current_sound_data);
}

View File

@ -114,27 +114,24 @@ UINT32 gameplan_state::screen_update_leprechn(screen_device &screen, bitmap_rgb3
*
*************************************/
static WRITE8_DEVICE_HANDLER( video_data_w )
WRITE8_MEMBER(gameplan_state::video_data_w)
{
gameplan_state *state = space.machine().driver_data<gameplan_state>();
state->m_video_data = data;
m_video_data = data;
}
static WRITE8_DEVICE_HANDLER( gameplan_video_command_w )
WRITE8_MEMBER(gameplan_state::gameplan_video_command_w)
{
gameplan_state *state = space.machine().driver_data<gameplan_state>();
state->m_video_command = data & 0x07;
m_video_command = data & 0x07;
}
static WRITE8_DEVICE_HANDLER( leprechn_video_command_w )
WRITE8_MEMBER(gameplan_state::leprechn_video_command_w)
{
gameplan_state *state = space.machine().driver_data<gameplan_state>();
state->m_video_command = (data >> 3) & 0x07;
m_video_command = (data >> 3) & 0x07;
}
@ -146,61 +143,60 @@ TIMER_CALLBACK_MEMBER(gameplan_state::clear_screen_done_callback)
}
static WRITE_LINE_DEVICE_HANDLER( video_command_trigger_w )
WRITE_LINE_MEMBER(gameplan_state::video_command_trigger_w)
{
gameplan_state *driver_state = device->machine().driver_data<gameplan_state>();
if (state == 0)
{
switch (driver_state->m_video_command)
switch (m_video_command)
{
/* draw pixel */
case 0:
/* auto-adjust X? */
if (driver_state->m_video_data & 0x10)
if (m_video_data & 0x10)
{
if (driver_state->m_video_data & 0x40)
driver_state->m_video_x = driver_state->m_video_x - 1;
if (m_video_data & 0x40)
m_video_x = m_video_x - 1;
else
driver_state->m_video_x = driver_state->m_video_x + 1;
m_video_x = m_video_x + 1;
}
/* auto-adjust Y? */
if (driver_state->m_video_data & 0x20)
if (m_video_data & 0x20)
{
if (driver_state->m_video_data & 0x80)
driver_state->m_video_y = driver_state->m_video_y - 1;
if (m_video_data & 0x80)
m_video_y = m_video_y - 1;
else
driver_state->m_video_y = driver_state->m_video_y + 1;
m_video_y = m_video_y + 1;
}
driver_state->m_videoram[driver_state->m_video_y * (HBSTART - HBEND) + driver_state->m_video_x] = driver_state->m_video_data & 0x0f;
m_videoram[m_video_y * (HBSTART - HBEND) + m_video_x] = m_video_data & 0x0f;
break;
/* load X register */
case 1:
driver_state->m_video_x = driver_state->m_video_data;
m_video_x = m_video_data;
break;
/* load Y register */
case 2:
driver_state->m_video_y = driver_state->m_video_data;
m_video_y = m_video_data;
break;
/* clear screen */
case 3:
/* indicate that the we are busy */
{
driver_state->m_via_0->write_ca1(1);
m_via_0->write_ca1(1);
}
memset(driver_state->m_videoram, driver_state->m_video_data & 0x0f, driver_state->m_videoram_size);
memset(m_videoram, m_video_data & 0x0f, m_videoram_size);
/* set a timer for an arbitrarily short period.
The real time it takes to clear to screen is not
important to the software */
device->machine().scheduler().synchronize(timer_expired_delegate(FUNC(gameplan_state::clear_screen_done_callback),driver_state));
machine().scheduler().synchronize(timer_expired_delegate(FUNC(gameplan_state::clear_screen_done_callback),this));
break;
}
@ -224,7 +220,7 @@ static void via_irq(device_t *device, int state)
}
static READ8_DEVICE_HANDLER( vblank_r )
READ8_MEMBER(gameplan_state::vblank_r)
{
/* this is needed for trivia quest */
return 0x20;
@ -233,30 +229,30 @@ static READ8_DEVICE_HANDLER( vblank_r )
const via6522_interface gameplan_via_0_interface =
{
DEVCB_NULL, DEVCB_HANDLER(vblank_r), /*inputs : A/B */
DEVCB_NULL, DEVCB_DRIVER_MEMBER(gameplan_state,vblank_r), /*inputs : A/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, /*inputs : CA/B1,CA/B2 */
DEVCB_HANDLER(video_data_w), DEVCB_HANDLER(gameplan_video_command_w), /*outputs: A/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_LINE(video_command_trigger_w), DEVCB_NULL, /*outputs: CA/B1,CA/B2 */
DEVCB_DRIVER_MEMBER(gameplan_state,video_data_w), DEVCB_DRIVER_MEMBER(gameplan_state,gameplan_video_command_w), /*outputs: A/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(gameplan_state,video_command_trigger_w), DEVCB_NULL, /*outputs: CA/B1,CA/B2 */
DEVCB_LINE(via_irq) /*irq */
};
const via6522_interface leprechn_via_0_interface =
{
DEVCB_NULL, DEVCB_HANDLER(vblank_r), /*inputs : A/B */
DEVCB_NULL, DEVCB_DRIVER_MEMBER(gameplan_state,vblank_r), /*inputs : A/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, /*inputs : CA/B1,CA/B2 */
DEVCB_HANDLER(video_data_w), DEVCB_HANDLER(leprechn_video_command_w), /*outputs: A/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_LINE(video_command_trigger_w), DEVCB_NULL, /*outputs: CA/B1,CA/B2 */
DEVCB_DRIVER_MEMBER(gameplan_state,video_data_w), DEVCB_DRIVER_MEMBER(gameplan_state,leprechn_video_command_w), /*outputs: A/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(gameplan_state,video_command_trigger_w), DEVCB_NULL, /*outputs: CA/B1,CA/B2 */
DEVCB_LINE(via_irq) /*irq */
};
const via6522_interface trvquest_via_0_interface =
{
DEVCB_NULL, DEVCB_HANDLER(vblank_r), /*inputs : A/B */
DEVCB_NULL, DEVCB_DRIVER_MEMBER(gameplan_state,vblank_r), /*inputs : A/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, /*inputs : CA/B1,CA/B2 */
DEVCB_HANDLER(video_data_w), DEVCB_HANDLER(gameplan_video_command_w), /*outputs: A/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_LINE(video_command_trigger_w), DEVCB_NULL, /*outputs: CA/B1,CA/B2 */
DEVCB_DRIVER_MEMBER(gameplan_state,video_data_w), DEVCB_DRIVER_MEMBER(gameplan_state,gameplan_video_command_w), /*outputs: A/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_LINE_MEMBER(gameplan_state,video_command_trigger_w), DEVCB_NULL, /*outputs: CA/B1,CA/B2 */
DEVCB_NULL /*irq */
};

View File

@ -78,14 +78,13 @@ WRITE8_MEMBER(hanaawas_state::hanaawas_colorram_w)
m_bg_tilemap->mark_tile_dirty((offset + (flip_screen() ? -1 : 1)) & 0x03ff);
}
WRITE8_DEVICE_HANDLER( hanaawas_portB_w )
WRITE8_MEMBER(hanaawas_state::hanaawas_portB_w)
{
/* bit 7 is flip screen */
hanaawas_state *state = space.machine().driver_data<hanaawas_state>();
if (state->flip_screen() != (~data & 0x80))
if (flip_screen() != (~data & 0x80))
{
state->flip_screen_set(~data & 0x80);
space.machine().tilemap().mark_all_dirty();
flip_screen_set(~data & 0x80);
machine().tilemap().mark_all_dirty();
}
}

View File

@ -35,20 +35,19 @@ WRITE8_MEMBER(homerun_state::homerun_scrollx_w)
m_scrollx = (m_scrollx & 0xff00) | data;
}
WRITE8_DEVICE_HANDLER(homerun_banking_w)
WRITE8_MEMBER(homerun_state::homerun_banking_w)
{
homerun_state *state = space.machine().driver_data<homerun_state>();
// games do mid-screen gfx bank switching
int vpos = space.machine().primary_screen->vpos();
space.machine().primary_screen->update_partial(vpos);
int vpos = machine().primary_screen->vpos();
machine().primary_screen->update_partial(vpos);
// d0-d1: gfx bank
// d2-d4: ?
// d5-d7: prg bank
state->m_gfx_ctrl = data;
state->m_tilemap->mark_all_dirty();
state->membank("bank1")->set_entry(data >> 5 & 7);
m_gfx_ctrl = data;
m_tilemap->mark_all_dirty();
membank("bank1")->set_entry(data >> 5 & 7);
}
WRITE8_MEMBER(homerun_state::homerun_videoram_w)

View File

@ -115,11 +115,10 @@ WRITE8_MEMBER(leland_state::leland_scroll_w)
}
WRITE8_DEVICE_HANDLER( leland_gfx_port_w )
WRITE8_MEMBER(leland_state::leland_gfx_port_w)
{
leland_state *state = space.machine().driver_data<leland_state>();
space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
state->m_gfxbank = data;
machine().primary_screen->update_partial(machine().primary_screen->vpos());
m_gfxbank = data;
}

View File

@ -424,16 +424,14 @@ READ8_MEMBER(phoenix_state::survival_input_port_0_r)
return m_survival_input_latches[0];
}
READ8_DEVICE_HANDLER( survival_protection_r )
READ8_MEMBER(phoenix_state::survival_protection_r)
{
phoenix_state *state = space.machine().driver_data<phoenix_state>();
return state->m_survival_protection_value;
return m_survival_protection_value;
}
READ_LINE_DEVICE_HANDLER( survival_sid_callback )
READ_LINE_MEMBER(phoenix_state::survival_sid_callback)
{
phoenix_state *state = device->machine().driver_data<phoenix_state>();
return state->m_survival_sid_value;
return m_survival_sid_value;
}

View File

@ -31,7 +31,7 @@
static MC6845_BEGIN_UPDATE( begin_update );
static MC6845_UPDATE_ROW( update_row );
static WRITE_LINE_DEVICE_HANDLER( display_enable_changed );
@ -61,18 +61,17 @@ VIDEO_START_MEMBER(qix_state,qix)
*
*************************************/
static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
WRITE_LINE_MEMBER(qix_state::display_enable_changed)
{
qix_state *driver_state = device->machine().driver_data<qix_state>();
/* on the rising edge, latch the scanline */
if (state)
{
UINT16 ma = downcast<mc6845_device *>(device)->get_ma();
UINT8 ra = downcast<mc6845_device *>(device)->get_ra();
UINT16 ma = downcast<mc6845_device *>(machine().device(MC6845_TAG))->get_ma();
UINT8 ra = downcast<mc6845_device *>(machine().device(MC6845_TAG))->get_ra();
/* RA0-RA2 goes to D0-D2 and MA5-MA9 goes to D3-D7 */
*driver_state->m_scanline_latch = ((ma >> 2) & 0xf8) | (ra & 0x07);
*m_scanline_latch = ((ma >> 2) & 0xf8) | (ra & 0x07);
}
}
@ -84,11 +83,10 @@ static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
*
*************************************/
WRITE8_DEVICE_HANDLER( qix_flip_screen_w )
WRITE8_MEMBER(qix_state::qix_flip_screen_w)
{
qix_state *state = space.machine().driver_data<qix_state>();
state->m_flip = data;
m_flip = data;
}
@ -402,10 +400,10 @@ static const mc6845_interface mc6845_intf =
begin_update, /* before pixel update callback */
update_row, /* row update callback */
NULL, /* after pixel update callback */
DEVCB_LINE(display_enable_changed), /* callback for display state changes */
DEVCB_DRIVER_LINE_MEMBER(qix_state,display_enable_changed), /* callback for display state changes */
DEVCB_NULL, /* callback for cursor state changes */
DEVCB_NULL, /* HSYNC callback */
DEVCB_LINE(qix_vsync_changed), /* VSYNC callback */
DEVCB_DRIVER_LINE_MEMBER(qix_state,qix_vsync_changed), /* VSYNC callback */
NULL /* update address callback */
};

View File

@ -275,10 +275,9 @@ WRITE8_MEMBER(system1_state::system1_videoram_w)
machine().primary_screen->update_now();
}
WRITE8_DEVICE_HANDLER( system1_videoram_bank_w )
WRITE8_MEMBER(system1_state::system1_videoram_bank_w)
{
system1_state *state = space.machine().driver_data<system1_state>();
state->m_videoram_bank = data;
m_videoram_bank = data;
}

View File

@ -35,19 +35,6 @@ enum {
A_Y,
};
/*********************************************************************
Prototypes
*********************************************************************/
static DECLARE_WRITE8_DEVICE_HANDLER (v_via_pa_w);
static DECLARE_WRITE8_DEVICE_HANDLER(v_via_pb_w);
static DECLARE_WRITE8_DEVICE_HANDLER (v_via_ca2_w);
static DECLARE_WRITE8_DEVICE_HANDLER (v_via_cb2_w);
/*********************************************************************
Local variables
@ -56,10 +43,10 @@ static DECLARE_WRITE8_DEVICE_HANDLER (v_via_cb2_w);
const via6522_interface vectrex_via6522_interface =
{
DEVCB_HANDLER(vectrex_via_pa_r), DEVCB_HANDLER(vectrex_via_pb_r), /* read PA/B */
DEVCB_DRIVER_MEMBER(vectrex_state,vectrex_via_pa_r), DEVCB_DRIVER_MEMBER(vectrex_state,vectrex_via_pb_r), /* read PA/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, /* read ca1, cb1, ca2, cb2 */
DEVCB_HANDLER(v_via_pa_w), DEVCB_HANDLER(v_via_pb_w), /* write PA/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(v_via_ca2_w), DEVCB_HANDLER(v_via_cb2_w), /* write ca1, cb1, ca2, cb2 */
DEVCB_DRIVER_MEMBER(vectrex_state,v_via_pa_w), DEVCB_DRIVER_MEMBER(vectrex_state,v_via_pb_w), /* write PA/B */
DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(vectrex_state,v_via_ca2_w), DEVCB_DRIVER_MEMBER(vectrex_state,v_via_cb2_w), /* write ca1, cb1, ca2, cb2 */
DEVCB_LINE(vectrex_via_irq), /* IRQ */
};
@ -317,17 +304,16 @@ static void vectrex_multiplexer(running_machine &machine, int mux)
}
static WRITE8_DEVICE_HANDLER(v_via_pb_w)
WRITE8_MEMBER(vectrex_state::v_via_pb_w)
{
vectrex_state *state = space.machine().driver_data<vectrex_state>();
if (!(data & 0x80))
{
/* RAMP is active */
if ((state->m_ramp & 0x80))
if ((m_ramp & 0x80))
{
/* RAMP was inactive before */
if (state->m_lightpen_down)
if (m_lightpen_down)
{
/* Simple lin. algebra to check if pen is near
* the line defined by (A_X,A_Y).
@ -348,42 +334,42 @@ static WRITE8_DEVICE_HANDLER(v_via_pb_w)
* a
*/
double a2, b2, ab, d2;
ab = (state->m_pen_x - state->m_x_int) * state->m_analog[A_X]
+(state->m_pen_y - state->m_y_int) * state->m_analog[A_Y];
ab = (m_pen_x - m_x_int) * m_analog[A_X]
+(m_pen_y - m_y_int) * m_analog[A_Y];
if (ab > 0)
{
a2 = (double)(state->m_analog[A_X] * state->m_analog[A_X]
+(double)state->m_analog[A_Y] * state->m_analog[A_Y]);
b2 = (double)(state->m_pen_x - state->m_x_int) * (state->m_pen_x - state->m_x_int)
+(double)(state->m_pen_y - state->m_y_int) * (state->m_pen_y - state->m_y_int);
a2 = (double)(m_analog[A_X] * m_analog[A_X]
+(double)m_analog[A_Y] * m_analog[A_Y]);
b2 = (double)(m_pen_x - m_x_int) * (m_pen_x - m_x_int)
+(double)(m_pen_y - m_y_int) * (m_pen_y - m_y_int);
d2 = b2 - ab * ab / a2;
if (d2 < 2e10 && state->m_analog[A_Z] * state->m_blank > 0)
state->m_lp_t->adjust(attotime::from_double(ab / a2 / (space.machine().device("maincpu")->unscaled_clock() * INT_PER_CLOCK)));
if (d2 < 2e10 && m_analog[A_Z] * m_blank > 0)
m_lp_t->adjust(attotime::from_double(ab / a2 / (machine().device("maincpu")->unscaled_clock() * INT_PER_CLOCK)));
}
}
}
if (!(data & 0x1) && (state->m_via_out[PORTB] & 0x1))
if (!(data & 0x1) && (m_via_out[PORTB] & 0x1))
{
/* MUX has been enabled */
space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),state));
machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),this));
}
}
else
{
/* RAMP is inactive */
if (!(state->m_ramp & 0x80))
if (!(m_ramp & 0x80))
{
/* Cancel running timer, line already finished */
if (state->m_lightpen_down)
state->m_lp_t->adjust(attotime::never);
if (m_lightpen_down)
m_lp_t->adjust(attotime::never);
}
}
/* Cartridge bank-switching */
if (state->m_64k_cart && ((data ^ state->m_via_out[PORTB]) & 0x40))
if (m_64k_cart && ((data ^ m_via_out[PORTB]) & 0x40))
{
device_t &root_device = space.machine().root_device();
device_t &root_device = machine().root_device();
root_device.membank("bank1")->set_base(root_device.memregion("maincpu")->base() + ((data & 0x40) ? 0x10000 : 0x0000));
}
@ -391,69 +377,66 @@ static WRITE8_DEVICE_HANDLER(v_via_pb_w)
/* Sound */
if (data & 0x10)
{
device_t *ay8912 = space.machine().device("ay8912");
device_t *ay8912 = machine().device("ay8912");
if (data & 0x08) /* BC1 (do we select a reg or write it ?) */
ay8910_address_w(ay8912, space, 0, state->m_via_out[PORTA]);
ay8910_address_w(ay8912, space, 0, m_via_out[PORTA]);
else
ay8910_data_w(ay8912, space, 0, state->m_via_out[PORTA]);
ay8910_data_w(ay8912, space, 0, m_via_out[PORTA]);
}
if (!(data & 0x1) && (state->m_via_out[PORTB] & 0x1))
vectrex_multiplexer (space.machine(), (data >> 1) & 0x3);
if (!(data & 0x1) && (m_via_out[PORTB] & 0x1))
vectrex_multiplexer (machine(), (data >> 1) & 0x3);
state->m_via_out[PORTB] = data;
space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),state), data & 0x80, &state->m_ramp);
m_via_out[PORTB] = data;
machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),this), data & 0x80, &m_ramp);
}
static WRITE8_DEVICE_HANDLER(v_via_pa_w)
WRITE8_MEMBER(vectrex_state::v_via_pa_w)
{
vectrex_state *state = space.machine().driver_data<vectrex_state>();
/* DAC output always goes to Y integrator */
state->m_via_out[PORTA] = data;
space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),state), data, &state->m_analog[A_Y]);
m_via_out[PORTA] = data;
machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::update_signal),this), data, &m_analog[A_Y]);
if (!(state->m_via_out[PORTB] & 0x1))
vectrex_multiplexer (space.machine(), (state->m_via_out[PORTB] >> 1) & 0x3);
if (!(m_via_out[PORTB] & 0x1))
vectrex_multiplexer (machine(), (m_via_out[PORTB] >> 1) & 0x3);
}
static WRITE8_DEVICE_HANDLER(v_via_ca2_w)
WRITE8_MEMBER(vectrex_state::v_via_ca2_w)
{
vectrex_state *state = space.machine().driver_data<vectrex_state>();
if (data == 0)
space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::vectrex_zero_integrators),state));
machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), timer_expired_delegate(FUNC(vectrex_state::vectrex_zero_integrators),this));
}
static WRITE8_DEVICE_HANDLER(v_via_cb2_w)
WRITE8_MEMBER(vectrex_state::v_via_cb2_w)
{
vectrex_state *state = space.machine().driver_data<vectrex_state>();
int dx, dy;
if (state->m_cb2 != data)
if (m_cb2 != data)
{
/* Check lightpen */
if (state->m_lightpen_port != 0)
if (m_lightpen_port != 0)
{
state->m_lightpen_down = state->ioport("LPENCONF")->read() & 0x10;
m_lightpen_down = ioport("LPENCONF")->read() & 0x10;
if (state->m_lightpen_down)
if (m_lightpen_down)
{
state->m_pen_x = state->ioport("LPENX")->read() * (state->m_x_max / 0xff);
state->m_pen_y = state->ioport("LPENY")->read() * (state->m_y_max / 0xff);
m_pen_x = ioport("LPENX")->read() * (m_x_max / 0xff);
m_pen_y = ioport("LPENY")->read() * (m_y_max / 0xff);
dx = abs(state->m_pen_x - state->m_x_int);
dy = abs(state->m_pen_y - state->m_y_int);
dx = abs(m_pen_x - m_x_int);
dy = abs(m_pen_y - m_y_int);
if (dx < 500000 && dy < 500000 && data > 0)
space.machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(vectrex_state::lightpen_trigger),state));
machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(vectrex_state::lightpen_trigger),this));
}
}
space.machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(vectrex_state::update_signal),state), data, &state->m_blank);
state->m_cb2 = data;
machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(vectrex_state::update_signal),this), data, &m_blank);
m_cb2 = data;
}
}
@ -466,8 +449,8 @@ static WRITE8_DEVICE_HANDLER(v_via_cb2_w)
const via6522_interface spectrum1_via6522_interface =
{
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_HANDLER(vectrex_via_pa_r), DEVCB_HANDLER(vectrex_s1_via_pb_r), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B1,CA/B2 */ DEVCB_HANDLER(v_via_pa_w), DEVCB_HANDLER(v_via_pb_w), DEVCB_NULL, DEVCB_NULL, DEVCB_HANDLER(v_via_ca2_w), DEVCB_HANDLER(v_via_cb2_w),
/*inputs : A/B,CA/B1,CA/B2 */ DEVCB_DRIVER_MEMBER(vectrex_state,vectrex_via_pa_r), DEVCB_DRIVER_MEMBER(vectrex_state,vectrex_s1_via_pb_r), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, DEVCB_NULL,
/*outputs: A/B,CA/B1,CA/B2 */ DEVCB_DRIVER_MEMBER(vectrex_state,v_via_pa_w), DEVCB_DRIVER_MEMBER(vectrex_state,v_via_pb_w), DEVCB_NULL, DEVCB_NULL, DEVCB_DRIVER_MEMBER(vectrex_state,v_via_ca2_w), DEVCB_DRIVER_MEMBER(vectrex_state,v_via_cb2_w),
/*irq */ DEVCB_LINE(vectrex_via_irq),
};

View File

@ -12,15 +12,13 @@ Video hardware driver by Uki
#include "includes/xxmissio.h"
WRITE8_DEVICE_HANDLER( xxmissio_scroll_x_w )
WRITE8_MEMBER(xxmissio_state::xxmissio_scroll_x_w)
{
xxmissio_state *state = space.machine().driver_data<xxmissio_state>();
state->m_xscroll = data;
m_xscroll = data;
}
WRITE8_DEVICE_HANDLER( xxmissio_scroll_y_w )
WRITE8_MEMBER(xxmissio_state::xxmissio_scroll_y_w)
{
xxmissio_state *state = space.machine().driver_data<xxmissio_state>();
state->m_yscroll = data;
m_yscroll = data;
}
WRITE8_MEMBER(xxmissio_state::xxmissio_flipscreen_w)

View File

@ -168,7 +168,7 @@ static ADDRESS_MAP_START( dc_map, AS_PROGRAM, 64, dc_state )
AM_RANGE(0x005f7c00, 0x005f7cff) AM_READWRITE_LEGACY(pvr_ctrl_r, pvr_ctrl_w )
AM_RANGE(0x005f8000, 0x005f9fff) AM_READWRITE_LEGACY(pvr_ta_r, pvr_ta_w )
AM_RANGE(0x00600000, 0x006007ff) AM_READWRITE_LEGACY(dc_modem_r, dc_modem_w )
AM_RANGE(0x00700000, 0x00707fff) AM_DEVREADWRITE_LEGACY("aica", dc_aica_reg_r, dc_aica_reg_w )
AM_RANGE(0x00700000, 0x00707fff) AM_READWRITE(dc_aica_reg_r, dc_aica_reg_w )
AM_RANGE(0x00710000, 0x0071000f) AM_READWRITE_LEGACY(dc_rtc_r, dc_rtc_w )
AM_RANGE(0x00800000, 0x009fffff) AM_READWRITE_LEGACY(dc_arm_r, dc_arm_w )
@ -202,7 +202,7 @@ ADDRESS_MAP_END
static ADDRESS_MAP_START( dc_audio_map, AS_PROGRAM, 32, dc_state )
AM_RANGE(0x00000000, 0x001fffff) AM_RAM AM_SHARE("dc_sound_ram") /* shared with SH-4 */
AM_RANGE(0x00800000, 0x00807fff) AM_DEVREADWRITE_LEGACY("aica", dc_arm_aica_r, dc_arm_aica_w)
AM_RANGE(0x00800000, 0x00807fff) AM_READWRITE(dc_arm_aica_r, dc_arm_aica_w)
ADDRESS_MAP_END
static MACHINE_RESET( dc_console )

View File

@ -735,7 +735,7 @@ MACHINE_CONFIG_END
static SUPERFX_CONFIG( snes_superfx_config )
{
DEVCB_LINE(snes_extern_irq_w) /* IRQ line from cart */
DEVCB_DRIVER_LINE_MEMBER(snes_state,snes_extern_irq_w) /* IRQ line from cart */
};
static MACHINE_CONFIG_DERIVED( snessfx, snes )