change from device->machine() to space.machine() in device handlers in order to make next changes easier (no whatsnew)

This commit is contained in:
Miodrag Milanovic 2012-09-21 08:25:27 +00:00
parent 81f2150890
commit 1f9d1cd620
164 changed files with 1535 additions and 1535 deletions

View File

@ -1839,14 +1839,14 @@ WRITE8_DEVICE_HANDLER( leland_80186_control_w )
}
/* /RESET */
device->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, data & 0x80 ? CLEAR_LINE : ASSERT_LINE);
space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, data & 0x80 ? CLEAR_LINE : ASSERT_LINE);
/* /NMI */
/* If the master CPU doesn't get a response by the time it's ready to send
the next command, it uses an NMI to force the issue; unfortunately, this
seems to really screw up the sound system. It turns out it's better to
just wait for the original interrupt to occur naturally */
/* device->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);*/
/* space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, data & 0x40 ? CLEAR_LINE : ASSERT_LINE);*/
/* INT0 */
if (data & 0x20)
@ -1894,7 +1894,7 @@ static TIMER_CALLBACK( command_lo_sync )
WRITE8_DEVICE_HANDLER( leland_80186_command_lo_w )
{
device->machine().scheduler().synchronize(FUNC(command_lo_sync), data, device);
space.machine().scheduler().synchronize(FUNC(command_lo_sync), data, device);
}
@ -1957,7 +1957,7 @@ READ8_DEVICE_HANDLER( leland_80186_response_r )
if (LOG_COMM) logerror("%04X:Read sound response latch = %02X\n", pc, state->m_sound_response);
/* synchronize the response */
device->machine().scheduler().synchronize(FUNC(delayed_response_r), pc + 2, device);
space.machine().scheduler().synchronize(FUNC(delayed_response_r), pc + 2, device);
return state->m_sound_response;
}
@ -2204,7 +2204,7 @@ static READ16_DEVICE_HANDLER( peripheral_r )
if (!state->m_has_ym2151)
return pit8254_r(device, space, offset | 0x40, mem_mask);
else
return ym2151_r(device->machine().device("ymsnd"), space, offset);
return ym2151_r(space.machine().device("ymsnd"), space, offset);
case 4:
if (state->m_is_redline)
@ -2241,7 +2241,7 @@ static WRITE16_DEVICE_HANDLER( peripheral_w )
if (!state->m_has_ym2151)
pit8254_w(device, space, offset | 0x40, data, mem_mask);
else
ym2151_w(device->machine().device("ymsnd"), space, offset, data);
ym2151_w(space.machine().device("ymsnd"), space, offset, data);
break;
case 4:

View File

@ -76,7 +76,7 @@ WRITE8_MEMBER(redalert_state::redalert_audio_command_w)
static WRITE8_DEVICE_HANDLER( redalert_AY8910_w )
{
redalert_state *state = device->machine().driver_data<redalert_state>();
redalert_state *state = space.machine().driver_data<redalert_state>();
/* BC2 is connected to a pull-up resistor, so BC2=1 always */
switch (data & 0x03)
{

View File

@ -1559,7 +1559,7 @@ static WRITE_LINE_DEVICE_HANDLER( chihiro_pic8259_1_set_int_line )
static READ8_DEVICE_HANDLER( get_slave_ack )
{
chihiro_state *chst=device->machine().driver_data<chihiro_state>();
chihiro_state *chst=space.machine().driver_data<chihiro_state>();
if (offset==2) { // IRQ = 2
return pic8259_acknowledge(chst->chihiro_devs.pic8259_2);
}

View File

@ -221,7 +221,7 @@ static WRITE8_HANDLER( saiyugoub1_adpcm_rom_addr_w )
static WRITE8_DEVICE_HANDLER( saiyugoub1_adpcm_control_w )
{
ddragon_state *state = device->machine().driver_data<ddragon_state>();
ddragon_state *state = space.machine().driver_data<ddragon_state>();
/* i8748 Port 2 write */
UINT8 *saiyugoub1_adpcm_rom = state->memregion("adpcm")->base();
@ -275,7 +275,7 @@ static WRITE8_DEVICE_HANDLER( saiyugoub1_m5205_clk_w )
/* Actually, T0 output clk mode is not supported by the i8048 core */
#if 0
ddragon_state *state = device->machine().driver_data<ddragon_state>();
ddragon_state *state = space.machine().driver_data<ddragon_state>();
state->m_m5205_clk++;
if (state->m_m5205_clk == 8)

View File

@ -1524,7 +1524,7 @@ static WRITE16_DEVICE_HANDLER( ddenlovr_oki_bank_w )
static WRITE16_DEVICE_HANDLER( quiz365_oki_bank1_w )
{
dynax_state *state = device->machine().driver_data<dynax_state>();
dynax_state *state = space.machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
{
@ -1536,7 +1536,7 @@ static WRITE16_DEVICE_HANDLER( quiz365_oki_bank1_w )
static WRITE16_DEVICE_HANDLER( quiz365_oki_bank2_w )
{
dynax_state *state = device->machine().driver_data<dynax_state>();
dynax_state *state = space.machine().driver_data<dynax_state>();
if (ACCESSING_BITS_0_7)
{
@ -1561,7 +1561,7 @@ READ16_MEMBER(dynax_state::unk16_r)
static WRITE8_DEVICE_HANDLER( ddenlovr_select_w )
{
dynax_state *state = device->machine().driver_data<dynax_state>();
dynax_state *state = space.machine().driver_data<dynax_state>();
state->m_dsw_sel = data;
}
@ -1598,13 +1598,13 @@ READ8_MEMBER(dynax_state::rongrong_input2_r)
static READ8_DEVICE_HANDLER( quiz365_input_r )
{
dynax_state *state = device->machine().driver_data<dynax_state>();
dynax_state *state = space.machine().driver_data<dynax_state>();
if (!BIT(state->m_dsw_sel, 0)) return state->ioport("DSW1")->read();
if (!BIT(state->m_dsw_sel, 1)) return state->ioport("DSW2")->read();
if (!BIT(state->m_dsw_sel, 2)) return state->ioport("DSW3")->read();
if (!BIT(state->m_dsw_sel, 3)) return 0xff;//device->machine().rand();
if (!BIT(state->m_dsw_sel, 4)) return 0xff;//device->machine().rand();
if (!BIT(state->m_dsw_sel, 3)) return 0xff;//space.machine().rand();
if (!BIT(state->m_dsw_sel, 4)) return 0xff;//space.machine().rand();
return 0xff;
}
@ -2812,7 +2812,7 @@ ADDRESS_MAP_END
static READ8_DEVICE_HANDLER( hginga_dsw_r )
{
dynax_state *state = device->machine().driver_data<dynax_state>();
dynax_state *state = space.machine().driver_data<dynax_state>();
if (!BIT(state->m_dsw_sel, 0)) return state->ioport("DSW4")->read();
if (!BIT(state->m_dsw_sel, 1)) return state->ioport("DSW3")->read();
@ -2820,7 +2820,7 @@ static READ8_DEVICE_HANDLER( hginga_dsw_r )
if (!BIT(state->m_dsw_sel, 3)) return state->ioport("DSW1")->read();
if (!BIT(state->m_dsw_sel, 4)) return state->ioport("DSW5")->read();
logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", device->machine().describe_context(), state->m_dsw_sel);
logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", space.machine().describe_context(), state->m_dsw_sel);
return 0xff;
}
@ -3657,7 +3657,7 @@ WRITE8_MEMBER(dynax_state::seljan2_palette_w)
static READ8_DEVICE_HANDLER( seljan2_dsw_r )
{
dynax_state *state = device->machine().driver_data<dynax_state>();
dynax_state *state = space.machine().driver_data<dynax_state>();
if (!BIT(state->m_dsw_sel, 0)) return state->ioport("DSW1")->read();
if (!BIT(state->m_dsw_sel, 1)) return state->ioport("DSW2")->read();
@ -3665,7 +3665,7 @@ static READ8_DEVICE_HANDLER( seljan2_dsw_r )
if (!BIT(state->m_dsw_sel, 3)) return state->ioport("DSW4")->read();
if (!BIT(state->m_dsw_sel, 4)) return state->ioport("DSWTOP")->read();
logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", device->machine().describe_context(), state->m_dsw_sel);
logerror("%s: warning, unknown bits read, ddenlovr_select = %02x\n", space.machine().describe_context(), state->m_dsw_sel);
return 0xff;
}

View File

@ -158,14 +158,14 @@ static WRITE_LINE_DEVICE_HANDLER( dleuro_interrupt )
static WRITE16_DEVICE_HANDLER( serial_transmit )
{
dlair_state *state = device->machine().driver_data<dlair_state>();
dlair_state *state = space.machine().driver_data<dlair_state>();
state->laserdisc_data_w(data);
}
static READ16_DEVICE_HANDLER( serial_receive )
{
dlair_state *state = device->machine().driver_data<dlair_state>();
dlair_state *state = space.machine().driver_data<dlair_state>();
/* if we still have data to send, do it now */
if (offset == 0 && state->laserdisc_data_available_r() == ASSERT_LINE)
return state->laserdisc_data_r();

View File

@ -201,7 +201,7 @@ WRITE8_MEMBER(esripsys_state::fdt_w)
static READ16_DEVICE_HANDLER( fdt_rip_r )
{
esripsys_state *state = device->machine().driver_data<esripsys_state>();
esripsys_state *state = space.machine().driver_data<esripsys_state>();
offset = (offset & 0x7ff) << 1;
if (!state->m_fasel)
@ -212,7 +212,7 @@ static READ16_DEVICE_HANDLER( fdt_rip_r )
static WRITE16_DEVICE_HANDLER( fdt_rip_w )
{
esripsys_state *state = device->machine().driver_data<esripsys_state>();
esripsys_state *state = space.machine().driver_data<esripsys_state>();
offset = (offset & 0x7ff) << 1;
if (!state->m_fasel)

View File

@ -207,9 +207,9 @@ static int s3c2410_core_pin_r( device_t *device, int pin)
static WRITE8_DEVICE_HANDLER( s3c2410_nand_command_w )
{
ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
ghosteo_state *state = space.machine().driver_data<ghosteo_state>();
struct nand_t &nand = state->m_nand;
// device_t *nand = device->machine().device( "nand");
// device_t *nand = space.machine().device( "nand");
#if NAND_LOG
logerror( "s3c2410_nand_command_w %02X\n", data);
#endif
@ -233,9 +233,9 @@ static WRITE8_DEVICE_HANDLER( s3c2410_nand_command_w )
static WRITE8_DEVICE_HANDLER( s3c2410_nand_address_w )
{
ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
ghosteo_state *state = space.machine().driver_data<ghosteo_state>();
struct nand_t &nand = state->m_nand;
// device_t *nand = device->machine().device( "nand");
// device_t *nand = space.machine().device( "nand");
#if NAND_LOG
logerror( "s3c2410_nand_address_w %02X\n", data);
#endif
@ -269,9 +269,9 @@ static WRITE8_DEVICE_HANDLER( s3c2410_nand_address_w )
static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
{
ghosteo_state *state = device->machine().driver_data<ghosteo_state>();
ghosteo_state *state = space.machine().driver_data<ghosteo_state>();
struct nand_t &nand = state->m_nand;
// device_t *nand = device->machine().device( "nand");
// device_t *nand = space.machine().device( "nand");
UINT8 data = 0;
switch (nand.mode)
{
@ -282,7 +282,7 @@ static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
break;
case NAND_M_READ :
{
UINT8 *flash = (UINT8 *)device->machine().root_device().memregion( "user1")->base();
UINT8 *flash = (UINT8 *)space.machine().root_device().memregion( "user1")->base();
if (nand.byte_addr < state->m_rom_pagesize)
{
data = *(flash + nand.page_addr * state->m_rom_pagesize + nand.byte_addr);
@ -318,7 +318,7 @@ static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
static WRITE8_DEVICE_HANDLER( s3c2410_nand_data_w )
{
// device_t *nand = device->machine().device( "nand");
// device_t *nand = space.machine().device( "nand");
#if NAND_LOG
logerror( "s3c2410_nand_data_w %02X\n", data);
#endif

View File

@ -130,14 +130,14 @@ Notes (couriersud)
static WRITE8_DEVICE_HANDLER( ic8j1_output_changed )
{
m10_state *state = device->machine().driver_data<m10_state>();
LOG(("ic8j1: %d %d\n", data, device->machine().primary_screen->vpos()));
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);
}
static WRITE8_DEVICE_HANDLER( ic8j2_output_changed )
{
m10_state *state = device->machine().driver_data<m10_state>();
m10_state *state = space.machine().driver_data<m10_state>();
/* written from /Q to A with slight delight */
LOG(("ic8j2: %d\n", data));

View File

@ -425,8 +425,8 @@ static WRITE8_DEVICE_HANDLER( vid_o1_callback )
if (data)
{
acia6850_device *acia_0 = device->machine().device<acia6850_device>("acia6850_0");
acia6850_device *acia_1 = device->machine().device<acia6850_device>("acia6850_1");
acia6850_device *acia_0 = space.machine().device<acia6850_device>("acia6850_0");
acia6850_device *acia_1 = space.machine().device<acia6850_device>("acia6850_1");
acia_0->tx_clock_in();
acia_0->rx_clock_in();
acia_1->tx_clock_in();
@ -720,7 +720,7 @@ READ16_HANDLER( bt471_r )
static READ8_DEVICE_HANDLER( pia_ic5_porta_track_r )
{
mpu4vid_state *state = device->machine().driver_data<mpu4vid_state>();
mpu4vid_state *state = space.machine().driver_data<mpu4vid_state>();
/* The SWP trackball interface connects a standard trackball to the AUX1 port on the MPU4
mainboard. As per usual, they've taken the cheap route here, reading and processing the
raw quadrature signal from the encoder wheels for a 4 bit interface, rather than use any
@ -729,7 +729,7 @@ static READ8_DEVICE_HANDLER( pia_ic5_porta_track_r )
We invert the X and Y data at source due to the use of Schmitt triggers in the interface, which
clean up the pulses and flip the active phase.*/
LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",device->machine().describe_context()));
LOG(("%s: IC5 PIA Read of Port A (AUX1)\n",space.machine().describe_context()));
UINT8 data = state->ioport("AUX1")->read();

View File

@ -35,16 +35,16 @@
static WRITE8_DEVICE_HANDLER( mquake_cia_0_porta_w )
{
/* switch banks as appropriate */
device->machine().root_device().membank("bank1")->set_entry(data & 1);
space.machine().root_device().membank("bank1")->set_entry(data & 1);
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
/* overlay disabled, map RAM on 0x000000 */
device->machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x000000, 0x07ffff, "bank1");
space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x000000, 0x07ffff, "bank1");
else
/* overlay enabled, map Amiga system ROM on 0x000000 */
device->machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x000000, 0x07ffff);
space.machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x000000, 0x07ffff);
}
@ -67,14 +67,14 @@ static WRITE8_DEVICE_HANDLER( mquake_cia_0_porta_w )
static READ8_DEVICE_HANDLER( mquake_cia_0_portb_r )
{
/* parallel port */
logerror("%s:CIA0_portb_r\n", device->machine().describe_context());
logerror("%s:CIA0_portb_r\n", space.machine().describe_context());
return 0xff;
}
static WRITE8_DEVICE_HANDLER( mquake_cia_0_portb_w )
{
/* parallel port */
logerror("%s:CIA0_portb_w(%02x)\n", device->machine().describe_context(), data);
logerror("%s:CIA0_portb_w(%02x)\n", space.machine().describe_context(), data);
}

View File

@ -264,7 +264,7 @@ static const pia6821_interface pia_2_intf =
static WRITE8_DEVICE_HANDLER( ic48_1_74123_output_changed )
{
nyny_state *state = device->machine().driver_data<nyny_state>();
nyny_state *state = space.machine().driver_data<nyny_state>();
state->m_pia2->ca1_w(data);
}

View File

@ -252,7 +252,7 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( n7751_rom_control_w )
{
othello_state *state = device->machine().driver_data<othello_state>();
othello_state *state = space.machine().driver_data<othello_state>();
/* P4 - address lines 0-3 */
/* P5 - address lines 4-7 */

View File

@ -36,7 +36,7 @@ static WRITE16_DEVICE_HANDLER( magicstk_coin_eeprom_w )
{
if (ACCESSING_BITS_0_7)
{
coin_counter_w(device->machine(), 0, data & 0x20);
coin_counter_w(space.machine(), 0, data & 0x20);
eeprom_device *eeprom = downcast<eeprom_device *>(device);
eeprom->set_cs_line((data & 8) ? CLEAR_LINE : ASSERT_LINE);
@ -70,7 +70,7 @@ static WRITE16_DEVICE_HANDLER( oki_banking )
{
int addr = 0x40000 * ((data & 3) - 1);
if (addr < device->machine().root_device().memregion("oki")->bytes())
if (addr < space.machine().root_device().memregion("oki")->bytes())
downcast<okim6295_device *>(device)->set_bank_base(addr);
}
}

View File

@ -311,7 +311,7 @@ static Z80CTC_INTERFACE( ctc_intf )
static WRITE16_DEVICE_HANDLER( serial_transmit )
{
proconn_state *state = device->machine().driver_data<proconn_state>();
proconn_state *state = space.machine().driver_data<proconn_state>();
//Don't like the look of this, should be a clock somewhere
// if (offset == 0)

View File

@ -231,8 +231,8 @@ static const ay8910_interface ay8910_2_interface =
static WRITE8_DEVICE_HANDLER( ttl74123_output_changed )
{
r2dtank_state *state = device->machine().driver_data<r2dtank_state>();
pia6821_device *pia = device->machine().device<pia6821_device>("pia_main");
r2dtank_state *state = space.machine().driver_data<r2dtank_state>();
pia6821_device *pia = space.machine().device<pia6821_device>("pia_main");
pia->ca1_w(data);
state->m_ttl74123_output = data;
}

View File

@ -165,7 +165,7 @@ MACHINE_RESET_MEMBER(segac2_state,segac2)
/* handle writes to the UPD7759 */
static WRITE16_DEVICE_HANDLER( segac2_upd7759_w )
{
segac2_state *state = device->machine().driver_data<segac2_state>();
segac2_state *state = space.machine().driver_data<segac2_state>();
/* make sure we have a UPD chip */
if (!state->m_sound_banks)

View File

@ -426,7 +426,7 @@ WRITE8_MEMBER( segas16a_state::n7751_rom_offset_w )
WRITE8_DEVICE_HANDLER( segas16a_state::static_n7751_rom_offset_w )
{
segas16a_state *state = device->machine().driver_data<segas16a_state>();
segas16a_state *state = space.machine().driver_data<segas16a_state>();
state->n7751_rom_offset_w(state->m_maincpu->space(AS_PROGRAM), offset, data);
}

View File

@ -374,7 +374,7 @@ static const pia6821_interface pia_4_intf =
static WRITE8_DEVICE_HANDLER( ic60_74123_output_changed)
{
pia6821_device *pia2 = device->machine().device<pia6821_device>("pia2");
pia6821_device *pia2 = space.machine().device<pia6821_device>("pia2");
pia2->ca1_w(data);
}

View File

@ -423,7 +423,7 @@ WRITE8_MEMBER(topspeed_state::sound_bankswitch_w)/* assumes Z80 sandwiched betwe
static WRITE8_DEVICE_HANDLER( topspeed_tc0140syt_comm_w )
{
device->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_NMI, PULSE_LINE);
tc0140syt_comm_w(device, space, 0, data);
}

View File

@ -50,7 +50,7 @@ static READ8_HANDLER( trvquest_question_r )
static WRITE8_DEVICE_HANDLER( trvquest_coin_w )
{
coin_counter_w(device->machine(), 0, ~data & 1);
coin_counter_w(space.machine(), 0, ~data & 1);
}
static WRITE8_DEVICE_HANDLER( trvquest_misc_w )

View File

@ -64,12 +64,12 @@ void atari_interrupt_cb(pokey_device *device, int mask)
READ8_DEVICE_HANDLER(atari_pia_pa_r)
{
return device->machine().root_device().ioport("djoy_0_1")->read_safe(0);
return space.machine().root_device().ioport("djoy_0_1")->read_safe(0);
}
READ8_DEVICE_HANDLER(atari_pia_pb_r)
{
return device->machine().root_device().ioport("djoy_2_3")->read_safe(0);
return space.machine().root_device().ioport("djoy_2_3")->read_safe(0);
}
WRITE8_DEVICE_HANDLER(a600xl_pia_pb_w) { a600xl_mmu(device->machine(), data); }

View File

@ -88,23 +88,23 @@ static READ_LINE_DEVICE_HANDLER( b_via_0_ca2_r )
static READ8_DEVICE_HANDLER( b_via_0_pa_r )
{
beezer_state *state = device->machine().driver_data<beezer_state>();
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?
}
static READ8_DEVICE_HANDLER( b_via_0_pb_r )
{
beezer_state *state = device->machine().driver_data<beezer_state>();
beezer_state *state = space.machine().driver_data<beezer_state>();
return state->m_pbus;
}
static WRITE8_DEVICE_HANDLER( b_via_0_pa_w )
{
beezer_state *state = device->machine().driver_data<beezer_state>();
beezer_state *state = space.machine().driver_data<beezer_state>();
if ((data & 0x08) == 0)
device->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
else
device->machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
space.machine().device("audiocpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
if ((data & 0x04) == 0)
{
@ -128,30 +128,30 @@ static WRITE8_DEVICE_HANDLER( b_via_0_pa_w )
static WRITE8_DEVICE_HANDLER( b_via_0_pb_w )
{
beezer_state *state = device->machine().driver_data<beezer_state>();
beezer_state *state = space.machine().driver_data<beezer_state>();
state->m_pbus = data;
}
static READ8_DEVICE_HANDLER( b_via_1_pa_r )
{
beezer_state *state = device->machine().driver_data<beezer_state>();
beezer_state *state = space.machine().driver_data<beezer_state>();
return state->m_pbus;
}
static READ8_DEVICE_HANDLER( b_via_1_pb_r )
{
return 0x1F | (beezer_noise_r(device->machine().device("custom"), space, 0)?0x40:0);
return 0x1F | (beezer_noise_r(space.machine().device("custom"), space, 0)?0x40:0);
}
static WRITE8_DEVICE_HANDLER( b_via_1_pa_w )
{
beezer_state *state = device->machine().driver_data<beezer_state>();
beezer_state *state = space.machine().driver_data<beezer_state>();
state->m_pbus = data;
}
static WRITE8_DEVICE_HANDLER( b_via_1_pb_w )
{
beezer_timer1_w(device->machine().device("custom"), space, 0, data&0x80);
beezer_timer1_w(space.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

@ -356,7 +356,7 @@ WRITE8_MEMBER(carpolo_state::carpolo_timer_interrupt_clear_w)
static WRITE8_DEVICE_HANDLER( pia_0_port_a_w )
{
carpolo_state *state = device->machine().driver_data<carpolo_state>();
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,7 +366,7 @@ static WRITE8_DEVICE_HANDLER( pia_0_port_a_w )
bit 6 - Player 1 crash sound
bit 7 - Ball hit pulse sound */
coin_counter_w(device->machine(), 0, data & 0x01);
coin_counter_w(space.machine(), 0, data & 0x01);
state->m_ttl7474_1f_1->clear_w((data & 0x08) >> 3);
@ -378,7 +378,7 @@ static WRITE8_DEVICE_HANDLER( pia_0_port_a_w )
static WRITE8_DEVICE_HANDLER( pia_0_port_b_w )
{
carpolo_state *state = device->machine().driver_data<carpolo_state>();
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
@ -394,7 +394,7 @@ static WRITE8_DEVICE_HANDLER( pia_0_port_b_w )
static READ8_DEVICE_HANDLER( pia_0_port_b_r )
{
carpolo_state *state = device->machine().driver_data<carpolo_state>();
carpolo_state *state = space.machine().driver_data<carpolo_state>();
/* bit 4 - Pedal bit 0
bit 5 - Pedal bit 1 */
@ -405,7 +405,7 @@ static READ8_DEVICE_HANDLER( pia_0_port_b_r )
static READ8_DEVICE_HANDLER( pia_1_port_a_r )
{
carpolo_state *state = device->machine().driver_data<carpolo_state>();
carpolo_state *state = space.machine().driver_data<carpolo_state>();
UINT8 ret;
/* bit 0 - Player 4 steering input (left or right)
@ -429,7 +429,7 @@ static READ8_DEVICE_HANDLER( pia_1_port_a_r )
static READ8_DEVICE_HANDLER( pia_1_port_b_r )
{
carpolo_state *state = device->machine().driver_data<carpolo_state>();
carpolo_state *state = space.machine().driver_data<carpolo_state>();
UINT8 ret;
/* bit 4 - Player 4 steering input (wheel moving or stopped)

View File

@ -835,11 +835,11 @@ void dc_state::machine_reset()
READ64_DEVICE_HANDLER( dc_aica_reg_r )
{
// dc_state *state = device->machine().driver_data<dc_state>();
// dc_state *state = space.machine().driver_data<dc_state>();
//int reg;
UINT64 shift;
/*reg = */decode_reg32_64(device->machine(), offset, mem_mask, &shift);
/*reg = */decode_reg32_64(space.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);
@ -848,12 +848,12 @@ READ64_DEVICE_HANDLER( dc_aica_reg_r )
WRITE64_DEVICE_HANDLER( dc_aica_reg_w )
{
// dc_state *state = device->machine().driver_data<dc_state>();
// dc_state *state = space.machine().driver_data<dc_state>();
int reg;
UINT64 shift;
UINT32 dat;
reg = decode_reg32_64(device->machine(), offset, mem_mask, &shift);
reg = decode_reg32_64(space.machine(), offset, mem_mask, &shift);
dat = (UINT32)(data >> shift);
if (reg == (0x2c00/4))
@ -861,12 +861,12 @@ WRITE64_DEVICE_HANDLER( dc_aica_reg_w )
if (dat & 1)
{
/* halt the ARM7 */
device->machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
space.machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
}
else
{
/* it's alive ! */
device->machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
space.machine().device("soundcpu")->execute().set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
}
}

View File

@ -443,7 +443,7 @@ WRITE32_DEVICE_HANDLER(nwk_fifo_0_w)
{
if (nwk_device_sel[0] & 0x01)
{
nwk_fifo_w(device->machine(), 0, data);
nwk_fifo_w(space.machine(), 0, data);
}
else if (nwk_device_sel[0] & 0x02)
{
@ -460,7 +460,7 @@ WRITE32_DEVICE_HANDLER(nwk_fifo_1_w)
{
if (nwk_device_sel[1] & 0x01)
{
nwk_fifo_w(device->machine(), 1, data);
nwk_fifo_w(space.machine(), 1, data);
}
else if (nwk_device_sel[1] & 0x02)
{
@ -501,7 +501,7 @@ WRITE32_DEVICE_HANDLER(nwk_voodoo_0_w)
{
if (nwk_device_sel[0] & 0x01)
{
nwk_fifo_w(device->machine(), 0, data);
nwk_fifo_w(space.machine(), 0, data);
}
else if (nwk_device_sel[0] & 0x02)
{
@ -518,7 +518,7 @@ WRITE32_DEVICE_HANDLER(nwk_voodoo_1_w)
{
if (nwk_device_sel[1] & 0x01)
{
nwk_fifo_w(device->machine(), 1, data);
nwk_fifo_w(space.machine(), 1, data);
}
else if (nwk_device_sel[1] & 0x02)
{

View File

@ -821,15 +821,15 @@ void ataxx_init_eeprom(running_machine &machine, const UINT16 *data)
READ8_DEVICE_HANDLER( ataxx_eeprom_r )
{
int port = device->machine().root_device().ioport("IN2")->read();
if (LOG_EEPROM) logerror("%s:EE read\n", device->machine().describe_context());
int port = space.machine().root_device().ioport("IN2")->read();
if (LOG_EEPROM) logerror("%s:EE read\n", space.machine().describe_context());
return port;
}
WRITE8_DEVICE_HANDLER( ataxx_eeprom_w )
{
if (LOG_EEPROM) logerror("%s:EE write %d%d%d\n", device->machine().describe_context(),
if (LOG_EEPROM) logerror("%s:EE write %d%d%d\n", space.machine().describe_context(),
(data >> 6) & 1, (data >> 5) & 1, (data >> 4) & 1);
eeprom_device *eeprom = downcast<eeprom_device *>(device);
eeprom->write_bit ((data & 0x10) >> 4);
@ -1306,14 +1306,14 @@ READ8_MEMBER(leland_state::ataxx_paletteram_and_misc_r)
READ8_DEVICE_HANDLER( leland_sound_port_r )
{
leland_state *state = device->machine().driver_data<leland_state>();
leland_state *state = space.machine().driver_data<leland_state>();
return state->m_gfx_control;
}
WRITE8_DEVICE_HANDLER( leland_sound_port_w )
{
leland_state *state = device->machine().driver_data<leland_state>();
leland_state *state = space.machine().driver_data<leland_state>();
/* update the graphics banking */
leland_gfx_port_w(device, space, 0, data);
@ -1324,9 +1324,9 @@ WRITE8_DEVICE_HANDLER( leland_sound_port_w )
/* some bankswitching occurs here */
if (LOG_BANKSWITCHING_M)
if ((state->m_sound_port_bank ^ data) & 0x24)
logerror("%s:sound_port_bank = %02X\n", device->machine().describe_context(), 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)(device->machine());
(*state->m_update_master_bank)(space.machine());
}

View File

@ -41,7 +41,7 @@ static TIMER_CALLBACK( counter_fired_callback );
static READ8_DEVICE_HANDLER( zwackery_port_1_r )
{
UINT8 ret = device->machine().root_device().ioport("IN1")->read();
UINT8 ret = space.machine().root_device().ioport("IN1")->read();
downcast<pia6821_device *>(device)->set_port_a_z_mask(ret);
@ -51,7 +51,7 @@ static READ8_DEVICE_HANDLER( zwackery_port_1_r )
static READ8_DEVICE_HANDLER( zwackery_port_3_r )
{
UINT8 ret = device->machine().root_device().ioport("IN3")->read();
UINT8 ret = space.machine().root_device().ioport("IN3")->read();
downcast<pia6821_device *>(device)->set_port_a_z_mask(ret);
@ -270,7 +270,7 @@ static TIMER_CALLBACK( mcr68_493_callback )
WRITE8_DEVICE_HANDLER( zwackery_pia0_w )
{
/* bit 7 is the watchdog */
if (!(data & 0x80)) device->machine().watchdog_reset();
if (!(data & 0x80)) space.machine().watchdog_reset();
/* bits 5 and 6 control hflip/vflip */
/* bits 3 and 4 control coin counters? */
@ -280,7 +280,7 @@ WRITE8_DEVICE_HANDLER( zwackery_pia0_w )
WRITE8_DEVICE_HANDLER( zwackery_pia1_w )
{
mcr68_state *state = device->machine().driver_data<mcr68_state>();
mcr68_state *state = space.machine().driver_data<mcr68_state>();
state->m_zwackery_sound_data = (data >> 4) & 0x0f;
}

View File

@ -114,7 +114,7 @@ READ8_DEVICE_HANDLER( megadriv_68k_YM2612_read)
}
else
{
logerror("%s: 68000 attempting to access YM2612 (read) without bus\n", device->machine().describe_context());
logerror("%s: 68000 attempting to access YM2612 (read) without bus\n", space.machine().describe_context());
return 0;
}
@ -131,7 +131,7 @@ WRITE8_DEVICE_HANDLER( megadriv_68k_YM2612_write)
}
else
{
logerror("%s: 68000 attempting to access YM2612 (write) without bus\n", device->machine().describe_context());
logerror("%s: 68000 attempting to access YM2612 (write) without bus\n", space.machine().describe_context());
}
}

View File

@ -683,7 +683,7 @@ UINT32 n64_periphs::sp_reg_r(UINT32 offset)
READ32_DEVICE_HANDLER( n64_sp_reg_r )
{
return device->machine().device<n64_periphs>("rcp")->sp_reg_r(offset);
return space.machine().device<n64_periphs>("rcp")->sp_reg_r(offset);
}
void n64_periphs::sp_reg_w(UINT32 offset, UINT32 data, UINT32 mem_mask)
@ -896,7 +896,7 @@ void n64_periphs::sp_reg_w(UINT32 offset, UINT32 data, UINT32 mem_mask)
WRITE32_DEVICE_HANDLER( n64_sp_reg_w )
{
device->machine().device<n64_periphs>("rcp")->sp_reg_w(offset, data, mem_mask);
space.machine().device<n64_periphs>("rcp")->sp_reg_w(offset, data, mem_mask);
}
// RDP Interface
@ -908,8 +908,8 @@ void dp_full_sync(running_machine &machine)
READ32_DEVICE_HANDLER( n64_dp_reg_r )
{
n64_state *state = device->machine().driver_data<n64_state>();
n64_periphs *periphs = device->machine().device<n64_periphs>("rcp");
n64_state *state = space.machine().driver_data<n64_state>();
n64_periphs *periphs = space.machine().device<n64_periphs>("rcp");
UINT32 ret = 0;
switch (offset)
{
@ -944,16 +944,16 @@ READ32_DEVICE_HANDLER( n64_dp_reg_r )
break;
}
//printf("%08x dp_reg_r %08x = %08x\n", (UINT32)device->machine().device("rsp")->state().state_int(RSP_PC), offset, ret); fflush(stdout);
//printf("%08x dp_reg_r %08x = %08x\n", (UINT32)space.machine().device("rsp")->state().state_int(RSP_PC), offset, ret); fflush(stdout);
return ret;
}
WRITE32_DEVICE_HANDLER( n64_dp_reg_w )
{
n64_state *state = device->machine().driver_data<n64_state>();
n64_periphs *periphs = device->machine().device<n64_periphs>("rcp");
n64_state *state = space.machine().driver_data<n64_state>();
n64_periphs *periphs = space.machine().device<n64_periphs>("rcp");
//printf("%08x dp_reg_w %08x %08x %08x\n", (UINT32)device->machine().device("rsp")->state().state_int(RSP_PC), offset, data, mem_mask); fflush(stdout);
//printf("%08x dp_reg_w %08x %08x %08x\n", (UINT32)space.machine().device("rsp")->state().state_int(RSP_PC), offset, data, mem_mask); fflush(stdout);
switch (offset)
{
case 0x00/4: // DP_START_REG

View File

@ -135,11 +135,11 @@ READ8_DEVICE_HANDLER( namco_06xx_data_r )
UINT8 result = 0xff;
int devnum;
LOG(("%s: 06XX '%s' read offset %d\n",device->machine().describe_context(),device->tag(),offset));
LOG(("%s: 06XX '%s' read offset %d\n",space.machine().describe_context(),device->tag(),offset));
if (!(state->m_control & 0x10))
{
logerror("%s: 06XX '%s' read in write mode %02x\n",device->machine().describe_context(),device->tag(),state->m_control);
logerror("%s: 06XX '%s' read in write mode %02x\n",space.machine().describe_context(),device->tag(),state->m_control);
return 0;
}
@ -156,11 +156,11 @@ WRITE8_DEVICE_HANDLER( namco_06xx_data_w )
namco_06xx_state *state = get_safe_token(device);
int devnum;
LOG(("%s: 06XX '%s' write offset %d = %02x\n",device->machine().describe_context(),device->tag(),offset,data));
LOG(("%s: 06XX '%s' write offset %d = %02x\n",space.machine().describe_context(),device->tag(),offset,data));
if (state->m_control & 0x10)
{
logerror("%s: 06XX '%s' write in read mode %02x\n",device->machine().describe_context(),device->tag(),state->m_control);
logerror("%s: 06XX '%s' write in read mode %02x\n",space.machine().describe_context(),device->tag(),state->m_control);
return;
}
@ -173,7 +173,7 @@ WRITE8_DEVICE_HANDLER( namco_06xx_data_w )
READ8_DEVICE_HANDLER( namco_06xx_ctrl_r )
{
namco_06xx_state *state = get_safe_token(device);
LOG(("%s: 06XX '%s' ctrl_r\n",device->machine().describe_context(),device->tag()));
LOG(("%s: 06XX '%s' ctrl_r\n",space.machine().describe_context(),device->tag()));
return state->m_control;
}
@ -182,7 +182,7 @@ WRITE8_DEVICE_HANDLER( namco_06xx_ctrl_w )
namco_06xx_state *state = get_safe_token(device);
int devnum;
LOG(("%s: 06XX '%s' control %02x\n",device->machine().describe_context(),device->tag(),data));
LOG(("%s: 06XX '%s' control %02x\n",space.machine().describe_context(),device->tag(),data));
state->m_control = data;

View File

@ -223,7 +223,7 @@ static void namco_50xx_irq_set(device_t *device)
WRITE8_DEVICE_HANDLER( namco_50xx_write )
{
device->machine().scheduler().synchronize(FUNC(namco_50xx_latch_callback), data, (void *)device);
space.machine().scheduler().synchronize(FUNC(namco_50xx_latch_callback), data, (void *)device);
namco_50xx_irq_set(device);
}

View File

@ -100,7 +100,7 @@ WRITE8_DEVICE_HANDLER( namco_51xx_write )
data &= 0x07;
LOG(("%s: custom 51XX write %02x\n",device->machine().describe_context(),data));
LOG(("%s: custom 51XX write %02x\n",space.machine().describe_context(),data));
if (state->m_coincred_mode)
{
@ -130,9 +130,9 @@ WRITE8_DEVICE_HANDLER( namco_51xx_write )
static int namcoio_51XX_kludge = 0;
/* Only compute namcoio_51XX_kludge when gamedrv changes */
if (namcoio_51XX_driver != &device->machine().system())
if (namcoio_51XX_driver != &space.machine().system())
{
namcoio_51XX_driver = &device->machine().system();
namcoio_51XX_driver = &space.machine().system();
if (strcmp(namcoio_51XX_driver->name, "xevious") == 0 ||
strcmp(namcoio_51XX_driver->parent, "xevious") == 0)
namcoio_51XX_kludge = 1;
@ -198,7 +198,7 @@ READ8_DEVICE_HANDLER( namco_51xx_read )
{
namco_51xx_state *state = get_safe_token(device);
LOG(("%s: custom 51XX read\n",device->machine().describe_context()));
LOG(("%s: custom 51XX read\n",space.machine().describe_context()));
if (state->m_mode == 0) /* switch mode */
{
@ -265,7 +265,7 @@ READ8_DEVICE_HANDLER( namco_51xx_read )
if (state->m_mode == 1)
{
int on = (device->machine().primary_screen->frame_number() & 0x10) >> 4;
int on = (space.machine().primary_screen->frame_number() & 0x10) >> 4;
if (state->m_credits >= 2)
WRITE_PORT(state,0,0x0c | 3*on); // lamps

View File

@ -267,7 +267,7 @@ static WRITE_LINE_DEVICE_HANDLER( pic8259_1_set_int_line )
static READ8_DEVICE_HANDLER( get_slave_ack )
{
if (offset==2) { // IRQ = 2
return pic8259_acknowledge(device->machine().device("pic8259_2"));
return pic8259_acknowledge(space.machine().device("pic8259_2"));
}
return 0x00;
}

View File

@ -346,7 +346,7 @@ READ8_MEMBER(qix_state::qix_video_firq_ack_r)
READ8_DEVICE_HANDLER( qixmcu_coin_r )
{
qix_state *state = device->machine().driver_data<qix_state>();
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];
@ -355,7 +355,7 @@ READ8_DEVICE_HANDLER( qixmcu_coin_r )
static WRITE8_DEVICE_HANDLER( qixmcu_coin_w )
{
qix_state *state = device->machine().driver_data<qix_state>();
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 */
@ -366,18 +366,18 @@ static WRITE8_DEVICE_HANDLER( qixmcu_coin_w )
static WRITE8_DEVICE_HANDLER( qixmcu_coinctrl_w )
{
qix_state *state = device->machine().driver_data<qix_state>();
qix_state *state = space.machine().driver_data<qix_state>();
/* if (!(data & 0x04)) */
if (data & 0x04)
{
device->machine().device("mcu")->execute().set_input_line(M68705_IRQ_LINE, ASSERT_LINE);
space.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 */
device->machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
space.machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(50));
}
else
device->machine().device("mcu")->execute().set_input_line(M68705_IRQ_LINE, CLEAR_LINE);
space.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() */
@ -473,7 +473,7 @@ WRITE8_DEVICE_HANDLER( qix_pia_w )
{
/* make all the CPUs synchronize, and only AFTER that write the command to the PIA */
/* otherwise the 68705 will miss commands */
device->machine().scheduler().synchronize(FUNC(pia_w_callback), data | (offset << 8), (void *)downcast<pia6821_device *>(device));
space.machine().scheduler().synchronize(FUNC(pia_w_callback), data | (offset << 8), (void *)downcast<pia6821_device *>(device));
}
@ -486,8 +486,8 @@ WRITE8_DEVICE_HANDLER( qix_pia_w )
static WRITE8_DEVICE_HANDLER( qix_coinctl_w )
{
coin_lockout_w(device->machine(), 0, (~data >> 2) & 1);
coin_counter_w(device->machine(), 0, (data >> 1) & 1);
coin_lockout_w(space.machine(), 0, (~data >> 2) & 1);
coin_counter_w(space.machine(), 0, (data >> 1) & 1);
}
@ -500,10 +500,10 @@ static WRITE8_DEVICE_HANDLER( qix_coinctl_w )
static WRITE8_DEVICE_HANDLER( slither_76489_0_w )
{
qix_state *state = device->machine().driver_data<qix_state>();
qix_state *state = space.machine().driver_data<qix_state>();
/* write to the sound chip */
state->m_sn1->write(device->machine().device<legacy_cpu_device>("maincpu")->space(), 0, data);
state->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);
@ -514,10 +514,10 @@ static WRITE8_DEVICE_HANDLER( qix_coinctl_w )
static WRITE8_DEVICE_HANDLER( slither_76489_1_w )
{
qix_state *state = device->machine().driver_data<qix_state>();
qix_state *state = space.machine().driver_data<qix_state>();
/* write to the sound chip */
state->m_sn2->write(device->machine().device<legacy_cpu_device>("maincpu")->space(), 0, data);
state->m_sn2->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);
@ -535,7 +535,7 @@ static WRITE8_DEVICE_HANDLER( slither_76489_1_w )
static READ8_DEVICE_HANDLER( slither_trak_lr_r )
{
qix_state *state = device->machine().driver_data<qix_state>();
qix_state *state = space.machine().driver_data<qix_state>();
return state->ioport(state->m_flip ? "AN3" : "AN1")->read();
}
@ -543,7 +543,7 @@ static READ8_DEVICE_HANDLER( slither_trak_lr_r )
static READ8_DEVICE_HANDLER( slither_trak_ud_r )
{
qix_state *state = device->machine().driver_data<qix_state>();
qix_state *state = space.machine().driver_data<qix_state>();
return state->ioport(state->m_flip ? "AN2" : "AN0")->read();
}

View File

@ -51,13 +51,13 @@ CUSTOM_INPUT_MEMBER(scramble_state::darkplnt_custom_r)
WRITE8_DEVICE_HANDLER( scramble_protection_w )
{
scramble_state *state = device->machine().driver_data<scramble_state>();
scramble_state *state = space.machine().driver_data<scramble_state>();
state->m_xb = data;
}
READ8_DEVICE_HANDLER( scramble_protection_r )
{
switch (device->machine().device("maincpu")->safe_pc())
switch (space.machine().device("maincpu")->safe_pc())
{
case 0x00a8: return 0xf0;
case 0x00be: return 0xb0;
@ -68,7 +68,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",device->machine().describe_context());
logerror("%s: read protection\n",space.machine().describe_context());
return 0;
}
}

View File

@ -212,7 +212,7 @@ void stfight_adpcm_int(device_t *device)
WRITE8_DEVICE_HANDLER( stfight_adpcm_control_w )
{
stfight_state *state = device->machine().driver_data<stfight_state>();
stfight_state *state = space.machine().driver_data<stfight_state>();
if( data < 0x08 )
{
state->m_adpcm_data_offs = sampleLimits[data];

View File

@ -126,15 +126,15 @@ WRITE8_DEVICE_HANDLER( tc0220ioc_w )
{
case 0x00:
device->machine().watchdog_reset();
space.machine().watchdog_reset();
break;
case 0x04: /* coin counters and lockout, hi nibble irrelevant */
coin_lockout_w(device->machine(), 0, ~data & 0x01);
coin_lockout_w(device->machine(), 1, ~data & 0x02);
coin_counter_w(device->machine(), 0, data & 0x04);
coin_counter_w(device->machine(), 1, data & 0x08);
coin_lockout_w(space.machine(), 0, ~data & 0x01);
coin_lockout_w(space.machine(), 1, ~data & 0x02);
coin_counter_w(space.machine(), 0, data & 0x04);
coin_counter_w(space.machine(), 1, data & 0x08);
//if (data & 0xf0)
//logerror("PC %06x: warning - write %02x to TC0220IOC address %02x\n",space.device().safe_pc(),data,offset);
@ -282,14 +282,14 @@ WRITE8_DEVICE_HANDLER( tc0510nio_w )
switch (offset)
{
case 0x00:
device->machine().watchdog_reset();
space.machine().watchdog_reset();
break;
case 0x04: /* coin counters and lockout */
coin_lockout_w(device->machine(), 0, ~data & 0x01);
coin_lockout_w(device->machine(), 1, ~data & 0x02);
coin_counter_w(device->machine(), 0, data & 0x04);
coin_counter_w(device->machine(), 1, data & 0x08);
coin_lockout_w(space.machine(), 0, ~data & 0x01);
coin_lockout_w(space.machine(), 1, ~data & 0x02);
coin_counter_w(space.machine(), 0, data & 0x04);
coin_counter_w(space.machine(), 1, data & 0x08);
break;
default:
@ -432,14 +432,14 @@ WRITE8_DEVICE_HANDLER( tc0640fio_w )
{
case 0x00:
device->machine().watchdog_reset();
space.machine().watchdog_reset();
break;
case 0x04: /* coin counters and lockout */
coin_lockout_w(device->machine(), 0, ~data & 0x01);
coin_lockout_w(device->machine(), 1, ~data & 0x02);
coin_counter_w(device->machine(), 0, data & 0x04);
coin_counter_w(device->machine(), 1, data & 0x08);
coin_lockout_w(space.machine(), 0, ~data & 0x01);
coin_lockout_w(space.machine(), 1, ~data & 0x02);
coin_counter_w(space.machine(), 0, data & 0x04);
coin_counter_w(space.machine(), 1, data & 0x08);
break;
default:

View File

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

View File

@ -561,12 +561,12 @@ static TIMER_CALLBACK( williams_deferred_snd_cmd_w )
WRITE8_DEVICE_HANDLER( williams_snd_cmd_w )
{
/* the high two bits are set externally, and should be 1 */
device->machine().scheduler().synchronize(FUNC(williams_deferred_snd_cmd_w), data | 0xc0);
space.machine().scheduler().synchronize(FUNC(williams_deferred_snd_cmd_w), data | 0xc0);
}
WRITE8_DEVICE_HANDLER( playball_snd_cmd_w )
{
device->machine().scheduler().synchronize(FUNC(williams_deferred_snd_cmd_w), data);
space.machine().scheduler().synchronize(FUNC(williams_deferred_snd_cmd_w), data);
}
static TIMER_CALLBACK( blaster_deferred_snd_cmd_w )
@ -582,7 +582,7 @@ static TIMER_CALLBACK( blaster_deferred_snd_cmd_w )
WRITE8_DEVICE_HANDLER( blaster_snd_cmd_w )
{
device->machine().scheduler().synchronize(FUNC(blaster_deferred_snd_cmd_w), data);
space.machine().scheduler().synchronize(FUNC(blaster_deferred_snd_cmd_w), data);
}
@ -595,7 +595,7 @@ static TIMER_CALLBACK( williams2_deferred_snd_cmd_w )
static WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w )
{
device->machine().scheduler().synchronize(FUNC(williams2_deferred_snd_cmd_w), data);
space.machine().scheduler().synchronize(FUNC(williams2_deferred_snd_cmd_w), data);
}
@ -608,7 +608,7 @@ static WRITE8_DEVICE_HANDLER( williams2_snd_cmd_w )
WRITE8_DEVICE_HANDLER( williams_port_select_w )
{
williams_state *state = device->machine().driver_data<williams_state>();
williams_state *state = space.machine().driver_data<williams_state>();
state->m_port_select = data;
}
@ -650,13 +650,13 @@ CUSTOM_INPUT_MEMBER(williams_state::williams_mux_r)
READ8_DEVICE_HANDLER( williams_49way_port_0_r )
{
static const UINT8 translate49[7] = { 0x0, 0x4, 0x6, 0x7, 0xb, 0x9, 0x8 };
return (translate49[device->machine().root_device().ioport("49WAYX")->read() >> 4] << 4) | translate49[device->machine().root_device().ioport("49WAYY")->read() >> 4];
return (translate49[space.machine().root_device().ioport("49WAYX")->read() >> 4] << 4) | translate49[space.machine().root_device().ioport("49WAYY")->read() >> 4];
}
READ8_DEVICE_HANDLER( williams_input_port_49way_0_5_r )
{
williams_state *state = device->machine().driver_data<williams_state>();
williams_state *state = space.machine().driver_data<williams_state>();
if (state->m_port_select)
return williams_49way_port_0_r(device, space, 0);
else
@ -927,7 +927,7 @@ WRITE8_MEMBER(williams_state::blaster_bank_select_w)
static WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w )
{
coin_lockout_global_w(device->machine(), data & 1); /* bit 5 of PIC control port A */
coin_lockout_global_w(space.machine(), data & 1); /* bit 5 of PIC control port A */
}
@ -941,7 +941,7 @@ static WRITE8_DEVICE_HANDLER( lottofun_coin_lock_w )
static READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r )
{
/* merge in the gun inputs with the standard data */
int data = device->machine().root_device().ioport("IN0")->read();
int data = space.machine().root_device().ioport("IN0")->read();
int gun = (data & 0x3f) ^ ((data & 0x3f) >> 1);
return (data & 0xc0) | gun;
@ -953,7 +953,7 @@ static READ8_DEVICE_HANDLER( tshoot_input_port_0_3_r )
static WRITE8_DEVICE_HANDLER( tshoot_maxvol_w )
{
/* something to do with the sound volume */
logerror("tshoot maxvol = %d (%s)\n", data, device->machine().describe_context());
logerror("tshoot maxvol = %d (%s)\n", data, space.machine().describe_context());
}
@ -1000,16 +1000,16 @@ static TIMER_CALLBACK( joust2_deferred_snd_cmd_w )
static WRITE8_DEVICE_HANDLER( joust2_pia_3_cb1_w )
{
joust2_state *state = device->machine().driver_data<joust2_state>();
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(device->machine().driver_data()->generic_space(), 0, state->m_joust2_current_sound_data);
state->m_cvsd_sound->write(space.machine().driver_data()->generic_space(), 0, state->m_joust2_current_sound_data);
}
static WRITE8_DEVICE_HANDLER( joust2_snd_cmd_w )
{
joust2_state *state = device->machine().driver_data<joust2_state>();
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(device->machine().driver_data()->generic_space(), 0, state->m_joust2_current_sound_data);
device->machine().scheduler().synchronize(FUNC(joust2_deferred_snd_cmd_w), state->m_joust2_current_sound_data);
state->m_cvsd_sound->write(space.machine().driver_data()->generic_space(), 0, state->m_joust2_current_sound_data);
space.machine().scheduler().synchronize(FUNC(joust2_deferred_snd_cmd_w), state->m_joust2_current_sound_data);
}

View File

@ -571,7 +571,7 @@ READ16_DEVICE_HANDLER( deco16ic_pf2_data_r )
WRITE16_DEVICE_HANDLER( deco16ic_pf_control_w )
{
deco16ic_state *deco16ic = get_safe_token(device);
device->machine().primary_screen->update_partial(device->machine().primary_screen->vpos());
space.machine().primary_screen->update_partial(space.machine().primary_screen->vpos());
COMBINE_DATA(&deco16ic->pf12_control[offset]);
}

View File

@ -46,7 +46,7 @@ WRITE16_DEVICE_HANDLER( decocomn_nonbuffered_palette_w )
{
int r,g,b;
driver_device *state = device->machine().driver_data();
driver_device *state = space.machine().driver_data();
COMBINE_DATA(&state->m_generic_paletteram_16[offset]);
if (offset&1) offset--;
@ -54,14 +54,14 @@ WRITE16_DEVICE_HANDLER( decocomn_nonbuffered_palette_w )
g = (state->m_generic_paletteram_16[offset + 1] >> 8) & 0xff;
r = (state->m_generic_paletteram_16[offset + 1] >> 0) & 0xff;
palette_set_color(device->machine(), offset / 2, MAKE_RGB(r,g,b));
palette_set_color(space.machine(), offset / 2, MAKE_RGB(r,g,b));
}
WRITE16_DEVICE_HANDLER( decocomn_buffered_palette_w )
{
decocomn_state *decocomn = get_safe_token(device);
driver_device *state = device->machine().driver_data();
driver_device *state = space.machine().driver_data();
COMBINE_DATA(&state->m_generic_paletteram_16[offset]);
decocomn->dirty_palette[offset / 2] = 1;
@ -70,8 +70,8 @@ WRITE16_DEVICE_HANDLER( decocomn_buffered_palette_w )
WRITE16_DEVICE_HANDLER( decocomn_palette_dma_w )
{
decocomn_state *decocomn = get_safe_token(device);
driver_device *state = device->machine().driver_data();
const int m = device->machine().total_colors();
driver_device *state = space.machine().driver_data();
const int m = space.machine().total_colors();
int r, g, b, i;
for (i = 0; i < m; i++)
@ -84,7 +84,7 @@ WRITE16_DEVICE_HANDLER( decocomn_palette_dma_w )
g = (state->m_generic_paletteram_16[i * 2 + 1] >> 8) & 0xff;
r = (state->m_generic_paletteram_16[i * 2 + 1] >> 0) & 0xff;
palette_set_color(device->machine(), i, MAKE_RGB(r,g,b));
palette_set_color(space.machine(), i, MAKE_RGB(r,g,b));
}
}
}

View File

@ -116,7 +116,7 @@ UINT32 gameplan_state::screen_update_leprechn(screen_device &screen, bitmap_rgb3
static WRITE8_DEVICE_HANDLER( video_data_w )
{
gameplan_state *state = device->machine().driver_data<gameplan_state>();
gameplan_state *state = space.machine().driver_data<gameplan_state>();
state->m_video_data = data;
}
@ -124,7 +124,7 @@ static WRITE8_DEVICE_HANDLER( video_data_w )
static WRITE8_DEVICE_HANDLER( gameplan_video_command_w )
{
gameplan_state *state = device->machine().driver_data<gameplan_state>();
gameplan_state *state = space.machine().driver_data<gameplan_state>();
state->m_video_command = data & 0x07;
}
@ -132,7 +132,7 @@ static WRITE8_DEVICE_HANDLER( gameplan_video_command_w )
static WRITE8_DEVICE_HANDLER( leprechn_video_command_w )
{
gameplan_state *state = device->machine().driver_data<gameplan_state>();
gameplan_state *state = space.machine().driver_data<gameplan_state>();
state->m_video_command = (data >> 3) & 0x07;
}

View File

@ -434,7 +434,7 @@ static WRITE16_DEVICE_HANDLER( gp9001_devvideoram16_w )
static READ16_DEVICE_HANDLER( gp9001_vdpstatus_r )
{
return ((device->machine().primary_screen->vpos() + 15) % 262) >= 245;
return ((space.machine().primary_screen->vpos() + 15) % 262) >= 245;
}
static WRITE16_DEVICE_HANDLER( gp9001_scroll_reg_select_w )

View File

@ -81,11 +81,11 @@ WRITE8_MEMBER(hanaawas_state::hanaawas_colorram_w)
WRITE8_DEVICE_HANDLER( hanaawas_portB_w )
{
/* bit 7 is flip screen */
hanaawas_state *state = device->machine().driver_data<hanaawas_state>();
hanaawas_state *state = space.machine().driver_data<hanaawas_state>();
if (state->flip_screen() != (~data & 0x80))
{
state->flip_screen_set(~data & 0x80);
device->machine().tilemap().mark_all_dirty();
space.machine().tilemap().mark_all_dirty();
}
}

View File

@ -37,11 +37,11 @@ WRITE8_MEMBER(homerun_state::homerun_scrollx_w)
WRITE8_DEVICE_HANDLER(homerun_banking_w)
{
homerun_state *state = device->machine().driver_data<homerun_state>();
homerun_state *state = space.machine().driver_data<homerun_state>();
// games do mid-screen gfx bank switching
int vpos = device->machine().primary_screen->vpos();
device->machine().primary_screen->update_partial(vpos);
int vpos = space.machine().primary_screen->vpos();
space.machine().primary_screen->update_partial(vpos);
// d0-d1: gfx bank
// d2-d4: ?

View File

@ -1376,7 +1376,7 @@ WRITE8_DEVICE_HANDLER( k007121_ctrl_w )
case 6:
/* palette bank change */
if ((k007121->ctrlram[offset] & 0x30) != (data & 0x30))
device->machine().tilemap().mark_all_dirty();
space.machine().tilemap().mark_all_dirty();
break;
case 7:
k007121->flipscreen = data & 0x08;
@ -1702,7 +1702,7 @@ WRITE8_DEVICE_HANDLER( k007342_vreg_w )
break;
case 0x01: /* used for banking in Rock'n'Rage */
if (data != k007342->regs[1])
device->machine().tilemap().mark_all_dirty();
space.machine().tilemap().mark_all_dirty();
case 0x02:
k007342->scrollx[0] = (k007342->scrollx[0] & 0xff) | ((data & 0x01) << 8);
k007342->scrollx[1] = (k007342->scrollx[1] & 0xff) | ((data & 0x02) << 7);
@ -2314,14 +2314,14 @@ READ8_DEVICE_HANDLER( k052109_r )
if (k052109->has_extra_video_ram)
code |= color << 8; /* kludge for X-Men */
else
k052109->callback(device->machine(), 0, bank, &code, &color, &flags, &priority);
k052109->callback(space.machine(), 0, bank, &code, &color, &flags, &priority);
addr = (code << 5) + (offset & 0x1f);
addr &= device->machine().root_device().memregion(k052109->memory_region)->bytes() - 1;
addr &= space.machine().root_device().memregion(k052109->memory_region)->bytes() - 1;
// logerror("%04x: off = %04x sub = %02x (bnk = %x) adr = %06x\n", space.device().safe_pc(), offset, k052109->romsubbank, bank, addr);
return device->machine().root_device().memregion(k052109->memory_region)->base()[addr];
return space.machine().root_device().memregion(k052109->memory_region)->base()[addr];
}
}
@ -3572,7 +3572,7 @@ INLINE void k053245_update_buffer( device_t *device )
READ8_DEVICE_HANDLER( k053244_r )
{
k05324x_state *k053244 = k05324x_get_safe_token(device);
running_machine &machine = device->machine();
running_machine &machine = space.machine();
if ((k053244->regs[5] & 0x10) && offset >= 0x0c && offset < 0x10)
{
@ -3612,7 +3612,7 @@ WRITE8_DEVICE_HANDLER( k053244_w )
// popmessage("053244 reg 05 = %02x",data);
/* bit 2 = unknown, Parodius uses it */
/* bit 5 = unknown, Rollergames uses it */
// logerror("%s: write %02x to 053244 address 5\n", device->machine().describe_context(), data);
// logerror("%s: write %02x to 053244 address 5\n", space.machine().describe_context(), data);
break;
case 0x06:
@ -4474,9 +4474,9 @@ WRITE8_DEVICE_HANDLER( k053247_w )
READ16_DEVICE_HANDLER( k055673_rom_word_r ) // 5bpp
{
k053247_state *k053246 = k053247_get_safe_token(device);
UINT8 *ROM8 = (UINT8 *)device->machine().root_device().memregion(k053246->memory_region)->base();
UINT16 *ROM = (UINT16 *)device->machine().root_device().memregion(k053246->memory_region)->base();
int size4 = (device->machine().root_device().memregion(k053246->memory_region)->bytes() / (1024 * 1024)) / 5;
UINT8 *ROM8 = (UINT8 *)space.machine().root_device().memregion(k053246->memory_region)->base();
UINT16 *ROM = (UINT16 *)space.machine().root_device().memregion(k053246->memory_region)->base();
int size4 = (space.machine().root_device().memregion(k053246->memory_region)->bytes() / (1024 * 1024)) / 5;
int romofs;
size4 *= 4 * 1024 * 1024; // get offset to 5th bit
@ -4513,7 +4513,7 @@ READ16_DEVICE_HANDLER( k055673_rom_word_r ) // 5bpp
READ16_DEVICE_HANDLER( k055673_GX6bpp_rom_word_r )
{
k053247_state *k053246 = k053247_get_safe_token(device);
UINT16 *ROM = (UINT16 *)device->machine().root_device().memregion(k053246->memory_region)->base();
UINT16 *ROM = (UINT16 *)space.machine().root_device().memregion(k053246->memory_region)->base();
int romofs;
romofs = k053246->kx46_regs[6] << 16 | k053246->kx46_regs[7] << 8 | k053246->kx46_regs[4];
@ -4553,10 +4553,10 @@ READ8_DEVICE_HANDLER( k053246_r )
int addr;
addr = (k053246->kx46_regs[6] << 17) | (k053246->kx46_regs[7] << 9) | (k053246->kx46_regs[4] << 1) | ((offset & 1) ^ 1);
addr &= device->machine().root_device().memregion(k053246->memory_region)->bytes() - 1;
addr &= space.machine().root_device().memregion(k053246->memory_region)->bytes() - 1;
// if (VERBOSE)
// popmessage("%04x: offset %02x addr %06x", space.device().safe_pc(), offset, addr);
return device->machine().root_device().memregion(k053246->memory_region)->base()[addr];
return space.machine().root_device().memregion(k053246->memory_region)->base()[addr];
}
else
{
@ -5438,15 +5438,15 @@ READ8_DEVICE_HANDLER( k051316_rom_r )
int addr = offset + (k051316->ctrlram[0x0c] << 11) + (k051316->ctrlram[0x0d] << 19);
if (k051316->bpp <= 4)
addr /= 2;
addr &= device->machine().root_device().memregion(k051316->memory_region)->bytes() - 1;
addr &= space.machine().root_device().memregion(k051316->memory_region)->bytes() - 1;
// popmessage("%s: offset %04x addr %04x", device->machine().describe_context(), offset, addr);
// popmessage("%s: offset %04x addr %04x", space.machine().describe_context(), offset, addr);
return device->machine().root_device().memregion(k051316->memory_region)->base()[addr];
return space.machine().root_device().memregion(k051316->memory_region)->base()[addr];
}
else
{
//logerror("%s: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n", device->machine().describe_context(), offset);
//logerror("%s: read 051316 ROM offset %04x but reg 0x0c bit 0 not clear\n", space.machine().describe_context(), offset);
return 0;
}
}
@ -5455,7 +5455,7 @@ WRITE8_DEVICE_HANDLER( k051316_ctrl_w )
{
k051316_state *k051316= k051316_get_safe_token(device);
k051316->ctrlram[offset] = data;
//if (offset >= 0x0c) logerror("%s: write %02x to 051316 reg %x\n", device->machine().describe_context(), data, offset);
//if (offset >= 0x0c) logerror("%s: write %02x to 051316 reg %x\n", space.machine().describe_context(), data, offset);
}
// a few games (ajax, rollerg, ultraman, etc.) can enable and disable wraparound after start
@ -6002,7 +6002,7 @@ WRITE8_DEVICE_HANDLER( k053251_w )
}
if (!k053251->tilemaps_set)
device->machine().tilemap().mark_all_dirty();
space.machine().tilemap().mark_all_dirty();
}
else if (offset == 10)
{
@ -6018,7 +6018,7 @@ WRITE8_DEVICE_HANDLER( k053251_w )
}
if (!k053251->tilemaps_set)
device->machine().tilemap().mark_all_dirty();
space.machine().tilemap().mark_all_dirty();
}
}
}
@ -6888,7 +6888,7 @@ READ16_DEVICE_HANDLER( k056832_rom_word_r )
int addr = 0x2000 * k056832->cur_gfx_banks + 2 * offset;
if (!k056832->rombase)
k056832->rombase = device->machine().root_device().memregion(k056832->memory_region)->base();
k056832->rombase = space.machine().root_device().memregion(k056832->memory_region)->base();
return k056832->rombase[addr + 1] | (k056832->rombase[addr] << 8);
}
@ -6902,7 +6902,7 @@ READ16_DEVICE_HANDLER( k056832_mw_rom_word_r )
int addr;
if (!k056832->rombase)
k056832->rombase = device->machine().root_device().memregion(k056832->memory_region)->base();
k056832->rombase = space.machine().root_device().memregion(k056832->memory_region)->base();
if (k056832->regsb[2] & 0x8)
{
@ -6965,7 +6965,7 @@ READ16_DEVICE_HANDLER( k056832_bishi_rom_word_r )
int addr = 0x4000 * k056832->cur_gfx_banks + offset;
if (!k056832->rombase)
k056832->rombase = device->machine().root_device().memregion(k056832->memory_region)->base();
k056832->rombase = space.machine().root_device().memregion(k056832->memory_region)->base();
return k056832->rombase[addr + 2] | (k056832->rombase[addr] << 8);
}
@ -6976,7 +6976,7 @@ READ16_DEVICE_HANDLER( k056832_rom_word_8000_r )
int addr = 0x8000 * k056832->cur_gfx_banks + 2 * offset;
if (!k056832->rombase)
k056832->rombase = device->machine().root_device().memregion(k056832->memory_region)->base();
k056832->rombase = space.machine().root_device().memregion(k056832->memory_region)->base();
return k056832->rombase[addr + 2] | (k056832->rombase[addr] << 8);
}
@ -6987,7 +6987,7 @@ READ16_DEVICE_HANDLER( k056832_old_rom_word_r )
int addr = 0x2000 * k056832->cur_gfx_banks + 2 * offset;
if (!k056832->rombase)
k056832->rombase = device->machine().root_device().memregion(k056832->memory_region)->base();
k056832->rombase = space.machine().root_device().memregion(k056832->memory_region)->base();
return k056832->rombase[addr + 1] | (k056832->rombase[addr] << 8);
}
@ -9009,7 +9009,7 @@ READ32_DEVICE_HANDLER( k001006_r )
{
case 0x0b: // CG Board ROM read
{
UINT16 *rom = (UINT16*)device->machine().root_device().memregion(k001006->gfx_region)->base();
UINT16 *rom = (UINT16*)space.machine().root_device().memregion(k001006->gfx_region)->base();
return rom[k001006->addr / 2] << 16;
}
case 0x0d: // Palette RAM read
@ -10380,8 +10380,8 @@ READ32_DEVICE_HANDLER( k001604_reg_r )
switch (offset)
{
case 0x54/4: return device->machine().rand() << 16;
case 0x5c/4: return device->machine().rand() << 16 | device->machine().rand();
case 0x54/4: return space.machine().rand() << 16;
case 0x5c/4: return space.machine().rand() << 16 | space.machine().rand();
}
return k001604->reg[offset];
@ -10457,8 +10457,8 @@ WRITE32_DEVICE_HANDLER( k001604_char_w )
COMBINE_DATA(k001604->char_ram + addr);
device->machine().gfx[k001604->gfx_index[0]]->mark_dirty(addr / 32);
device->machine().gfx[k001604->gfx_index[1]]->mark_dirty(addr / 128);
space.machine().gfx[k001604->gfx_index[0]]->mark_dirty(addr / 32);
space.machine().gfx[k001604->gfx_index[1]]->mark_dirty(addr / 128);
}
WRITE32_DEVICE_HANDLER( k001604_reg_w )
@ -10750,7 +10750,7 @@ WRITE32_DEVICE_HANDLER( k037122_char_w )
UINT32 addr = offset + (bank * (0x40000/4));
COMBINE_DATA(k037122->char_ram + addr);
device->machine().gfx[k037122->gfx_index]->mark_dirty(addr / 32);
space.machine().gfx[k037122->gfx_index]->mark_dirty(addr / 32);
}
READ32_DEVICE_HANDLER( k037122_reg_r )

View File

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

View File

@ -426,7 +426,7 @@ READ8_MEMBER(phoenix_state::survival_input_port_0_r)
READ8_DEVICE_HANDLER( survival_protection_r )
{
phoenix_state *state = device->machine().driver_data<phoenix_state>();
phoenix_state *state = space.machine().driver_data<phoenix_state>();
return state->m_survival_protection_value;
}

View File

@ -86,7 +86,7 @@ static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
WRITE8_DEVICE_HANDLER( qix_flip_screen_w )
{
qix_state *state = device->machine().driver_data<qix_state>();
qix_state *state = space.machine().driver_data<qix_state>();
state->m_flip = data;
}

View File

@ -277,7 +277,7 @@ WRITE8_MEMBER(system1_state::system1_videoram_w)
WRITE8_DEVICE_HANDLER( system1_videoram_bank_w )
{
system1_state *state = device->machine().driver_data<system1_state>();
system1_state *state = space.machine().driver_data<system1_state>();
state->m_videoram_bank = data;
}

View File

@ -1490,7 +1490,7 @@ WRITE16_DEVICE_HANDLER( tc0080vco_word_w )
if (offset < 0x1000 / 2)
{
device->machine().gfx[tc0080vco->tx_gfx]->mark_dirty(offset / 8);
space.machine().gfx[tc0080vco->tx_gfx]->mark_dirty(offset / 8);
#if 0
if (!tc0080vco->has_tx)
{
@ -1521,7 +1521,7 @@ WRITE16_DEVICE_HANDLER( tc0080vco_word_w )
else if (offset < 0x11000 / 2)
{
device->machine().gfx[tc0080vco->tx_gfx]->mark_dirty((offset - 0x10000 / 2) / 8);
space.machine().gfx[tc0080vco->tx_gfx]->mark_dirty((offset - 0x10000 / 2) / 8);
#if 0
if (!tc0080vco->has_tx)
{
@ -2246,7 +2246,7 @@ WRITE16_DEVICE_HANDLER( tc0100scn_word_w )
else if (offset < 0x3000)
tc0100scn->tilemap[2][0]->mark_tile_dirty((offset & 0x0fff));
else if (offset < 0x3800)
device->machine().gfx[tc0100scn->tx_gfx]->mark_dirty((offset - 0x3000) / 8);
space.machine().gfx[tc0100scn->tx_gfx]->mark_dirty((offset - 0x3000) / 8);
else if (offset >= 0x4000 && offset < 0x6000)
tc0100scn->tilemap[1][0]->mark_tile_dirty((offset & 0x1fff) / 2);
}
@ -2257,7 +2257,7 @@ WRITE16_DEVICE_HANDLER( tc0100scn_word_w )
else if (offset >= 0x4000 && offset < 0x8000)
tc0100scn->tilemap[1][1]->mark_tile_dirty((offset & 0x3fff) / 2);
else if (offset >= 0x8800 && offset < 0x9000)
device->machine().gfx[tc0100scn->tx_gfx]->mark_dirty((offset - 0x8800) / 8);
space.machine().gfx[tc0100scn->tx_gfx]->mark_dirty((offset - 0x8800) / 8);
else if (offset >= 0x9000)
tc0100scn->tilemap[2][1]->mark_tile_dirty((offset & 0x0fff));
}
@ -2319,7 +2319,7 @@ WRITE16_DEVICE_HANDLER( tc0100scn_ctrl_word_w )
tc0100scn_dirty_tilemaps(device);
/* reset the pointer to the text characters (and dirty them all) */
device->machine().gfx[tc0100scn->tx_gfx]->set_source((UINT8 *)tc0100scn->char_ram);
space.machine().gfx[tc0100scn->tx_gfx]->set_source((UINT8 *)tc0100scn->char_ram);
}
break;
@ -3126,7 +3126,7 @@ WRITE16_DEVICE_HANDLER( tc0480scp_word_w )
}
else if (offset <= 0x7fff)
{
device->machine().gfx[tc0480scp->tx_gfx]->mark_dirty((offset - 0x7000) / 16);
space.machine().gfx[tc0480scp->tx_gfx]->mark_dirty((offset - 0x7000) / 16);
}
}
else
@ -3144,7 +3144,7 @@ WRITE16_DEVICE_HANDLER( tc0480scp_word_w )
}
else if (offset <= 0x7fff)
{
device->machine().gfx[tc0480scp->tx_gfx]->mark_dirty((offset - 0x7000) / 16);
space.machine().gfx[tc0480scp->tx_gfx]->mark_dirty((offset - 0x7000) / 16);
}
}
}
@ -4859,7 +4859,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_word_w )
case 1:
tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
palette_set_color_rgb(device->machine(), tc0110pcr->addr, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
palette_set_color_rgb(space.machine(), tc0110pcr->addr, pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
break;
default:
@ -4882,7 +4882,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_step1_word_w )
case 1:
tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
palette_set_color_rgb(device->machine(), tc0110pcr->addr + (tc0110pcr->pal_offs << 12), pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
palette_set_color_rgb(space.machine(), tc0110pcr->addr + (tc0110pcr->pal_offs << 12), pal5bit(data >> 0), pal5bit(data >> 5), pal5bit(data >> 10));
break;
default:
@ -4907,7 +4907,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_step1_rbswap_word_w )
case 1:
tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
palette_set_color_rgb(device->machine(), tc0110pcr->addr, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
palette_set_color_rgb(space.machine(), tc0110pcr->addr, pal5bit(data >> 10), pal5bit(data >> 5), pal5bit(data >> 0));
break;
default:
@ -4932,7 +4932,7 @@ WRITE16_DEVICE_HANDLER( tc0110pcr_step1_4bpg_word_w )
case 1:
tc0110pcr->ram[tc0110pcr->addr] = data & 0xffff;
palette_set_color_rgb(device->machine(), tc0110pcr->addr, pal4bit(data >> 0), pal4bit(data >> 4), pal4bit(data >> 8));
palette_set_color_rgb(space.machine(), tc0110pcr->addr, pal4bit(data >> 0), pal4bit(data >> 4), pal4bit(data >> 8));
break;
default:

View File

@ -323,7 +323,7 @@ static void vectrex_multiplexer(running_machine &machine, int mux)
static WRITE8_DEVICE_HANDLER(v_via_pb_w)
{
vectrex_state *state = device->machine().driver_data<vectrex_state>();
vectrex_state *state = space.machine().driver_data<vectrex_state>();
if (!(data & 0x80))
{
/* RAMP is active */
@ -362,7 +362,7 @@ static WRITE8_DEVICE_HANDLER(v_via_pb_w)
+(double)(state->m_pen_y - state->m_y_int) * (state->m_pen_y - state->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 / (device->machine().device("maincpu")->unscaled_clock() * INT_PER_CLOCK)));
state->m_lp_t->adjust(attotime::from_double(ab / a2 / (space.machine().device("maincpu")->unscaled_clock() * INT_PER_CLOCK)));
}
}
}
@ -370,7 +370,7 @@ static WRITE8_DEVICE_HANDLER(v_via_pb_w)
if (!(data & 0x1) && (state->m_via_out[PORTB] & 0x1))
{
/* MUX has been enabled */
device->machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(update_signal));
space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(update_signal));
}
}
else
@ -387,7 +387,7 @@ static WRITE8_DEVICE_HANDLER(v_via_pb_w)
/* Cartridge bank-switching */
if (state->m_64k_cart && ((data ^ state->m_via_out[PORTB]) & 0x40))
{
device_t &root_device = device->machine().root_device();
device_t &root_device = space.machine().root_device();
root_device.membank("bank1")->set_base(root_device.memregion("maincpu")->base() + ((data & 0x40) ? 0x10000 : 0x0000));
}
@ -395,7 +395,7 @@ static WRITE8_DEVICE_HANDLER(v_via_pb_w)
/* Sound */
if (data & 0x10)
{
device_t *ay8912 = device->machine().device("ay8912");
device_t *ay8912 = space.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]);
@ -404,35 +404,35 @@ static WRITE8_DEVICE_HANDLER(v_via_pb_w)
}
if (!(data & 0x1) && (state->m_via_out[PORTB] & 0x1))
vectrex_multiplexer (device->machine(), (data >> 1) & 0x3);
vectrex_multiplexer (space.machine(), (data >> 1) & 0x3);
state->m_via_out[PORTB] = data;
device->machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(update_signal), data & 0x80, &state->m_ramp);
space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(update_signal), data & 0x80, &state->m_ramp);
}
static WRITE8_DEVICE_HANDLER(v_via_pa_w)
{
vectrex_state *state = device->machine().driver_data<vectrex_state>();
vectrex_state *state = space.machine().driver_data<vectrex_state>();
/* DAC output always goes to Y integrator */
state->m_via_out[PORTA] = data;
device->machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(update_signal), data, &state->m_analog[A_Y]);
space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(update_signal), data, &state->m_analog[A_Y]);
if (!(state->m_via_out[PORTB] & 0x1))
vectrex_multiplexer (device->machine(), (state->m_via_out[PORTB] >> 1) & 0x3);
vectrex_multiplexer (space.machine(), (state->m_via_out[PORTB] >> 1) & 0x3);
}
static WRITE8_DEVICE_HANDLER(v_via_ca2_w)
{
if (data == 0)
device->machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(vectrex_zero_integrators));
space.machine().scheduler().timer_set(attotime::from_nsec(ANALOG_DELAY), FUNC(vectrex_zero_integrators));
}
static WRITE8_DEVICE_HANDLER(v_via_cb2_w)
{
vectrex_state *state = device->machine().driver_data<vectrex_state>();
vectrex_state *state = space.machine().driver_data<vectrex_state>();
int dx, dy;
if (state->m_cb2 != data)
@ -451,11 +451,11 @@ static WRITE8_DEVICE_HANDLER(v_via_cb2_w)
dx = abs(state->m_pen_x - state->m_x_int);
dy = abs(state->m_pen_y - state->m_y_int);
if (dx < 500000 && dy < 500000 && data > 0)
device->machine().scheduler().timer_set(attotime::zero, FUNC(lightpen_trigger));
space.machine().scheduler().timer_set(attotime::zero, FUNC(lightpen_trigger));
}
}
device->machine().scheduler().timer_set(attotime::zero, FUNC(update_signal), data, &state->m_blank);
space.machine().scheduler().timer_set(attotime::zero, FUNC(update_signal), data, &state->m_blank);
state->m_cb2 = data;
}
}

View File

@ -14,12 +14,12 @@ Video hardware driver by Uki
WRITE8_DEVICE_HANDLER( xxmissio_scroll_x_w )
{
xxmissio_state *state = device->machine().driver_data<xxmissio_state>();
xxmissio_state *state = space.machine().driver_data<xxmissio_state>();
state->m_xscroll = data;
}
WRITE8_DEVICE_HANDLER( xxmissio_scroll_y_w )
{
xxmissio_state *state = device->machine().driver_data<xxmissio_state>();
xxmissio_state *state = space.machine().driver_data<xxmissio_state>();
state->m_yscroll = data;
}

View File

@ -454,7 +454,7 @@ static WRITE8_DEVICE_HANDLER(dave_sound_w)
count++;
dave->Period[channel_index] = ((STEP * device->machine().sample_rate())/125000) * count;
dave->Period[channel_index] = ((STEP * space.machine().sample_rate())/125000) * count;
}
break;

View File

@ -557,12 +557,12 @@ READ8_DEVICE_HANDLER ( mea8000_r )
case 1:
/* ready to accept next frame */
#if 0
LOG(( "$%04x %f: mea8000_r ready=%i\n", device->machine().firstcpu->pcbase( ), machine.time().as_double(), mea8000_accept_byte( mea8000 ) ));
LOG(( "$%04x %f: mea8000_r ready=%i\n", space.machine().firstcpu->pcbase( ), machine.time().as_double(), mea8000_accept_byte( mea8000 ) ));
#endif
return mea8000_accept_byte(mea8000) << 7;
default:
logerror( "$%04x mea8000_r invalid read offset %i\n", device->machine().firstcpu->pcbase( ), offset );
logerror( "$%04x mea8000_r invalid read offset %i\n", space.machine().firstcpu->pcbase( ), offset );
}
return 0;
}
@ -578,19 +578,19 @@ WRITE8_DEVICE_HANDLER ( mea8000_w )
{
/* got pitch byte before first frame */
mea8000->pitch = 2 * data;
LOG(( "$%04x %f: mea8000_w pitch %i\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), mea8000->pitch ));
LOG(( "$%04x %f: mea8000_w pitch %i\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), mea8000->pitch ));
mea8000->state = MEA8000_WAIT_FIRST;
mea8000->bufpos = 0;
}
else if (mea8000->bufpos == 4)
{
/* overflow */
LOG(( "$%04x %f: mea8000_w data overflow %02X\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), data ));
LOG(( "$%04x %f: mea8000_w data overflow %02X\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), data ));
}
else
{
/* enqueue frame byte */
LOG(( "$%04x %f: mea8000_w data %02X in frame pos %i\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double(),
LOG(( "$%04x %f: mea8000_w data %02X in frame pos %i\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double(),
data, mea8000->bufpos ));
mea8000->buf[mea8000->bufpos] = data;
mea8000->bufpos++;
@ -621,10 +621,10 @@ WRITE8_DEVICE_HANDLER ( mea8000_w )
mea8000->roe = data & 1;
if (stop)
mea8000_stop_frame(device->machine(), mea8000);
mea8000_stop_frame(space.machine(), mea8000);
LOG(( "$%04x %f: mea8000_w command %02X stop=%i cont=%i roe=%i\n",
device->machine().firstcpu->pcbase(), device->machine().time().as_double(), data,
space.machine().firstcpu->pcbase(), space.machine().time().as_double(), data,
stop, mea8000->cont, mea8000->roe ));
mea8000_update_req(device);
@ -632,7 +632,7 @@ WRITE8_DEVICE_HANDLER ( mea8000_w )
}
default:
logerror( "$%04x mea8000_w invalid write offset %i\n", device->machine().firstcpu->pcbase( ), offset );
logerror( "$%04x mea8000_w invalid write offset %i\n", space.machine().firstcpu->pcbase( ), offset );
}
}

View File

@ -82,7 +82,7 @@ void svision_sound_decrement(device_t *device)
WRITE8_DEVICE_HANDLER( svision_sounddma_w )
{
svision_sound_state *state = get_safe_token(device);
logerror("%.6f svision snddma write %04x %02x\n", device->machine().time().as_double(),offset+0x18,data);
logerror("%.6f svision snddma write %04x %02x\n", space.machine().time().as_double(),offset+0x18,data);
state->dma.reg[offset] = data;
switch (offset)
{
@ -94,7 +94,7 @@ WRITE8_DEVICE_HANDLER( svision_sounddma_w )
state->dma.size = (data ? data : 0x100) * 32;
break;
case 3:
state->dma.step = device->machine().device("maincpu")->unscaled_clock() / (256.0 * device->machine().sample_rate() * (1 + (data & 3)));
state->dma.step = space.machine().device("maincpu")->unscaled_clock() / (256.0 * space.machine().sample_rate() * (1 + (data & 3)));
state->dma.right = data & 4;
state->dma.left = data & 8;
state->dma.ca14to16 = ((data & 0x70) >> 4) << 14;
@ -118,7 +118,7 @@ WRITE8_DEVICE_HANDLER( svision_noise_w )
{
case 0:
state->noise.volume=data&0xf;
state->noise.step= device->machine().device("maincpu")->unscaled_clock() / (256.0*device->machine().sample_rate()*(1+(data>>4)));
state->noise.step= space.machine().device("maincpu")->unscaled_clock() / (256.0*space.machine().sample_rate()*(1+(data>>4)));
break;
case 1:
state->noise.count = data + 1;

View File

@ -69,28 +69,28 @@ WRITE8_DEVICE_HANDLER( wswan_sound_port_w )
switch( offset ) {
case 0x80: /* Audio 1 freq (lo) */
wswan_ch_set_freq(device->machine(), &state->audio1, (state->audio1.freq & 0xff00) | data);
wswan_ch_set_freq(space.machine(), &state->audio1, (state->audio1.freq & 0xff00) | data);
break;
case 0x81: /* Audio 1 freq (hi) */
wswan_ch_set_freq(device->machine(), &state->audio1, (data << 8 ) | (state->audio1.freq & 0x00ff));
wswan_ch_set_freq(space.machine(), &state->audio1, (data << 8 ) | (state->audio1.freq & 0x00ff));
break;
case 0x82: /* Audio 2 freq (lo) */
wswan_ch_set_freq(device->machine(), &state->audio2, (state->audio2.freq & 0xff00) | data);
wswan_ch_set_freq(space.machine(), &state->audio2, (state->audio2.freq & 0xff00) | data);
break;
case 0x83: /* Audio 2 freq (hi) */
wswan_ch_set_freq(device->machine(), &state->audio2, (data << 8 ) | (state->audio2.freq & 0x00ff));
wswan_ch_set_freq(space.machine(), &state->audio2, (data << 8 ) | (state->audio2.freq & 0x00ff));
break;
case 0x84: /* Audio 3 freq (lo) */
wswan_ch_set_freq(device->machine(), &state->audio3, (state->audio3.freq & 0xff00) | data);
wswan_ch_set_freq(space.machine(), &state->audio3, (state->audio3.freq & 0xff00) | data);
break;
case 0x85: /* Audio 3 freq (hi) */
wswan_ch_set_freq(device->machine(), &state->audio3, (data << 8) | (state->audio3.freq & 0x00ff));
wswan_ch_set_freq(space.machine(), &state->audio3, (data << 8) | (state->audio3.freq & 0x00ff));
break;
case 0x86: /* Audio 4 freq (lo) */
wswan_ch_set_freq(device->machine(), &state->audio4, (state->audio4.freq & 0xff00) | data);
wswan_ch_set_freq(space.machine(), &state->audio4, (state->audio4.freq & 0xff00) | data);
break;
case 0x87: /* Audio 4 freq (hi) */
wswan_ch_set_freq(device->machine(), &state->audio4, (data << 8) | (state->audio4.freq & 0x00ff));
wswan_ch_set_freq(space.machine(), &state->audio4, (data << 8) | (state->audio4.freq & 0x00ff));
break;
case 0x88: /* Audio 1 volume */
state->audio1.vol_left = ( data & 0xF0 ) >> 4;
@ -113,7 +113,7 @@ WRITE8_DEVICE_HANDLER( wswan_sound_port_w )
state->sweep_step = (INT8)data;
break;
case 0x8D: /* Sweep time */
state->sweep_time = device->machine().sample_rate() / ( 3072000 / ( 8192 * (data + 1) ) );
state->sweep_time = space.machine().sample_rate() / ( 3072000 / ( 8192 * (data + 1) ) );
break;
case 0x8E: /* Noise control */
state->noise_type = data & 0x07;

View File

@ -1177,8 +1177,8 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER(switch_A_w)
{
a2600_state *state = device->machine().driver_data<a2600_state>();
running_machine &machine = device->machine();
a2600_state *state = space.machine().driver_data<a2600_state>();
running_machine &machine = space.machine();
/* Left controller port */
if ( machine.root_device().ioport("CONTROLLERS")->read() / CATEGORY_SELECT == 0x03 )
@ -1201,7 +1201,7 @@ static WRITE8_DEVICE_HANDLER(switch_A_w)
static READ8_DEVICE_HANDLER( switch_A_r )
{
static const UINT8 driving_lookup[4] = { 0x00, 0x02, 0x03, 0x01 };
running_machine &machine = device->machine();
running_machine &machine = space.machine();
UINT8 val = 0;
/* Left controller port PINs 1-4 ( 4321 ) */
@ -1261,7 +1261,7 @@ static WRITE_LINE_DEVICE_HANDLER( irq_callback )
static READ8_DEVICE_HANDLER( riot_input_port_8_r )
{
return device->machine().root_device().ioport("SWB")->read();
return space.machine().root_device().ioport("SWB")->read();
}
static const riot6532_interface r6532_interface =

View File

@ -85,10 +85,10 @@ WRITE32_MEMBER(ami1200_state::aga_overlay_w)
static WRITE8_DEVICE_HANDLER( ami1200_cia_0_porta_w )
{
ami1200_state *state = device->machine().driver_data<ami1200_state>();
ami1200_state *state = space.machine().driver_data<ami1200_state>();
/* bit 2 = Power Led on Amiga */
set_led_status(device->machine(), 0, !BIT(data, 1));
set_led_status(space.machine(), 0, !BIT(data, 1));
handle_cd32_joystick_cia(state, data, mos6526_r(device, space, 2));
}
@ -111,14 +111,14 @@ static WRITE8_DEVICE_HANDLER( ami1200_cia_0_porta_w )
static READ8_DEVICE_HANDLER( ami1200_cia_0_portb_r )
{
/* parallel port */
logerror("%s:CIA0_portb_r\n", device->machine().describe_context());
logerror("%s:CIA0_portb_r\n", space.machine().describe_context());
return 0xff;
}
static WRITE8_DEVICE_HANDLER( ami1200_cia_0_portb_w )
{
/* parallel port */
logerror("%s:CIA0_portb_w(%02x)\n", device->machine().describe_context(), data);
logerror("%s:CIA0_portb_w(%02x)\n", space.machine().describe_context(), data);
}
static ADDRESS_MAP_START( a1200_map, AS_PROGRAM, 32, ami1200_state )
@ -246,8 +246,8 @@ INPUT_PORTS_END
static READ8_DEVICE_HANDLER( a1200_cia_0_portA_r )
{
UINT8 ret = device->machine().root_device().ioport("CIA0PORTA")->read() & 0xc0; /* Gameport 1 and 0 buttons */
ret |= device->machine().device<amiga_fdc>("fdc")->ciaapra_r();
UINT8 ret = space.machine().root_device().ioport("CIA0PORTA")->read() & 0xc0; /* Gameport 1 and 0 buttons */
ret |= space.machine().device<amiga_fdc>("fdc")->ciaapra_r();
return ret;
}

View File

@ -76,7 +76,7 @@ static WRITE16_HANDLER( amiga_clock_w )
static READ8_DEVICE_HANDLER( amiga_cia_1_porta_r )
{
centronics_device *centronics = device->machine().device<centronics_device>("centronics");
centronics_device *centronics = space.machine().device<centronics_device>("centronics");
UINT8 result = 0;
/* centronics status is stored in PA0 to PA2 */
@ -523,21 +523,21 @@ MACHINE_CONFIG_END
static READ8_DEVICE_HANDLER( amiga_cia_0_portA_r )
{
UINT8 ret = device->machine().root_device().ioport("CIA0PORTA")->read() & 0xc0; /* Gameport 1 and 0 buttons */
ret |= device->machine().device<amiga_fdc>("fdc")->ciaapra_r();
UINT8 ret = space.machine().root_device().ioport("CIA0PORTA")->read() & 0xc0; /* Gameport 1 and 0 buttons */
ret |= space.machine().device<amiga_fdc>("fdc")->ciaapra_r();
return ret;
}
static READ8_DEVICE_HANDLER( amiga_cia_0_cdtv_portA_r )
{
return device->machine().root_device().ioport("CIA0PORTA")->read() & 0xc0; /* Gameport 1 and 0 buttons */
return space.machine().root_device().ioport("CIA0PORTA")->read() & 0xc0; /* Gameport 1 and 0 buttons */
}
static WRITE8_DEVICE_HANDLER( amiga_cia_0_portA_w )
{
amiga_state *state = device->machine().driver_data<amiga_state>();
amiga_state *state = space.machine().driver_data<amiga_state>();
/* switch banks as appropriate */
state->membank("bank1")->set_entry(data & 1);
@ -550,17 +550,17 @@ static WRITE8_DEVICE_HANDLER( amiga_cia_0_portA_w )
}
/* overlay disabled, map RAM on 0x000000 */
device->machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x000000, state->m_chip_ram.bytes() - 1, 0, mirror_mask, "bank1");
space.machine().device("maincpu")->memory().space(AS_PROGRAM).install_write_bank(0x000000, state->m_chip_ram.bytes() - 1, 0, mirror_mask, "bank1");
/* if there is a cart region, check for cart overlay */
if (device->machine().root_device().memregion("user2")->base() != NULL)
amiga_cart_check_overlay(device->machine());
if (space.machine().root_device().memregion("user2")->base() != NULL)
amiga_cart_check_overlay(space.machine());
}
else
/* overlay enabled, map Amiga system ROM on 0x000000 */
device->machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x000000, state->m_chip_ram.bytes() - 1);
space.machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x000000, state->m_chip_ram.bytes() - 1);
set_led_status( device->machine(), 0, ( data & 2 ) ? 0 : 1 ); /* bit 2 = Power Led on Amiga */
set_led_status( space.machine(), 0, ( data & 2 ) ? 0 : 1 ); /* bit 2 = Power Led on Amiga */
output_set_value("power_led", ( data & 2 ) ? 0 : 1);
}

View File

@ -283,7 +283,7 @@ static WRITE8_DEVICE_HANDLER(tape_write)
if (image->exists())
image->fwrite(& data5, 1);
apexc_teletyper_putchar(device->machine(), data & 0x1f); /* display on screen */
apexc_teletyper_putchar(space.machine(), data & 0x1f); /* display on screen */
}
/*

View File

@ -1158,7 +1158,7 @@ INPUT_PORTS_END
static WRITE8_DEVICE_HANDLER( apollo_kbd_putchar ) {
// put keyboard character to the keyboard sio
// DLOG1(("apollo_kbd_putchar: 0x%02x", data));
apollo_sio_rx_data(device->machine().device(APOLLO_SIO_TAG), 0, data);
apollo_sio_rx_data(space.machine().device(APOLLO_SIO_TAG), 0, data);
}
static READ8_DEVICE_HANDLER( apollo_kbd_has_beeper ) {
@ -1181,7 +1181,7 @@ static WRITE8_DEVICE_HANDLER( terminal_kbd_putchar ) {
// FIXME: as of mess0145u1, terminal.c will append a null character after each input character
if (data != 0)
{
apollo_sio_rx_data(device->machine().device(APOLLO_SIO_TAG), 1, data);
apollo_sio_rx_data(space.machine().device(APOLLO_SIO_TAG), 1, data);
}
}

View File

@ -223,24 +223,24 @@ Apple 3.5 and Apple 5.25 drives - up to three devices
static WRITE8_DEVICE_HANDLER(a2bus_irq_w)
{
apple2_state *a2 = device->machine().driver_data<apple2_state>();
apple2_state *a2 = space.machine().driver_data<apple2_state>();
a2->m_maincpu->set_input_line(M6502_IRQ_LINE, data);
}
static WRITE8_DEVICE_HANDLER(a2bus_nmi_w)
{
apple2_state *a2 = device->machine().driver_data<apple2_state>();
apple2_state *a2 = space.machine().driver_data<apple2_state>();
a2->m_maincpu->set_input_line(INPUT_LINE_NMI, data);
}
static WRITE8_DEVICE_HANDLER(a2bus_inh_w)
{
apple2_state *a2 = device->machine().driver_data<apple2_state>();
apple2_state *a2 = space.machine().driver_data<apple2_state>();
a2->m_inh_slot = data;
apple2_update_memory(device->machine());
apple2_update_memory(space.machine());
}
/***************************************************************************

View File

@ -186,27 +186,27 @@ static WRITE8_DEVICE_HANDLER(a2bus_irq_w)
{
if (data)
{
apple2gs_add_irq(device->machine(), IRQ_SLOT);
apple2gs_add_irq(space.machine(), IRQ_SLOT);
}
else
{
apple2gs_remove_irq(device->machine(), IRQ_SLOT);
apple2gs_remove_irq(space.machine(), IRQ_SLOT);
}
}
static WRITE8_DEVICE_HANDLER(a2bus_nmi_w)
{
apple2gs_state *a2 = device->machine().driver_data<apple2gs_state>();
apple2gs_state *a2 = space.machine().driver_data<apple2gs_state>();
a2->m_maincpu->set_input_line(INPUT_LINE_NMI, data);
}
static WRITE8_DEVICE_HANDLER(a2bus_inh_w)
{
apple2_state *a2 = device->machine().driver_data<apple2_state>();
apple2_state *a2 = space.machine().driver_data<apple2_state>();
a2->m_inh_slot = data;
apple2_update_memory(device->machine());
apple2_update_memory(space.machine());
}
static const struct a2bus_interface a2bus_intf =

View File

@ -909,13 +909,13 @@ static WRITE8_DEVICE_HANDLER(a1200xl_pia_pb_w) { a1200xl_mmu(device->machine(),
static WRITE8_DEVICE_HANDLER(a800xl_pia_pb_w)
{
if (downcast<pia6821_device *>(device)->port_b_z_mask() != 0xff)
a800xl_mmu(device->machine(), data);
a800xl_mmu(space.machine(), data);
}
static WRITE8_DEVICE_HANDLER(xegs_pia_pb_w)
{
if (downcast<pia6821_device *>(device)->port_b_z_mask() != 0xff)
xegs_mmu(device->machine(), data);
xegs_mmu(space.machine(), data);
}
static const pokey_interface atari_pokey_interface =

View File

@ -330,7 +330,7 @@ WRITE8_MEMBER( bml3_state::bml3_psg_latch_w)
static READ8_DEVICE_HANDLER( bml3_ym2203_r )
{
bml3_state *state = device->machine().driver_data<bml3_state>();
bml3_state *state = space.machine().driver_data<bml3_state>();
UINT8 dev_offs = ((state->m_psg_latch & 3) != 3);
return ym2203_r(device,space, dev_offs);
@ -338,7 +338,7 @@ static READ8_DEVICE_HANDLER( bml3_ym2203_r )
static WRITE8_DEVICE_HANDLER( bml3_ym2203_w )
{
bml3_state *state = device->machine().driver_data<bml3_state>();
bml3_state *state = space.machine().driver_data<bml3_state>();
UINT8 dev_offs = ((state->m_psg_latch & 3) != 3);
ym2203_w(device,space, dev_offs,data);

View File

@ -719,7 +719,7 @@ DRIVER_INIT_MEMBER(dectalk_state,dectalk)
static WRITE8_DEVICE_HANDLER( dectalk_kbd_put )
{
duart68681_rx_data(device->machine().device("duart68681"), 1, data);
duart68681_rx_data(space.machine().device("duart68681"), 1, data);
}
static GENERIC_TERMINAL_INTERFACE( dectalk_terminal_intf )

View File

@ -560,7 +560,7 @@ INPUT_PORTS_END
******************************************************************************/
static WRITE8_DEVICE_HANDLER( digel804_serial_put )
{
digel804_state *state = device->machine().driver_data<digel804_state>();
digel804_state *state = space.machine().driver_data<digel804_state>();
state->m_acia->receive_character(data);
}

View File

@ -270,7 +270,7 @@ UINT32 dm7000_state::screen_update_dm7000(screen_device &screen, bitmap_ind16 &b
static READ32_DEVICE_HANDLER( dcr_r )
{
dm7000_state *state = device->machine().driver_data<dm7000_state>();
dm7000_state *state = space.machine().driver_data<dm7000_state>();
mame_printf_debug("DCR %03X read\n", offset);
if(offset>=1024) {printf("get %04X\n", offset); return 0;} else
switch(offset) {
@ -285,7 +285,7 @@ static READ32_DEVICE_HANDLER( dcr_r )
static WRITE32_DEVICE_HANDLER( dcr_w )
{
mame_printf_debug("DCR %03X write = %08X\n", offset, data);
dm7000_state *state = device->machine().driver_data<dm7000_state>();
dm7000_state *state = space.machine().driver_data<dm7000_state>();
if(offset>=1024) {printf("get %04X\n", offset); } else
state->dcr[offset] = data;
}

View File

@ -240,23 +240,23 @@ READ8_MEMBER(einstein_state::einstein_keyboard_data_read)
static WRITE8_DEVICE_HANDLER( einstein_drsel_w )
{
einstein_state *einstein = device->machine().driver_data<einstein_state>();
einstein_state *einstein = space.machine().driver_data<einstein_state>();
if(VERBOSE_DISK)
logerror("%s: einstein_drsel_w %02x\n", device->machine().describe_context(), data);
logerror("%s: einstein_drsel_w %02x\n", space.machine().describe_context(), data);
/* bit 0 to 3 select the drive */
static const char *names[] = { "fd0", "fd1", "fd2", "fd3" };
floppy_image_device *floppy = 0;
for(int i=0; i<4; i++) {
if(BIT(data, i)) {
floppy_connector *con = device->machine().device<floppy_connector>(names[i]);
floppy_connector *con = space.machine().device<floppy_connector>(names[i]);
if(con)
floppy = con->get_device();
}
}
/* double sided drive connected? */
if (device->machine().root_device().ioport("config")->read() & data)
if (space.machine().root_device().ioport("config")->read() & data)
{
/* bit 4 selects the side then */
//floppy->ss_w(BIT(data, 4));

View File

@ -176,13 +176,13 @@ static void elwro800jr_mmu_w(running_machine &machine, UINT8 data)
static READ8_DEVICE_HANDLER(i8255_port_c_r)
{
centronics_device *centronics = device->machine().device<centronics_device>("centronics");
centronics_device *centronics = space.machine().device<centronics_device>("centronics");
return (centronics->ack_r() << 2);
}
static WRITE8_DEVICE_HANDLER(i8255_port_c_w)
{
centronics_device *centronics = device->machine().device<centronics_device>("centronics");
centronics_device *centronics = space.machine().device<centronics_device>("centronics");
centronics->strobe_w((data >> 7) & 0x01);
}

View File

@ -100,7 +100,7 @@ static void enterprise_update_memory_page(address_space &space, offs_t page, int
/* EP specific handling of dave register write */
static WRITE8_DEVICE_HANDLER( enterprise_dave_reg_write )
{
ep_state *ep = device->machine().driver_data<ep_state>();
ep_state *ep = space.machine().driver_data<ep_state>();
switch (offset)
{
@ -108,7 +108,7 @@ static WRITE8_DEVICE_HANDLER( enterprise_dave_reg_write )
case 0x11:
case 0x12:
case 0x13:
enterprise_update_memory_page(device->machine().device("maincpu")->memory().space(AS_PROGRAM), offset - 0x0f, data);
enterprise_update_memory_page(space.machine().device("maincpu")->memory().space(AS_PROGRAM), offset - 0x0f, data);
break;
case 0x15:
@ -126,19 +126,19 @@ static READ8_DEVICE_HANDLER( enterprise_dave_reg_read )
"LINE5", "LINE6", "LINE7", "LINE8", "LINE9"
};
ep_state *ep = device->machine().driver_data<ep_state>();
ep_state *ep = space.machine().driver_data<ep_state>();
switch (offset)
{
case 0x015:
/* read keyboard line */
dave_set_reg(device, 0x015, device->machine().root_device().ioport(keynames[ep->keyboard_line])->read());
dave_set_reg(device, 0x015, space.machine().root_device().ioport(keynames[ep->keyboard_line])->read());
break;
case 0x016:
{
int ExternalJoystickInputs;
int ExternalJoystickPortInput = device->machine().root_device().ioport("JOY1")->read();
int ExternalJoystickPortInput = space.machine().root_device().ioport("JOY1")->read();
if (ep->keyboard_line <= 4)
{

View File

@ -943,7 +943,7 @@ READ8_MEMBER(fidelz80_state::rand_r)
static WRITE8_DEVICE_HANDLER( digit_w )
{
fidelz80_state *state = device->machine().driver_data<fidelz80_state>();
fidelz80_state *state = space.machine().driver_data<fidelz80_state>();
if (state->m_digit_line_status[offset])
return;

View File

@ -943,12 +943,12 @@ READ8_MEMBER(fm7_state::fm7_fmirq_r)
static READ8_DEVICE_HANDLER( fm77av_joy_1_r )
{
return device->machine().root_device().ioport("joy1")->read();
return space.machine().root_device().ioport("joy1")->read();
}
static READ8_DEVICE_HANDLER( fm77av_joy_2_r )
{
return device->machine().root_device().ioport("joy2")->read();
return space.machine().root_device().ioport("joy2")->read();
}
READ8_MEMBER(fm7_state::fm7_unknown_r)

View File

@ -2555,7 +2555,7 @@ static const struct pit8253_config towns_pit8253_config_2 =
static READ8_DEVICE_HANDLER( get_slave_ack )
{
towns_state* state = device->machine().driver_data<towns_state>();
towns_state* state = space.machine().driver_data<towns_state>();
if (offset==7) { // IRQ = 7
return pic8259_acknowledge(state->m_pic_slave);
}

View File

@ -229,7 +229,7 @@ static const char *const keynames[] = {
static READ8_DEVICE_HANDLER(jr100_via_read_b)
{
jr100_state *state = device->machine().driver_data<jr100_state>();
jr100_state *state = space.machine().driver_data<jr100_state>();
UINT8 val = 0x1f;
if (keynames[state->m_keyboard_line]) {
val = state->ioport(keynames[state->m_keyboard_line])->read();
@ -239,13 +239,13 @@ static READ8_DEVICE_HANDLER(jr100_via_read_b)
static WRITE8_DEVICE_HANDLER(jr100_via_write_a )
{
jr100_state *state = device->machine().driver_data<jr100_state>();
jr100_state *state = space.machine().driver_data<jr100_state>();
state->m_keyboard_line = data & 0x0f;
}
static WRITE8_DEVICE_HANDLER(jr100_via_write_b )
{
jr100_state *state = device->machine().driver_data<jr100_state>();
jr100_state *state = space.machine().driver_data<jr100_state>();
state->m_use_pcg = (data & 0x20) ? TRUE : FALSE;
state->m_speaker = data>>7;
}

View File

@ -233,7 +233,7 @@ WRITE32_MEMBER(juicebox_state::juicebox_nand_w)
static WRITE16_DEVICE_HANDLER( s3c44b0_i2s_data_w )
{
juicebox_state *juicebox = device->machine().driver_data<juicebox_state>();
juicebox_state *juicebox = space.machine().driver_data<juicebox_state>();
juicebox->dac->write_signed16(data ^ 0x8000);
}

View File

@ -113,25 +113,25 @@ static int s3c2440_core_pin_r( device_t *device, int pin)
static WRITE8_DEVICE_HANDLER( s3c2440_nand_command_w )
{
mini2440_state *state = device->machine().driver_data<mini2440_state>();
mini2440_state *state = space.machine().driver_data<mini2440_state>();
state->m_nand->command_w(data);
}
static WRITE8_DEVICE_HANDLER( s3c2440_nand_address_w )
{
mini2440_state *state = device->machine().driver_data<mini2440_state>();
mini2440_state *state = space.machine().driver_data<mini2440_state>();
state->m_nand->address_w(data);
}
static READ8_DEVICE_HANDLER( s3c2440_nand_data_r )
{
mini2440_state *state = device->machine().driver_data<mini2440_state>();
mini2440_state *state = space.machine().driver_data<mini2440_state>();
return state->m_nand->data_r();
}
static WRITE8_DEVICE_HANDLER( s3c2440_nand_data_w )
{
mini2440_state *state = device->machine().driver_data<mini2440_state>();
mini2440_state *state = space.machine().driver_data<mini2440_state>();
state->m_nand->data_w(data);
}
@ -139,7 +139,7 @@ static WRITE8_DEVICE_HANDLER( s3c2440_nand_data_w )
static WRITE16_DEVICE_HANDLER( s3c2440_i2s_data_w )
{
mini2440_state *state = device->machine().driver_data<mini2440_state>();
mini2440_state *state = space.machine().driver_data<mini2440_state>();
state->m_dac[offset]->write_signed16(data + 0x8000);
}
@ -150,10 +150,10 @@ static READ32_DEVICE_HANDLER( s3c2440_adc_data_r )
UINT32 data = 0;
switch (offset)
{
case 2 + 0 : data = device->machine().root_device().ioport( "PENX")->read(); break;
case 2 + 1 : data = 915 - device->machine().root_device().ioport( "PENY")->read() + 90; break;
case 2 + 0 : data = space.machine().root_device().ioport( "PENX")->read(); break;
case 2 + 1 : data = 915 - space.machine().root_device().ioport( "PENY")->read() + 90; break;
}
verboselog( device->machine(), 5, "s3c2440_adc_data_r %08X\n", data);
verboselog( space.machine(), 5, "s3c2440_adc_data_r %08X\n", data);
return data;
}

View File

@ -165,7 +165,7 @@ static WRITE8_DEVICE_HANDLER( mirage_via_write_porta )
static WRITE8_DEVICE_HANDLER( mirage_via_write_portb )
{
int bank = 0;
mirage_state *state = device->machine().driver_data<mirage_state>();
mirage_state *state = space.machine().driver_data<mirage_state>();
// handle sound RAM bank switching
bank = (data & 2) ? (64*1024) : 0;

View File

@ -236,7 +236,7 @@ void ms0515_state::palette_init()
static WRITE8_DEVICE_HANDLER(ms0515_portc_w)
{
ms0515_state *state = device->machine().driver_data<ms0515_state>();
ms0515_state *state = space.machine().driver_data<ms0515_state>();
state->m_sysreg = data;
}
I8255A_INTERFACE( ms0515_ppi8255_interface_1 )

View File

@ -420,7 +420,7 @@ WRITE8_MEMBER( mycom_state::mycom_0a_w )
static WRITE8_DEVICE_HANDLER( mycom_rtc_w )
{
mycom_state *state = device->machine().driver_data<mycom_state>();
mycom_state *state = space.machine().driver_data<mycom_state>();
state->m_rtc->address_w(data & 0x0f);

View File

@ -290,7 +290,7 @@ WRITE8_MEMBER(mz2000_state::mz2000_gvram_bank_w)
static READ8_DEVICE_HANDLER( mz2000_wd17xx_r )
{
mz2000_state *state = device->machine().driver_data<mz2000_state>();
mz2000_state *state = space.machine().driver_data<mz2000_state>();
if(state->m_has_fdc)
return wd17xx_r(device, space, offset) ^ 0xff;
@ -300,7 +300,7 @@ static READ8_DEVICE_HANDLER( mz2000_wd17xx_r )
static WRITE8_DEVICE_HANDLER( mz2000_wd17xx_w )
{
mz2000_state *state = device->machine().driver_data<mz2000_state>();
mz2000_state *state = space.machine().driver_data<mz2000_state>();
if(state->m_has_fdc)
wd17xx_w(device, space, offset, data ^ 0xff);
@ -573,7 +573,7 @@ static READ8_DEVICE_HANDLER( mz2000_porta_r )
static READ8_DEVICE_HANDLER( mz2000_portb_r )
{
mz2000_state *state = device->machine().driver_data<mz2000_state>();
mz2000_state *state = space.machine().driver_data<mz2000_state>();
/*
x--- ---- break key
-x-- ---- read tape data
@ -593,7 +593,7 @@ static READ8_DEVICE_HANDLER( mz2000_portb_r )
else
res |= 0x20;
res |= (device->machine().primary_screen->vblank()) ? 0x00 : 0x01;
res |= (space.machine().primary_screen->vblank()) ? 0x00 : 0x01;
return res;
}
@ -617,7 +617,7 @@ static WRITE8_DEVICE_HANDLER( mz2000_porta_w )
---- --x- tape ff
---- ---x tape rewind
*/
mz2000_state *state = device->machine().driver_data<mz2000_state>();
mz2000_state *state = space.machine().driver_data<mz2000_state>();
if((state->m_tape_ctrl & 0x80) == 0 && data & 0x80)
{
@ -673,7 +673,7 @@ static WRITE8_DEVICE_HANDLER( mz2000_portb_w )
static WRITE8_DEVICE_HANDLER( mz2000_portc_w )
{
mz2000_state *state = device->machine().driver_data<mz2000_state>();
mz2000_state *state = space.machine().driver_data<mz2000_state>();
/*
x--- ---- tape data write
-x-- ---- tape rec
@ -692,10 +692,10 @@ static WRITE8_DEVICE_HANDLER( mz2000_portc_w )
{
state->m_ipl_enable = 0;
/* correct? */
device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
space.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
}
beep_set_state(device->machine().device(BEEPER_TAG),data & 0x04);
beep_set_state(space.machine().device(BEEPER_TAG),data & 0x04);
state->m_old_portc = data;
}
@ -712,7 +712,7 @@ static I8255_INTERFACE( ppi8255_intf )
static WRITE8_DEVICE_HANDLER( mz2000_pio1_porta_w )
{
mz2000_state *state = device->machine().driver_data<mz2000_state>();
mz2000_state *state = space.machine().driver_data<mz2000_state>();
state->m_tvram_enable = ((data & 0xc0) == 0xc0);
state->m_gvram_enable = ((data & 0xc0) == 0x80);
state->m_width80 = ((data & 0x20) >> 5);
@ -723,7 +723,7 @@ static WRITE8_DEVICE_HANDLER( mz2000_pio1_porta_w )
static READ8_DEVICE_HANDLER( mz2000_pio1_portb_r )
{
mz2000_state *state = device->machine().driver_data<mz2000_state>();
mz2000_state *state = space.machine().driver_data<mz2000_state>();
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3",
"KEY4", "KEY5", "KEY6", "KEY7",
"KEY8", "KEY9", "KEYA", "KEYB",
@ -735,17 +735,17 @@ static READ8_DEVICE_HANDLER( mz2000_pio1_portb_r )
res = 0xff;
for(i=0;i<0xe;i++)
res &= device->machine().root_device().ioport(keynames[i])->read();
res &= space.machine().root_device().ioport(keynames[i])->read();
return res;
}
return device->machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
return space.machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
}
static READ8_DEVICE_HANDLER( mz2000_pio1_porta_r )
{
mz2000_state *state = device->machine().driver_data<mz2000_state>();
mz2000_state *state = space.machine().driver_data<mz2000_state>();
return state->m_porta_latch;
}

View File

@ -1253,13 +1253,13 @@ WRITE8_MEMBER(mz2500_state::palette4096_io_w)
static READ8_DEVICE_HANDLER( mz2500_wd17xx_r )
{
mz2500_state *state = device->machine().driver_data<mz2500_state>();
mz2500_state *state = space.machine().driver_data<mz2500_state>();
return wd17xx_r(device, space, offset) ^ state->m_fdc_reverse;
}
static WRITE8_DEVICE_HANDLER( mz2500_wd17xx_w )
{
mz2500_state *state = device->machine().driver_data<mz2500_state>();
mz2500_state *state = space.machine().driver_data<mz2500_state>();
wd17xx_w(device, space, offset, data ^ state->m_fdc_reverse);
}
@ -1841,7 +1841,7 @@ static READ8_DEVICE_HANDLER( mz2500_portb_r )
{
UINT8 vblank_bit;
vblank_bit = device->machine().primary_screen->vblank() ? 0 : 1; //Guess: NOBO wants this bit to be high/low
vblank_bit = space.machine().primary_screen->vblank() ? 0 : 1; //Guess: NOBO wants this bit to be high/low
return 0xfe | vblank_bit;
}
@ -1865,7 +1865,7 @@ static WRITE8_DEVICE_HANDLER( mz2500_portb_w )
static WRITE8_DEVICE_HANDLER( mz2500_portc_w )
{
mz2500_state *state = device->machine().driver_data<mz2500_state>();
mz2500_state *state = space.machine().driver_data<mz2500_state>();
/*
---- x--- 0->1 transition = IPL reset
---- -x-- beeper state
@ -1877,7 +1877,7 @@ static WRITE8_DEVICE_HANDLER( mz2500_portc_w )
{
mz2500_reset(state, WRAM_RESET);
/* correct? */
device->machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
space.machine().device("maincpu")->execute().set_input_line(INPUT_LINE_RESET, PULSE_LINE);
}
/* bit 2 is speaker */
@ -1888,7 +1888,7 @@ static WRITE8_DEVICE_HANDLER( mz2500_portc_w )
state->m_old_portc = data;
beep_set_state(device->machine().device(BEEPER_TAG),data & 0x04);
beep_set_state(space.machine().device(BEEPER_TAG),data & 0x04);
if(data & ~0x0e)
logerror("PPI PORTC W %02x\n",data & ~0x0e);
@ -1906,14 +1906,14 @@ static I8255_INTERFACE( ppi8255_intf )
static WRITE8_DEVICE_HANDLER( mz2500_pio1_porta_w )
{
mz2500_state *state = device->machine().driver_data<mz2500_state>();
mz2500_state *state = space.machine().driver_data<mz2500_state>();
// printf("%02x\n",data);
if(state->m_prev_col_val != ((data & 0x20) >> 5))
{
state->m_text_col_size = ((data & 0x20) >> 5);
state->m_prev_col_val = state->m_text_col_size;
mz2500_reconfigure_screen(device->machine());
mz2500_reconfigure_screen(space.machine());
}
state->m_key_mux = data & 0x1f;
}
@ -1921,7 +1921,7 @@ static WRITE8_DEVICE_HANDLER( mz2500_pio1_porta_w )
static READ8_DEVICE_HANDLER( mz2500_pio1_porta_r )
{
mz2500_state *state = device->machine().driver_data<mz2500_state>();
mz2500_state *state = space.machine().driver_data<mz2500_state>();
static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3",
"KEY4", "KEY5", "KEY6", "KEY7",
"KEY8", "KEY9", "KEYA", "KEYB",
@ -1933,22 +1933,22 @@ static READ8_DEVICE_HANDLER( mz2500_pio1_porta_r )
res = 0xff;
for(i=0;i<0xe;i++)
res &= device->machine().root_device().ioport(keynames[i])->read();
res &= space.machine().root_device().ioport(keynames[i])->read();
state->m_pio_latchb = res;
return res;
}
state->m_pio_latchb = device->machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
state->m_pio_latchb = space.machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
return device->machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
return space.machine().root_device().ioport(keynames[state->m_key_mux & 0xf])->read();
}
#if 0
static READ8_DEVICE_HANDLER( mz2500_pio1_portb_r )
{
mz2500_state *state = device->machine().driver_data<mz2500_state>();
mz2500_state *state = space.machine().driver_data<mz2500_state>();
return state->m_pio_latchb;
}
#endif
@ -1967,13 +1967,13 @@ static Z80PIO_INTERFACE( mz2500_pio1_intf )
static READ8_DEVICE_HANDLER( opn_porta_r )
{
mz2500_state *state = device->machine().driver_data<mz2500_state>();
mz2500_state *state = space.machine().driver_data<mz2500_state>();
return state->m_ym_porta;
}
static WRITE8_DEVICE_HANDLER( opn_porta_w )
{
mz2500_state *state = device->machine().driver_data<mz2500_state>();
mz2500_state *state = space.machine().driver_data<mz2500_state>();
/*
---- x--- mouse select
---- -x-- palette bit (16/4096 colors)

View File

@ -308,7 +308,7 @@ UINT32 nanos_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, c
static READ8_DEVICE_HANDLER (nanos_port_a_r)
{
nanos_state *state = device->machine().driver_data<nanos_state>();
nanos_state *state = space.machine().driver_data<nanos_state>();
UINT8 retVal;
if (state->m_key_command==0) {
return state->m_key_pressed;
@ -327,12 +327,12 @@ static READ8_DEVICE_HANDLER (nanos_port_b_r)
static WRITE8_DEVICE_HANDLER (nanos_port_b_w)
{
nanos_state *state = device->machine().driver_data<nanos_state>();
nanos_state *state = space.machine().driver_data<nanos_state>();
state->m_key_command = BIT(data,1);
if (BIT(data,7)) {
state->membank("bank1")->set_base(state->memregion("maincpu")->base());
} else {
state->membank("bank1")->set_base(device->machine().device<ram_device>(RAM_TAG)->pointer());
state->membank("bank1")->set_base(space.machine().device<ram_device>(RAM_TAG)->pointer());
}
}

View File

@ -349,7 +349,7 @@ UINT32 osbexec_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap,
static READ8_DEVICE_HANDLER( osbexec_pia0_a_r )
{
osbexec_state *state = device->machine().driver_data<osbexec_state>();
osbexec_state *state = space.machine().driver_data<osbexec_state>();
return state->m_pia0_porta;
}
@ -357,19 +357,19 @@ static READ8_DEVICE_HANDLER( osbexec_pia0_a_r )
static WRITE8_DEVICE_HANDLER( osbexec_pia0_a_w )
{
osbexec_state *state = device->machine().driver_data<osbexec_state>();
osbexec_state *state = space.machine().driver_data<osbexec_state>();
logerror("osbexec_pia0_a_w: %02x\n", data );
state->m_pia0_porta = data;
state->set_banks(device->machine());
state->set_banks(space.machine());
}
static READ8_DEVICE_HANDLER( osbexec_pia0_b_r )
{
osbexec_state *state = device->machine().driver_data<osbexec_state>();
osbexec_state *state = space.machine().driver_data<osbexec_state>();
return state->m_pia0_portb;
}
@ -377,7 +377,7 @@ static READ8_DEVICE_HANDLER( osbexec_pia0_b_r )
static WRITE8_DEVICE_HANDLER( osbexec_pia0_b_w )
{
osbexec_state *state = device->machine().driver_data<osbexec_state>();
osbexec_state *state = space.machine().driver_data<osbexec_state>();
state->m_pia0_portb = data;

View File

@ -513,12 +513,12 @@ static WRITE16_DEVICE_HANDLER( p8k_16_pio_w )
static READ16_DEVICE_HANDLER( p8k_16_ctc_r )
{
return (UINT16)downcast<z80ctc_device *>(device)->read(device->machine().driver_data()->generic_space(),(offset & 0x06) >> 1);
return (UINT16)downcast<z80ctc_device *>(device)->read(space.machine().driver_data()->generic_space(),(offset & 0x06) >> 1);
}
static WRITE16_DEVICE_HANDLER( p8k_16_ctc_w )
{
downcast<z80ctc_device *>(device)->write(device->machine().driver_data()->generic_space(), (offset & 0x06) >> 1, (UINT8)(data & 0xff));
downcast<z80ctc_device *>(device)->write(space.machine().driver_data()->generic_space(), (offset & 0x06) >> 1, (UINT8)(data & 0xff));
}
READ16_MEMBER( p8k_state::portff82_r )

View File

@ -73,7 +73,7 @@ INPUT_CHANGED_MEMBER(palm_state::button_check)
static WRITE8_DEVICE_HANDLER( palm_port_f_out )
{
palm_state *state = device->machine().driver_data<palm_state>();
palm_state *state = space.machine().driver_data<palm_state>();
state->m_port_f_latch = data;
}
@ -84,19 +84,19 @@ static READ8_DEVICE_HANDLER( palm_port_c_in )
static READ8_DEVICE_HANDLER( palm_port_f_in )
{
palm_state *state = device->machine().driver_data<palm_state>();
palm_state *state = space.machine().driver_data<palm_state>();
return state->m_port_f_latch;
}
static WRITE16_DEVICE_HANDLER( palm_spim_out )
{
palm_state *state = device->machine().driver_data<palm_state>();
palm_state *state = space.machine().driver_data<palm_state>();
state->m_spim_data = data;
}
static READ16_DEVICE_HANDLER( palm_spim_in )
{
palm_state *state = device->machine().driver_data<palm_state>();
palm_state *state = space.machine().driver_data<palm_state>();
return state->m_spim_data;
}
@ -159,7 +159,7 @@ ADDRESS_MAP_END
static WRITE8_DEVICE_HANDLER( palm_dac_transition )
{
palm_state *state = device->machine().driver_data<palm_state>();
palm_state *state = space.machine().driver_data<palm_state>();
state->m_dac->write_unsigned8(0x7f * data );
}

View File

@ -112,30 +112,30 @@ public:
static WRITE8_DEVICE_HANDLER( s3c2410_nand_command_w )
{
palmz22_state *state = device->machine().driver_data<palmz22_state>();
verboselog( device->machine(), 9, "s3c2410_nand_command_w %02X\n", data);
palmz22_state *state = space.machine().driver_data<palmz22_state>();
verboselog( space.machine(), 9, "s3c2410_nand_command_w %02X\n", data);
state->m_nand->command_w(data);
}
static WRITE8_DEVICE_HANDLER( s3c2410_nand_address_w )
{
palmz22_state *state = device->machine().driver_data<palmz22_state>();
verboselog( device->machine(), 9, "s3c2410_nand_address_w %02X\n", data);
palmz22_state *state = space.machine().driver_data<palmz22_state>();
verboselog( space.machine(), 9, "s3c2410_nand_address_w %02X\n", data);
state->m_nand->address_w(data);
}
static READ8_DEVICE_HANDLER( s3c2410_nand_data_r )
{
palmz22_state *state = device->machine().driver_data<palmz22_state>();
palmz22_state *state = space.machine().driver_data<palmz22_state>();
UINT8 data = state->m_nand->data_r();
verboselog( device->machine(), 9, "s3c2410_nand_data_r %02X\n", data);
verboselog( space.machine(), 9, "s3c2410_nand_data_r %02X\n", data);
return data;
}
static WRITE8_DEVICE_HANDLER( s3c2410_nand_data_w )
{
palmz22_state *state = device->machine().driver_data<palmz22_state>();
verboselog( device->machine(), 9, "s3c2410_nand_data_w %02X\n", data);
palmz22_state *state = space.machine().driver_data<palmz22_state>();
verboselog( space.machine(), 9, "s3c2410_nand_data_w %02X\n", data);
state->m_nand->data_w(data);
}
@ -217,10 +217,10 @@ static READ32_DEVICE_HANDLER( s3c2410_adc_data_r )
{
case 0 + 0 : data = 0x2EE + (PALM_Z22_BATTERY_LEVEL * 0xFF / 100); break;
case 0 + 1 : data = 0; break;
case 2 + 0 : data = device->machine().root_device().ioport( "PENX")->read(); break;
case 2 + 1 : data = 0x3FF - device->machine().root_device().ioport( "PENY")->read(); break;
case 2 + 0 : data = space.machine().root_device().ioport( "PENX")->read(); break;
case 2 + 1 : data = 0x3FF - space.machine().root_device().ioport( "PENY")->read(); break;
}
verboselog( device->machine(), 5, "s3c2410_adc_data_r %08X\n", data);
verboselog( space.machine(), 5, "s3c2410_adc_data_r %08X\n", data);
return data;
}

View File

@ -1820,16 +1820,16 @@ ADDRESS_MAP_END
static READ8_DEVICE_HANDLER( cpu_8255_c_r )
{
pc8801_state *state = device->machine().driver_data<pc8801_state>();
// device->machine().scheduler().synchronize(); // force resync
pc8801_state *state = space.machine().driver_data<pc8801_state>();
// space.machine().scheduler().synchronize(); // force resync
return state->m_i8255_1_pc >> 4;
}
static WRITE8_DEVICE_HANDLER( cpu_8255_c_w )
{
pc8801_state *state = device->machine().driver_data<pc8801_state>();
// device->machine().scheduler().synchronize(); // force resync
pc8801_state *state = space.machine().driver_data<pc8801_state>();
// space.machine().scheduler().synchronize(); // force resync
state->m_i8255_0_pc = data;
}
@ -1847,16 +1847,16 @@ static I8255A_INTERFACE( master_fdd_intf )
static READ8_DEVICE_HANDLER( fdc_8255_c_r )
{
pc8801_state *state = device->machine().driver_data<pc8801_state>();
// device->machine().scheduler().synchronize(); // force resync
pc8801_state *state = space.machine().driver_data<pc8801_state>();
// space.machine().scheduler().synchronize(); // force resync
return state->m_i8255_0_pc >> 4;
}
static WRITE8_DEVICE_HANDLER( fdc_8255_c_w )
{
pc8801_state *state = device->machine().driver_data<pc8801_state>();
// device->machine().scheduler().synchronize(); // force resync
pc8801_state *state = space.machine().driver_data<pc8801_state>();
// space.machine().scheduler().synchronize(); // force resync
state->m_i8255_1_pc = data;
}
@ -2569,9 +2569,9 @@ static const struct upd765_interface pc8801_upd765_interface =
static READ8_DEVICE_HANDLER( opn_porta_r )
{
pc8801_state *state = device->machine().driver_data<pc8801_state>();
pc8801_state *state = space.machine().driver_data<pc8801_state>();
if(device->machine().root_device().ioport("BOARD_CONFIG")->read() & 2)
if(space.machine().root_device().ioport("BOARD_CONFIG")->read() & 2)
{
UINT8 shift,res;
@ -2583,7 +2583,7 @@ static READ8_DEVICE_HANDLER( opn_porta_r )
return ((res >> shift) & 0x0f) | 0xf0;
}
return device->machine().root_device().ioport("OPN_PA")->read();
return space.machine().root_device().ioport("OPN_PA")->read();
}
static READ8_DEVICE_HANDLER( opn_portb_r ) { return device->machine().root_device().ioport("OPN_PB")->read(); }

View File

@ -1398,14 +1398,14 @@ GFXDECODE_END
static READ8_DEVICE_HANDLER( cpu_8255_c_r )
{
pc88va_state *state = device->machine().driver_data<pc88va_state>();
pc88va_state *state = space.machine().driver_data<pc88va_state>();
return state->m_i8255_1_pc >> 4;
}
static WRITE8_DEVICE_HANDLER( cpu_8255_c_w )
{
pc88va_state *state = device->machine().driver_data<pc88va_state>();
pc88va_state *state = space.machine().driver_data<pc88va_state>();
state->m_i8255_0_pc = data;
}
@ -1422,14 +1422,14 @@ static I8255A_INTERFACE( master_fdd_intf )
static READ8_DEVICE_HANDLER( fdc_8255_c_r )
{
pc88va_state *state = device->machine().driver_data<pc88va_state>();
pc88va_state *state = space.machine().driver_data<pc88va_state>();
return state->m_i8255_0_pc >> 4;
}
static WRITE8_DEVICE_HANDLER( fdc_8255_c_w )
{
pc88va_state *state = device->machine().driver_data<pc88va_state>();
pc88va_state *state = space.machine().driver_data<pc88va_state>();
state->m_i8255_1_pc = data;
}
@ -1448,11 +1448,11 @@ static READ8_DEVICE_HANDLER( r232_ctrl_porta_r )
{
UINT8 sw5, sw4, sw3, sw2,speed_sw;
speed_sw = (device->machine().root_device().ioport("SPEED_SW")->read() & 1) ? 0x20 : 0x00;
sw5 = (device->machine().root_device().ioport("DSW")->read() & 0x10);
sw4 = (device->machine().root_device().ioport("DSW")->read() & 0x08);
sw3 = (device->machine().root_device().ioport("DSW")->read() & 0x04);
sw2 = (device->machine().root_device().ioport("DSW")->read() & 0x02);
speed_sw = (space.machine().root_device().ioport("SPEED_SW")->read() & 1) ? 0x20 : 0x00;
sw5 = (space.machine().root_device().ioport("DSW")->read() & 0x10);
sw4 = (space.machine().root_device().ioport("DSW")->read() & 0x08);
sw3 = (space.machine().root_device().ioport("DSW")->read() & 0x04);
sw2 = (space.machine().root_device().ioport("DSW")->read() & 0x02);
return 0xc1 | sw5 | sw4 | sw3 | sw2 | speed_sw;
}
@ -1461,7 +1461,7 @@ static READ8_DEVICE_HANDLER( r232_ctrl_portb_r )
{
UINT8 xsw1;
xsw1 = (device->machine().root_device().ioport("DSW")->read() & 1) ? 0 : 8;
xsw1 = (space.machine().root_device().ioport("DSW")->read() & 1) ? 0 : 8;
return 0xf7 | xsw1;
}
@ -1510,7 +1510,7 @@ static WRITE_LINE_DEVICE_HANDLER( pc88va_pic_irq )
static READ8_DEVICE_HANDLER( get_slave_ack )
{
if (offset==7) { // IRQ = 7
return pic8259_acknowledge(device->machine().device( "pic8259_slave"));
return pic8259_acknowledge(space.machine().device( "pic8259_slave"));
}
return 0x00;
}

View File

@ -2207,7 +2207,7 @@ static WRITE_LINE_DEVICE_HANDLER( pc9801_master_set_int_line )
static READ8_DEVICE_HANDLER( get_slave_ack )
{
if (offset==7) { // IRQ = 7
return pic8259_acknowledge( device->machine().device( "pic8259_slave" ));
return pic8259_acknowledge( space.machine().device( "pic8259_slave" ));
}
return 0x00;
}
@ -2348,7 +2348,7 @@ static READ8_DEVICE_HANDLER( ppi_prn_portb_r ) { return device->machine().root_d
static WRITE8_DEVICE_HANDLER( ppi_sys_portc_w )
{
beep_set_state(device->machine().device(BEEPER_TAG),!(data & 0x08));
beep_set_state(space.machine().device(BEEPER_TAG),!(data & 0x08));
}
static I8255A_INTERFACE( ppi_system_intf )
@ -2378,17 +2378,17 @@ static READ8_DEVICE_HANDLER( ppi_fdd_porta_r )
static READ8_DEVICE_HANDLER( ppi_fdd_portb_r )
{
return 0xff; //upd765_status_r(device->machine().device("upd765_2dd"),space, 0);
return 0xff; //upd765_status_r(space.machine().device("upd765_2dd"),space, 0);
}
static READ8_DEVICE_HANDLER( ppi_fdd_portc_r )
{
return 0xff; //upd765_data_r(device->machine().device("upd765_2dd"),space, 0);
return 0xff; //upd765_data_r(space.machine().device("upd765_2dd"),space, 0);
}
static WRITE8_DEVICE_HANDLER( ppi_fdd_portc_w )
{
//upd765_data_w(device->machine().device("upd765_2dd"),space, 0,data);
//upd765_data_w(space.machine().device("upd765_2dd"),space, 0,data);
}
static I8255A_INTERFACE( ppi_fdd_intf )

View File

@ -67,7 +67,7 @@ Address map:
/* Devices */
static WRITE8_DEVICE_HANDLER( pes_kbd_input )
{
pes_state *state = device->machine().driver_data<pes_state>();
pes_state *state = space.machine().driver_data<pes_state>();
#ifdef DEBUG_FIFO
fprintf(stderr,"keyboard input: %c, ", data);
#endif
@ -87,8 +87,8 @@ static WRITE8_DEVICE_HANDLER( pes_kbd_input )
fprintf(stderr,"kb input fifo fullness: %d\n",(state->m_infifo_head_ptr-state->m_infifo_tail_ptr)&0x1F);
#endif
// todo: following two should be set so clear happens after one cpu cycle
device->machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, ASSERT_LINE);
device->machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, CLEAR_LINE);
space.machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, ASSERT_LINE);
space.machine().device("maincpu")->execute().set_input_line(MCS51_RX_LINE, CLEAR_LINE);
}
static GENERIC_TERMINAL_INTERFACE( pes_terminal_intf )

View File

@ -102,30 +102,30 @@ static void pk8000_set_bank(running_machine &machine,UINT8 data)
}
static WRITE8_DEVICE_HANDLER(pk8000_80_porta_w)
{
pk8000_set_bank(device->machine(),data);
pk8000_set_bank(space.machine(),data);
}
static READ8_DEVICE_HANDLER(pk8000_80_portb_r)
{
pk8000_state *state = device->machine().driver_data<pk8000_state>();
pk8000_state *state = space.machine().driver_data<pk8000_state>();
static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7", "LINE8", "LINE9" };
if(state->m_keyboard_line>9) {
return 0xff;
}
return device->machine().root_device().ioport(keynames[state->m_keyboard_line])->read();
return space.machine().root_device().ioport(keynames[state->m_keyboard_line])->read();
}
static WRITE8_DEVICE_HANDLER(pk8000_80_portc_w)
{
pk8000_state *state = device->machine().driver_data<pk8000_state>();
pk8000_state *state = space.machine().driver_data<pk8000_state>();
state->m_keyboard_line = data & 0x0f;
speaker_level_w(device->machine().device(SPEAKER_TAG), BIT(data,7));
speaker_level_w(space.machine().device(SPEAKER_TAG), BIT(data,7));
cassette_device_image(device->machine())->change_state(
cassette_device_image(space.machine())->change_state(
(BIT(data,4)) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED,
CASSETTE_MASK_MOTOR);
cassette_device_image(device->machine())->output((BIT(data,6)) ? +1.0 : 0.0);
cassette_device_image(space.machine())->output((BIT(data,6)) ? +1.0 : 0.0);
}
static I8255_INTERFACE( pk8000_ppi8255_interface_1 )

View File

@ -658,7 +658,7 @@ void portfolio_state::palette_init()
static READ8_DEVICE_HANDLER( hd61830_rd_r )
{
UINT16 address = ((offset & 0xff) << 3) | ((offset >> 12) & 0x07);
UINT8 data = device->machine().root_device().memregion(HD61830_TAG)->base()[address];
UINT8 data = space.machine().root_device().memregion(HD61830_TAG)->base()[address];
return data;
}

View File

@ -267,25 +267,25 @@ READ8_MEMBER(samcoupe_state::samcoupe_attributes_r)
static READ8_DEVICE_HANDLER( samcoupe_lpt1_busy_r )
{
centronics_device *centronics = device->machine().device<centronics_device>("lpt1");
centronics_device *centronics = space.machine().device<centronics_device>("lpt1");
return centronics->busy_r();
}
static WRITE8_DEVICE_HANDLER( samcoupe_lpt1_strobe_w )
{
centronics_device *centronics = device->machine().device<centronics_device>("lpt1");
centronics_device *centronics = space.machine().device<centronics_device>("lpt1");
centronics->strobe_w(data);
}
static READ8_DEVICE_HANDLER( samcoupe_lpt2_busy_r )
{
centronics_device *centronics = device->machine().device<centronics_device>("lpt2");
centronics_device *centronics = space.machine().device<centronics_device>("lpt2");
return centronics->busy_r();
}
static WRITE8_DEVICE_HANDLER( samcoupe_lpt2_strobe_w )
{
centronics_device *centronics = device->machine().device<centronics_device>("lpt2");
centronics_device *centronics = space.machine().device<centronics_device>("lpt2");
centronics->strobe_w(data);
}

View File

@ -359,7 +359,7 @@ WRITE16_MEMBER(sgi_ip2_state::sgi_ip2_stklmt_w)
static WRITE8_DEVICE_HANDLER( sgi_kbd_put )
{
duart68681_rx_data(device->machine().device("duart68681a"), 1, data);
duart68681_rx_data(space.machine().device("duart68681a"), 1, data);
}
static GENERIC_TERMINAL_INTERFACE( sgi_terminal_intf )

View File

@ -100,7 +100,7 @@ READ8_MEMBER(spc1000_state::spc1000_keyboard_r){
static WRITE8_DEVICE_HANDLER(spc1000_gmode_w)
{
spc1000_state *state = device->machine().driver_data<spc1000_state>();
spc1000_state *state = space.machine().driver_data<spc1000_state>();
state->m_GMODE = data;
// state->m_GMODE layout: CSS|NA|PS2|PS1|~A/G|GM0|GM1|NA
@ -113,7 +113,7 @@ static WRITE8_DEVICE_HANDLER(spc1000_gmode_w)
static READ8_DEVICE_HANDLER(spc1000_gmode_r)
{
spc1000_state *state = device->machine().driver_data<spc1000_state>();
spc1000_state *state = space.machine().driver_data<spc1000_state>();
return state->m_GMODE;
}
@ -244,7 +244,7 @@ void spc1000_state::machine_reset()
static READ8_DEVICE_HANDLER( spc1000_mc6847_videoram_r )
{
spc1000_state *state = device->machine().driver_data<spc1000_state>();
spc1000_state *state = space.machine().driver_data<spc1000_state>();
if (offset == ~0) return 0xff;
// state->m_GMODE layout: CSS|NA|PS2|PS1|~A/G|GM0|GM1|NA

View File

@ -119,49 +119,49 @@ static void ssystem3_playfield_read(running_machine &machine, int *on, int *read
static WRITE8_DEVICE_HANDLER(ssystem3_via_write_a)
{
ssystem3_state *state = device->machine().driver_data<ssystem3_state>();
ssystem3_state *state = space.machine().driver_data<ssystem3_state>();
state->m_porta=data;
// logerror("%.4x via port a write %02x\n",(int)activecpu_get_pc(), data);
}
static READ8_DEVICE_HANDLER(ssystem3_via_read_a)
{
ssystem3_state *state = device->machine().driver_data<ssystem3_state>();
ssystem3_state *state = space.machine().driver_data<ssystem3_state>();
UINT8 data=0xff;
#if 1 // time switch
if (!(state->m_porta&0x10)) data&=device->machine().root_device().ioport("matrix1")->read()|0xf1;
if (!(state->m_porta&0x20)) data&=device->machine().root_device().ioport("matrix2")->read()|0xf1;
if (!(state->m_porta&0x40)) data&=device->machine().root_device().ioport("matrix3")->read()|0xf1;
if (!(state->m_porta&0x80)) data&=device->machine().root_device().ioport("matrix4")->read()|0xf1;
if (!(state->m_porta&0x10)) data&=space.machine().root_device().ioport("matrix1")->read()|0xf1;
if (!(state->m_porta&0x20)) data&=space.machine().root_device().ioport("matrix2")->read()|0xf1;
if (!(state->m_porta&0x40)) data&=space.machine().root_device().ioport("matrix3")->read()|0xf1;
if (!(state->m_porta&0x80)) data&=space.machine().root_device().ioport("matrix4")->read()|0xf1;
#else
if (!(state->m_porta&0x10)) data&=device->machine().root_device().ioport("matrix1")->read()|0xf0;
if (!(state->m_porta&0x20)) data&=device->machine().root_device().ioport("matrix2")->read()|0xf0;
if (!(state->m_porta&0x40)) data&=device->machine().root_device().ioport("matrix3")->read()|0xf0;
if (!(state->m_porta&0x80)) data&=device->machine().root_device().ioport("matrix4")->read()|0xf0;
if (!(state->m_porta&0x10)) data&=space.machine().root_device().ioport("matrix1")->read()|0xf0;
if (!(state->m_porta&0x20)) data&=space.machine().root_device().ioport("matrix2")->read()|0xf0;
if (!(state->m_porta&0x40)) data&=space.machine().root_device().ioport("matrix3")->read()|0xf0;
if (!(state->m_porta&0x80)) data&=space.machine().root_device().ioport("matrix4")->read()|0xf0;
#endif
if (!(state->m_porta&1)) {
if (!(device->machine().root_device().ioport("matrix1")->read()&1)) data&=~0x10;
if (!(device->machine().root_device().ioport("matrix2")->read()&1)) data&=~0x20;
if (!(device->machine().root_device().ioport("matrix3")->read()&1)) data&=~0x40;
if (!(space.machine().root_device().ioport("matrix1")->read()&1)) data&=~0x10;
if (!(space.machine().root_device().ioport("matrix2")->read()&1)) data&=~0x20;
if (!(space.machine().root_device().ioport("matrix3")->read()&1)) data&=~0x40;
if (!(state->ioport("matrix4")->read()&1)) data&=~0x80;
}
if (!(state->m_porta&2)) {
if (!(device->machine().root_device().ioport("matrix1")->read()&2)) data&=~0x10;
if (!(device->machine().root_device().ioport("matrix2")->read()&2)) data&=~0x20;
if (!(device->machine().root_device().ioport("matrix3")->read()&2)) data&=~0x40;
if (!(device->machine().root_device().ioport("matrix4")->read()&2)) data&=~0x80;
if (!(space.machine().root_device().ioport("matrix1")->read()&2)) data&=~0x10;
if (!(space.machine().root_device().ioport("matrix2")->read()&2)) data&=~0x20;
if (!(space.machine().root_device().ioport("matrix3")->read()&2)) data&=~0x40;
if (!(space.machine().root_device().ioport("matrix4")->read()&2)) data&=~0x80;
}
if (!(state->m_porta&4)) {
if (!(device->machine().root_device().ioport("matrix1")->read()&4)) data&=~0x10;
if (!(device->machine().root_device().ioport("matrix2")->read()&4)) data&=~0x20;
if (!(device->machine().root_device().ioport("matrix3")->read()&4)) data&=~0x40;
if (!(device->machine().root_device().ioport("matrix4")->read()&4)) data&=~0x80;
if (!(space.machine().root_device().ioport("matrix1")->read()&4)) data&=~0x10;
if (!(space.machine().root_device().ioport("matrix2")->read()&4)) data&=~0x20;
if (!(space.machine().root_device().ioport("matrix3")->read()&4)) data&=~0x40;
if (!(space.machine().root_device().ioport("matrix4")->read()&4)) data&=~0x80;
}
if (!(state->m_porta&8)) {
if (!(device->machine().root_device().ioport("matrix1")->read()&8)) data&=~0x10;
if (!(device->machine().root_device().ioport("matrix2")->read()&8)) data&=~0x20;
if (!(device->machine().root_device().ioport("matrix3")->read()&8)) data&=~0x40;
if (!(device->machine().root_device().ioport("matrix4")->read()&8)) data&=~0x80;
if (!(space.machine().root_device().ioport("matrix1")->read()&8)) data&=~0x10;
if (!(space.machine().root_device().ioport("matrix2")->read()&8)) data&=~0x20;
if (!(space.machine().root_device().ioport("matrix3")->read()&8)) data&=~0x40;
if (!(space.machine().root_device().ioport("matrix4")->read()&8)) data&=~0x80;
}
// logerror("%.4x via port a read %02x\n",(int)activecpu_get_pc(), data);
return data;
@ -193,7 +193,7 @@ static READ8_DEVICE_HANDLER(ssystem3_via_read_b)
{
UINT8 data=0xff;
int on, ready;
ssystem3_playfield_read(device->machine(), &on, &ready);
ssystem3_playfield_read(space.machine(), &on, &ready);
if (!on) data&=~0x20;
if (!ready) data&=~0x10;
return data;
@ -201,11 +201,11 @@ static READ8_DEVICE_HANDLER(ssystem3_via_read_b)
static WRITE8_DEVICE_HANDLER(ssystem3_via_write_b)
{
via6522_device *via_0 = device->machine().device<via6522_device>("via6522_0");
via6522_device *via_0 = space.machine().device<via6522_device>("via6522_0");
UINT8 d;
ssystem3_playfield_write(device->machine(), data&1, data&8);
ssystem3_lcd_write(device->machine(), data&4, data&2);
ssystem3_playfield_write(space.machine(), data&1, data&8);
ssystem3_lcd_write(space.machine(), data&4, data&2);
d=ssystem3_via_read_b(via_0, space, 0, mem_mask)&~0x40;
if (data&0x80) d|=0x40;

View File

@ -701,8 +701,8 @@ WRITE8_MEMBER( v1050_state::misc_ppi_pa_w )
static WRITE8_DEVICE_HANDLER( misc_ppi_pb_w )
{
centronics_device *centronics = device->machine().device<centronics_device>(CENTRONICS_TAG);
centronics->write( device->machine().driver_data()->generic_space() , 0, ~data & 0xff);
centronics_device *centronics = space.machine().device<centronics_device>(CENTRONICS_TAG);
centronics->write( space.machine().driver_data()->generic_space() , 0, ~data & 0xff);
}
static READ8_DEVICE_HANDLER( misc_ppi_pc_r )
@ -723,7 +723,7 @@ static READ8_DEVICE_HANDLER( misc_ppi_pc_r )
*/
UINT8 data = 0;
centronics_device *centronics = device->machine().device<centronics_device>(CENTRONICS_TAG);
centronics_device *centronics = space.machine().device<centronics_device>(CENTRONICS_TAG);
data |= centronics->not_busy_r() << 4;
data |= centronics->pe_r() << 5;

Some files were not shown because too many files have changed in this diff Show More