summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2012-09-21 08:25:27 +0000
committerGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2012-09-21 08:25:27 +0000
commit1f9d1cd62092e47bdda6868f6f865ef092656742 (patch) (github)
tree7dfd5e67f785ac1e612c38804ee868e9ef2290d0
parent81f215089087327e3738b6e9eac2d5ee07b0e6c6 (diff)
downloadmame-1f9d1cd62092e47bdda6868f6f865ef092656742.tar.bz2
mame-1f9d1cd62092e47bdda6868f6f865ef092656742.zip
change from device->machine() to space.machine() in device handlers in order to make next changes easier (no whatsnew)
-rw-r--r--src/mame/audio/leland.c12
-rw-r--r--src/mame/audio/redalert.c2
-rw-r--r--src/mame/drivers/chihiro.c2
-rw-r--r--src/mame/drivers/chinagat.c4
-rw-r--r--src/mame/drivers/ddenlovr.c20
-rw-r--r--src/mame/drivers/dlair.c4
-rw-r--r--src/mame/drivers/esripsys.c4
-rw-r--r--src/mame/drivers/ghosteo.c16
-rw-r--r--src/mame/drivers/m10.c6
-rw-r--r--src/mame/drivers/mpu4vid.c8
-rw-r--r--src/mame/drivers/mquake.c10
-rw-r--r--src/mame/drivers/nyny.c2
-rw-r--r--src/mame/drivers/othello.c2
-rw-r--r--src/mame/drivers/powerbal.c4
-rw-r--r--src/mame/drivers/proconn.c2
-rw-r--r--src/mame/drivers/r2dtank.c4
-rw-r--r--src/mame/drivers/segac2.c2
-rw-r--r--src/mame/drivers/segas16a.c2
-rw-r--r--src/mame/drivers/spiders.c2
-rw-r--r--src/mame/drivers/topspeed.c2
-rw-r--r--src/mame/drivers/trvquest.c2
-rw-r--r--src/mame/machine/atari.c4
-rw-r--r--src/mame/machine/beezer.c20
-rw-r--r--src/mame/machine/carpolo.c12
-rw-r--r--src/mame/machine/dc.c12
-rw-r--r--src/mame/machine/konppc.c8
-rw-r--r--src/mame/machine/leland.c14
-rw-r--r--src/mame/machine/mcr68.c8
-rw-r--r--src/mame/machine/megadriv.c4
-rw-r--r--src/mame/machine/n64.c16
-rw-r--r--src/mame/machine/namco06.c12
-rw-r--r--src/mame/machine/namco50.c2
-rw-r--r--src/mame/machine/namco51.c10
-rw-r--r--src/mame/machine/pcshare.c2
-rw-r--r--src/mame/machine/qix.c30
-rw-r--r--src/mame/machine/scramble.c6
-rw-r--r--src/mame/machine/stfight.c2
-rw-r--r--src/mame/machine/taitoio.c30
-rw-r--r--src/mame/machine/vectrex.c10
-rw-r--r--src/mame/machine/williams.c30
-rw-r--r--src/mame/video/deco16ic.c2
-rw-r--r--src/mame/video/decocomn.c12
-rw-r--r--src/mame/video/gameplan.c6
-rw-r--r--src/mame/video/gp9001.c2
-rw-r--r--src/mame/video/hanaawas.c4
-rw-r--r--src/mame/video/homerun.c6
-rw-r--r--src/mame/video/konicdev.c62
-rw-r--r--src/mame/video/leland.c4
-rw-r--r--src/mame/video/phoenix.c2
-rw-r--r--src/mame/video/qix.c2
-rw-r--r--src/mame/video/system1.c2
-rw-r--r--src/mame/video/taitoic.c22
-rw-r--r--src/mame/video/vectrex.c28
-rw-r--r--src/mame/video/xxmissio.c4
-rw-r--r--src/mess/audio/dave.c2
-rw-r--r--src/mess/audio/mea8000.c16
-rw-r--r--src/mess/audio/svision.c6
-rw-r--r--src/mess/audio/wswan.c18
-rw-r--r--src/mess/drivers/a2600.c8
-rw-r--r--src/mess/drivers/ami1200.c12
-rw-r--r--src/mess/drivers/amiga.c20
-rw-r--r--src/mess/drivers/apexc.c2
-rw-r--r--src/mess/drivers/apollo.c4
-rw-r--r--src/mess/drivers/apple2.c8
-rw-r--r--src/mess/drivers/apple2gs.c10
-rw-r--r--src/mess/drivers/atari400.c4
-rw-r--r--src/mess/drivers/bml3.c4
-rw-r--r--src/mess/drivers/dectalk.c2
-rw-r--r--src/mess/drivers/digel804.c2
-rw-r--r--src/mess/drivers/dm7000.c4
-rw-r--r--src/mess/drivers/einstein.c8
-rw-r--r--src/mess/drivers/elwro800.c4
-rw-r--r--src/mess/drivers/enterp.c10
-rw-r--r--src/mess/drivers/fidelz80.c2
-rw-r--r--src/mess/drivers/fm7.c4
-rw-r--r--src/mess/drivers/fmtowns.c2
-rw-r--r--src/mess/drivers/jr100.c6
-rw-r--r--src/mess/drivers/juicebox.c2
-rw-r--r--src/mess/drivers/mini2440.c16
-rw-r--r--src/mess/drivers/mirage.c2
-rw-r--r--src/mess/drivers/ms0515.c2
-rw-r--r--src/mess/drivers/mycom.c2
-rw-r--r--src/mess/drivers/mz2000.c26
-rw-r--r--src/mess/drivers/mz2500.c30
-rw-r--r--src/mess/drivers/nanos.c6
-rw-r--r--src/mess/drivers/osbexec.c10
-rw-r--r--src/mess/drivers/p8k.c4
-rw-r--r--src/mess/drivers/palm.c10
-rw-r--r--src/mess/drivers/palmz22.c22
-rw-r--r--src/mess/drivers/pc8801.c22
-rw-r--r--src/mess/drivers/pc88va.c22
-rw-r--r--src/mess/drivers/pc9801.c10
-rw-r--r--src/mess/drivers/pes.c6
-rw-r--r--src/mess/drivers/pk8000.c14
-rw-r--r--src/mess/drivers/portfoli.c2
-rw-r--r--src/mess/drivers/samcoupe.c8
-rw-r--r--src/mess/drivers/sgi_ip2.c2
-rw-r--r--src/mess/drivers/spc1000.c6
-rw-r--r--src/mess/drivers/ssystem3.c58
-rw-r--r--src/mess/drivers/v1050.c6
-rw-r--r--src/mess/drivers/vtech1.c6
-rw-r--r--src/mess/drivers/x68k.c28
-rw-r--r--src/mess/drivers/xor100.c2
-rw-r--r--src/mess/machine/a7800.c6
-rw-r--r--src/mess/machine/ac1.c18
-rw-r--r--src/mess/machine/amstrad.c16
-rw-r--r--src/mess/machine/apollo.c8
-rw-r--r--src/mess/machine/apple1.c6
-rw-r--r--src/mess/machine/apple3.c16
-rw-r--r--src/mess/machine/atarifdc.c4
-rw-r--r--src/mess/machine/b2m.c30
-rw-r--r--src/mess/machine/bbc.c12
-rw-r--r--src/mess/machine/bebox.c6
-rw-r--r--src/mess/machine/c64.c24
-rw-r--r--src/mess/machine/c65.c12
-rw-r--r--src/mess/machine/cbmb.c62
-rw-r--r--src/mess/machine/cgenie.c4
-rw-r--r--src/mess/machine/concept.c2
-rw-r--r--src/mess/machine/dgn_beta.c38
-rw-r--r--src/mess/machine/e05a03.c4
-rw-r--r--src/mess/machine/isa_fdc.c12
-rw-r--r--src/mess/machine/isa_hdc.c4
-rw-r--r--src/mess/machine/kaypro.c6
-rw-r--r--src/mess/machine/kramermc.c6
-rw-r--r--src/mess/machine/lisa.c20
-rw-r--r--src/mess/machine/lviv.c48
-rw-r--r--src/mess/machine/mac.c50
-rw-r--r--src/mess/machine/macpci.c12
-rw-r--r--src/mess/machine/mc68328.c756
-rw-r--r--src/mess/machine/mc6843.c40
-rw-r--r--src/mess/machine/mc6846.c36
-rw-r--r--src/mess/machine/mc6854.c30
-rw-r--r--src/mess/machine/micropolis.c2
-rw-r--r--src/mess/machine/microtan.c4
-rw-r--r--src/mess/machine/mos6530.c6
-rw-r--r--src/mess/machine/msx.c12
-rw-r--r--src/mess/machine/mtx.c6
-rw-r--r--src/mess/machine/mz700.c28
-rw-r--r--src/mess/machine/oric.c40
-rw-r--r--src/mess/machine/orion.c6
-rw-r--r--src/mess/machine/pc.c84
-rw-r--r--src/mess/machine/pc_lpt.c4
-rw-r--r--src/mess/machine/pet.c42
-rw-r--r--src/mess/machine/pk8020.c36
-rw-r--r--src/mess/machine/pmd85.c36
-rw-r--r--src/mess/machine/pokemini.c78
-rw-r--r--src/mess/machine/pp01.c10
-rw-r--r--src/mess/machine/radio86.c50
-rw-r--r--src/mess/machine/rmnimbus.c2
-rw-r--r--src/mess/machine/s3c44b0.c70
-rw-r--r--src/mess/machine/samcoupe.c4
-rw-r--r--src/mess/machine/super80.c2
-rw-r--r--src/mess/machine/svi318.c20
-rw-r--r--src/mess/machine/sym1.c38
-rw-r--r--src/mess/machine/tf20.c4
-rw-r--r--src/mess/machine/thomson.c174
-rw-r--r--src/mess/machine/upd7002.c4
-rw-r--r--src/mess/machine/upd765.c2
-rw-r--r--src/mess/machine/z80ne.c10
-rw-r--r--src/mess/video/911_vdt.c6
-rw-r--r--src/mess/video/cirrus.c2
-rw-r--r--src/mess/video/vic4567.c10
-rw-r--r--src/mess/video/vic6567.c4
-rw-r--r--src/mess/video/vtvideo.c2
164 files changed, 1535 insertions, 1535 deletions
diff --git a/src/mame/audio/leland.c b/src/mame/audio/leland.c
index ad3ca46a23f..97aa48f69dc 100644
--- a/src/mame/audio/leland.c
+++ b/src/mame/audio/leland.c
@@ -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:
diff --git a/src/mame/audio/redalert.c b/src/mame/audio/redalert.c
index c819e3af37f..77d23f6de45 100644
--- a/src/mame/audio/redalert.c
+++ b/src/mame/audio/redalert.c
@@ -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)
{
diff --git a/src/mame/drivers/chihiro.c b/src/mame/drivers/chihiro.c
index 8039c356d3b..9813995cef5 100644
--- a/src/mame/drivers/chihiro.c
+++ b/src/mame/drivers/chihiro.c
@@ -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);
}
diff --git a/src/mame/drivers/chinagat.c b/src/mame/drivers/chinagat.c
index f1debbd27dd..2d4e2a6b946 100644
--- a/src/mame/drivers/chinagat.c
+++ b/src/mame/drivers/chinagat.c
@@ -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)
diff --git a/src/mame/drivers/ddenlovr.c b/src/mame/drivers/ddenlovr.c
index f02a8ee485e..4c6448fa14a 100644
--- a/src/mame/drivers/ddenlovr.c
+++ b/src/mame/drivers/ddenlovr.c
@@ -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;
}
diff --git a/src/mame/drivers/dlair.c b/src/mame/drivers/dlair.c
index 2499adb6927..342068dc9e0 100644
--- a/src/mame/drivers/dlair.c
+++ b/src/mame/drivers/dlair.c
@@ -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();
diff --git a/src/mame/drivers/esripsys.c b/src/mame/drivers/esripsys.c
index cbb911da7e0..e434690585d 100644
--- a/src/mame/drivers/esripsys.c
+++ b/src/mame/drivers/esripsys.c
@@ -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)
diff --git a/src/mame/drivers/ghosteo.c b/src/mame/drivers/ghosteo.c
index 5946687e037..2f7bf4d3329 100644
--- a/src/mame/drivers/ghosteo.c
+++ b/src/mame/drivers/ghosteo.c
@@ -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
diff --git a/src/mame/drivers/m10.c b/src/mame/drivers/m10.c
index 5e2267bfa86..ba349914e44 100644
--- a/src/mame/drivers/m10.c
+++ b/src/mame/drivers/m10.c
@@ -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));
diff --git a/src/mame/drivers/mpu4vid.c b/src/mame/drivers/mpu4vid.c
index 608a5993ec4..c150b01ed38 100644
--- a/src/mame/drivers/mpu4vid.c
+++ b/src/mame/drivers/mpu4vid.c
@@ -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();
diff --git a/src/mame/drivers/mquake.c b/src/mame/drivers/mquake.c
index f9eb15297cf..e32e38e3f78 100644
--- a/src/mame/drivers/mquake.c
+++ b/src/mame/drivers/mquake.c
@@ -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);
}
diff --git a/src/mame/drivers/nyny.c b/src/mame/drivers/nyny.c
index a8dc2f6d7a4..5c0ed682a31 100644
--- a/src/mame/drivers/nyny.c
+++ b/src/mame/drivers/nyny.c
@@ -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);
}
diff --git a/src/mame/drivers/othello.c b/src/mame/drivers/othello.c
index f6a652e6630..c0f363fe3db 100644
--- a/src/mame/drivers/othello.c
+++ b/src/mame/drivers/othello.c
@@ -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 */
diff --git a/src/mame/drivers/powerbal.c b/src/mame/drivers/powerbal.c
index 65ec5da9895..5d265ecc178 100644
--- a/src/mame/drivers/powerbal.c
+++ b/src/mame/drivers/powerbal.c
@@ -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);
}
}
diff --git a/src/mame/drivers/proconn.c b/src/mame/drivers/proconn.c
index 726d547c2f1..b3828f11069 100644
--- a/src/mame/drivers/proconn.c
+++ b/src/mame/drivers/proconn.c
@@ -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)
diff --git a/src/mame/drivers/r2dtank.c b/src/mame/drivers/r2dtank.c
index 1fc471f30cc..de0934f5145 100644
--- a/src/mame/drivers/r2dtank.c
+++ b/src/mame/drivers/r2dtank.c
@@ -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;
}
diff --git a/src/mame/drivers/segac2.c b/src/mame/drivers/segac2.c
index a6b4bd04fc9..f9f2653585c 100644
--- a/src/mame/drivers/segac2.c
+++ b/src/mame/drivers/segac2.c
@@ -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)
diff --git a/src/mame/drivers/segas16a.c b/src/mame/drivers/segas16a.c
index d94ef490623..1199bb28386 100644
--- a/src/mame/drivers/segas16a.c
+++ b/src/mame/drivers/segas16a.c
@@ -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);
}
diff --git a/src/mame/drivers/spiders.c b/src/mame/drivers/spiders.c
index 0b4421acff2..c897199a361 100644
--- a/src/mame/drivers/spiders.c
+++ b/src/mame/drivers/spiders.c
@@ -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);
}
diff --git a/src/mame/drivers/topspeed.c b/src/mame/drivers/topspeed.c
index ada448adf9d..4ac798490b8 100644
--- a/src/mame/drivers/topspeed.c
+++ b/src/mame/drivers/topspeed.c
@@ -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);
}
diff --git a/src/mame/drivers/trvquest.c b/src/mame/drivers/trvquest.c
index b1b6d0f5a4f..6d1f69571ae 100644
--- a/src/mame/drivers/trvquest.c
+++ b/src/mame/drivers/trvquest.c
@@ -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 )
diff --git a/src/mame/machine/atari.c b/src/mame/machine/atari.c
index de5fd60e30d..4d954e77894 100644
--- a/src/mame/machine/atari.c
+++ b/src/mame/machine/atari.c
@@ -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); }
diff --git a/src/mame/machine/beezer.c b/src/mame/machine/beezer.c
index 8701ae2c655..e149fe278c1 100644
--- a/src/mame/machine/beezer.c
+++ b/src/mame/machine/beezer.c
@@ -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);
}
diff --git a/src/mame/machine/carpolo.c b/src/mame/machine/carpolo.c
index 7ef216990b8..cc05f0597e5 100644
--- a/src/mame/machine/carpolo.c
+++ b/src/mame/machine/carpolo.c
@@ -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)
diff --git a/src/mame/machine/dc.c b/src/mame/machine/dc.c
index dcf934f063c..e4ed6077eec 100644
--- a/src/mame/machine/dc.c
+++ b/src/mame/machine/dc.c
@@ -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);
}
}
diff --git a/src/mame/machine/konppc.c b/src/mame/machine/konppc.c
index e953b33fac8..4ba560c7aca 100644
--- a/src/mame/machine/konppc.c
+++ b/src/mame/machine/konppc.c
@@ -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)
{
diff --git a/src/mame/machine/leland.c b/src/mame/machine/leland.c
index 5cfc8ab501c..968233d2084 100644
--- a/src/mame/machine/leland.c
+++ b/src/mame/machine/leland.c
@@ -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());
}
diff --git a/src/mame/machine/mcr68.c b/src/mame/machine/mcr68.c
index b2c00d2df9b..d99e4039efe 100644
--- a/src/mame/machine/mcr68.c
+++ b/src/mame/machine/mcr68.c
@@ -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;
}
diff --git a/src/mame/machine/megadriv.c b/src/mame/machine/megadriv.c
index a32b4a896d6..3b0798b7d77 100644
--- a/src/mame/machine/megadriv.c
+++ b/src/mame/machine/megadriv.c
@@ -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());
}
}
diff --git a/src/mame/machine/n64.c b/src/mame/machine/n64.c
index be42a00bc1e..1eac18e4f35 100644
--- a/src/mame/machine/n64.c
+++ b/src/mame/machine/n64.c
@@ -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
diff --git a/src/mame/machine/namco06.c b/src/mame/machine/namco06.c
index b0844525f43..c98294ac84a 100644
--- a/src/mame/machine/namco06.c
+++ b/src/mame/machine/namco06.c
@@ -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;
diff --git a/src/mame/machine/namco50.c b/src/mame/machine/namco50.c
index f697358d837..e0734ef8e0f 100644
--- a/src/mame/machine/namco50.c
+++ b/src/mame/machine/namco50.c
@@ -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);
}
diff --git a/src/mame/machine/namco51.c b/src/mame/machine/namco51.c
index f9ef2ecf4c9..a7e837357bc 100644
--- a/src/mame/machine/namco51.c
+++ b/src/mame/machine/namco51.c
@@ -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
diff --git a/src/mame/machine/pcshare.c b/src/mame/machine/pcshare.c
index a296dd7fa76..80dfc6526db 100644
--- a/src/mame/machine/pcshare.c
+++ b/src/mame/machine/pcshare.c
@@ -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;
}
diff --git a/src/mame/machine/qix.c b/src/mame/machine/qix.c
index bb8d7620600..24a8d6dc2f2 100644
--- a/src/mame/machine/qix.c
+++ b/src/mame/machine/qix.c
@@ -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();
}
diff --git a/src/mame/machine/scramble.c b/src/mame/machine/scramble.c
index f66181fd00a..a670f09fd16 100644
--- a/src/mame/machine/scramble.c
+++ b/src/mame/machine/scramble.c
@@ -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;
}
}
diff --git a/src/mame/machine/stfight.c b/src/mame/machine/stfight.c
index cdde2c09594..364276c86db 100644
--- a/src/mame/machine/stfight.c
+++ b/src/mame/machine/stfight.c
@@ -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];
diff --git a/src/mame/machine/taitoio.c b/src/mame/machine/taitoio.c
index 6e8298933ed..aaf9f885560 100644
--- a/src/mame/machine/taitoio.c
+++ b/src/mame/machine/taitoio.c
@@ -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:
diff --git a/src/mame/machine/vectrex.c b/src/mame/machine/vectrex.c
index 4cbc9a615cd..ee0be96add4 100644
--- a/src/mame/machine/vectrex.c
+++ b/src/mame/machine/vectrex.c
@@ -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);
}
diff --git a/src/mame/machine/williams.c b/src/mame/machine/williams.c
index 6af1dce7aaa..8b911b72b59 100644
--- a/src/mame/machine/williams.c
+++ b/src/mame/machine/williams.c
@@ -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);
}
diff --git a/src/mame/video/deco16ic.c b/src/mame/video/deco16ic.c
index 1044e81abc2..67b512c851f 100644
--- a/src/mame/video/deco16ic.c
+++ b/src/mame/video/deco16ic.c
@@ -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]);
}
diff --git a/src/mame/video/decocomn.c b/src/mame/video/decocomn.c
index 242d94c88ef..319c221febc 100644
--- a/src/mame/video/decocomn.c
+++ b/src/mame/video/decocomn.c
@@ -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));
}
}
}
diff --git a/src/mame/video/gameplan.c b/src/mame/video/gameplan.c
index 7d78a5b65b2..af2ab8fac1f 100644
--- a/src/mame/video/gameplan.c
+++ b/src/mame/video/gameplan.c
@@ -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;
}
diff --git a/src/mame/video/gp9001.c b/src/mame/video/gp9001.c
index 71174c2260e..fa1929c3f89 100644
--- a/src/mame/video/gp9001.c
+++ b/src/mame/video/gp9001.c
@@ -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 )
diff --git a/src/mame/video/hanaawas.c b/src/mame/video/hanaawas.c
index 8fac834b6ae..04bbb91b7f5 100644
--- a/src/mame/video/hanaawas.c
+++ b/src/mame/video/hanaawas.c
@@ -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();
}
}
diff --git a/src/mame/video/homerun.c b/src/mame/video/homerun.c
index 91b60f06e0f..13bd9874fb2 100644
--- a/src/mame/video/homerun.c
+++ b/src/mame/video/homerun.c
@@ -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: ?
diff --git a/src/mame/video/konicdev.c b/src/mame/video/konicdev.c
index d6999235212..309f345e23f 100644
--- a/src/mame/video/konicdev.c
+++ b/src/mame/video/konicdev.c
@@ -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 )
diff --git a/src/mame/video/leland.c b/src/mame/video/leland.c
index cd470585804..25c4a1f3a39 100644
--- a/src/mame/video/leland.c
+++ b/src/mame/video/leland.c
@@ -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;
}
diff --git a/src/mame/video/phoenix.c b/src/mame/video/phoenix.c
index 90c1f2c3455..a15cdecd34c 100644
--- a/src/mame/video/phoenix.c
+++ b/src/mame/video/phoenix.c
@@ -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;
}
diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c
index 0c62bc00129..b636d23a907 100644
--- a/src/mame/video/qix.c
+++ b/src/mame/video/qix.c
@@ -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;
}
diff --git a/src/mame/video/system1.c b/src/mame/video/system1.c
index 4565f3f591f..030d40d4e85 100644
--- a/src/mame/video/system1.c
+++ b/src/mame/video/system1.c
@@ -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;
}
diff --git a/src/mame/video/taitoic.c b/src/mame/video/taitoic.c
index 31b47171d65..f9b0aab80b8 100644
--- a/src/mame/video/taitoic.c
+++ b/src/mame/video/taitoic.c
@@ -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:
diff --git a/src/mame/video/vectrex.c b/src/mame/video/vectrex.c
index 1ff51a9224f..fd34ab2d759 100644
--- a/src/mame/video/vectrex.c
+++ b/src/mame/video/vectrex.c
@@ -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;
}
}
diff --git a/src/mame/video/xxmissio.c b/src/mame/video/xxmissio.c
index f66bbd49682..6dde20da060 100644
--- a/src/mame/video/xxmissio.c
+++ b/src/mame/video/xxmissio.c
@@ -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;
}
diff --git a/src/mess/audio/dave.c b/src/mess/audio/dave.c
index 66ac2059602..5edddc45b28 100644
--- a/src/mess/audio/dave.c
+++ b/src/mess/audio/dave.c
@@ -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;
diff --git a/src/mess/audio/mea8000.c b/src/mess/audio/mea8000.c
index fa5fa1ec350..390c60f46bd 100644
--- a/src/mess/audio/mea8000.c
+++ b/src/mess/audio/mea8000.c
@@ -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 );
}
}
diff --git a/src/mess/audio/svision.c b/src/mess/audio/svision.c
index 22ea0ae6ab0..3d87ae5793c 100644
--- a/src/mess/audio/svision.c
+++ b/src/mess/audio/svision.c
@@ -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;
diff --git a/src/mess/audio/wswan.c b/src/mess/audio/wswan.c
index 2f0631b0337..cf93c73bdb9 100644
--- a/src/mess/audio/wswan.c
+++ b/src/mess/audio/wswan.c
@@ -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;
diff --git a/src/mess/drivers/a2600.c b/src/mess/drivers/a2600.c
index 30cfb3e8a8f..b74dea81692 100644
--- a/src/mess/drivers/a2600.c
+++ b/src/mess/drivers/a2600.c
@@ -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 =
diff --git a/src/mess/drivers/ami1200.c b/src/mess/drivers/ami1200.c
index 4b489aecb9e..3435cd5ed41 100644
--- a/src/mess/drivers/ami1200.c
+++ b/src/mess/drivers/ami1200.c
@@ -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;
}
diff --git a/src/mess/drivers/amiga.c b/src/mess/drivers/amiga.c
index 147ca668f77..0bf9eb65303 100644
--- a/src/mess/drivers/amiga.c
+++ b/src/mess/drivers/amiga.c
@@ -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);
}
diff --git a/src/mess/drivers/apexc.c b/src/mess/drivers/apexc.c
index 27e94542ed3..09f5003f975 100644
--- a/src/mess/drivers/apexc.c
+++ b/src/mess/drivers/apexc.c
@@ -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 */
}
/*
diff --git a/src/mess/drivers/apollo.c b/src/mess/drivers/apollo.c
index 97f6b52526c..343002d9287 100644
--- a/src/mess/drivers/apollo.c
+++ b/src/mess/drivers/apollo.c
@@ -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);
}
}
diff --git a/src/mess/drivers/apple2.c b/src/mess/drivers/apple2.c
index 4cfb3d84112..7fc9fb8a9ef 100644
--- a/src/mess/drivers/apple2.c
+++ b/src/mess/drivers/apple2.c
@@ -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());
}
/***************************************************************************
diff --git a/src/mess/drivers/apple2gs.c b/src/mess/drivers/apple2gs.c
index 9fd8360c0aa..d7fa59e186e 100644
--- a/src/mess/drivers/apple2gs.c
+++ b/src/mess/drivers/apple2gs.c
@@ -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 =
diff --git a/src/mess/drivers/atari400.c b/src/mess/drivers/atari400.c
index 47d1d619d62..aea208dac36 100644
--- a/src/mess/drivers/atari400.c
+++ b/src/mess/drivers/atari400.c
@@ -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 =
diff --git a/src/mess/drivers/bml3.c b/src/mess/drivers/bml3.c
index 8a40aa2b409..8ce509f35c7 100644
--- a/src/mess/drivers/bml3.c
+++ b/src/mess/drivers/bml3.c
@@ -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);
diff --git a/src/mess/drivers/dectalk.c b/src/mess/drivers/dectalk.c
index 84b4094f8fd..7454083f8c6 100644
--- a/src/mess/drivers/dectalk.c
+++ b/src/mess/drivers/dectalk.c
@@ -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 )
diff --git a/src/mess/drivers/digel804.c b/src/mess/drivers/digel804.c
index 792477b1795..47d5fe0b086 100644
--- a/src/mess/drivers/digel804.c
+++ b/src/mess/drivers/digel804.c
@@ -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);
}
diff --git a/src/mess/drivers/dm7000.c b/src/mess/drivers/dm7000.c
index 0c4a2f38de5..6093c7569d8 100644
--- a/src/mess/drivers/dm7000.c
+++ b/src/mess/drivers/dm7000.c
@@ -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;
}
diff --git a/src/mess/drivers/einstein.c b/src/mess/drivers/einstein.c
index 7dd4cc01937..b6c514b23e6 100644
--- a/src/mess/drivers/einstein.c
+++ b/src/mess/drivers/einstein.c
@@ -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));
diff --git a/src/mess/drivers/elwro800.c b/src/mess/drivers/elwro800.c
index 61471a95116..428d9d2201e 100644
--- a/src/mess/drivers/elwro800.c
+++ b/src/mess/drivers/elwro800.c
@@ -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);
}
diff --git a/src/mess/drivers/enterp.c b/src/mess/drivers/enterp.c
index b718fb2d18f..ad36f8b2ceb 100644
--- a/src/mess/drivers/enterp.c
+++ b/src/mess/drivers/enterp.c
@@ -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)
{
diff --git a/src/mess/drivers/fidelz80.c b/src/mess/drivers/fidelz80.c
index 555f0e69366..8095c6d8ab3 100644
--- a/src/mess/drivers/fidelz80.c
+++ b/src/mess/drivers/fidelz80.c
@@ -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;
diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c
index c5dfe1e0aaa..974b75e1680 100644
--- a/src/mess/drivers/fm7.c
+++ b/src/mess/drivers/fm7.c
@@ -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)
diff --git a/src/mess/drivers/fmtowns.c b/src/mess/drivers/fmtowns.c
index 83ada1d37bd..069bece6227 100644
--- a/src/mess/drivers/fmtowns.c
+++ b/src/mess/drivers/fmtowns.c
@@ -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);
}
diff --git a/src/mess/drivers/jr100.c b/src/mess/drivers/jr100.c
index e140030143a..f3d62c16430 100644
--- a/src/mess/drivers/jr100.c
+++ b/src/mess/drivers/jr100.c
@@ -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;
}
diff --git a/src/mess/drivers/juicebox.c b/src/mess/drivers/juicebox.c
index 1cce3acbd56..76335cc5929 100644
--- a/src/mess/drivers/juicebox.c
+++ b/src/mess/drivers/juicebox.c
@@ -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);
}
diff --git a/src/mess/drivers/mini2440.c b/src/mess/drivers/mini2440.c
index 5d5dde797b0..f161b685140 100644
--- a/src/mess/drivers/mini2440.c
+++ b/src/mess/drivers/mini2440.c
@@ -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;
}
diff --git a/src/mess/drivers/mirage.c b/src/mess/drivers/mirage.c
index 144c6f528c8..7e2d739ff57 100644
--- a/src/mess/drivers/mirage.c
+++ b/src/mess/drivers/mirage.c
@@ -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;
diff --git a/src/mess/drivers/ms0515.c b/src/mess/drivers/ms0515.c
index 69050349877..4ef5924f249 100644
--- a/src/mess/drivers/ms0515.c
+++ b/src/mess/drivers/ms0515.c
@@ -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 )
diff --git a/src/mess/drivers/mycom.c b/src/mess/drivers/mycom.c
index a13e39ae837..73c2be71043 100644
--- a/src/mess/drivers/mycom.c
+++ b/src/mess/drivers/mycom.c
@@ -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);
diff --git a/src/mess/drivers/mz2000.c b/src/mess/drivers/mz2000.c
index 78be141a360..313856b3763 100644
--- a/src/mess/drivers/mz2000.c
+++ b/src/mess/drivers/mz2000.c
@@ -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;
}
diff --git a/src/mess/drivers/mz2500.c b/src/mess/drivers/mz2500.c
index 88da6555839..9f945293e2d 100644
--- a/src/mess/drivers/mz2500.c
+++ b/src/mess/drivers/mz2500.c
@@ -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)
diff --git a/src/mess/drivers/nanos.c b/src/mess/drivers/nanos.c
index 06c9493dada..af5b9cbf630 100644
--- a/src/mess/drivers/nanos.c
+++ b/src/mess/drivers/nanos.c
@@ -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());
}
}
diff --git a/src/mess/drivers/osbexec.c b/src/mess/drivers/osbexec.c
index 7b05635aef2..beea7d061c0 100644
--- a/src/mess/drivers/osbexec.c
+++ b/src/mess/drivers/osbexec.c
@@ -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;
diff --git a/src/mess/drivers/p8k.c b/src/mess/drivers/p8k.c
index e60c46226f6..51c7381624d 100644
--- a/src/mess/drivers/p8k.c
+++ b/src/mess/drivers/p8k.c
@@ -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 )
diff --git a/src/mess/drivers/palm.c b/src/mess/drivers/palm.c
index 2a3b975342d..10e144e841f 100644
--- a/src/mess/drivers/palm.c
+++ b/src/mess/drivers/palm.c
@@ -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 );
}
diff --git a/src/mess/drivers/palmz22.c b/src/mess/drivers/palmz22.c
index e11e934ab5f..6376d9001af 100644
--- a/src/mess/drivers/palmz22.c
+++ b/src/mess/drivers/palmz22.c
@@ -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;
}
diff --git a/src/mess/drivers/pc8801.c b/src/mess/drivers/pc8801.c
index c84bd1cdef8..cd45bcdabce 100644
--- a/src/mess/drivers/pc8801.c
+++ b/src/mess/drivers/pc8801.c
@@ -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(); }
diff --git a/src/mess/drivers/pc88va.c b/src/mess/drivers/pc88va.c
index 84b44d883d4..2fc235369f2 100644
--- a/src/mess/drivers/pc88va.c
+++ b/src/mess/drivers/pc88va.c
@@ -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;
}
diff --git a/src/mess/drivers/pc9801.c b/src/mess/drivers/pc9801.c
index 3d2ff84e4a7..7f70ce08eab 100644
--- a/src/mess/drivers/pc9801.c
+++ b/src/mess/drivers/pc9801.c
@@ -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 )
diff --git a/src/mess/drivers/pes.c b/src/mess/drivers/pes.c
index beaf7c8dda9..dd6626eb48b 100644
--- a/src/mess/drivers/pes.c
+++ b/src/mess/drivers/pes.c
@@ -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 )
diff --git a/src/mess/drivers/pk8000.c b/src/mess/drivers/pk8000.c
index 4ccb94e2e43..d0ff985aacc 100644
--- a/src/mess/drivers/pk8000.c
+++ b/src/mess/drivers/pk8000.c
@@ -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 )
diff --git a/src/mess/drivers/portfoli.c b/src/mess/drivers/portfoli.c
index c5a0e9869b8..cc174efa0ab 100644
--- a/src/mess/drivers/portfoli.c
+++ b/src/mess/drivers/portfoli.c
@@ -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;
}
diff --git a/src/mess/drivers/samcoupe.c b/src/mess/drivers/samcoupe.c
index 282c6fe589d..ee0f700d36c 100644
--- a/src/mess/drivers/samcoupe.c
+++ b/src/mess/drivers/samcoupe.c
@@ -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);
}
diff --git a/src/mess/drivers/sgi_ip2.c b/src/mess/drivers/sgi_ip2.c
index 22ffda25fec..4d41927bc90 100644
--- a/src/mess/drivers/sgi_ip2.c
+++ b/src/mess/drivers/sgi_ip2.c
@@ -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 )
diff --git a/src/mess/drivers/spc1000.c b/src/mess/drivers/spc1000.c
index b2834eead53..a90725db65d 100644
--- a/src/mess/drivers/spc1000.c
+++ b/src/mess/drivers/spc1000.c
@@ -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
diff --git a/src/mess/drivers/ssystem3.c b/src/mess/drivers/ssystem3.c
index 367ede0f39e..b51589b8c75 100644
--- a/src/mess/drivers/ssystem3.c
+++ b/src/mess/drivers/ssystem3.c
@@ -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;
diff --git a/src/mess/drivers/v1050.c b/src/mess/drivers/v1050.c
index fcc9d5a35bb..f7f0c48ec0d 100644
--- a/src/mess/drivers/v1050.c
+++ b/src/mess/drivers/v1050.c
@@ -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;
diff --git a/src/mess/drivers/vtech1.c b/src/mess/drivers/vtech1.c
index 71322afad10..a42fed806b7 100644
--- a/src/mess/drivers/vtech1.c
+++ b/src/mess/drivers/vtech1.c
@@ -482,14 +482,14 @@ static const floppy_interface vtech1_floppy_interface =
static READ8_DEVICE_HANDLER( vtech1_printer_r )
{
- centronics_device *centronics = device->machine().device<centronics_device>("centronics");
+ centronics_device *centronics = space.machine().device<centronics_device>("centronics");
return 0xfe | centronics->busy_r();
}
/* TODO: figure out how this really works */
static WRITE8_DEVICE_HANDLER( vtech1_strobe_w )
{
- centronics_device *centronics = device->machine().device<centronics_device>("centronics");
+ centronics_device *centronics = space.machine().device<centronics_device>("centronics");
centronics->strobe_w(TRUE);
centronics->strobe_w(FALSE);
}
@@ -613,7 +613,7 @@ WRITE8_MEMBER(vtech1_state::vtech1_video_bank_w)
static READ8_DEVICE_HANDLER( vtech1_mc6847_videoram_r )
{
- vtech1_state *vtech1 = device->machine().driver_data<vtech1_state>();
+ vtech1_state *vtech1 = space.machine().driver_data<vtech1_state>();
if (offset == ~0) return 0xff;
vtech1->m_mc6847->inv_w(BIT(vtech1->m_videoram[offset], 6));
vtech1->m_mc6847->as_w(BIT(vtech1->m_videoram[offset], 7));
diff --git a/src/mess/drivers/x68k.c b/src/mess/drivers/x68k.c
index a2d4537f91c..73df7848ddc 100644
--- a/src/mess/drivers/x68k.c
+++ b/src/mess/drivers/x68k.c
@@ -868,8 +868,8 @@ static UINT8 xpd1lr_r(device_t* device, int port)
// Judging from the XM6 source code, PPI ports A and B are joystick inputs
static READ8_DEVICE_HANDLER( ppi_port_a_r )
{
- x68k_state *state = device->machine().driver_data<x68k_state>();
- int ctrl = device->machine().root_device().ioport("ctrltype")->read() & 0x0f;
+ x68k_state *state = space.machine().driver_data<x68k_state>();
+ int ctrl = space.machine().root_device().ioport("ctrltype")->read() & 0x0f;
switch(ctrl)
{
@@ -891,8 +891,8 @@ static READ8_DEVICE_HANDLER( ppi_port_a_r )
static READ8_DEVICE_HANDLER( ppi_port_b_r )
{
- x68k_state *state = device->machine().driver_data<x68k_state>();
- int ctrl = device->machine().root_device().ioport("ctrltype")->read() & 0xf0;
+ x68k_state *state = space.machine().driver_data<x68k_state>();
+ int ctrl = space.machine().root_device().ioport("ctrltype")->read() & 0xf0;
switch(ctrl)
{
@@ -914,7 +914,7 @@ static READ8_DEVICE_HANDLER( ppi_port_b_r )
static READ8_DEVICE_HANDLER( ppi_port_c_r )
{
- x68k_state *state = device->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
return state->m_ppi_port[2];
}
@@ -928,16 +928,16 @@ static READ8_DEVICE_HANDLER( ppi_port_c_r )
*/
static WRITE8_DEVICE_HANDLER( ppi_port_c_w )
{
- x68k_state *state = device->machine().driver_data<x68k_state>();
+ x68k_state *state = space.machine().driver_data<x68k_state>();
// ADPCM / Joystick control
- device_t *oki = device->machine().device("okim6258");
+ device_t *oki = space.machine().device("okim6258");
state->m_ppi_port[2] = data;
if((data & 0x0f) != (state->m_ppi_prev & 0x0f))
{
state->m_adpcm.pan = data & 0x03;
state->m_adpcm.rate = data & 0x0c;
- x68k_set_adpcm(device->machine());
+ x68k_set_adpcm(space.machine());
okim6258_set_divider(oki, (data >> 2) & 3);
}
@@ -947,7 +947,7 @@ static WRITE8_DEVICE_HANDLER( ppi_port_c_w )
if((state->m_ppi_prev & 0x10) == 0x00 && (data & 0x10) == 0x10)
{
state->m_mdctrl.seq1++;
- state->m_mdctrl.io_timeout1->adjust(device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(8192));
+ state->m_mdctrl.io_timeout1->adjust(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(8192));
}
state->m_joy.joy2_enable = data & 0x20;
@@ -955,7 +955,7 @@ static WRITE8_DEVICE_HANDLER( ppi_port_c_w )
if((state->m_ppi_prev & 0x20) == 0x00 && (data & 0x20) == 0x20)
{
state->m_mdctrl.seq2++;
- state->m_mdctrl.io_timeout2->adjust(device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(8192));
+ state->m_mdctrl.io_timeout2->adjust(space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(8192));
}
state->m_ppi_prev = data;
@@ -1141,16 +1141,16 @@ static READ16_HANDLER( x68k_fm_r )
static WRITE8_DEVICE_HANDLER( x68k_ct_w )
{
- x68k_state *state = device->machine().driver_data<x68k_state>();
- device_t *fdc = device->machine().device("upd72065");
- device_t *okim = device->machine().device("okim6258");
+ x68k_state *state = space.machine().driver_data<x68k_state>();
+ device_t *fdc = space.machine().device("upd72065");
+ device_t *okim = space.machine().device("okim6258");
// CT1 and CT2 bits from YM2151 port 0x1b
// CT1 - ADPCM clock - 0 = 8MHz, 1 = 4MHz
// CT2 - 1 = Set ready state of FDC
upd765_ready_w(fdc,data & 0x01);
state->m_adpcm.clock = data & 0x02;
- x68k_set_adpcm(device->machine());
+ x68k_set_adpcm(space.machine());
okim6258_set_clock(okim, data & 0x02 ? 4000000 : 8000000);
}
diff --git a/src/mess/drivers/xor100.c b/src/mess/drivers/xor100.c
index 34a9330e8af..4705b3cf9a9 100644
--- a/src/mess/drivers/xor100.c
+++ b/src/mess/drivers/xor100.c
@@ -417,7 +417,7 @@ static const i8251_interface terminal_8251_intf =
static READ8_DEVICE_HANDLER( i8255_pc_r )
{
- centronics_device *centronics = device->machine().device<centronics_device>("centronics");
+ centronics_device *centronics = space.machine().device<centronics_device>("centronics");
/*
bit description
diff --git a/src/mess/machine/a7800.c b/src/mess/machine/a7800.c
index 8909e827ef3..c5a6c02a710 100644
--- a/src/mess/machine/a7800.c
+++ b/src/mess/machine/a7800.c
@@ -40,17 +40,17 @@
static READ8_DEVICE_HANDLER( riot_joystick_r )
{
- return device->machine().root_device().ioport("joysticks")->read();
+ return space.machine().root_device().ioport("joysticks")->read();
}
static READ8_DEVICE_HANDLER( riot_console_button_r )
{
- return device->machine().root_device().ioport("console_buttons")->read();
+ return space.machine().root_device().ioport("console_buttons")->read();
}
static WRITE8_DEVICE_HANDLER( riot_button_pullup_w )
{
- a7800_state *state = device->machine().driver_data<a7800_state>();
+ a7800_state *state = space.machine().driver_data<a7800_state>();
state->m_p1_one_button = data & 0x04; // pin 6 of the controller port is held high by the riot chip when reading two-button controllers (from schematic)
state->m_p2_one_button = data & 0x10;
}
diff --git a/src/mess/machine/ac1.c b/src/mess/machine/ac1.c
index c193ce9cdb7..44826d279b1 100644
--- a/src/mess/machine/ac1.c
+++ b/src/mess/machine/ac1.c
@@ -13,7 +13,7 @@
static READ8_DEVICE_HANDLER (ac1_port_b_r)
{
- ac1_state *state = device->machine().driver_data<ac1_state>();
+ ac1_state *state = space.machine().driver_data<ac1_state>();
UINT8 data = 0x7f;
if (state->m_cassette->input() > 0.03)
@@ -26,13 +26,13 @@ static READ8_DEVICE_HANDLER (ac1_port_b_r)
static READ8_DEVICE_HANDLER (ac1_port_a_r)
{
- UINT8 line0 = device->machine().root_device().ioport("LINE0")->read();
- UINT8 line1 = device->machine().root_device().ioport("LINE1")->read();
- UINT8 line2 = device->machine().root_device().ioport("LINE2")->read();
- UINT8 line3 = device->machine().root_device().ioport("LINE3")->read();
- UINT8 line4 = device->machine().root_device().ioport("LINE4")->read();
- UINT8 line5 = device->machine().root_device().ioport("LINE5")->read();
- UINT8 line6 = device->machine().root_device().ioport("LINE6")->read();
+ UINT8 line0 = space.machine().root_device().ioport("LINE0")->read();
+ UINT8 line1 = space.machine().root_device().ioport("LINE1")->read();
+ UINT8 line2 = space.machine().root_device().ioport("LINE2")->read();
+ UINT8 line3 = space.machine().root_device().ioport("LINE3")->read();
+ UINT8 line4 = space.machine().root_device().ioport("LINE4")->read();
+ UINT8 line5 = space.machine().root_device().ioport("LINE5")->read();
+ UINT8 line6 = space.machine().root_device().ioport("LINE6")->read();
UINT8 SH = BNOT(BIT(line6,0));
UINT8 CTRL = BNOT(BIT(line6,1));
@@ -94,7 +94,7 @@ static WRITE8_DEVICE_HANDLER (ac1_port_b_w)
7 cassette in
*/
- ac1_state *state = device->machine().driver_data<ac1_state>();
+ ac1_state *state = space.machine().driver_data<ac1_state>();
state->m_cassette->output((data & 0x40) ? -1.0 : +1.0);
}
diff --git a/src/mess/machine/amstrad.c b/src/mess/machine/amstrad.c
index 22ed66eb021..8a6066b441d 100644
--- a/src/mess/machine/amstrad.c
+++ b/src/mess/machine/amstrad.c
@@ -2508,17 +2508,17 @@ static void update_psg(running_machine &machine)
/* Read/Write 8255 PPI port A (connected to AY-3-8912 databus) */
READ8_DEVICE_HANDLER ( amstrad_ppi_porta_r )
{
- amstrad_state *state = device->machine().driver_data<amstrad_state>();
- update_psg(device->machine());
+ amstrad_state *state = space.machine().driver_data<amstrad_state>();
+ update_psg(space.machine());
return state->m_ppi_port_inputs[amstrad_ppi_PortA];
}
WRITE8_DEVICE_HANDLER ( amstrad_ppi_porta_w )
{
- amstrad_state *state = device->machine().driver_data<amstrad_state>();
+ amstrad_state *state = space.machine().driver_data<amstrad_state>();
state->m_ppi_port_outputs[amstrad_ppi_PortA] = data;
- update_psg(device->machine());
+ update_psg(space.machine());
}
@@ -2550,7 +2550,7 @@ Note:
READ8_DEVICE_HANDLER (amstrad_ppi_portb_r)
{
- amstrad_state *state = device->machine().driver_data<amstrad_state>();
+ amstrad_state *state = space.machine().driver_data<amstrad_state>();
int data = 0;
/* Set b7 with cassette tape input */
if(state->m_system_type != SYSTEM_GX4000)
@@ -2582,7 +2582,7 @@ READ8_DEVICE_HANDLER (amstrad_ppi_portb_r)
logerror("amstrad_ppi_portb_r\n");
/* Schedule a write to PC2 */
- device->machine().scheduler().timer_set( attotime::zero, FUNC(amstrad_pc2_low));
+ space.machine().scheduler().timer_set( attotime::zero, FUNC(amstrad_pc2_low));
return data;
}
@@ -2604,7 +2604,7 @@ Bit Description Usage
WRITE8_DEVICE_HANDLER ( amstrad_ppi_portc_w )
{
- amstrad_state *state = device->machine().driver_data<amstrad_state>();
+ amstrad_state *state = space.machine().driver_data<amstrad_state>();
int changed_data;
state->m_previous_ppi_portc_w = state->m_ppi_port_outputs[amstrad_ppi_PortC];
@@ -2620,7 +2620,7 @@ WRITE8_DEVICE_HANDLER ( amstrad_ppi_portc_w )
state->m_aleste_rtc_function = data & 0x07;
/* Perform PSG function */
- update_psg(device->machine());
+ update_psg(space.machine());
/* b5 Cassette Write data */
if(state->m_system_type != SYSTEM_GX4000)
diff --git a/src/mess/machine/apollo.c b/src/mess/machine/apollo.c
index 5c081ba6069..a30c2660b0c 100644
--- a/src/mess/machine/apollo.c
+++ b/src/mess/machine/apollo.c
@@ -507,7 +507,7 @@ WRITE8_MEMBER(apollo_state::apollo_dma_write_word){
static READ8_DEVICE_HANDLER( apollo_dma8237_ctape_dack_r ) {
- UINT8 data = sc499_dack_r(&device->machine());
+ UINT8 data = sc499_dack_r(&space.machine());
DLOG2(("dma ctape dack read %02x",data));
// hack for DN3000: select appropriate DMA channel No.
@@ -518,7 +518,7 @@ static READ8_DEVICE_HANDLER( apollo_dma8237_ctape_dack_r ) {
static WRITE8_DEVICE_HANDLER( apollo_dma8237_ctape_dack_w ) {
DLOG2(("dma ctape dack write %02x", data));
- sc499_dack_w(&device->machine(), data);
+ sc499_dack_w(&space.machine(), data);
// hack for DN3000: select appropriate DMA channel No.
// Note: too late for this byte, but next bytes will be ok
@@ -526,7 +526,7 @@ static WRITE8_DEVICE_HANDLER( apollo_dma8237_ctape_dack_w ) {
}
static READ8_DEVICE_HANDLER( apollo_dma8237_fdc_dack_r ) {
- UINT8 data = pc_fdc_dack_r(device->machine(), space);
+ UINT8 data = pc_fdc_dack_r(space.machine(), space);
// DLOG2(("dma fdc dack read %02x",data));
// hack for DN3000: select appropriate DMA channel No.
@@ -537,7 +537,7 @@ static READ8_DEVICE_HANDLER( apollo_dma8237_fdc_dack_r ) {
static WRITE8_DEVICE_HANDLER( apollo_dma8237_fdc_dack_w ) {
// DLOG2(("dma fdc dack write %02x", data));
- pc_fdc_dack_w(device->machine(), space, data);
+ pc_fdc_dack_w(space.machine(), space, data);
// hack for DN3000: select appropriate DMA channel No.
// Note: too late for this byte, but next bytes will be ok
diff --git a/src/mess/machine/apple1.c b/src/mess/machine/apple1.c
index 1655f14fb0b..f6424e3042f 100644
--- a/src/mess/machine/apple1.c
+++ b/src/mess/machine/apple1.c
@@ -384,7 +384,7 @@ static TIMER_CALLBACK(apple1_kbd_strobe_end)
*****************************************************************************/
static READ8_DEVICE_HANDLER( apple1_pia0_kbdin )
{
- apple1_state *state = device->machine().driver_data<apple1_state>();
+ apple1_state *state = space.machine().driver_data<apple1_state>();
/* Bit 7 of the keyboard input is permanently wired high. This is
what the ROM Monitor software expects. */
return state->m_kbd_data | 0x80;
@@ -393,7 +393,7 @@ static READ8_DEVICE_HANDLER( apple1_pia0_kbdin )
static WRITE8_DEVICE_HANDLER( apple1_pia0_dspout )
{
/* Send an ASCII character to the video hardware. */
- apple1_vh_dsp_w(device->machine(), data);
+ apple1_vh_dsp_w(space.machine(), data);
}
static WRITE8_DEVICE_HANDLER( apple1_pia0_dsp_write_signal )
@@ -413,7 +413,7 @@ static WRITE8_DEVICE_HANDLER( apple1_pia0_dsp_write_signal )
write. Thus the write delay depends on the cursor position and
where the display is in the refresh cycle. */
if (!data)
- device->machine().scheduler().timer_set(apple1_vh_dsp_time_to_ready(device->machine()), FUNC(apple1_dsp_ready_start));
+ space.machine().scheduler().timer_set(apple1_vh_dsp_time_to_ready(space.machine()), FUNC(apple1_dsp_ready_start));
}
static TIMER_CALLBACK(apple1_dsp_ready_start)
diff --git a/src/mess/machine/apple3.c b/src/mess/machine/apple3.c
index 8e6a0624e37..c4fe506b411 100644
--- a/src/mess/machine/apple3.c
+++ b/src/mess/machine/apple3.c
@@ -472,26 +472,26 @@ static READ8_DEVICE_HANDLER(apple3_via_1_in_b) { return ~0; }
static WRITE8_DEVICE_HANDLER(apple3_via_0_out_a)
{
- apple3_state *state = device->machine().driver_data<apple3_state>();
- apple3_via_out(device->machine(), &state->m_via_0_a, data);
+ apple3_state *state = space.machine().driver_data<apple3_state>();
+ apple3_via_out(space.machine(), &state->m_via_0_a, data);
}
static WRITE8_DEVICE_HANDLER(apple3_via_0_out_b)
{
- apple3_state *state = device->machine().driver_data<apple3_state>();
- apple3_via_out(device->machine(), &state->m_via_0_b, data);
+ apple3_state *state = space.machine().driver_data<apple3_state>();
+ apple3_via_out(space.machine(), &state->m_via_0_b, data);
}
static WRITE8_DEVICE_HANDLER(apple3_via_1_out_a)
{
- apple3_state *state = device->machine().driver_data<apple3_state>();
- apple3_via_out(device->machine(), &state->m_via_1_a, data);
+ apple3_state *state = space.machine().driver_data<apple3_state>();
+ apple3_via_out(space.machine(), &state->m_via_1_a, data);
}
static WRITE8_DEVICE_HANDLER(apple3_via_1_out_b)
{
- apple3_state *state = device->machine().driver_data<apple3_state>();
- apple3_via_out(device->machine(), &state->m_via_1_b, data);
+ apple3_state *state = space.machine().driver_data<apple3_state>();
+ apple3_via_out(space.machine(), &state->m_via_1_b, data);
}
static void apple2_via_1_irq_func(device_t *device, int state)
diff --git a/src/mess/machine/atarifdc.c b/src/mess/machine/atarifdc.c
index d165a45e963..fa4ebdd9588 100644
--- a/src/mess/machine/atarifdc.c
+++ b/src/mess/machine/atarifdc.c
@@ -702,7 +702,7 @@ READ8_DEVICE_HANDLER ( atari_serin_r )
if (fdc->serin_count)
{
- pokey_device *pokey = device->machine().device<pokey_device>("pokey");
+ pokey_device *pokey = space.machine().device<pokey_device>("pokey");
data = fdc->serin_buff[fdc->serin_offs];
ser_delay = 2 * 40;
@@ -727,7 +727,7 @@ READ8_DEVICE_HANDLER ( atari_serin_r )
WRITE8_DEVICE_HANDLER ( atari_serout_w )
{
- pia6821_device *pia = device->machine().device<pia6821_device>( "pia" );
+ pia6821_device *pia = space.machine().device<pia6821_device>( "pia" );
atari_fdc_t *fdc = get_safe_token(device);
/* ignore serial commands if no floppy image is specified */
diff --git a/src/mess/machine/b2m.c b/src/mess/machine/b2m.c
index d08e49c7b25..8be772535b2 100644
--- a/src/mess/machine/b2m.c
+++ b/src/mess/machine/b2m.c
@@ -172,27 +172,27 @@ const struct pit8253_config b2m_pit8253_intf =
static WRITE8_DEVICE_HANDLER (b2m_8255_porta_w )
{
- b2m_state *state = device->machine().driver_data<b2m_state>();
+ b2m_state *state = space.machine().driver_data<b2m_state>();
state->m_b2m_8255_porta = data;
}
static WRITE8_DEVICE_HANDLER (b2m_8255_portb_w )
{
- b2m_state *state = device->machine().driver_data<b2m_state>();
+ b2m_state *state = space.machine().driver_data<b2m_state>();
state->m_b2m_video_scroll = data;
}
static WRITE8_DEVICE_HANDLER (b2m_8255_portc_w )
{
- b2m_state *state = device->machine().driver_data<b2m_state>();
+ b2m_state *state = space.machine().driver_data<b2m_state>();
state->m_b2m_8255_portc = data;
- b2m_set_bank(device->machine(), state->m_b2m_8255_portc & 7);
+ b2m_set_bank(space.machine(), state->m_b2m_8255_portc & 7);
state->m_b2m_video_page = (state->m_b2m_8255_portc >> 7) & 1;
}
static READ8_DEVICE_HANDLER (b2m_8255_portb_r )
{
- b2m_state *state = device->machine().driver_data<b2m_state>();
+ b2m_state *state = space.machine().driver_data<b2m_state>();
return state->m_b2m_video_scroll;
}
@@ -212,20 +212,20 @@ static WRITE8_DEVICE_HANDLER (b2m_ext_8255_portc_w )
{
UINT8 drive = ((data >> 1) & 1) ^ 1;
UINT8 side = (data & 1) ^ 1;
- b2m_state *state = device->machine().driver_data<b2m_state>();
- floppy_mon_w(floppy_get_device(device->machine(), 0), 1);
- floppy_mon_w(floppy_get_device(device->machine(), 1), 1);
+ b2m_state *state = space.machine().driver_data<b2m_state>();
+ floppy_mon_w(floppy_get_device(space.machine(), 0), 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 1), 1);
if (state->m_b2m_drive!=drive) {
wd17xx_set_drive(state->m_fdc,drive);
- floppy_mon_w(floppy_get_device(device->machine(), 0), 0);
- floppy_drive_set_ready_state(floppy_get_device(device->machine(), 0), 1, 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 0), 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), 1, 1);
state->m_b2m_drive = drive;
}
if (state->m_b2m_side!=side) {
wd17xx_set_side(state->m_fdc,side);
- floppy_mon_w(floppy_get_device(device->machine(), 1), 0);
- floppy_drive_set_ready_state(floppy_get_device(device->machine(), 1), 1, 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 1), 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 1), 1, 1);
state->m_b2m_side = side;
}
wd17xx_dden_w(state->m_fdc, 0);
@@ -243,7 +243,7 @@ I8255A_INTERFACE( b2m_ppi8255_interface_2 )
static READ8_DEVICE_HANDLER (b2m_romdisk_porta_r )
{
- b2m_state *state = device->machine().driver_data<b2m_state>();
+ b2m_state *state = space.machine().driver_data<b2m_state>();
UINT8 *romdisk = state->memregion("maincpu")->base() + 0x12000;
return romdisk[state->m_b2m_romdisk_msb*256+state->m_b2m_romdisk_lsb];
@@ -251,13 +251,13 @@ static READ8_DEVICE_HANDLER (b2m_romdisk_porta_r )
static WRITE8_DEVICE_HANDLER (b2m_romdisk_portb_w )
{
- b2m_state *state = device->machine().driver_data<b2m_state>();
+ b2m_state *state = space.machine().driver_data<b2m_state>();
state->m_b2m_romdisk_lsb = data;
}
static WRITE8_DEVICE_HANDLER (b2m_romdisk_portc_w )
{
- b2m_state *state = device->machine().driver_data<b2m_state>();
+ b2m_state *state = space.machine().driver_data<b2m_state>();
state->m_b2m_romdisk_msb = data & 0x7f;
}
diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c
index c053f3c0da3..d692a118179 100644
--- a/src/mess/machine/bbc.c
+++ b/src/mess/machine/bbc.c
@@ -908,7 +908,7 @@ static void MC146818_set(address_space &space)
static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_porta )
{
- bbc_state *state = device->machine().driver_data<bbc_state>();
+ bbc_state *state = space.machine().driver_data<bbc_state>();
//logerror("SYSTEM write porta %d\n",data);
state->m_via_system_porta = data;
@@ -928,7 +928,7 @@ static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_porta )
static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_portb )
{
- bbc_state *state = device->machine().driver_data<bbc_state>();
+ bbc_state *state = space.machine().driver_data<bbc_state>();
int bit, value;
bit = data & 0x07;
value = (data >> 3) & 0x01;
@@ -1127,7 +1127,7 @@ static WRITE8_DEVICE_HANDLER( bbcb_via_system_write_portb )
static READ8_DEVICE_HANDLER( bbcb_via_system_read_porta )
{
- bbc_state *state = device->machine().driver_data<bbc_state>();
+ bbc_state *state = space.machine().driver_data<bbc_state>();
//logerror("SYSTEM read porta %d\n",state->m_via_system_porta);
return state->m_via_system_porta;
}
@@ -1158,7 +1158,7 @@ static READ8_DEVICE_HANDLER( bbcb_via_system_read_portb )
//logerror("SYSTEM read portb %d\n",0xf | input_port(machine, "IN0")|(TMSint<<6)|(TMSrdy<<7));
- return (0xf | device->machine().root_device().ioport("IN0")->read()|(TMSint<<6)|(TMSrdy<<7));
+ return (0xf | space.machine().root_device().ioport("IN0")->read()|(TMSint<<6)|(TMSrdy<<7));
}
@@ -1172,7 +1172,7 @@ static READ8_DEVICE_HANDLER( bbcb_via_system_read_ca1 )
/* joystick EOC */
static READ8_DEVICE_HANDLER( bbcb_via_system_read_cb1 )
{
- return uPD7002_EOC_r(device->machine().device("upd7002"),space,0);
+ return uPD7002_EOC_r(space.machine().device("upd7002"),space,0);
}
@@ -1233,7 +1233,7 @@ static READ8_DEVICE_HANDLER( bbcb_via_user_read_portb )
static WRITE8_DEVICE_HANDLER( bbcb_via_user_write_portb )
{
- bbc_state *state = device->machine().driver_data<bbc_state>();
+ bbc_state *state = space.machine().driver_data<bbc_state>();
state->m_userport = data;
}
diff --git a/src/mess/machine/bebox.c b/src/mess/machine/bebox.c
index b9497bfe137..0dc6f6b5428 100644
--- a/src/mess/machine/bebox.c
+++ b/src/mess/machine/bebox.c
@@ -481,7 +481,7 @@ static WRITE_LINE_DEVICE_HANDLER( bebox_pic8259_slave_set_int_line )
static READ8_DEVICE_HANDLER( get_slave_ack )
{
- bebox_state *state = device->machine().driver_data<bebox_state>();
+ bebox_state *state = space.machine().driver_data<bebox_state>();
if (offset==2) { // IRQ = 2
return pic8259_acknowledge(state->m_devices.pic8259_slave);
}
@@ -696,12 +696,12 @@ static WRITE8_HANDLER( bebox_dma_write_byte )
static READ8_DEVICE_HANDLER( bebox_dma8237_fdc_dack_r ) {
- return pc_fdc_dack_r(device->machine(),space);
+ return pc_fdc_dack_r(space.machine(),space);
}
static WRITE8_DEVICE_HANDLER( bebox_dma8237_fdc_dack_w ) {
- pc_fdc_dack_w( device->machine(), space, data );
+ pc_fdc_dack_w( space.machine(), space, data );
}
diff --git a/src/mess/machine/c64.c b/src/mess/machine/c64.c
index 2e97e6dbeab..f6f61639cb6 100644
--- a/src/mess/machine/c64.c
+++ b/src/mess/machine/c64.c
@@ -80,21 +80,21 @@ static void c64_nmi( running_machine &machine )
static READ8_DEVICE_HANDLER( c64_cia0_port_a_r )
{
- UINT8 cia0portb = mos6526_pb_r(device->machine().device("cia_0"), space, 0);
+ UINT8 cia0portb = mos6526_pb_r(space.machine().device("cia_0"), space, 0);
return cbm_common_cia0_port_a_r(device, cia0portb);
}
static READ8_DEVICE_HANDLER( c64_cia0_port_b_r )
{
- UINT8 cia0porta = mos6526_pa_r(device->machine().device("cia_0"), space, 0);
+ UINT8 cia0porta = mos6526_pa_r(space.machine().device("cia_0"), space, 0);
return cbm_common_cia0_port_b_r(device, cia0porta);
}
static WRITE8_DEVICE_HANDLER( c64_cia0_port_b_w )
{
- device_t *vic2 = device->machine().device("vic2");
+ device_t *vic2 = space.machine().device("vic2");
vic2_lightpen_write(vic2, data & 0x10);
}
@@ -177,7 +177,7 @@ const mos6526_interface c64_pal_cia0 =
*/
static READ8_DEVICE_HANDLER( c64_cia1_port_a_r )
{
- legacy_c64_state *state = device->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
UINT8 value = 0xff;
@@ -192,7 +192,7 @@ static READ8_DEVICE_HANDLER( c64_cia1_port_a_r )
static WRITE8_DEVICE_HANDLER( c64_cia1_port_a_w )
{
- legacy_c64_state *state = device->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
static const int helper[4] = {0xc000, 0x8000, 0x4000, 0x0000};
state->m_iec->clk_w(!(data & 0x10));
@@ -545,7 +545,7 @@ static void c64_bankswitch( running_machine &machine, int reset )
WRITE8_DEVICE_HANDLER(c64_m6510_port_write)
{
- legacy_c64_state *state = device->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
UINT8 direction = offset; // HACK ALERT!
@@ -568,26 +568,26 @@ WRITE8_DEVICE_HANDLER(c64_m6510_port_write)
{
if (direction & 0x08)
{
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x08) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x08) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
}
if (direction & 0x20)
{
if(!(data & 0x20))
{
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
state->m_datasette_timer->adjust(attotime::zero, 0, attotime::from_hz(44100));
}
else
{
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
state->m_datasette_timer->reset();
}
}
}
if (!state->m_ultimax)
- c64_bankswitch(device->machine(), 0);
+ c64_bankswitch(space.machine(), 0);
state->m_memory[0x000] = device->memory().space(AS_PROGRAM).read_byte(0);
state->m_memory[0x001] = device->memory().space(AS_PROGRAM).read_byte(1);
@@ -596,12 +596,12 @@ WRITE8_DEVICE_HANDLER(c64_m6510_port_write)
READ8_DEVICE_HANDLER(c64_m6510_port_read)
{
- legacy_c64_state *state = device->machine().driver_data<legacy_c64_state>();
+ legacy_c64_state *state = space.machine().driver_data<legacy_c64_state>();
UINT8 data = state->m_port_data;
if (state->m_tape_on)
{
- if ((device->machine().device<cassette_image_device>(CASSETTE_TAG)->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED)
+ if ((space.machine().device<cassette_image_device>(CASSETTE_TAG)->get_state() & CASSETTE_MASK_UISTATE) != CASSETTE_STOPPED)
data &= ~0x10;
else
data |= 0x10;
diff --git a/src/mess/machine/c65.c b/src/mess/machine/c65.c
index 5bc2b010348..78c1d29a41e 100644
--- a/src/mess/machine/c65.c
+++ b/src/mess/machine/c65.c
@@ -72,16 +72,16 @@ static void c65_nmi( running_machine &machine )
static READ8_DEVICE_HANDLER( c65_cia0_port_a_r )
{
- UINT8 cia0portb = mos6526_pb_r(device->machine().device("cia_0"), space, 0);
+ UINT8 cia0portb = mos6526_pb_r(space.machine().device("cia_0"), space, 0);
return cbm_common_cia0_port_a_r(device, cia0portb);
}
static READ8_DEVICE_HANDLER( c65_cia0_port_b_r )
{
- c65_state *state = device->machine().driver_data<c65_state>();
+ c65_state *state = space.machine().driver_data<c65_state>();
UINT8 value = 0xff;
- UINT8 cia0porta = mos6526_pa_r(device->machine().device("cia_0"), space, 0);
+ UINT8 cia0porta = mos6526_pa_r(space.machine().device("cia_0"), space, 0);
value &= cbm_common_cia0_port_b_r(device, cia0porta);
@@ -94,7 +94,7 @@ static READ8_DEVICE_HANDLER( c65_cia0_port_b_r )
static WRITE8_DEVICE_HANDLER( c65_cia0_port_b_w )
{
// was there lightpen support in c65 video chip?
-// device_t *vic3 = device->machine().device("vic3");
+// device_t *vic3 = space.machine().device("vic3");
// vic3_lightpen_write(vic3, data & 0x10);
}
@@ -167,7 +167,7 @@ const mos6526_interface c65_cia0 =
*/
static READ8_DEVICE_HANDLER( c65_cia1_port_a_r )
{
- c65_state *state = device->machine().driver_data<c65_state>();
+ c65_state *state = space.machine().driver_data<c65_state>();
UINT8 value = 0xff;
if (!state->m_iec->clk_r())
@@ -181,7 +181,7 @@ static READ8_DEVICE_HANDLER( c65_cia1_port_a_r )
static WRITE8_DEVICE_HANDLER( c65_cia1_port_a_w )
{
- c65_state *state = device->machine().driver_data<c65_state>();
+ c65_state *state = space.machine().driver_data<c65_state>();
static const int helper[4] = {0xc000, 0x8000, 0x4000, 0x0000};
state->m_iec->atn_w(!BIT(data, 3));
diff --git a/src/mess/machine/cbmb.c b/src/mess/machine/cbmb.c
index d8f9576e352..dead30b4a59 100644
--- a/src/mess/machine/cbmb.c
+++ b/src/mess/machine/cbmb.c
@@ -59,7 +59,7 @@ static TIMER_CALLBACK( cbmb_frame_interrupt );
*/
READ8_DEVICE_HANDLER( cbmb_tpi0_port_a_r )
{
- cbmb_state *state = device->machine().driver_data<cbmb_state>();
+ cbmb_state *state = space.machine().driver_data<cbmb_state>();
UINT8 data = 0;
if (state->m_ieee->nrfd_r())
@@ -85,7 +85,7 @@ READ8_DEVICE_HANDLER( cbmb_tpi0_port_a_r )
WRITE8_DEVICE_HANDLER( cbmb_tpi0_port_a_w )
{
- cbmb_state *state = device->machine().driver_data<cbmb_state>();
+ cbmb_state *state = space.machine().driver_data<cbmb_state>();
state->m_ieee->nrfd_w(BIT(data, 7));
state->m_ieee->ndac_w(BIT(data, 6));
@@ -97,7 +97,7 @@ WRITE8_DEVICE_HANDLER( cbmb_tpi0_port_a_w )
READ8_DEVICE_HANDLER( cbmb_tpi0_port_b_r )
{
- cbmb_state *state = device->machine().driver_data<cbmb_state>();
+ cbmb_state *state = space.machine().driver_data<cbmb_state>();
UINT8 data = 0;
if (state->m_ieee->srq_r())
@@ -111,7 +111,7 @@ READ8_DEVICE_HANDLER( cbmb_tpi0_port_b_r )
WRITE8_DEVICE_HANDLER( cbmb_tpi0_port_b_w )
{
- cbmb_state *state = device->machine().driver_data<cbmb_state>();
+ cbmb_state *state = space.machine().driver_data<cbmb_state>();
state->m_ieee->srq_w(BIT(data, 1));
state->m_ieee->ifc_w(BIT(data, 0));
@@ -131,40 +131,40 @@ WRITE8_DEVICE_HANDLER( cbmb_tpi0_port_b_w )
port a7..a0 b7..b0 keyboard input */
WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_a )
{
- cbmb_state *state = device->machine().driver_data<cbmb_state>();
+ cbmb_state *state = space.machine().driver_data<cbmb_state>();
state->m_keyline_a = data;
}
WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_b )
{
- cbmb_state *state = device->machine().driver_data<cbmb_state>();
+ cbmb_state *state = space.machine().driver_data<cbmb_state>();
state->m_keyline_b = data;
}
WRITE8_DEVICE_HANDLER( cbmb_keyboard_line_select_c )
{
- cbmb_state *state = device->machine().driver_data<cbmb_state>();
+ cbmb_state *state = space.machine().driver_data<cbmb_state>();
state->m_keyline_c = data;
}
READ8_DEVICE_HANDLER( cbmb_keyboard_line_a )
{
- cbmb_state *state = device->machine().driver_data<cbmb_state>();
+ cbmb_state *state = space.machine().driver_data<cbmb_state>();
int data = 0;
if (!(state->m_keyline_c & 0x01))
- data |= device->machine().root_device().ioport("ROW0")->read();
+ data |= space.machine().root_device().ioport("ROW0")->read();
if (!(state->m_keyline_c & 0x02))
- data |= device->machine().root_device().ioport("ROW2")->read();
+ data |= space.machine().root_device().ioport("ROW2")->read();
if (!(state->m_keyline_c & 0x04))
- data |= device->machine().root_device().ioport("ROW4")->read();
+ data |= space.machine().root_device().ioport("ROW4")->read();
if (!(state->m_keyline_c & 0x08))
- data |= device->machine().root_device().ioport("ROW6")->read();
+ data |= space.machine().root_device().ioport("ROW6")->read();
if (!(state->m_keyline_c & 0x10))
- data |= device->machine().root_device().ioport("ROW8")->read();
+ data |= space.machine().root_device().ioport("ROW8")->read();
if (!(state->m_keyline_c & 0x20))
data |= state->ioport("ROW10")->read();
@@ -174,22 +174,22 @@ READ8_DEVICE_HANDLER( cbmb_keyboard_line_a )
READ8_DEVICE_HANDLER( cbmb_keyboard_line_b )
{
- cbmb_state *state = device->machine().driver_data<cbmb_state>();
+ cbmb_state *state = space.machine().driver_data<cbmb_state>();
int data = 0;
if (!(state->m_keyline_c & 0x01))
- data |= device->machine().root_device().ioport("ROW1")->read();
+ data |= space.machine().root_device().ioport("ROW1")->read();
if (!(state->m_keyline_c & 0x02))
- data |= device->machine().root_device().ioport("ROW3")->read();
+ data |= space.machine().root_device().ioport("ROW3")->read();
if (!(state->m_keyline_c & 0x04))
- data |= device->machine().root_device().ioport("ROW5")->read();
+ data |= space.machine().root_device().ioport("ROW5")->read();
if (!(state->m_keyline_c & 0x08))
- data |= device->machine().root_device().ioport("ROW7")->read();
+ data |= space.machine().root_device().ioport("ROW7")->read();
if (!(state->m_keyline_c & 0x10))
- data |= device->machine().root_device().ioport("ROW9")->read() | ((device->machine().root_device().ioport("SPECIAL")->read() & 0x04) ? 1 : 0 );
+ data |= space.machine().root_device().ioport("ROW9")->read() | ((space.machine().root_device().ioport("SPECIAL")->read() & 0x04) ? 1 : 0 );
if (!(state->m_keyline_c & 0x20))
data |= state->ioport("ROW11")->read();
@@ -200,28 +200,28 @@ READ8_DEVICE_HANDLER( cbmb_keyboard_line_b )
READ8_DEVICE_HANDLER( cbmb_keyboard_line_c )
{
int data = 0;
- cbmb_state *state = device->machine().driver_data<cbmb_state>();
- if ((device->machine().root_device().ioport("ROW0")->read() & ~state->m_keyline_a) ||
- (device->machine().root_device().ioport("ROW1")->read() & ~state->m_keyline_b))
+ cbmb_state *state = space.machine().driver_data<cbmb_state>();
+ if ((space.machine().root_device().ioport("ROW0")->read() & ~state->m_keyline_a) ||
+ (space.machine().root_device().ioport("ROW1")->read() & ~state->m_keyline_b))
data |= 0x01;
- if ((device->machine().root_device().ioport("ROW2")->read() & ~state->m_keyline_a) ||
- (device->machine().root_device().ioport("ROW3")->read() & ~state->m_keyline_b))
+ if ((space.machine().root_device().ioport("ROW2")->read() & ~state->m_keyline_a) ||
+ (space.machine().root_device().ioport("ROW3")->read() & ~state->m_keyline_b))
data |= 0x02;
- if ((device->machine().root_device().ioport("ROW4")->read() & ~state->m_keyline_a) ||
- (device->machine().root_device().ioport("ROW5")->read() & ~state->m_keyline_b))
+ if ((space.machine().root_device().ioport("ROW4")->read() & ~state->m_keyline_a) ||
+ (space.machine().root_device().ioport("ROW5")->read() & ~state->m_keyline_b))
data |= 0x04;
- if ((device->machine().root_device().ioport("ROW6")->read() & ~state->m_keyline_a) ||
- (device->machine().root_device().ioport("ROW7")->read() & ~state->m_keyline_b))
+ if ((space.machine().root_device().ioport("ROW6")->read() & ~state->m_keyline_a) ||
+ (space.machine().root_device().ioport("ROW7")->read() & ~state->m_keyline_b))
data |= 0x08;
- if ((device->machine().root_device().ioport("ROW8")->read() & ~state->m_keyline_a) ||
- ((device->machine().root_device().ioport("ROW9")->read() | ((device->machine().root_device().ioport("SPECIAL")->read() & 0x04) ? 1 : 0)) & ~state->m_keyline_b))
+ if ((space.machine().root_device().ioport("ROW8")->read() & ~state->m_keyline_a) ||
+ ((space.machine().root_device().ioport("ROW9")->read() | ((space.machine().root_device().ioport("SPECIAL")->read() & 0x04) ? 1 : 0)) & ~state->m_keyline_b))
data |= 0x10;
- if ((device->machine().root_device().ioport("ROW10")->read() & ~state->m_keyline_a) ||
+ if ((space.machine().root_device().ioport("ROW10")->read() & ~state->m_keyline_a) ||
(state->ioport("ROW11")->read() & ~state->m_keyline_b))
data |= 0x20;
diff --git a/src/mess/machine/cgenie.c b/src/mess/machine/cgenie.c
index 346ed50a2ce..e0d5cd76770 100644
--- a/src/mess/machine/cgenie.c
+++ b/src/mess/machine/cgenie.c
@@ -604,13 +604,13 @@ INTERRUPT_GEN_MEMBER(cgenie_state::cgenie_frame_interrupt)
READ8_DEVICE_HANDLER( cgenie_sh_control_port_r )
{
- cgenie_state *state = device->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
return state->m_control_port;
}
WRITE8_DEVICE_HANDLER( cgenie_sh_control_port_w )
{
- cgenie_state *state = device->machine().driver_data<cgenie_state>();
+ cgenie_state *state = space.machine().driver_data<cgenie_state>();
state->m_control_port = data;
ay8910_address_w(device, space, offset, data);
}
diff --git a/src/mess/machine/concept.c b/src/mess/machine/concept.c
index 60fce3e425a..b81d2db1f4f 100644
--- a/src/mess/machine/concept.c
+++ b/src/mess/machine/concept.c
@@ -223,7 +223,7 @@ static READ8_DEVICE_HANDLER(via_in_b)
{
UINT8 status;
- status = ((device->machine().root_device().ioport("DSW0")->read() & 0x80) >> 1) | ((device->machine().root_device().ioport("DSW0")->read() & 0x40) << 1);
+ status = ((space.machine().root_device().ioport("DSW0")->read() & 0x80) >> 1) | ((space.machine().root_device().ioport("DSW0")->read() & 0x40) << 1);
LOG(("via_in_b: VIA port B (DIP switches, Video, Comm Rate) - status: 0x%2.2x\n", status));
return status;
}
diff --git a/src/mess/machine/dgn_beta.c b/src/mess/machine/dgn_beta.c
index 286b1066663..8a787415be6 100644
--- a/src/mess/machine/dgn_beta.c
+++ b/src/mess/machine/dgn_beta.c
@@ -565,7 +565,7 @@ static WRITE8_DEVICE_HANDLER(d_pia0_pa_w)
static READ8_DEVICE_HANDLER(d_pia0_pb_r)
{
- dgn_beta_state *state = device->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int RetVal;
int Idx;
int Selected;
@@ -586,7 +586,7 @@ static READ8_DEVICE_HANDLER(d_pia0_pb_r)
{
for(Idx=0; Idx<NoKeyrows; Idx++)
{
- state->m_Keyboard[Idx] = device->machine().root_device().ioport(keynames[Idx])->read();
+ state->m_Keyboard[Idx] = space.machine().root_device().ioport(keynames[Idx])->read();
if(state->m_Keyboard[Idx] != 0x7F)
state->m_KAny_next = 1;
@@ -607,7 +607,7 @@ static READ8_DEVICE_HANDLER(d_pia0_pb_r)
static WRITE8_DEVICE_HANDLER(d_pia0_pb_w)
{
- dgn_beta_state *state = device->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int InClkState;
//int OutClkState;
@@ -635,7 +635,7 @@ static WRITE8_DEVICE_HANDLER(d_pia0_pb_w)
static WRITE8_DEVICE_HANDLER(d_pia0_cb2_w)
{
- dgn_beta_state *state = device->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int RowNo;
LOG_KEYBOARD(("\nCB2 Write\n"));
@@ -650,7 +650,7 @@ static WRITE8_DEVICE_HANDLER(d_pia0_cb2_w)
state->m_RowShifter = (state->m_RowShifter<<1) | ((state->m_d_pia0_pb_last & KOutDat)>>4);
state->m_RowShifter &= 0x3FF;
LOG_KEYBOARD(("Rowshifter=$%02X Keyrow=$%02X\n",state->m_RowShifter,state->m_Keyrow));
- if (VERBOSE) debug_console_printf(device->machine(), "rowshifter clocked, value=%3X, RowNo=%d, Keyrow=%2X\n",state->m_RowShifter,RowNo,state->m_Keyrow);
+ if (VERBOSE) debug_console_printf(space.machine(), "rowshifter clocked, value=%3X, RowNo=%d, Keyrow=%2X\n",state->m_RowShifter,RowNo,state->m_Keyrow);
}
state->m_d_pia0_cb2_last=data;
@@ -684,9 +684,9 @@ static READ8_DEVICE_HANDLER(d_pia1_pa_r)
static WRITE8_DEVICE_HANDLER(d_pia1_pa_w)
{
- dgn_beta_state *state = device->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int HALT_DMA;
- device_t *fdc = device->machine().device(FDC_TAG);
+ device_t *fdc = space.machine().device(FDC_TAG);
/* Only play with halt line if halt bit changed since last write */
if((data & 0x80) != state->m_d_pia1_pa_last)
@@ -698,11 +698,11 @@ static WRITE8_DEVICE_HANDLER(d_pia1_pa_w)
HALT_DMA = CLEAR_LINE;
LOG_HALT(("DMA_CPU HALT=%d\n", HALT_DMA));
- device->machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_HALT, HALT_DMA);
+ space.machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_HALT, HALT_DMA);
/* CPU un-halted let it run ! */
if (HALT_DMA == CLEAR_LINE)
- device->machine().device(MAINCPU_TAG)->execute().yield();
+ space.machine().device(MAINCPU_TAG)->execute().yield();
state->m_d_pia1_pa_last = data & 0x80;
}
@@ -722,7 +722,7 @@ static READ8_DEVICE_HANDLER(d_pia1_pb_r)
static WRITE8_DEVICE_HANDLER(d_pia1_pb_w)
{
- dgn_beta_state *state = device->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int HALT_CPU;
/* Only play with halt line if halt bit changed since last write */
@@ -735,13 +735,13 @@ static WRITE8_DEVICE_HANDLER(d_pia1_pb_w)
HALT_CPU = ASSERT_LINE;
LOG_HALT(("MAIN_CPU HALT=%d\n", HALT_CPU));
- device->machine().device(MAINCPU_TAG)->execute().set_input_line(INPUT_LINE_HALT, HALT_CPU);
+ space.machine().device(MAINCPU_TAG)->execute().set_input_line(INPUT_LINE_HALT, HALT_CPU);
state->m_d_pia1_pb_last = data & 0x02;
/* CPU un-halted let it run ! */
if (HALT_CPU == CLEAR_LINE)
- device->machine().device(DMACPU_TAG)->execute().yield();
+ space.machine().device(DMACPU_TAG)->execute().yield();
}
}
@@ -771,7 +771,7 @@ static READ8_DEVICE_HANDLER(d_pia2_pa_r)
static WRITE8_DEVICE_HANDLER(d_pia2_pa_w)
{
- dgn_beta_state *state = device->machine().driver_data<dgn_beta_state>();
+ dgn_beta_state *state = space.machine().driver_data<dgn_beta_state>();
int OldTask;
int OldEnableMap;
int NMI;
@@ -787,13 +787,13 @@ static WRITE8_DEVICE_HANDLER(d_pia2_pa_w)
LOG_INTS(("cpu1 NMI : %d\n", NMI));
if(!NMI)
{
- device->machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
+ space.machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_NMI, ASSERT_LINE);
logerror("device_yield()\n");
- device->machine().device(DMACPU_TAG)->execute().yield(); /* Let DMA CPU run */
+ space.machine().device(DMACPU_TAG)->execute().yield(); /* Let DMA CPU run */
}
else
{
- device->machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
+ space.machine().device(DMACPU_TAG)->execute().set_input_line(INPUT_LINE_NMI, CLEAR_LINE);
}
state->m_DMA_NMI_LAST = NMI; /* Save it for next time */
@@ -821,7 +821,7 @@ static WRITE8_DEVICE_HANDLER(d_pia2_pa_w)
else
state->m_TaskReg = NoPagingTask;
- UpdateBanks(device->machine(), 0, IOPage + 1);
+ UpdateBanks(space.machine(), 0, IOPage + 1);
}
else
{
@@ -829,7 +829,7 @@ static WRITE8_DEVICE_HANDLER(d_pia2_pa_w)
if ((state->m_PIATaskReg != OldTask) && (state->m_EnableMapRegs))
{
state->m_TaskReg = state->m_PIATaskReg;
- UpdateBanks(device->machine(), 0, IOPage + 1);
+ UpdateBanks(space.machine(), 0, IOPage + 1);
}
}
LOG_TASK(("TaskReg=$%02X PIATaskReg=$%02X\n", state->m_TaskReg, state->m_PIATaskReg));
@@ -843,7 +843,7 @@ static READ8_DEVICE_HANDLER(d_pia2_pb_r)
static WRITE8_DEVICE_HANDLER(d_pia2_pb_w)
{
/* Update top video address lines */
- dgnbeta_vid_set_gctrl(device->machine(), data);
+ dgnbeta_vid_set_gctrl(space.machine(), data);
}
static WRITE_LINE_DEVICE_HANDLER( d_pia2_irq_a )
diff --git a/src/mess/machine/e05a03.c b/src/mess/machine/e05a03.c
index ff54a738634..ba5725311b0 100644
--- a/src/mess/machine/e05a03.c
+++ b/src/mess/machine/e05a03.c
@@ -117,7 +117,7 @@ WRITE8_DEVICE_HANDLER( e05a03_w )
{
e05a03_state *e05a03 = get_safe_token(device);
- logerror("%s: e05a03_w(%02x): %02x\n", device->machine().describe_context(), offset, data);
+ logerror("%s: e05a03_w(%02x): %02x\n", space.machine().describe_context(), offset, data);
switch (offset)
{
@@ -157,7 +157,7 @@ READ8_DEVICE_HANDLER( e05a03_r )
e05a03_state *e05a03 = get_safe_token(device);
UINT8 result = 0;
- logerror("%s: e05a03_r(%02x)\n", device->machine().describe_context(), offset);
+ logerror("%s: e05a03_r(%02x)\n", space.machine().describe_context(), offset);
switch (offset)
{
diff --git a/src/mess/machine/isa_fdc.c b/src/mess/machine/isa_fdc.c
index 32348cfee51..98664fb9d62 100644
--- a/src/mess/machine/isa_fdc.c
+++ b/src/mess/machine/isa_fdc.c
@@ -226,7 +226,7 @@ static WRITE8_DEVICE_HANDLER( pc_fdc_dor_w )
int selected_drive;
int floppy_count;
- floppy_count = floppy_get_count(device->machine());
+ floppy_count = floppy_get_count(space.machine());
if (floppy_count > (fdc->digital_output_register & 0x03))
floppy_drive_set_ready_state(get_floppy_subdevice(device, fdc->digital_output_register & 0x03), 1, 0);
@@ -359,7 +359,7 @@ static READ8_DEVICE_HANDLER ( pc_fdc_r )
data = upd765_data_r(fdc->m_upd765, space, offset);
break;
case 6: /* FDC reserved */
- hdd = device->machine().device(":board3:ide:ide");
+ hdd = space.machine().device(":board3:ide:ide");
if (hdd)
data = ide_controller16_r(hdd, space, 0x3f6/2, 0x00ff);
break;
@@ -371,7 +371,7 @@ static READ8_DEVICE_HANDLER ( pc_fdc_r )
}
if (LOG_FDC)
- logerror("pc_fdc_r(): pc=0x%08x offset=%d result=0x%02X\n", (unsigned) device->machine().firstcpu->pc(), offset, data);
+ logerror("pc_fdc_r(): pc=0x%08x offset=%d result=0x%02X\n", (unsigned) space.machine().firstcpu->pc(), offset, data);
return data;
}
@@ -382,8 +382,8 @@ static WRITE8_DEVICE_HANDLER ( pc_fdc_w )
isa8_fdc_device *fdc = downcast<isa8_fdc_device *>(device);
if (LOG_FDC)
- logerror("pc_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) device->machine().firstcpu->pc(), offset, data);
- pc_fdc_check_data_rate(fdc,device->machine()); // check every time a command may start
+ logerror("pc_fdc_w(): pc=0x%08x offset=%d data=0x%02X\n", (unsigned) space.machine().firstcpu->pc(), offset, data);
+ pc_fdc_check_data_rate(fdc,space.machine()); // check every time a command may start
device_t *hdd = NULL;
switch(offset)
@@ -405,7 +405,7 @@ static WRITE8_DEVICE_HANDLER ( pc_fdc_w )
break;
case 6:
/* FDC reserved */
- hdd = device->machine().device(":board3:ide:ide");
+ hdd = space.machine().device(":board3:ide:ide");
if (hdd)
ide_controller16_w(hdd, space, 0x3f6/2, data, 0x00ff);
break;
diff --git a/src/mess/machine/isa_hdc.c b/src/mess/machine/isa_hdc.c
index 17a72dd050b..3d0c82a7f64 100644
--- a/src/mess/machine/isa_hdc.c
+++ b/src/mess/machine/isa_hdc.c
@@ -796,7 +796,7 @@ static READ8_DEVICE_HANDLER(pc_HDC_r )
}
if (LOG_HDC_CALL)
- logerror("pc_HDC_r(): pc=%06X offs=%d result=0x%02x\n", device->machine().firstcpu->pc(), offset, data);
+ logerror("pc_HDC_r(): pc=%06X offs=%d result=0x%02x\n", space.machine().firstcpu->pc(), offset, data);
return data;
}
@@ -805,7 +805,7 @@ static WRITE8_DEVICE_HANDLER( pc_HDC_w )
{
isa8_hdc_device *hdc = downcast<isa8_hdc_device *>(device);
if (LOG_HDC_CALL)
- logerror("pc_HDC_w(): pc=%06X offs=%d data=0x%02x\n", device->machine().firstcpu->pc(), offset, data);
+ logerror("pc_HDC_w(): pc=%06X offs=%d data=0x%02x\n", space.machine().firstcpu->pc(), offset, data);
switch( offset )
{
diff --git a/src/mess/machine/kaypro.c b/src/mess/machine/kaypro.c
index 680fa288bf1..a60b37b77ff 100644
--- a/src/mess/machine/kaypro.c
+++ b/src/mess/machine/kaypro.c
@@ -242,13 +242,13 @@ READ8_DEVICE_HANDLER( kaypro_sio_r )
else
if (offset == 1)
// return z80sio_d_r(device, 1);
- return kay_kbd_d_r(device->machine());
+ return kay_kbd_d_r(space.machine());
else
if (offset == 2)
return dynamic_cast<z80sio_device*>(device)->control_read(0);
else
// return z80sio_c_r(device, 1);
- return kay_kbd_c_r(device->machine());
+ return kay_kbd_c_r(space.machine());
}
WRITE8_DEVICE_HANDLER( kaypro_sio_w )
@@ -258,7 +258,7 @@ WRITE8_DEVICE_HANDLER( kaypro_sio_w )
else
if (offset == 1)
// z80sio_d_w(device, 1, data);
- kay_kbd_d_w(device->machine(), data);
+ kay_kbd_d_w(space.machine(), data);
else
if (offset == 2)
dynamic_cast<z80sio_device*>(device)->control_write(0, data);
diff --git a/src/mess/machine/kramermc.c b/src/mess/machine/kramermc.c
index 039a32006ab..396d9018d38 100644
--- a/src/mess/machine/kramermc.c
+++ b/src/mess/machine/kramermc.c
@@ -19,15 +19,15 @@ static READ8_DEVICE_HANDLER (kramermc_port_a_r)
static READ8_DEVICE_HANDLER (kramermc_port_b_r)
{
- kramermc_state *state = device->machine().driver_data<kramermc_state>();
+ kramermc_state *state = space.machine().driver_data<kramermc_state>();
static const char *const keynames[] = { "LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7" };
- return device->machine().root_device().ioport(keynames[state->m_key_row])->read();
+ return space.machine().root_device().ioport(keynames[state->m_key_row])->read();
}
static WRITE8_DEVICE_HANDLER (kramermc_port_a_w)
{
- kramermc_state *state = device->machine().driver_data<kramermc_state>();
+ kramermc_state *state = space.machine().driver_data<kramermc_state>();
state->m_key_row = ((data >> 1) & 0x07);
}
diff --git a/src/mess/machine/lisa.c b/src/mess/machine/lisa.c
index 94390d474fc..47f93882f90 100644
--- a/src/mess/machine/lisa.c
+++ b/src/mess/machine/lisa.c
@@ -681,20 +681,20 @@ static void init_COPS(running_machine &machine)
*/
static WRITE8_DEVICE_HANDLER(COPS_via_out_a)
{
- lisa_state *state = device->machine().driver_data<lisa_state>();
+ lisa_state *state = space.machine().driver_data<lisa_state>();
// printf("VIA A = %02x\n", data);
state->m_COPS_command = data;
}
static WRITE8_DEVICE_HANDLER(COPS_via_out_ca2)
{
- lisa_state *state = device->machine().driver_data<lisa_state>();
+ lisa_state *state = space.machine().driver_data<lisa_state>();
state->m_hold_COPS_data = data;
/*logerror("COPS CA2 line state : %d\n", val);*/
/*logerror("COPS_via_out_ca2 : trying to send data to VIA\n");*/
- COPS_send_data_if_possible(device->machine());
+ COPS_send_data_if_possible(space.machine());
}
/*
@@ -713,7 +713,7 @@ static WRITE8_DEVICE_HANDLER(COPS_via_out_ca2)
*/
static READ8_DEVICE_HANDLER(COPS_via_in_b)
{
- lisa_state *state = device->machine().driver_data<lisa_state>();
+ lisa_state *state = space.machine().driver_data<lisa_state>();
int val = 0;
if (state->m_COPS_Ready)
@@ -727,8 +727,8 @@ static READ8_DEVICE_HANDLER(COPS_via_in_b)
static WRITE8_DEVICE_HANDLER(COPS_via_out_b)
{
- lisa_state *state = device->machine().driver_data<lisa_state>();
- via6522_device *via_0 = device->machine().device<via6522_device>("via6522_0");
+ lisa_state *state = space.machine().driver_data<lisa_state>();
+ via6522_device *via_0 = space.machine().device<via6522_device>("via6522_0");
/* pull-up */
data |= (~ via_0->read(space,VIA_DDRA)) & 0x01;
@@ -738,7 +738,7 @@ static WRITE8_DEVICE_HANDLER(COPS_via_out_b)
if (state->m_COPS_force_unplug)
{
state->m_COPS_force_unplug = 0;
- plug_keyboard(device->machine());
+ plug_keyboard(space.machine());
}
}
else
@@ -746,7 +746,7 @@ static WRITE8_DEVICE_HANDLER(COPS_via_out_b)
if (! state->m_COPS_force_unplug)
{
state->m_COPS_force_unplug = 1;
- unplug_keyboard(device->machine());
+ unplug_keyboard(space.machine());
//reset_COPS(state);
}
}
@@ -754,7 +754,7 @@ static WRITE8_DEVICE_HANDLER(COPS_via_out_b)
static WRITE8_DEVICE_HANDLER(COPS_via_out_cb2)
{
- device_t *speaker = device->machine().device(SPEAKER_TAG);
+ device_t *speaker = space.machine().device(SPEAKER_TAG);
speaker_level_w(speaker, data);
}
@@ -790,7 +790,7 @@ static void COPS_via_irq_func(device_t *device, int val)
*/
static READ8_DEVICE_HANDLER(parallel_via_in_b)
{
- lisa_state *state = device->machine().driver_data<lisa_state>();
+ lisa_state *state = space.machine().driver_data<lisa_state>();
int val = 0;
if (state->m_DISK_DIAG)
diff --git a/src/mess/machine/lviv.c b/src/mess/machine/lviv.c
index 371505cb78b..3bbb7f2f6f5 100644
--- a/src/mess/machine/lviv.c
+++ b/src/mess/machine/lviv.c
@@ -65,9 +65,9 @@ static READ8_DEVICE_HANDLER ( lviv_ppi_0_portb_r )
static READ8_DEVICE_HANDLER ( lviv_ppi_0_portc_r )
{
- lviv_state *state = device->machine().driver_data<lviv_state>();
+ lviv_state *state = space.machine().driver_data<lviv_state>();
UINT8 data = state->m_ppi_port_outputs[0][2] & 0x0f;
- if (device->machine().device<cassette_image_device>(CASSETTE_TAG)->input() > 0.038)
+ if (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input() > 0.038)
data |= 0x10;
if (state->m_ppi_port_outputs[0][0] & state->ioport("JOY")->read())
data |= 0x80;
@@ -76,26 +76,26 @@ static READ8_DEVICE_HANDLER ( lviv_ppi_0_portc_r )
static WRITE8_DEVICE_HANDLER ( lviv_ppi_0_porta_w )
{
- lviv_state *state = device->machine().driver_data<lviv_state>();
+ lviv_state *state = space.machine().driver_data<lviv_state>();
state->m_ppi_port_outputs[0][0] = data;
}
static WRITE8_DEVICE_HANDLER ( lviv_ppi_0_portb_w )
{
- lviv_state *state = device->machine().driver_data<lviv_state>();
+ lviv_state *state = space.machine().driver_data<lviv_state>();
state->m_ppi_port_outputs[0][1] = data;
- lviv_update_palette(device->machine(), data&0x7f);
+ lviv_update_palette(space.machine(), data&0x7f);
}
static WRITE8_DEVICE_HANDLER ( lviv_ppi_0_portc_w ) /* tape in/out, video memory on/off */
{
- lviv_state *state = device->machine().driver_data<lviv_state>();
- device_t *speaker = device->machine().device(SPEAKER_TAG);
+ lviv_state *state = space.machine().driver_data<lviv_state>();
+ device_t *speaker = space.machine().device(SPEAKER_TAG);
state->m_ppi_port_outputs[0][2] = data;
if (state->m_ppi_port_outputs[0][1]&0x80)
speaker_level_w(speaker, data&0x01);
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x01) ? -1.0 : 1.0);
- lviv_update_memory(device->machine());
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x01) ? -1.0 : 1.0);
+ lviv_update_memory(space.machine());
}
static READ8_DEVICE_HANDLER ( lviv_ppi_1_porta_r )
@@ -105,41 +105,41 @@ static READ8_DEVICE_HANDLER ( lviv_ppi_1_porta_r )
static READ8_DEVICE_HANDLER ( lviv_ppi_1_portb_r ) /* keyboard reading */
{
- lviv_state *state = device->machine().driver_data<lviv_state>();
- return ((state->m_ppi_port_outputs[1][0] & 0x01) ? 0xff : device->machine().root_device().ioport("KEY0")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x02) ? 0xff : device->machine().root_device().ioport("KEY1")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x04) ? 0xff : device->machine().root_device().ioport("KEY2")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x08) ? 0xff : device->machine().root_device().ioport("KEY3")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x10) ? 0xff : device->machine().root_device().ioport("KEY4")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x20) ? 0xff : device->machine().root_device().ioport("KEY5")->read()) &
- ((state->m_ppi_port_outputs[1][0] & 0x40) ? 0xff : device->machine().root_device().ioport("KEY6")->read()) &
+ lviv_state *state = space.machine().driver_data<lviv_state>();
+ return ((state->m_ppi_port_outputs[1][0] & 0x01) ? 0xff : space.machine().root_device().ioport("KEY0")->read()) &
+ ((state->m_ppi_port_outputs[1][0] & 0x02) ? 0xff : space.machine().root_device().ioport("KEY1")->read()) &
+ ((state->m_ppi_port_outputs[1][0] & 0x04) ? 0xff : space.machine().root_device().ioport("KEY2")->read()) &
+ ((state->m_ppi_port_outputs[1][0] & 0x08) ? 0xff : space.machine().root_device().ioport("KEY3")->read()) &
+ ((state->m_ppi_port_outputs[1][0] & 0x10) ? 0xff : space.machine().root_device().ioport("KEY4")->read()) &
+ ((state->m_ppi_port_outputs[1][0] & 0x20) ? 0xff : space.machine().root_device().ioport("KEY5")->read()) &
+ ((state->m_ppi_port_outputs[1][0] & 0x40) ? 0xff : space.machine().root_device().ioport("KEY6")->read()) &
((state->m_ppi_port_outputs[1][0] & 0x80) ? 0xff : state->ioport("KEY7")->read());
}
static READ8_DEVICE_HANDLER ( lviv_ppi_1_portc_r ) /* keyboard reading */
{
- lviv_state *state = device->machine().driver_data<lviv_state>();
- return ((state->m_ppi_port_outputs[1][2] & 0x01) ? 0xff : device->machine().root_device().ioport("KEY8")->read()) &
- ((state->m_ppi_port_outputs[1][2] & 0x02) ? 0xff : device->machine().root_device().ioport("KEY9" )->read()) &
- ((state->m_ppi_port_outputs[1][2] & 0x04) ? 0xff : device->machine().root_device().ioport("KEY10")->read()) &
+ lviv_state *state = space.machine().driver_data<lviv_state>();
+ return ((state->m_ppi_port_outputs[1][2] & 0x01) ? 0xff : space.machine().root_device().ioport("KEY8")->read()) &
+ ((state->m_ppi_port_outputs[1][2] & 0x02) ? 0xff : space.machine().root_device().ioport("KEY9" )->read()) &
+ ((state->m_ppi_port_outputs[1][2] & 0x04) ? 0xff : space.machine().root_device().ioport("KEY10")->read()) &
((state->m_ppi_port_outputs[1][2] & 0x08) ? 0xff : state->ioport("KEY11")->read());
}
static WRITE8_DEVICE_HANDLER ( lviv_ppi_1_porta_w ) /* kayboard scaning */
{
- lviv_state *state = device->machine().driver_data<lviv_state>();
+ lviv_state *state = space.machine().driver_data<lviv_state>();
state->m_ppi_port_outputs[1][0] = data;
}
static WRITE8_DEVICE_HANDLER ( lviv_ppi_1_portb_w )
{
- lviv_state *state = device->machine().driver_data<lviv_state>();
+ lviv_state *state = space.machine().driver_data<lviv_state>();
state->m_ppi_port_outputs[1][1] = data;
}
static WRITE8_DEVICE_HANDLER ( lviv_ppi_1_portc_w ) /* kayboard scaning */
{
- lviv_state *state = device->machine().driver_data<lviv_state>();
+ lviv_state *state = space.machine().driver_data<lviv_state>();
state->m_ppi_port_outputs[1][2] = data;
}
diff --git a/src/mess/machine/mac.c b/src/mess/machine/mac.c
index 1bc818aa4cc..c8be804ce16 100644
--- a/src/mess/machine/mac.c
+++ b/src/mess/machine/mac.c
@@ -738,14 +738,14 @@ static void kbd_shift_out(running_machine &machine, int data)
static WRITE8_DEVICE_HANDLER(mac_via_out_cb2)
{
- mac_state *mac = device->machine().driver_data<mac_state>();
+ mac_state *mac = space.machine().driver_data<mac_state>();
if (mac->m_kbd_comm == FALSE && data == 0)
{
/* Mac pulls CB2 down to initiate communication */
mac->m_kbd_comm = TRUE;
mac->m_kbd_receive = TRUE;
- device->machine().scheduler().timer_set(attotime::from_usec(100), FUNC(kbd_clock));
+ space.machine().scheduler().timer_set(attotime::from_usec(100), FUNC(kbd_clock));
}
if (mac->m_kbd_comm == TRUE && mac->m_kbd_receive == TRUE)
{
@@ -1179,7 +1179,7 @@ WRITE16_MEMBER ( mac_state::mac_iwm_w )
static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2)
{
UINT8 ret;
- mac_state *mac = device->machine().driver_data<mac_state>();
+ mac_state *mac = space.machine().driver_data<mac_state>();
if (ADB_IS_EGRET)
{
@@ -1208,7 +1208,7 @@ static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2)
static WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2)
{
- mac_state *mac = device->machine().driver_data<mac_state>();
+ mac_state *mac = space.machine().driver_data<mac_state>();
// printf("VIA OUT CB2 = %x\n", data);
if (ADB_IS_EGRET)
@@ -1264,9 +1264,9 @@ static WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2)
static READ8_DEVICE_HANDLER(mac_via_in_a)
{
- mac_state *mac = device->machine().driver_data<mac_state>();
+ mac_state *mac = space.machine().driver_data<mac_state>();
-// printf("VIA1 IN_A (PC %x)\n", device->machine().device("maincpu")->safe_pc());
+// printf("VIA1 IN_A (PC %x)\n", space.machine().device("maincpu")->safe_pc());
switch (mac->m_model)
{
@@ -1332,7 +1332,7 @@ static READ8_DEVICE_HANDLER(mac_via_in_a)
static READ8_DEVICE_HANDLER(mac_via_in_b)
{
int val = 0;
- mac_state *mac = device->machine().driver_data<mac_state>();
+ mac_state *mac = space.machine().driver_data<mac_state>();
// portable/PB100 is pretty different
if (mac->m_model >= MODEL_MAC_PORTABLE && mac->m_model <= MODEL_MAC_PB100)
@@ -1343,7 +1343,7 @@ static READ8_DEVICE_HANDLER(mac_via_in_b)
else
{
/* video beam in display (! VBLANK && ! HBLANK basically) */
- if (device->machine().primary_screen->vpos() >= MAC_V_VIS)
+ if (space.machine().primary_screen->vpos() >= MAC_V_VIS)
val |= 0x40;
if (ADB_IS_BITBANG)
@@ -1369,25 +1369,25 @@ static READ8_DEVICE_HANDLER(mac_via_in_b)
val |= 0x20;
if (mac->m_mouse_bit_x) /* Mouse X2 */
val |= 0x10;
- if ((device->machine().root_device().ioport("MOUSE0")->read() & 0x01) == 0)
+ if ((space.machine().root_device().ioport("MOUSE0")->read() & 0x01) == 0)
val |= 0x08;
}
if (mac->m_rtc_data_out)
val |= 1;
}
-// printf("VIA1 IN_B = %02x (PC %x)\n", val, device->machine().device("maincpu")->safe_pc());
+// printf("VIA1 IN_B = %02x (PC %x)\n", val, space.machine().device("maincpu")->safe_pc());
return val;
}
static WRITE8_DEVICE_HANDLER(mac_via_out_a)
{
- device_t *sound = device->machine().device("custom");
- device_t *fdc = device->machine().device("fdc");
- mac_state *mac = device->machine().driver_data<mac_state>();
+ device_t *sound = space.machine().device("custom");
+ device_t *fdc = space.machine().device("fdc");
+ mac_state *mac = space.machine().driver_data<mac_state>();
-// printf("VIA1 OUT A: %02x (PC %x)\n", data, device->machine().device("maincpu")->safe_pc());
+// printf("VIA1 OUT A: %02x (PC %x)\n", data, space.machine().device("maincpu")->safe_pc());
if (ADB_IS_PM_VIA1)
{
@@ -1427,15 +1427,15 @@ static WRITE8_DEVICE_HANDLER(mac_via_out_a)
static WRITE8_DEVICE_HANDLER(mac_via_out_b)
{
- device_t *sound = device->machine().device("custom");
+ device_t *sound = space.machine().device("custom");
int new_rtc_rTCClk;
- mac_state *mac = device->machine().driver_data<mac_state>();
+ mac_state *mac = space.machine().driver_data<mac_state>();
-// printf("VIA1 OUT B: %02x (PC %x)\n", data, device->machine().device("maincpu")->safe_pc());
+// printf("VIA1 OUT B: %02x (PC %x)\n", data, space.machine().device("maincpu")->safe_pc());
if (ADB_IS_PM_VIA1)
{
- device_t *fdc = device->machine().device("fdc");
+ device_t *fdc = space.machine().device("fdc");
sony_set_sel_line(fdc,(data & 0x20) >> 5);
mac->m_drive_select = ((data & 0x10) >> 4);
@@ -1632,7 +1632,7 @@ WRITE16_MEMBER ( mac_state::mac_via2_w )
static READ8_DEVICE_HANDLER(mac_via2_in_a)
{
UINT8 result;
- mac_state *mac = device->machine().driver_data<mac_state>();
+ mac_state *mac = space.machine().driver_data<mac_state>();
if (ADB_IS_PM_VIA2)
{
@@ -1652,9 +1652,9 @@ static READ8_DEVICE_HANDLER(mac_via2_in_a)
static READ8_DEVICE_HANDLER(mac_via2_in_b)
{
- mac_state *mac =device->machine().driver_data<mac_state>();
+ mac_state *mac =space.machine().driver_data<mac_state>();
-// logerror("VIA2 IN B (PC %x)\n", device->machine().device("maincpu")->safe_pc());
+// logerror("VIA2 IN B (PC %x)\n", space.machine().device("maincpu")->safe_pc());
if (ADB_IS_PM_VIA2)
{
@@ -1683,9 +1683,9 @@ static READ8_DEVICE_HANDLER(mac_via2_in_b)
static WRITE8_DEVICE_HANDLER(mac_via2_out_a)
{
- mac_state *mac = device->machine().driver_data<mac_state>();
+ mac_state *mac = space.machine().driver_data<mac_state>();
-// logerror("VIA2 OUT A: %02x (PC %x)\n", data, device->machine().device("maincpu")->safe_pc());
+// logerror("VIA2 OUT A: %02x (PC %x)\n", data, space.machine().device("maincpu")->safe_pc());
if (ADB_IS_PM_VIA2)
{
mac->m_pm_data_send = data;
@@ -1695,9 +1695,9 @@ static WRITE8_DEVICE_HANDLER(mac_via2_out_a)
static WRITE8_DEVICE_HANDLER(mac_via2_out_b)
{
- mac_state *mac = device->machine().driver_data<mac_state>();
+ mac_state *mac = space.machine().driver_data<mac_state>();
-// logerror("VIA2 OUT B: %02x (PC %x)\n", data, device->machine().device("maincpu")->safe_pc());
+// logerror("VIA2 OUT B: %02x (PC %x)\n", data, space.machine().device("maincpu")->safe_pc());
if (ADB_IS_PM_VIA2)
{
diff --git a/src/mess/machine/macpci.c b/src/mess/machine/macpci.c
index f5d087decbc..0f2d2eaa79a 100644
--- a/src/mess/machine/macpci.c
+++ b/src/mess/machine/macpci.c
@@ -51,7 +51,7 @@ static void mac_via_irq(device_t *device, int state)
static READ8_DEVICE_HANDLER(mac_via_in_a)
{
-// macpci_state *mac = device->machine().driver_data<macpci_state>();
+// macpci_state *mac = space.machine().driver_data<macpci_state>();
// printf("VIA1 IN_A (PC %x)\n", mac->m_maincpu->pc());
@@ -61,7 +61,7 @@ static READ8_DEVICE_HANDLER(mac_via_in_a)
static READ8_DEVICE_HANDLER(mac_via_in_b)
{
int val = 0;
- macpci_state *mac = device->machine().driver_data<macpci_state>();
+ macpci_state *mac = space.machine().driver_data<macpci_state>();
val |= mac->m_cuda->get_treq()<<3;
@@ -72,14 +72,14 @@ static READ8_DEVICE_HANDLER(mac_via_in_b)
static WRITE8_DEVICE_HANDLER(mac_via_out_a)
{
-// macpci_state *mac = device->machine().driver_data<macpci_state>();
+// macpci_state *mac = space.machine().driver_data<macpci_state>();
// printf("VIA1 OUT A: %02x (PC %x)\n", data, mac->m_maincpu->pc());
}
static WRITE8_DEVICE_HANDLER(mac_via_out_b)
{
- macpci_state *mac = device->machine().driver_data<macpci_state>();
+ macpci_state *mac = space.machine().driver_data<macpci_state>();
// printf("VIA1 OUT B: %02x (PC %x)\n", data, mac->m_maincpu->pc());
@@ -125,7 +125,7 @@ WRITE16_MEMBER ( macpci_state::mac_via_w )
static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2)
{
UINT8 ret;
- macpci_state *mac = device->machine().driver_data<macpci_state>();
+ macpci_state *mac = space.machine().driver_data<macpci_state>();
ret = mac->m_cuda->get_via_data();
#if LOG_ADB
@@ -137,7 +137,7 @@ static READ8_DEVICE_HANDLER(mac_adb_via_in_cb2)
static WRITE8_DEVICE_HANDLER(mac_adb_via_out_cb2)
{
- macpci_state *mac = device->machine().driver_data<macpci_state>();
+ macpci_state *mac = space.machine().driver_data<macpci_state>();
mac->m_cuda->set_via_data(data & 1);
}
diff --git a/src/mess/machine/mc68328.c b/src/mess/machine/mc68328.c
index 51d559e9945..6cb24d466ea 100644
--- a/src/mess/machine/mc68328.c
+++ b/src/mess/machine/mc68328.c
@@ -416,287 +416,287 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x000:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfff001) = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfff001) = %02x\n", data & 0x00ff);
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: SCR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: SCR = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0x100:
- verboselog(device->machine(), 2, "mc68328_w: GRPBASEA = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: GRPBASEA = %04x\n", data);
mc68328->regs.grpbasea = data;
break;
case 0x102:
- verboselog(device->machine(), 2, "mc68328_w: GRPBASEB = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: GRPBASEB = %04x\n", data);
mc68328->regs.grpbaseb = data;
break;
case 0x104:
- verboselog(device->machine(), 2, "mc68328_w: GRPBASEC = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: GRPBASEC = %04x\n", data);
mc68328->regs.grpbasec = data;
break;
case 0x106:
- verboselog(device->machine(), 2, "mc68328_w: GRPBASED = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: GRPBASED = %04x\n", data);
mc68328->regs.grpbased = data;
break;
case 0x108:
- verboselog(device->machine(), 2, "mc68328_w: GRPMASKA = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: GRPMASKA = %04x\n", data);
mc68328->regs.grpmaska = data;
break;
case 0x10a:
- verboselog(device->machine(), 2, "mc68328_w: GRPMASKB = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: GRPMASKB = %04x\n", data);
mc68328->regs.grpmaskb = data;
break;
case 0x10c:
- verboselog(device->machine(), 2, "mc68328_w: GRPMASKC = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: GRPMASKC = %04x\n", data);
mc68328->regs.grpmaskc = data;
break;
case 0x10e:
- verboselog(device->machine(), 2, "mc68328_w: GRPMASKD = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: GRPMASKD = %04x\n", data);
mc68328->regs.grpmaskd = data;
break;
case 0x110:
- verboselog(device->machine(), 5, "mc68328_w: CSA0(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSA0(0) = %04x\n", data);
mc68328->regs.csa0 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csa0 |= data & mem_mask;
break;
case 0x112:
- verboselog(device->machine(), 5, "mc68328_w: CSA0(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSA0(16) = %04x\n", data);
mc68328->regs.csa0 &= ~(mem_mask << 16);
mc68328->regs.csa0 |= (data & mem_mask) << 16;
break;
case 0x114:
- verboselog(device->machine(), 5, "mc68328_w: CSA1(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSA1(0) = %04x\n", data);
mc68328->regs.csa1 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csa1 |= data & mem_mask;
break;
case 0x116:
- verboselog(device->machine(), 5, "mc68328_w: CSA1(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSA1(16) = %04x\n", data);
mc68328->regs.csa1 &= ~(mem_mask << 16);
mc68328->regs.csa1 |= (data & mem_mask) << 16;
break;
case 0x118:
- verboselog(device->machine(), 5, "mc68328_w: CSA2(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSA2(0) = %04x\n", data);
mc68328->regs.csa2 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csa2 |= data & mem_mask;
break;
case 0x11a:
- verboselog(device->machine(), 5, "mc68328_w: CSA2(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSA2(16) = %04x\n", data);
mc68328->regs.csa2 &= ~(mem_mask << 16);
mc68328->regs.csa2 |= (data & mem_mask) << 16;
break;
case 0x11c:
- verboselog(device->machine(), 5, "mc68328_w: CSA3(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSA3(0) = %04x\n", data);
mc68328->regs.csa3 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csa3 |= data & mem_mask;
break;
case 0x11e:
- verboselog(device->machine(), 5, "mc68328_w: CSA3(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSA3(16) = %04x\n", data);
mc68328->regs.csa3 &= ~(mem_mask << 16);
mc68328->regs.csa3 |= (data & mem_mask) << 16;
break;
case 0x120:
- verboselog(device->machine(), 5, "mc68328_w: CSB0(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSB0(0) = %04x\n", data);
mc68328->regs.csb0 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csb0 |= data & mem_mask;
break;
case 0x122:
- verboselog(device->machine(), 5, "mc68328_w: CSB0(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSB0(16) = %04x\n", data);
mc68328->regs.csb0 &= ~(mem_mask << 16);
mc68328->regs.csb0 |= (data & mem_mask) << 16;
break;
case 0x124:
- verboselog(device->machine(), 5, "mc68328_w: CSB1(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSB1(0) = %04x\n", data);
mc68328->regs.csb1 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csb1 |= data & mem_mask;
break;
case 0x126:
- verboselog(device->machine(), 5, "mc68328_w: CSB1(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSB1(16) = %04x\n", data);
mc68328->regs.csb1 &= ~(mem_mask << 16);
mc68328->regs.csb1 |= (data & mem_mask) << 16;
break;
case 0x128:
- verboselog(device->machine(), 5, "mc68328_w: CSB2(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSB2(0) = %04x\n", data);
mc68328->regs.csb2 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csb2 |= data & mem_mask;
break;
case 0x12a:
- verboselog(device->machine(), 5, "mc68328_w: CSB2(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSB2(16) = %04x\n", data);
mc68328->regs.csb2 &= ~(mem_mask << 16);
mc68328->regs.csb2 |= (data & mem_mask) << 16;
break;
case 0x12c:
- verboselog(device->machine(), 5, "mc68328_w: CSB3(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSB3(0) = %04x\n", data);
mc68328->regs.csb3 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csb3 |= data & mem_mask;
break;
case 0x12e:
- verboselog(device->machine(), 5, "mc68328_w: CSB3(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSB3(16) = %04x\n", data);
mc68328->regs.csb3 &= ~(mem_mask << 16);
mc68328->regs.csb3 |= (data & mem_mask) << 16;
break;
case 0x130:
- verboselog(device->machine(), 5, "mc68328_w: CSC0(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSC0(0) = %04x\n", data);
mc68328->regs.csc0 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csc0 |= data & mem_mask;
break;
case 0x132:
- verboselog(device->machine(), 5, "mc68328_w: CSC0(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSC0(16) = %04x\n", data);
mc68328->regs.csc0 &= ~(mem_mask << 16);
mc68328->regs.csc0 |= (data & mem_mask) << 16;
break;
case 0x134:
- verboselog(device->machine(), 5, "mc68328_w: CSC1(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSC1(0) = %04x\n", data);
mc68328->regs.csc1 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csc1 |= data & mem_mask;
break;
case 0x136:
- verboselog(device->machine(), 5, "mc68328_w: CSC1(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSC1(16) = %04x\n", data);
mc68328->regs.csc1 &= ~(mem_mask << 16);
mc68328->regs.csc1 |= (data & mem_mask) << 16;
break;
case 0x138:
- verboselog(device->machine(), 5, "mc68328_w: CSC2(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSC2(0) = %04x\n", data);
mc68328->regs.csc2 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csc2 |= data & mem_mask;
break;
case 0x13a:
- verboselog(device->machine(), 5, "mc68328_w: CSC2(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSC2(16) = %04x\n", data);
mc68328->regs.csc2 &= ~(mem_mask << 16);
mc68328->regs.csc2 |= (data & mem_mask) << 16;
break;
case 0x13c:
- verboselog(device->machine(), 5, "mc68328_w: CSC3(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSC3(0) = %04x\n", data);
mc68328->regs.csc3 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csc3 |= data & mem_mask;
break;
case 0x13e:
- verboselog(device->machine(), 5, "mc68328_w: CSC3(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSC3(16) = %04x\n", data);
mc68328->regs.csc3 &= ~(mem_mask << 16);
mc68328->regs.csc3 |= (data & mem_mask) << 16;
break;
case 0x140:
- verboselog(device->machine(), 5, "mc68328_w: CSD0(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSD0(0) = %04x\n", data);
mc68328->regs.csd0 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csd0 |= data & mem_mask;
break;
case 0x142:
- verboselog(device->machine(), 5, "mc68328_w: CSD0(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSD0(16) = %04x\n", data);
mc68328->regs.csd0 &= ~(mem_mask << 16);
mc68328->regs.csd0 |= (data & mem_mask) << 16;
break;
case 0x144:
- verboselog(device->machine(), 5, "mc68328_w: CSD1(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSD1(0) = %04x\n", data);
mc68328->regs.csd1 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csd1 |= data & mem_mask;
break;
case 0x146:
- verboselog(device->machine(), 5, "mc68328_w: CSD1(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSD1(16) = %04x\n", data);
mc68328->regs.csd1 &= ~(mem_mask << 16);
mc68328->regs.csd1 |= (data & mem_mask) << 16;
break;
case 0x148:
- verboselog(device->machine(), 5, "mc68328_w: CSD2(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSD2(0) = %04x\n", data);
mc68328->regs.csd2 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csd2 |= data & mem_mask;
break;
case 0x14a:
- verboselog(device->machine(), 5, "mc68328_w: CSD2(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSD2(16) = %04x\n", data);
mc68328->regs.csd2 &= ~(mem_mask << 16);
mc68328->regs.csd2 |= (data & mem_mask) << 16;
break;
case 0x14c:
- verboselog(device->machine(), 5, "mc68328_w: CSD3(0) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSD3(0) = %04x\n", data);
mc68328->regs.csd3 &= 0xffff0000 | (~mem_mask);
mc68328->regs.csd3 |= data & mem_mask;
break;
case 0x14e:
- verboselog(device->machine(), 5, "mc68328_w: CSD3(16) = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: CSD3(16) = %04x\n", data);
mc68328->regs.csd3 &= ~(mem_mask << 16);
mc68328->regs.csd3 |= (data & mem_mask) << 16;
break;
case 0x200:
- verboselog(device->machine(), 2, "mc68328_w: PLLCR = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: PLLCR = %04x\n", data);
mc68328->regs.pllcr = data;
break;
case 0x202:
- verboselog(device->machine(), 2, "mc68328_w: PLLFSR = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: PLLFSR = %04x\n", data);
mc68328->regs.pllfsr = data;
break;
case 0x206:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PCTLR = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PCTLR = %02x\n", data & 0x00ff);
mc68328->regs.pctlr = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfff206) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfff206) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0x300:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfff301) = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfff301) = %02x\n", data & 0x00ff);
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: IVR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: IVR = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.ivr = (data >> 8) & 0x00ff;
}
break;
case 0x302:
- verboselog(device->machine(), 2, "mc68328_w: ICR = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: ICR = %04x\n", data);
mc68328->regs.icr = data;
break;
case 0x304:
- verboselog(device->machine(), 2, "mc68328_w: IMR(16) = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: IMR(16) = %04x\n", data);
mc68328->regs.imr &= ~(mem_mask << 16);
mc68328->regs.imr |= (data & mem_mask) << 16;
mc68328->regs.isr &= ~((data & mem_mask) << 16);
@@ -706,7 +706,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
break;
case 0x306:
- verboselog(device->machine(), 2, "mc68328_w: IMR(0) = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: IMR(0) = %04x\n", data);
mc68328->regs.imr &= 0xffff0000 | (~mem_mask);
mc68328->regs.imr |= data & mem_mask;
mc68328->regs.isr &= ~(data & mem_mask);
@@ -717,20 +717,20 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x308:
{
- verboselog(device->machine(), 2, "mc68328_w: IWR(16) = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: IWR(16) = %04x\n", data);
mc68328->regs.iwr &= ~(mem_mask << 16);
mc68328->regs.iwr |= (data & mem_mask) << 16;
}
break;
case 0x30a:
- verboselog(device->machine(), 2, "mc68328_w: IWR(0) = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: IWR(0) = %04x\n", data);
mc68328->regs.iwr &= 0xffff0000 | (~mem_mask);
mc68328->regs.iwr |= data & mem_mask;
break;
case 0x30c:
- verboselog(device->machine(), 2, "mc68328_w: ISR(16) = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: ISR(16) = %04x\n", data);
// Clear edge-triggered IRQ1
if((mc68328->regs.icr & ICR_ET1) == ICR_ET1 && (data & INT_IRQ1_SHIFT) == INT_IRQ1_SHIFT)
{
@@ -763,21 +763,21 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
break;
case 0x30e:
- verboselog(device->machine(), 2, "mc68328_w: ISR(0) = %04x (Ignored)\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: ISR(0) = %04x (Ignored)\n", data);
break;
case 0x310:
- verboselog(device->machine(), 2, "mc68328_w: IPR(16) = %04x (Ignored)\n");
+ verboselog(space.machine(), 2, "mc68328_w: IPR(16) = %04x (Ignored)\n");
break;
case 0x312:
- verboselog(device->machine(), 2, "mc68328_w: IPR(0) = %04x (Ignored)\n");
+ verboselog(space.machine(), 2, "mc68328_w: IPR(0) = %04x (Ignored)\n");
break;
case 0x400:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PADATA = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PADATA = %02x\n", data & 0x00ff);
mc68328->regs.padata = data & 0x00ff;
if(!mc68328->out_port_a.isnull())
{
@@ -786,7 +786,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PADIR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PADIR = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.padir = (data >> 8) & 0x00ff;
}
break;
@@ -794,19 +794,19 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x402:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PASEL = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PASEL = %02x\n", data & 0x00ff);
mc68328->regs.pasel = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfff402) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfff402) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0x408:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PBDATA = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PBDATA = %02x\n", data & 0x00ff);
mc68328->regs.pbdata = data & 0x00ff;
if(!mc68328->out_port_b.isnull())
{
@@ -815,7 +815,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PBDIR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PBDIR = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pbdir = (data >> 8) & 0x00ff;
}
break;
@@ -823,19 +823,19 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x40a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PBSEL = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PBSEL = %02x\n", data & 0x00ff);
mc68328->regs.pbsel = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfff40a) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfff40a) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0x410:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PCDATA = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PCDATA = %02x\n", data & 0x00ff);
mc68328->regs.pcdata = data & 0x00ff;
if(!mc68328->out_port_c.isnull())
{
@@ -844,7 +844,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PCDIR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PCDIR = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pcdir = (data >> 8) & 0x00ff;
}
break;
@@ -852,26 +852,26 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x412:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PCSEL = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PCSEL = %02x\n", data & 0x00ff);
mc68328->regs.pcsel = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfff412) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfff412) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0x418:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PDDATA = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PDDATA = %02x\n", data & 0x00ff);
mc68328->regs.pddataedge &= ~(data & 0x00ff);
mc68328_poll_port_d_interrupts(device);
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PDDIR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PDDIR = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pddir = (data >> 8) & 0x00ff;
}
break;
@@ -879,11 +879,11 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x41a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfff41b) = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfff41b) = %02x\n", data & 0x00ff);
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PDPUEN = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PDPUEN = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pdpuen = (data >> 8) & 0x00ff;
}
break;
@@ -891,14 +891,14 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x41c:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PDIRQEN = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PDIRQEN = %02x\n", data & 0x00ff);
mc68328->regs.pdirqen = data & 0x00ff;
mc68328_poll_port_d_interrupts(device);
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PDPOL = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PDPOL = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pdpol = (data >> 8) & 0x00ff;
}
break;
@@ -906,19 +906,19 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x41e:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PDIRQEDGE = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PDIRQEDGE = %02x\n", data & 0x00ff);
mc68328->regs.pdirqedge = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfff41e) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfff41e) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0x420:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PEDATA = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PEDATA = %02x\n", data & 0x00ff);
mc68328->regs.pedata = data & 0x00ff;
if(!mc68328->out_port_e.isnull())
{
@@ -927,7 +927,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PEDIR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PEDIR = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pedir = (data >> 8) & 0x00ff;
}
break;
@@ -935,12 +935,12 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x422:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PESEL = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PESEL = %02x\n", data & 0x00ff);
mc68328->regs.pesel = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PEPUEN = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PEPUEN = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pepuen = (data >> 8) & 0x00ff;
mc68328->regs.pedata |= mc68328->regs.pepuen;
}
@@ -949,7 +949,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x428:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PFDATA = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PFDATA = %02x\n", data & 0x00ff);
mc68328->regs.pfdata = data & 0x00ff;
if(!mc68328->out_port_f.isnull())
{
@@ -958,7 +958,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PFDIR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PFDIR = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pfdir = (data >> 8) & 0x00ff;
}
break;
@@ -966,12 +966,12 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x42a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PFSEL = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PFSEL = %02x\n", data & 0x00ff);
mc68328->regs.pfsel = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PFPUEN = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PFPUEN = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pfpuen = (data >> 8) & 0x00ff;
}
break;
@@ -979,7 +979,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x430:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PGDATA = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PGDATA = %02x\n", data & 0x00ff);
mc68328->regs.pgdata = data & 0x00ff;
if(!mc68328->out_port_g.isnull())
{
@@ -988,7 +988,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PGDIR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PGDIR = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pgdir = (data >> 8) & 0x00ff;
}
break;
@@ -996,12 +996,12 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x432:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PGSEL = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PGSEL = %02x\n", data & 0x00ff);
mc68328->regs.pgsel = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PGPUEN = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PGPUEN = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pgpuen = (data >> 8) & 0x00ff;
}
break;
@@ -1009,7 +1009,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x438:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PJDATA = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PJDATA = %02x\n", data & 0x00ff);
mc68328->regs.pjdata = data & 0x00ff;
if(!mc68328->out_port_j.isnull())
{
@@ -1018,7 +1018,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PJDIR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PJDIR = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pjdir = (data >> 8) & 0x00ff;
}
break;
@@ -1026,19 +1026,19 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x43a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PJSEL = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PJSEL = %02x\n", data & 0x00ff);
mc68328->regs.pjsel = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfff43a) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfff43a) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0x440:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PKDATA = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PKDATA = %02x\n", data & 0x00ff);
mc68328->regs.pkdata = data & 0x00ff;
if(!mc68328->out_port_k.isnull())
{
@@ -1047,7 +1047,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PKDIR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PKDIR = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pkdir = (data >> 8) & 0x00ff;
}
break;
@@ -1055,12 +1055,12 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x442:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PKSEL = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PKSEL = %02x\n", data & 0x00ff);
mc68328->regs.pksel = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PKPUEN = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PKPUEN = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pgpuen = (data >> 8) & 0x00ff;
}
break;
@@ -1068,7 +1068,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x448:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PMDATA = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PMDATA = %02x\n", data & 0x00ff);
mc68328->regs.pmdata = data & 0x00ff;
if(!mc68328->out_port_m.isnull())
{
@@ -1077,7 +1077,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PMDIR = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PMDIR = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pmdir = (data >> 8) & 0x00ff;
}
break;
@@ -1085,18 +1085,18 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
case 0x44a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: PMSEL = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PMSEL = %02x\n", data & 0x00ff);
mc68328->regs.pmsel = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: PMPUEN = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: PMPUEN = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.pmpuen = (data >> 8) & 0x00ff;
}
break;
case 0x500:
- verboselog(device->machine(), 2, "mc68328_w: PWMC = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: PWMC = %04x\n", data);
mc68328->regs.pwmc = data;
@@ -1128,22 +1128,22 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
break;
case 0x502:
- verboselog(device->machine(), 2, "mc68328_w: PWMP = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: PWMP = %04x\n", data);
mc68328->regs.pwmp = data;
break;
case 0x504:
- verboselog(device->machine(), 2, "mc68328_w: PWMW = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: PWMW = %04x\n", data);
mc68328->regs.pwmw = data;
break;
case 0x506:
- verboselog(device->machine(), 2, "mc68328_w: PWMCNT = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: PWMCNT = %04x\n", data);
mc68328->regs.pwmcnt = 0;
break;
case 0x600:
- verboselog(device->machine(), 2, "mc68328_w: TCTL1 = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: TCTL1 = %04x\n", data);
temp16[0] = mc68328->regs.tctl[0];
mc68328->regs.tctl[0] = data;
if((temp16[0] & TCTL_TEN) == (mc68328->regs.tctl[0] & TCTL_TEN))
@@ -1157,27 +1157,27 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
break;
case 0x602:
- verboselog(device->machine(), 2, "mc68328_w: TPRER1 = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: TPRER1 = %04x\n", data);
mc68328->regs.tprer[0] = data;
mc68328_maybe_start_timer(device, 0, 0);
break;
case 0x604:
- verboselog(device->machine(), 2, "mc68328_w: TCMP1 = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: TCMP1 = %04x\n", data);
mc68328->regs.tcmp[0] = data;
mc68328_maybe_start_timer(device, 0, 0);
break;
case 0x606:
- verboselog(device->machine(), 2, "mc68328_w: TCR1 = %04x (Ignored)\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: TCR1 = %04x (Ignored)\n", data);
break;
case 0x608:
- verboselog(device->machine(), 2, "mc68328_w: TCN1 = %04x (Ignored)\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: TCN1 = %04x (Ignored)\n", data);
break;
case 0x60a:
- verboselog(device->machine(), 5, "mc68328_w: TSTAT1 = %04x\n", data);
+ verboselog(space.machine(), 5, "mc68328_w: TSTAT1 = %04x\n", data);
mc68328->regs.tstat[0] &= ~mc68328->regs.tclear[0];
if(!(mc68328->regs.tstat[0] & TSTAT_COMP))
{
@@ -1186,7 +1186,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
break;
case 0x60c:
- verboselog(device->machine(), 2, "mc68328_w: TCTL2 = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: TCTL2 = %04x\n", data);
temp16[0] = mc68328->regs.tctl[1];
mc68328->regs.tctl[1] = data;
if((temp16[0] & TCTL_TEN) == (mc68328->regs.tctl[1] & TCTL_TEN))
@@ -1200,27 +1200,27 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
break;
case 0x60e:
- verboselog(device->machine(), 2, "mc68328_w: TPRER2 = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: TPRER2 = %04x\n", data);
mc68328->regs.tprer[1] = data;
mc68328_maybe_start_timer(device, 1, 0);
break;
case 0x610:
- verboselog(device->machine(), 2, "mc68328_w: TCMP2 = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: TCMP2 = %04x\n", data);
mc68328->regs.tcmp[1] = data;
mc68328_maybe_start_timer(device, 1, 0);
break;
case 0x612:
- verboselog(device->machine(), 2, "mc68328_w: TCR2 = %04x (Ignored)\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: TCR2 = %04x (Ignored)\n", data);
break;
case 0x614:
- verboselog(device->machine(), 2, "mc68328_w: TCN2 = %04x (Ignored)\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: TCN2 = %04x (Ignored)\n", data);
break;
case 0x616:
- verboselog(device->machine(), 2, "mc68328_w: TSTAT2 = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: TSTAT2 = %04x\n", data);
mc68328->regs.tstat[1] &= ~mc68328->regs.tclear[1];
if(!(mc68328->regs.tstat[1] & TSTAT_COMP))
{
@@ -1229,26 +1229,26 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
break;
case 0x618:
- verboselog(device->machine(), 2, "mc68328_w: WCTLR = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: WCTLR = %04x\n", data);
mc68328->regs.wctlr = data;
break;
case 0x61a:
- verboselog(device->machine(), 2, "mc68328_w: WCMPR = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: WCMPR = %04x\n", data);
mc68328->regs.wcmpr = data;
break;
case 0x61c:
- verboselog(device->machine(), 2, "mc68328_w: WCN = %04x (Ignored)\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: WCN = %04x (Ignored)\n", data);
break;
case 0x700:
- verboselog(device->machine(), 2, "mc68328_w: SPISR = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: SPISR = %04x\n", data);
mc68328->regs.spisr = data;
break;
case 0x800:
- verboselog(device->machine(), 2, "mc68328_w: SPIMDATA = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: SPIMDATA = %04x\n", data);
if(!mc68328->out_spim.isnull())
{
mc68328->out_spim( 0, data, 0xffff );
@@ -1260,15 +1260,15 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
break;
case 0x802:
- verboselog(device->machine(), 2, "mc68328_w: SPIMCONT = %04x\n", data);
- verboselog(device->machine(), 3, " Count = %d\n", data & SPIM_CLOCK_COUNT);
- verboselog(device->machine(), 3, " Polarity = %s\n", (data & SPIM_POL) ? "Inverted" : "Active-high");
- verboselog(device->machine(), 3, " Phase = %s\n", (data & SPIM_PHA) ? "Opposite" : "Normal");
- verboselog(device->machine(), 3, " IRQ Enable = %s\n", (data & SPIM_IRQEN) ? "Enable" : "Disable");
- verboselog(device->machine(), 3, " IRQ Pending = %s\n", (data & SPIM_SPIMIRQ) ? "Yes" : "No");
- verboselog(device->machine(), 3, " Exchange = %s\n", (data & SPIM_XCH) ? "Initiate" : "Idle");
- verboselog(device->machine(), 3, " SPIM Enable = %s\n", (data & SPIM_SPMEN) ? "Enable" : "Disable");
- verboselog(device->machine(), 3, " Data Rate = Divide By %d\n", 1 << ((((data & SPIM_RATE) >> 13) & 0x0007) + 2) );
+ verboselog(space.machine(), 2, "mc68328_w: SPIMCONT = %04x\n", data);
+ verboselog(space.machine(), 3, " Count = %d\n", data & SPIM_CLOCK_COUNT);
+ verboselog(space.machine(), 3, " Polarity = %s\n", (data & SPIM_POL) ? "Inverted" : "Active-high");
+ verboselog(space.machine(), 3, " Phase = %s\n", (data & SPIM_PHA) ? "Opposite" : "Normal");
+ verboselog(space.machine(), 3, " IRQ Enable = %s\n", (data & SPIM_IRQEN) ? "Enable" : "Disable");
+ verboselog(space.machine(), 3, " IRQ Pending = %s\n", (data & SPIM_SPIMIRQ) ? "Yes" : "No");
+ verboselog(space.machine(), 3, " Exchange = %s\n", (data & SPIM_XCH) ? "Initiate" : "Idle");
+ verboselog(space.machine(), 3, " SPIM Enable = %s\n", (data & SPIM_SPMEN) ? "Enable" : "Disable");
+ verboselog(space.machine(), 3, " Data Rate = Divide By %d\n", 1 << ((((data & SPIM_RATE) >> 13) & 0x0007) + 2) );
mc68328->regs.spimcont = data;
// $$HACK$$ We should probably emulate the ADS7843 A/D device properly.
if(data & SPIM_XCH)
@@ -1281,7 +1281,7 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
if(data & SPIM_IRQEN)
{
mc68328->regs.spimcont |= SPIM_SPIMIRQ;
- verboselog(device->machine(), 3, "Triggering SPIM Interrupt\n" );
+ verboselog(space.machine(), 3, "Triggering SPIM Interrupt\n" );
mc68328_set_interrupt_line(device, INT_SPIM, 1);
}
}
@@ -1292,292 +1292,292 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
break;
case 0x900:
- verboselog(device->machine(), 2, "mc68328_w: USTCNT = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: USTCNT = %04x\n", data);
mc68328->regs.ustcnt = data;
break;
case 0x902:
- verboselog(device->machine(), 2, "mc68328_w: UBAUD = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: UBAUD = %04x\n", data);
mc68328->regs.ubaud = data;
break;
case 0x904:
- verboselog(device->machine(), 2, "mc68328_w: URX = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: URX = %04x\n", data);
break;
case 0x906:
- verboselog(device->machine(), 2, "mc68328_w: UTX = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: UTX = %04x\n", data);
break;
case 0x908:
- verboselog(device->machine(), 2, "mc68328_w: UMISC = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: UMISC = %04x\n", data);
mc68328->regs.umisc = data;
break;
case 0xa00:
- verboselog(device->machine(), 2, "mc68328_w: LSSA(16) = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: LSSA(16) = %04x\n", data);
mc68328->regs.lssa &= ~(mem_mask << 16);
mc68328->regs.lssa |= (data & mem_mask) << 16;
- verboselog(device->machine(), 3, " Address: %08x\n", mc68328->regs.lssa);
+ verboselog(space.machine(), 3, " Address: %08x\n", mc68328->regs.lssa);
break;
case 0xa02:
- verboselog(device->machine(), 2, "mc68328_w: LSSA(0) = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: LSSA(0) = %04x\n", data);
mc68328->regs.lssa &= 0xffff0000 | (~mem_mask);
mc68328->regs.lssa |= data & mem_mask;
- verboselog(device->machine(), 3, " Address: %08x\n", mc68328->regs.lssa);
+ verboselog(space.machine(), 3, " Address: %08x\n", mc68328->regs.lssa);
break;
case 0xa04:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: LVPW = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: LVPW = %02x\n", data & 0x00ff);
mc68328->regs.lvpw = data & 0x00ff;
- verboselog(device->machine(), 3, " Page Width: %d or %d\n", (mc68328->regs.lvpw + 1) * ((mc68328->regs.lpicf & 0x01) ? 8 : 16));
+ verboselog(space.machine(), 3, " Page Width: %d or %d\n", (mc68328->regs.lvpw + 1) * ((mc68328->regs.lpicf & 0x01) ? 8 : 16));
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfffa04) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfffa04) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0xa08:
- verboselog(device->machine(), 2, "mc68328_w: LXMAX = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: LXMAX = %04x\n", data);
mc68328->regs.lxmax = data;
- verboselog(device->machine(), 3, " Width: %d\n", (data & 0x03ff) + 1);
+ verboselog(space.machine(), 3, " Width: %d\n", (data & 0x03ff) + 1);
break;
case 0xa0a:
- verboselog(device->machine(), 2, "mc68328_w: LYMAX = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: LYMAX = %04x\n", data);
mc68328->regs.lymax = data;
- verboselog(device->machine(), 3, " Height: %d\n", (data & 0x03ff) + 1);
+ verboselog(space.machine(), 3, " Height: %d\n", (data & 0x03ff) + 1);
break;
case 0xa18:
- verboselog(device->machine(), 2, "mc68328_w: LCXP = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: LCXP = %04x\n", data);
mc68328->regs.lcxp = data;
- verboselog(device->machine(), 3, " X Position: %d\n", data & 0x03ff);
+ verboselog(space.machine(), 3, " X Position: %d\n", data & 0x03ff);
switch(mc68328->regs.lcxp >> 14)
{
case 0:
- verboselog(device->machine(), 3, " Cursor Control: Transparent\n");
+ verboselog(space.machine(), 3, " Cursor Control: Transparent\n");
break;
case 1:
- verboselog(device->machine(), 3, " Cursor Control: Black\n");
+ verboselog(space.machine(), 3, " Cursor Control: Black\n");
break;
case 2:
- verboselog(device->machine(), 3, " Cursor Control: Reverse\n");
+ verboselog(space.machine(), 3, " Cursor Control: Reverse\n");
break;
case 3:
- verboselog(device->machine(), 3, " Cursor Control: Invalid\n");
+ verboselog(space.machine(), 3, " Cursor Control: Invalid\n");
break;
}
break;
case 0xa1a:
- verboselog(device->machine(), 2, "mc68328_w: LCYP = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: LCYP = %04x\n", data);
mc68328->regs.lcyp = data;
- verboselog(device->machine(), 3, " Y Position: %d\n", data & 0x01ff);
+ verboselog(space.machine(), 3, " Y Position: %d\n", data & 0x01ff);
break;
case 0xa1c:
- verboselog(device->machine(), 2, "mc68328_w: LCWCH = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: LCWCH = %04x\n", data);
mc68328->regs.lcwch = data;
- verboselog(device->machine(), 3, " Width: %d\n", (data >> 8) & 0x1f);
- verboselog(device->machine(), 3, " Height: %d\n", data & 0x1f);
+ verboselog(space.machine(), 3, " Width: %d\n", (data >> 8) & 0x1f);
+ verboselog(space.machine(), 3, " Height: %d\n", data & 0x1f);
break;
case 0xa1e:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: LBLKC = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: LBLKC = %02x\n", data & 0x00ff);
mc68328->regs.lblkc = data & 0x00ff;
- verboselog(device->machine(), 3, " Blink Enable: %d\n", mc68328->regs.lblkc >> 7);
- verboselog(device->machine(), 3, " Blink Divisor: %d\n", mc68328->regs.lblkc & 0x7f);
+ verboselog(space.machine(), 3, " Blink Enable: %d\n", mc68328->regs.lblkc >> 7);
+ verboselog(space.machine(), 3, " Blink Divisor: %d\n", mc68328->regs.lblkc & 0x7f);
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfffa1e) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfffa1e) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0xa20:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: LPOLCF = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: LPOLCF = %02x\n", data & 0x00ff);
mc68328->regs.lpolcf = data & 0x00ff;
- verboselog(device->machine(), 3, " LCD Shift Clock Polarity: %s\n", (mc68328->regs.lpicf & 0x08) ? "Active positive edge of LCLK" : "Active negative edge of LCLK");
- verboselog(device->machine(), 3, " First-line marker polarity: %s\n", (mc68328->regs.lpicf & 0x04) ? "Active Low" : "Active High");
- verboselog(device->machine(), 3, " Line-pulse polarity: %s\n", (mc68328->regs.lpicf & 0x02) ? "Active Low" : "Active High");
- verboselog(device->machine(), 3, " Pixel polarity: %s\n", (mc68328->regs.lpicf & 0x01) ? "Active Low" : "Active High");
+ verboselog(space.machine(), 3, " LCD Shift Clock Polarity: %s\n", (mc68328->regs.lpicf & 0x08) ? "Active positive edge of LCLK" : "Active negative edge of LCLK");
+ verboselog(space.machine(), 3, " First-line marker polarity: %s\n", (mc68328->regs.lpicf & 0x04) ? "Active Low" : "Active High");
+ verboselog(space.machine(), 3, " Line-pulse polarity: %s\n", (mc68328->regs.lpicf & 0x02) ? "Active Low" : "Active High");
+ verboselog(space.machine(), 3, " Pixel polarity: %s\n", (mc68328->regs.lpicf & 0x01) ? "Active Low" : "Active High");
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: LPICF = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: LPICF = %02x\n", (data >> 8) & 0x00ff);
mc68328->regs.lpicf = (data >> 8) & 0x00ff;
switch((mc68328->regs.lpicf >> 1) & 0x03)
{
case 0:
- verboselog(device->machine(), 3, " Bus Size: 1-bit\n");
+ verboselog(space.machine(), 3, " Bus Size: 1-bit\n");
break;
case 1:
- verboselog(device->machine(), 3, " Bus Size: 2-bit\n");
+ verboselog(space.machine(), 3, " Bus Size: 2-bit\n");
break;
case 2:
- verboselog(device->machine(), 3, " Bus Size: 4-bit\n");
+ verboselog(space.machine(), 3, " Bus Size: 4-bit\n");
break;
case 3:
- verboselog(device->machine(), 3, " Bus Size: unused\n");
+ verboselog(space.machine(), 3, " Bus Size: unused\n");
break;
}
- verboselog(device->machine(), 3, " Gray scale enable: %d\n", mc68328->regs.lpicf & 0x01);
+ verboselog(space.machine(), 3, " Gray scale enable: %d\n", mc68328->regs.lpicf & 0x01);
}
break;
case 0xa22:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: LACDRC = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: LACDRC = %02x\n", data & 0x00ff);
mc68328->regs.lacdrc = data & 0x00ff;
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfffa22) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfffa22) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0xa24:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: LPXCD = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: LPXCD = %02x\n", data & 0x00ff);
mc68328->regs.lpxcd = data & 0x00ff;
- verboselog(device->machine(), 3, " Clock Divisor: %d\n", mc68328->regs.lpxcd + 1);
+ verboselog(space.machine(), 3, " Clock Divisor: %d\n", mc68328->regs.lpxcd + 1);
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfffa24) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfffa24) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0xa26:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: LCKCON = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: LCKCON = %02x\n", data & 0x00ff);
mc68328->regs.lckcon = data & 0x00ff;
- verboselog(device->machine(), 3, " LCDC Enable: %d\n", (mc68328->regs.lckcon >> 7) & 0x01);
- verboselog(device->machine(), 3, " DMA Burst Length: %d\n", ((mc68328->regs.lckcon >> 6) & 0x01) ? 16 : 8);
- verboselog(device->machine(), 3, " DMA Bursting Clock Control: %d\n", ((mc68328->regs.lckcon >> 4) & 0x03) + 1);
- verboselog(device->machine(), 3, " Bus Width: %d\n", ((mc68328->regs.lckcon >> 1) & 0x01) ? 8 : 16);
- verboselog(device->machine(), 3, " Pixel Clock Divider Source: %s\n", (mc68328->regs.lckcon & 0x01) ? "PIX" : "SYS");
+ verboselog(space.machine(), 3, " LCDC Enable: %d\n", (mc68328->regs.lckcon >> 7) & 0x01);
+ verboselog(space.machine(), 3, " DMA Burst Length: %d\n", ((mc68328->regs.lckcon >> 6) & 0x01) ? 16 : 8);
+ verboselog(space.machine(), 3, " DMA Bursting Clock Control: %d\n", ((mc68328->regs.lckcon >> 4) & 0x03) + 1);
+ verboselog(space.machine(), 3, " Bus Width: %d\n", ((mc68328->regs.lckcon >> 1) & 0x01) ? 8 : 16);
+ verboselog(space.machine(), 3, " Pixel Clock Divider Source: %s\n", (mc68328->regs.lckcon & 0x01) ? "PIX" : "SYS");
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfffa26) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfffa26) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0xa28:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: LLBAR = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: LLBAR = %02x\n", data & 0x00ff);
mc68328->regs.llbar = data & 0x00ff;
- verboselog(device->machine(), 3, " Address: %d\n", (mc68328->regs.llbar & 0x7f) * ((mc68328->regs.lpicf & 0x01) ? 8 : 16));
+ verboselog(space.machine(), 3, " Address: %d\n", (mc68328->regs.llbar & 0x7f) * ((mc68328->regs.lpicf & 0x01) ? 8 : 16));
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfffa28) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfffa28) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0xa2a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: LOTCR = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: LOTCR = %02x\n", data & 0x00ff);
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfffa2a) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfffa2a) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0xa2c:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: LPOSR = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: LPOSR = %02x\n", data & 0x00ff);
mc68328->regs.lposr = data & 0x00ff;
- verboselog(device->machine(), 3, " Byte Offset: %d\n", (mc68328->regs.lposr >> 3) & 0x01);
- verboselog(device->machine(), 3, " Pixel Offset: %d\n", mc68328->regs.lposr & 0x07);
+ verboselog(space.machine(), 3, " Byte Offset: %d\n", (mc68328->regs.lposr >> 3) & 0x01);
+ verboselog(space.machine(), 3, " Pixel Offset: %d\n", mc68328->regs.lposr & 0x07);
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfffa2c) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfffa2c) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0xa30:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_w: LFRCM = %02x\n", data & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: LFRCM = %02x\n", data & 0x00ff);
mc68328->regs.lfrcm = data & 0x00ff;
- verboselog(device->machine(), 3, " X Modulation: %d\n", (mc68328->regs.lfrcm >> 4) & 0x0f);
- verboselog(device->machine(), 3, " Y Modulation: %d\n", mc68328->regs.lfrcm & 0x0f);
+ verboselog(space.machine(), 3, " X Modulation: %d\n", (mc68328->regs.lfrcm >> 4) & 0x0f);
+ verboselog(space.machine(), 3, " Y Modulation: %d\n", mc68328->regs.lfrcm & 0x0f);
}
else
{
- verboselog(device->machine(), 2, "mc68328_w: Unknown address (0xfffa30) = %02x\n", (data >> 8) & 0x00ff);
+ verboselog(space.machine(), 2, "mc68328_w: Unknown address (0xfffa30) = %02x\n", (data >> 8) & 0x00ff);
}
break;
case 0xa32:
- verboselog(device->machine(), 2, "mc68328_w: LGPMR = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: LGPMR = %04x\n", data);
mc68328->regs.lgpmr = data;
- verboselog(device->machine(), 3, " Palette 0: %d\n", (mc68328->regs.lgpmr >> 8) & 0x07);
- verboselog(device->machine(), 3, " Palette 1: %d\n", (mc68328->regs.lgpmr >> 12) & 0x07);
- verboselog(device->machine(), 3, " Palette 2: %d\n", (mc68328->regs.lgpmr >> 0) & 0x07);
- verboselog(device->machine(), 3, " Palette 3: %d\n", (mc68328->regs.lgpmr >> 4) & 0x07);
+ verboselog(space.machine(), 3, " Palette 0: %d\n", (mc68328->regs.lgpmr >> 8) & 0x07);
+ verboselog(space.machine(), 3, " Palette 1: %d\n", (mc68328->regs.lgpmr >> 12) & 0x07);
+ verboselog(space.machine(), 3, " Palette 2: %d\n", (mc68328->regs.lgpmr >> 0) & 0x07);
+ verboselog(space.machine(), 3, " Palette 3: %d\n", (mc68328->regs.lgpmr >> 4) & 0x07);
break;
case 0xb00:
- verboselog(device->machine(), 2, "mc68328_w: HMSR(0) = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: HMSR(0) = %04x\n", data);
mc68328->regs.hmsr &= ~(mem_mask << 16);
mc68328->regs.hmsr |= (data & mem_mask) << 16;
mc68328->regs.hmsr &= 0x1f3f003f;
break;
case 0xb02:
- verboselog(device->machine(), 2, "mc68328_w: HMSR(16) = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: HMSR(16) = %04x\n", data);
mc68328->regs.hmsr &= 0xffff0000 | (~mem_mask);
mc68328->regs.hmsr |= data & mem_mask;
mc68328->regs.hmsr &= 0x1f3f003f;
break;
case 0xb04:
- verboselog(device->machine(), 2, "mc68328_w: ALARM(0) = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: ALARM(0) = %04x\n", data);
mc68328->regs.alarm &= ~(mem_mask << 16);
mc68328->regs.alarm |= (data & mem_mask) << 16;
mc68328->regs.alarm &= 0x1f3f003f;
break;
case 0xb06:
- verboselog(device->machine(), 2, "mc68328_w: ALARM(16) = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: ALARM(16) = %04x\n", data);
mc68328->regs.alarm &= 0xffff0000 | (~mem_mask);
mc68328->regs.alarm |= data & mem_mask;
mc68328->regs.alarm &= 0x1f3f003f;
break;
case 0xb0c:
- verboselog(device->machine(), 2, "mc68328_w: RTCCTL = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: RTCCTL = %04x\n", data);
mc68328->regs.rtcctl = data & 0x00a0;
break;
case 0xb0e:
- verboselog(device->machine(), 2, "mc68328_w: RTCISR = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: RTCISR = %04x\n", data);
mc68328->regs.rtcisr &= ~data;
if(mc68328->regs.rtcisr == 0)
{
@@ -1586,17 +1586,17 @@ WRITE16_DEVICE_HANDLER( mc68328_w )
break;
case 0xb10:
- verboselog(device->machine(), 2, "mc68328_w: RTCIENR = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: RTCIENR = %04x\n", data);
mc68328->regs.rtcienr = data & 0x001f;
break;
case 0xb12:
- verboselog(device->machine(), 2, "mc68328_w: STPWTCH = %04x\n", data);
+ verboselog(space.machine(), 2, "mc68328_w: STPWTCH = %04x\n", data);
mc68328->regs.stpwtch = data & 0x003f;
break;
default:
- verboselog(device->machine(), 0, "mc68328_w: Unknown address (0x%06x) = %04x (%04x)\n", 0xfff000 + address, data, mem_mask);
+ verboselog(space.machine(), 0, "mc68328_w: Unknown address (0x%06x) = %04x (%04x)\n", 0xfff000 + address, data, mem_mask);
break;
}
}
@@ -1612,192 +1612,192 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x000:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfff001)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfff001)\n", mem_mask);
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): SCR = %02x\n", mem_mask, mc68328->regs.scr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): SCR = %02x\n", mem_mask, mc68328->regs.scr);
return mc68328->regs.scr << 8;
}
break;
case 0x100:
- verboselog(device->machine(), 2, "mc68328_r (%04x): GRPBASEA = %04x\n", mem_mask, mc68328->regs.grpbasea);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): GRPBASEA = %04x\n", mem_mask, mc68328->regs.grpbasea);
return mc68328->regs.grpbasea;
case 0x102:
- verboselog(device->machine(), 2, "mc68328_r (%04x): GRPBASEB = %04x\n", mem_mask, mc68328->regs.grpbaseb);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): GRPBASEB = %04x\n", mem_mask, mc68328->regs.grpbaseb);
return mc68328->regs.grpbaseb;
case 0x104:
- verboselog(device->machine(), 2, "mc68328_r (%04x): GRPBASEC = %04x\n", mem_mask, mc68328->regs.grpbasec);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): GRPBASEC = %04x\n", mem_mask, mc68328->regs.grpbasec);
return mc68328->regs.grpbasec;
case 0x106:
- verboselog(device->machine(), 2, "mc68328_r (%04x): GRPBASED = %04x\n", mem_mask, mc68328->regs.grpbased);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): GRPBASED = %04x\n", mem_mask, mc68328->regs.grpbased);
return mc68328->regs.grpbased;
case 0x108:
- verboselog(device->machine(), 2, "mc68328_r (%04x): GRPMASKA = %04x\n", mem_mask, mc68328->regs.grpmaska);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): GRPMASKA = %04x\n", mem_mask, mc68328->regs.grpmaska);
return mc68328->regs.grpmaska;
case 0x10a:
- verboselog(device->machine(), 2, "mc68328_r (%04x): GRPMASKB = %04x\n", mem_mask, mc68328->regs.grpmaskb);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): GRPMASKB = %04x\n", mem_mask, mc68328->regs.grpmaskb);
return mc68328->regs.grpmaskb;
case 0x10c:
- verboselog(device->machine(), 2, "mc68328_r (%04x): GRPMASKC = %04x\n", mem_mask, mc68328->regs.grpmaskc);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): GRPMASKC = %04x\n", mem_mask, mc68328->regs.grpmaskc);
return mc68328->regs.grpmaskc;
case 0x10e:
- verboselog(device->machine(), 2, "mc68328_r (%04x): GRPMASKD = %04x\n", mem_mask, mc68328->regs.grpmaskd);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): GRPMASKD = %04x\n", mem_mask, mc68328->regs.grpmaskd);
return mc68328->regs.grpmaskd;
case 0x110:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSA0(0) = %04x\n", mem_mask, mc68328->regs.csa0 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSA0(0) = %04x\n", mem_mask, mc68328->regs.csa0 & 0x0000ffff);
return mc68328->regs.csa0 & 0x0000ffff;
case 0x112:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSA0(16) = %04x\n", mem_mask, mc68328->regs.csa0 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSA0(16) = %04x\n", mem_mask, mc68328->regs.csa0 >> 16);
return mc68328->regs.csa0 >> 16;
case 0x114:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSA1(0) = %04x\n", mem_mask, mc68328->regs.csa1 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSA1(0) = %04x\n", mem_mask, mc68328->regs.csa1 & 0x0000ffff);
return mc68328->regs.csa1 & 0x0000ffff;
case 0x116:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSA1(16) = %04x\n", mem_mask, mc68328->regs.csa1 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSA1(16) = %04x\n", mem_mask, mc68328->regs.csa1 >> 16);
return mc68328->regs.csa1 >> 16;
case 0x118:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSA2(0) = %04x\n", mem_mask, mc68328->regs.csa2 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSA2(0) = %04x\n", mem_mask, mc68328->regs.csa2 & 0x0000ffff);
return mc68328->regs.csa2 & 0x0000ffff;
case 0x11a:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSA2(16) = %04x\n", mem_mask, mc68328->regs.csa2 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSA2(16) = %04x\n", mem_mask, mc68328->regs.csa2 >> 16);
return mc68328->regs.csa2 >> 16;
case 0x11c:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSA3(0) = %04x\n", mem_mask, mc68328->regs.csa3 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSA3(0) = %04x\n", mem_mask, mc68328->regs.csa3 & 0x0000ffff);
return mc68328->regs.csa3 & 0x0000ffff;
case 0x11e:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSA3(16) = %04x\n", mem_mask, mc68328->regs.csa3 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSA3(16) = %04x\n", mem_mask, mc68328->regs.csa3 >> 16);
return mc68328->regs.csa3 >> 16;
case 0x120:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSB0(0) = %04x\n", mem_mask, mc68328->regs.csb0 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSB0(0) = %04x\n", mem_mask, mc68328->regs.csb0 & 0x0000ffff);
return mc68328->regs.csb0 & 0x0000ffff;
case 0x122:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSB0(16) = %04x\n", mem_mask, mc68328->regs.csb0 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSB0(16) = %04x\n", mem_mask, mc68328->regs.csb0 >> 16);
return mc68328->regs.csb0 >> 16;
case 0x124:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSB1(0) = %04x\n", mem_mask, mc68328->regs.csb1 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSB1(0) = %04x\n", mem_mask, mc68328->regs.csb1 & 0x0000ffff);
return mc68328->regs.csb1 & 0x0000ffff;
case 0x126:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSB1(16) = %04x\n", mem_mask, mc68328->regs.csb1 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSB1(16) = %04x\n", mem_mask, mc68328->regs.csb1 >> 16);
return mc68328->regs.csb1 >> 16;
case 0x128:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSB2(0) = %04x\n", mem_mask, mc68328->regs.csb2 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSB2(0) = %04x\n", mem_mask, mc68328->regs.csb2 & 0x0000ffff);
return mc68328->regs.csb2 & 0x0000ffff;
case 0x12a:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSB2(16) = %04x\n", mem_mask, mc68328->regs.csb2 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSB2(16) = %04x\n", mem_mask, mc68328->regs.csb2 >> 16);
return mc68328->regs.csb2 >> 16;
case 0x12c:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSB3(0) = %04x\n", mem_mask, mc68328->regs.csb3 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSB3(0) = %04x\n", mem_mask, mc68328->regs.csb3 & 0x0000ffff);
return mc68328->regs.csb3 & 0x0000ffff;
case 0x12e:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSB3(16) = %04x\n", mem_mask, mc68328->regs.csb3 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSB3(16) = %04x\n", mem_mask, mc68328->regs.csb3 >> 16);
return mc68328->regs.csb3 >> 16;
case 0x130:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSC0(0) = %04x\n", mem_mask, mc68328->regs.csc0 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSC0(0) = %04x\n", mem_mask, mc68328->regs.csc0 & 0x0000ffff);
return mc68328->regs.csc0 & 0x0000ffff;
case 0x132:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSC0(16) = %04x\n", mem_mask, mc68328->regs.csc0 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSC0(16) = %04x\n", mem_mask, mc68328->regs.csc0 >> 16);
return mc68328->regs.csc0 >> 16;
case 0x134:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSC1(0) = %04x\n", mem_mask, mc68328->regs.csc1 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSC1(0) = %04x\n", mem_mask, mc68328->regs.csc1 & 0x0000ffff);
return mc68328->regs.csc1 & 0x0000ffff;
case 0x136:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSC1(16) = %04x\n", mem_mask, mc68328->regs.csc1 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSC1(16) = %04x\n", mem_mask, mc68328->regs.csc1 >> 16);
return mc68328->regs.csc1 >> 16;
case 0x138:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSC2(0) = %04x\n", mem_mask, mc68328->regs.csc2 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSC2(0) = %04x\n", mem_mask, mc68328->regs.csc2 & 0x0000ffff);
return mc68328->regs.csc2 & 0x0000ffff;
case 0x13a:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSC2(16) = %04x\n", mem_mask, mc68328->regs.csc2 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSC2(16) = %04x\n", mem_mask, mc68328->regs.csc2 >> 16);
return mc68328->regs.csc2 >> 16;
case 0x13c:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSC3(0) = %04x\n", mem_mask, mc68328->regs.csc3 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSC3(0) = %04x\n", mem_mask, mc68328->regs.csc3 & 0x0000ffff);
return mc68328->regs.csc3 & 0x0000ffff;
case 0x13e:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSC3(16) = %04x\n", mem_mask, mc68328->regs.csc3 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSC3(16) = %04x\n", mem_mask, mc68328->regs.csc3 >> 16);
return mc68328->regs.csc3 >> 16;
case 0x140:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSD0(0) = %04x\n", mem_mask, mc68328->regs.csd0 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSD0(0) = %04x\n", mem_mask, mc68328->regs.csd0 & 0x0000ffff);
return mc68328->regs.csd0 & 0x0000ffff;
case 0x142:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSD0(16) = %04x\n", mem_mask, mc68328->regs.csd0 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSD0(16) = %04x\n", mem_mask, mc68328->regs.csd0 >> 16);
return mc68328->regs.csd0 >> 16;
case 0x144:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSD1(0) = %04x\n", mem_mask, mc68328->regs.csd1 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSD1(0) = %04x\n", mem_mask, mc68328->regs.csd1 & 0x0000ffff);
return mc68328->regs.csd1 & 0x0000ffff;
case 0x146:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSD1(16) = %04x\n", mem_mask, mc68328->regs.csd1 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSD1(16) = %04x\n", mem_mask, mc68328->regs.csd1 >> 16);
return mc68328->regs.csd1 >> 16;
case 0x148:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSD2(0) = %04x\n", mem_mask, mc68328->regs.csd2 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSD2(0) = %04x\n", mem_mask, mc68328->regs.csd2 & 0x0000ffff);
return mc68328->regs.csd2 & 0x0000ffff;
case 0x14a:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSD2(16) = %04x\n", mem_mask, mc68328->regs.csd2 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSD2(16) = %04x\n", mem_mask, mc68328->regs.csd2 >> 16);
return mc68328->regs.csd2 >> 16;
case 0x14c:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSD3(0) = %04x\n", mem_mask, mc68328->regs.csd3 & 0x0000ffff);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSD3(0) = %04x\n", mem_mask, mc68328->regs.csd3 & 0x0000ffff);
return mc68328->regs.csd3 & 0x0000ffff;
case 0x14e:
- verboselog(device->machine(), 5, "mc68328_r (%04x): CSD3(16) = %04x\n", mem_mask, mc68328->regs.csd3 >> 16);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): CSD3(16) = %04x\n", mem_mask, mc68328->regs.csd3 >> 16);
return mc68328->regs.csd3 >> 16;
case 0x200:
- verboselog(device->machine(), 2, "mc68328_r (%04x): PLLCR = %04x\n", mem_mask, mc68328->regs.pllcr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PLLCR = %04x\n", mem_mask, mc68328->regs.pllcr);
return mc68328->regs.pllcr;
case 0x202:
- verboselog(device->machine(), 2, "mc68328_r (%04x): PLLFSR = %04x\n", mem_mask, mc68328->regs.pllfsr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PLLFSR = %04x\n", mem_mask, mc68328->regs.pllfsr);
mc68328->regs.pllfsr ^= 0x8000;
return mc68328->regs.pllfsr;
case 0x206:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfff206)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfff206)\n", mem_mask);
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PCTLR = %02x\n", mem_mask, mc68328->regs.pctlr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PCTLR = %02x\n", mem_mask, mc68328->regs.pctlr);
return mc68328->regs.pctlr << 8;
}
break;
@@ -1805,55 +1805,55 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x300:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfff301)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfff301)\n", mem_mask);
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): IVR = %02x\n", mem_mask, mc68328->regs.ivr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): IVR = %02x\n", mem_mask, mc68328->regs.ivr);
return mc68328->regs.ivr << 8;
}
break;
case 0x302:
- verboselog(device->machine(), 2, "mc68328_r (%04x): ICR = %04x\n", mem_mask, mc68328->regs.icr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): ICR = %04x\n", mem_mask, mc68328->regs.icr);
return mc68328->regs.icr;
case 0x304:
- verboselog(device->machine(), 2, "mc68328_r (%04x): IMR(16) = %04x\n", mem_mask, mc68328->regs.imr >> 16);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): IMR(16) = %04x\n", mem_mask, mc68328->regs.imr >> 16);
return mc68328->regs.imr >> 16;
case 0x306:
- verboselog(device->machine(), 2, "mc68328_r (%04x): IMR(0) = %04x\n", mem_mask, mc68328->regs.imr & 0x0000ffff);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): IMR(0) = %04x\n", mem_mask, mc68328->regs.imr & 0x0000ffff);
return mc68328->regs.imr & 0x0000ffff;
case 0x308:
- verboselog(device->machine(), 2, "mc68328_r (%04x): IWR(16) = %04x\n", mem_mask, mc68328->regs.iwr >> 16);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): IWR(16) = %04x\n", mem_mask, mc68328->regs.iwr >> 16);
return mc68328->regs.iwr >> 16;
case 0x30a:
- verboselog(device->machine(), 2, "mc68328_r (%04x): IWR(0) = %04x\n", mem_mask, mc68328->regs.iwr & 0x0000ffff);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): IWR(0) = %04x\n", mem_mask, mc68328->regs.iwr & 0x0000ffff);
return mc68328->regs.iwr & 0x0000ffff;
case 0x30c:
- verboselog(device->machine(), 2, "mc68328_r (%04x): ISR(16) = %04x\n", mem_mask, mc68328->regs.isr >> 16);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): ISR(16) = %04x\n", mem_mask, mc68328->regs.isr >> 16);
return mc68328->regs.isr >> 16;
case 0x30e:
- verboselog(device->machine(), 2, "mc68328_r (%04x): ISR(0) = %04x\n", mem_mask, mc68328->regs.isr & 0x0000ffff);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): ISR(0) = %04x\n", mem_mask, mc68328->regs.isr & 0x0000ffff);
return mc68328->regs.isr & 0x0000ffff;
case 0x310:
- verboselog(device->machine(), 2, "mc68328_r (%04x): IPR(16) = %04x\n", mem_mask, mc68328->regs.ipr >> 16);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): IPR(16) = %04x\n", mem_mask, mc68328->regs.ipr >> 16);
return mc68328->regs.ipr >> 16;
case 0x312:
- verboselog(device->machine(), 2, "mc68328_r (%04x): IPR(0) = %04x\n", mem_mask, mc68328->regs.ipr & 0x0000ffff);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): IPR(0) = %04x\n", mem_mask, mc68328->regs.ipr & 0x0000ffff);
return mc68328->regs.ipr & 0x0000ffff;
case 0x400:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PADATA = %02x\n", mem_mask, mc68328->regs.padata);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PADATA = %02x\n", mem_mask, mc68328->regs.padata);
if(!mc68328->in_port_a.isnull())
{
return mc68328->in_port_a( 0 );
@@ -1865,7 +1865,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PADIR = %02x\n", mem_mask, mc68328->regs.padir);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PADIR = %02x\n", mem_mask, mc68328->regs.padir);
return mc68328->regs.padir << 8;
}
break;
@@ -1873,19 +1873,19 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x402:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PASEL = %02x\n", mem_mask, mc68328->regs.pasel);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PASEL = %02x\n", mem_mask, mc68328->regs.pasel);
return mc68328->regs.pasel;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfff402)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfff402)\n", mem_mask);
}
break;
case 0x408:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PBDATA = %02x\n", mem_mask, mc68328->regs.pbdata);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PBDATA = %02x\n", mem_mask, mc68328->regs.pbdata);
if(!mc68328->in_port_b.isnull())
{
return mc68328->in_port_b( 0 );
@@ -1897,7 +1897,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PBDIR = %02x\n", mem_mask, mc68328->regs.pbdir);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PBDIR = %02x\n", mem_mask, mc68328->regs.pbdir);
return mc68328->regs.pbdir << 8;
}
break;
@@ -1905,19 +1905,19 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x40a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PBSEL = %02x\n", mem_mask, mc68328->regs.pbsel);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PBSEL = %02x\n", mem_mask, mc68328->regs.pbsel);
return mc68328->regs.pbsel;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfff40a)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfff40a)\n", mem_mask);
}
break;
case 0x410:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PCDATA = %02x\n", mem_mask, mc68328->regs.pcdata);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PCDATA = %02x\n", mem_mask, mc68328->regs.pcdata);
if(!mc68328->in_port_c.isnull())
{
return mc68328->in_port_c( 0 );
@@ -1929,7 +1929,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PCDIR = %02x\n", mem_mask, mc68328->regs.pcdir);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PCDIR = %02x\n", mem_mask, mc68328->regs.pcdir);
return mc68328->regs.pcdir << 8;
}
break;
@@ -1937,19 +1937,19 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x412:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PCSEL = %02x\n", mem_mask, mc68328->regs.pcsel);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PCSEL = %02x\n", mem_mask, mc68328->regs.pcsel);
return mc68328->regs.pcsel;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfff412)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfff412)\n", mem_mask);
}
break;
case 0x418:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PDDATA = %02x\n", mem_mask, mc68328->regs.pddata);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PDDATA = %02x\n", mem_mask, mc68328->regs.pddata);
if(!mc68328->in_port_d.isnull())
{
return mc68328->in_port_d( 0 );
@@ -1961,7 +1961,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PDDIR = %02x\n", mem_mask, mc68328->regs.pddir);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PDDIR = %02x\n", mem_mask, mc68328->regs.pddir);
return mc68328->regs.pddir << 8;
}
break;
@@ -1969,11 +1969,11 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x41a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfff41b)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfff41b)\n", mem_mask);
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PDPUEN = %02x\n", mem_mask, mc68328->regs.pdpuen);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PDPUEN = %02x\n", mem_mask, mc68328->regs.pdpuen);
return mc68328->regs.pdpuen << 8;
}
break;
@@ -1981,12 +1981,12 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x41c:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PDIRQEN = %02x\n", mem_mask, mc68328->regs.pdirqen);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PDIRQEN = %02x\n", mem_mask, mc68328->regs.pdirqen);
return mc68328->regs.pdirqen;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PDPOL = %02x\n", mem_mask, mc68328->regs.pdpol);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PDPOL = %02x\n", mem_mask, mc68328->regs.pdpol);
return mc68328->regs.pdpol << 8;
}
break;
@@ -1994,19 +1994,19 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x41e:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PDIRQEDGE = %02x\n", mem_mask, mc68328->regs.pdirqedge);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PDIRQEDGE = %02x\n", mem_mask, mc68328->regs.pdirqedge);
return mc68328->regs.pdirqedge;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfff41e)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfff41e)\n", mem_mask);
}
break;
case 0x420:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PEDATA = %02x\n", mem_mask, mc68328->regs.pedata);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PEDATA = %02x\n", mem_mask, mc68328->regs.pedata);
if(!mc68328->in_port_e.isnull())
{
return mc68328->in_port_e( 0 );
@@ -2018,7 +2018,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PEDIR = %02x\n", mem_mask, mc68328->regs.pedir);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PEDIR = %02x\n", mem_mask, mc68328->regs.pedir);
return mc68328->regs.pedir << 8;
}
break;
@@ -2026,12 +2026,12 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x422:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PESEL = %02x\n", mem_mask, mc68328->regs.pesel);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PESEL = %02x\n", mem_mask, mc68328->regs.pesel);
return mc68328->regs.pesel;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PEPUEN = %02x\n", mem_mask, mc68328->regs.pepuen);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PEPUEN = %02x\n", mem_mask, mc68328->regs.pepuen);
return mc68328->regs.pepuen << 8;
}
break;
@@ -2039,7 +2039,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x428:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PFDATA = %02x\n", mem_mask, mc68328->regs.pfdata);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PFDATA = %02x\n", mem_mask, mc68328->regs.pfdata);
if(!mc68328->in_port_f.isnull())
{
return mc68328->in_port_f( 0 );
@@ -2051,7 +2051,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PFDIR = %02x\n", mem_mask, mc68328->regs.pfdir);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PFDIR = %02x\n", mem_mask, mc68328->regs.pfdir);
return mc68328->regs.pfdir << 8;
}
break;
@@ -2059,12 +2059,12 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x42a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PFSEL = %02x\n", mem_mask, mc68328->regs.pfsel);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PFSEL = %02x\n", mem_mask, mc68328->regs.pfsel);
return mc68328->regs.pfsel;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PFPUEN = %02x\n", mem_mask, mc68328->regs.pfpuen);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PFPUEN = %02x\n", mem_mask, mc68328->regs.pfpuen);
return mc68328->regs.pfpuen << 8;
}
break;
@@ -2072,7 +2072,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x430:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PGDATA = %02x\n", mem_mask, mc68328->regs.pgdata);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PGDATA = %02x\n", mem_mask, mc68328->regs.pgdata);
if(!mc68328->in_port_g.isnull())
{
return mc68328->in_port_g( 0 );
@@ -2084,7 +2084,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PGDIR = %02x\n", mem_mask, mc68328->regs.pgdir);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PGDIR = %02x\n", mem_mask, mc68328->regs.pgdir);
return mc68328->regs.pgdir << 8;
}
break;
@@ -2092,12 +2092,12 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x432:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PGSEL = %02x\n", mem_mask, mc68328->regs.pgsel);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PGSEL = %02x\n", mem_mask, mc68328->regs.pgsel);
return mc68328->regs.pgsel;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PGPUEN = %02x\n", mem_mask, mc68328->regs.pgpuen);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PGPUEN = %02x\n", mem_mask, mc68328->regs.pgpuen);
return mc68328->regs.pgpuen << 8;
}
break;
@@ -2105,7 +2105,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x438:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PJDATA = %02x\n", mem_mask, mc68328->regs.pjdata);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PJDATA = %02x\n", mem_mask, mc68328->regs.pjdata);
if(!mc68328->in_port_j.isnull())
{
return mc68328->in_port_j( 0 );
@@ -2117,7 +2117,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PJDIR = %02x\n", mem_mask, mc68328->regs.pjdir);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PJDIR = %02x\n", mem_mask, mc68328->regs.pjdir);
return mc68328->regs.pjdir << 8;
}
break;
@@ -2125,19 +2125,19 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x43a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PJSEL = %02x\n", mem_mask, mc68328->regs.pjsel);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PJSEL = %02x\n", mem_mask, mc68328->regs.pjsel);
return mc68328->regs.pjsel;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfff43a)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfff43a)\n", mem_mask);
}
break;
case 0x440:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PKDATA = %02x\n", mem_mask, mc68328->regs.pkdata);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PKDATA = %02x\n", mem_mask, mc68328->regs.pkdata);
if(!mc68328->in_port_k.isnull())
{
return mc68328->in_port_k( 0 );
@@ -2149,7 +2149,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PKDIR = %02x\n", mem_mask, mc68328->regs.pkdir);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PKDIR = %02x\n", mem_mask, mc68328->regs.pkdir);
return mc68328->regs.pkdir << 8;
}
break;
@@ -2157,12 +2157,12 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x442:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PKSEL = %02x\n", mem_mask, mc68328->regs.pksel);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PKSEL = %02x\n", mem_mask, mc68328->regs.pksel);
return mc68328->regs.pksel;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PKPUEN = %02x\n", mem_mask, mc68328->regs.pkpuen);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PKPUEN = %02x\n", mem_mask, mc68328->regs.pkpuen);
return mc68328->regs.pkpuen << 8;
}
break;
@@ -2170,7 +2170,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x448:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PMDATA = %02x\n", mem_mask, mc68328->regs.pmdata);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PMDATA = %02x\n", mem_mask, mc68328->regs.pmdata);
if(!mc68328->in_port_m.isnull())
{
return mc68328->in_port_m( 0 );
@@ -2182,7 +2182,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PMDIR = %02x\n", mem_mask, mc68328->regs.pmdir);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PMDIR = %02x\n", mem_mask, mc68328->regs.pmdir);
return mc68328->regs.pmdir << 8;
}
break;
@@ -2190,18 +2190,18 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0x44a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PMSEL = %02x\n", mem_mask, mc68328->regs.pmsel);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PMSEL = %02x\n", mem_mask, mc68328->regs.pmsel);
return mc68328->regs.pmsel;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): PMPUEN = %02x\n", mem_mask, mc68328->regs.pmpuen);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PMPUEN = %02x\n", mem_mask, mc68328->regs.pmpuen);
return mc68328->regs.pmpuen << 8;
}
break;
case 0x500:
- verboselog(device->machine(), 2, "mc68328_r (%04x): PWMC = %04x\n", mem_mask, mc68328->regs.pwmc);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PWMC = %04x\n", mem_mask, mc68328->regs.pwmc);
temp16 = mc68328->regs.pwmc;
if(mc68328->regs.pwmc & PWMC_PWMIRQ)
{
@@ -2211,85 +2211,85 @@ READ16_DEVICE_HANDLER( mc68328_r )
return temp16;
case 0x502:
- verboselog(device->machine(), 2, "mc68328_r (%04x): PWMP = %04x\n", mem_mask, mc68328->regs.pwmp);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PWMP = %04x\n", mem_mask, mc68328->regs.pwmp);
return mc68328->regs.pwmp;
case 0x504:
- verboselog(device->machine(), 2, "mc68328_r (%04x): PWMW = %04x\n", mem_mask, mc68328->regs.pwmw);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PWMW = %04x\n", mem_mask, mc68328->regs.pwmw);
return mc68328->regs.pwmw;
case 0x506:
- verboselog(device->machine(), 2, "mc68328_r (%04x): PWMCNT = %04x\n", mem_mask, mc68328->regs.pwmcnt);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): PWMCNT = %04x\n", mem_mask, mc68328->regs.pwmcnt);
return mc68328->regs.pwmcnt;
case 0x600:
- verboselog(device->machine(), 2, "mc68328_r (%04x): TCTL1 = %04x\n", mem_mask, mc68328->regs.tctl[0]);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): TCTL1 = %04x\n", mem_mask, mc68328->regs.tctl[0]);
return mc68328->regs.tctl[0];
case 0x602:
- verboselog(device->machine(), 2, "mc68328_r (%04x): TPRER1 = %04x\n", mem_mask, mc68328->regs.tprer[0]);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): TPRER1 = %04x\n", mem_mask, mc68328->regs.tprer[0]);
return mc68328->regs.tprer[0];
case 0x604:
- verboselog(device->machine(), 2, "mc68328_r (%04x): TCMP1 = %04x\n", mem_mask, mc68328->regs.tcmp[0]);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): TCMP1 = %04x\n", mem_mask, mc68328->regs.tcmp[0]);
return mc68328->regs.tcmp[0];
case 0x606:
- verboselog(device->machine(), 2, "mc68328_r (%04x): TCR1 = %04x\n", mem_mask, mc68328->regs.tcr[0]);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): TCR1 = %04x\n", mem_mask, mc68328->regs.tcr[0]);
return mc68328->regs.tcr[0];
case 0x608:
- verboselog(device->machine(), 2, "mc68328_r (%04x): TCN1 = %04x\n", mem_mask, mc68328->regs.tcn[0]);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): TCN1 = %04x\n", mem_mask, mc68328->regs.tcn[0]);
return mc68328->regs.tcn[0];
case 0x60a:
- verboselog(device->machine(), 5, "mc68328_r (%04x): TSTAT1 = %04x\n", mem_mask, mc68328->regs.tstat[0]);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): TSTAT1 = %04x\n", mem_mask, mc68328->regs.tstat[0]);
mc68328->regs.tclear[0] |= mc68328->regs.tstat[0];
return mc68328->regs.tstat[0];
case 0x60c:
- verboselog(device->machine(), 2, "mc68328_r (%04x): TCTL2 = %04x\n", mem_mask, mc68328->regs.tctl[1]);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): TCTL2 = %04x\n", mem_mask, mc68328->regs.tctl[1]);
return mc68328->regs.tctl[1];
case 0x60e:
- verboselog(device->machine(), 2, "mc68328_r (%04x): TPREP2 = %04x\n", mem_mask, mc68328->regs.tprer[1]);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): TPREP2 = %04x\n", mem_mask, mc68328->regs.tprer[1]);
return mc68328->regs.tprer[1];
case 0x610:
- verboselog(device->machine(), 2, "mc68328_r (%04x): TCMP2 = %04x\n", mem_mask, mc68328->regs.tcmp[1]);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): TCMP2 = %04x\n", mem_mask, mc68328->regs.tcmp[1]);
return mc68328->regs.tcmp[1];
case 0x612:
- verboselog(device->machine(), 2, "mc68328_r (%04x): TCR2 = %04x\n", mem_mask, mc68328->regs.tcr[1]);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): TCR2 = %04x\n", mem_mask, mc68328->regs.tcr[1]);
return mc68328->regs.tcr[1];
case 0x614:
- verboselog(device->machine(), 2, "mc68328_r (%04x): TCN2 = %04x\n", mem_mask, mc68328->regs.tcn[1]);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): TCN2 = %04x\n", mem_mask, mc68328->regs.tcn[1]);
return mc68328->regs.tcn[1];
case 0x616:
- verboselog(device->machine(), 2, "mc68328_r (%04x): TSTAT2 = %04x\n", mem_mask, mc68328->regs.tstat[1]);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): TSTAT2 = %04x\n", mem_mask, mc68328->regs.tstat[1]);
mc68328->regs.tclear[1] |= mc68328->regs.tstat[1];
return mc68328->regs.tstat[1];
case 0x618:
- verboselog(device->machine(), 2, "mc68328_r (%04x): WCTLR = %04x\n", mem_mask, mc68328->regs.wctlr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): WCTLR = %04x\n", mem_mask, mc68328->regs.wctlr);
return mc68328->regs.wctlr;
case 0x61a:
- verboselog(device->machine(), 2, "mc68328_r (%04x): WCMPR = %04x\n", mem_mask, mc68328->regs.wcmpr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): WCMPR = %04x\n", mem_mask, mc68328->regs.wcmpr);
return mc68328->regs.wcmpr;
case 0x61c:
- verboselog(device->machine(), 2, "mc68328_r (%04x): WCN = %04x\n", mem_mask, mc68328->regs.wcn);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): WCN = %04x\n", mem_mask, mc68328->regs.wcn);
return mc68328->regs.wcn;
case 0x700:
- verboselog(device->machine(), 2, "mc68328_r (%04x): SPISR = %04x\n", mem_mask, mc68328->regs.spisr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): SPISR = %04x\n", mem_mask, mc68328->regs.spisr);
return mc68328->regs.spisr;
case 0x800:
- verboselog(device->machine(), 2, "mc68328_r (%04x): SPIMDATA = %04x\n", mem_mask, mc68328->regs.spimdata);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): SPIMDATA = %04x\n", mem_mask, mc68328->regs.spimdata);
if(!mc68328->in_spim.isnull())
{
return mc68328->in_spim( 0, 0xffff );
@@ -2297,7 +2297,7 @@ READ16_DEVICE_HANDLER( mc68328_r )
return mc68328->regs.spimdata;
case 0x802:
- verboselog(device->machine(), 2, "mc68328_r (%04x): SPIMCONT = %04x\n", mem_mask, mc68328->regs.spimcont);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): SPIMCONT = %04x\n", mem_mask, mc68328->regs.spimcont);
if(mc68328->regs.spimcont & SPIM_XCH)
{
mc68328->regs.spimcont &= ~SPIM_XCH;
@@ -2307,86 +2307,86 @@ READ16_DEVICE_HANDLER( mc68328_r )
return mc68328->regs.spimcont;
case 0x900:
- verboselog(device->machine(), 2, "mc68328_r (%04x): USTCNT = %04x\n", mem_mask, mc68328->regs.ustcnt);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): USTCNT = %04x\n", mem_mask, mc68328->regs.ustcnt);
return mc68328->regs.ustcnt;
case 0x902:
- verboselog(device->machine(), 2, "mc68328_r (%04x): UBAUD = %04x\n", mem_mask, mc68328->regs.ubaud);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): UBAUD = %04x\n", mem_mask, mc68328->regs.ubaud);
return mc68328->regs.ubaud;
case 0x904:
- verboselog(device->machine(), 5, "mc68328_r (%04x): URX = %04x\n", mem_mask, mc68328->regs.urx);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): URX = %04x\n", mem_mask, mc68328->regs.urx);
return mc68328->regs.urx;
case 0x906:
- verboselog(device->machine(), 5, "mc68328_r (%04x): UTX = %04x\n", mem_mask, mc68328->regs.utx);
+ verboselog(space.machine(), 5, "mc68328_r (%04x): UTX = %04x\n", mem_mask, mc68328->regs.utx);
return mc68328->regs.utx | UTX_FIFO_EMPTY | UTX_FIFO_HALF | UTX_TX_AVAIL;
case 0x908:
- verboselog(device->machine(), 2, "mc68328_r (%04x): UMISC = %04x\n", mem_mask, mc68328->regs.umisc);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): UMISC = %04x\n", mem_mask, mc68328->regs.umisc);
return mc68328->regs.umisc;
case 0xa00:
- verboselog(device->machine(), 2, "mc68328_r (%04x): LSSA(16) = %04x\n", mem_mask, mc68328->regs.lssa >> 16);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LSSA(16) = %04x\n", mem_mask, mc68328->regs.lssa >> 16);
return mc68328->regs.lssa >> 16;
case 0xa02:
- verboselog(device->machine(), 2, "mc68328_r (%04x): LSSA(0) = %04x\n", mem_mask, mc68328->regs.lssa & 0x0000ffff);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LSSA(0) = %04x\n", mem_mask, mc68328->regs.lssa & 0x0000ffff);
return mc68328->regs.lssa & 0x0000ffff;
case 0xa04:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): LVPW = %02x\n", mem_mask, mc68328->regs.lvpw);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LVPW = %02x\n", mem_mask, mc68328->regs.lvpw);
return mc68328->regs.lvpw;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa04)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa04)\n", mem_mask);
}
break;
case 0xa08:
- verboselog(device->machine(), 2, "mc68328_r (%04x): LXMAX = %04x\n", mem_mask, mc68328->regs.lxmax);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LXMAX = %04x\n", mem_mask, mc68328->regs.lxmax);
return mc68328->regs.lxmax;
case 0xa0a:
- verboselog(device->machine(), 2, "mc68328_r (%04x): LYMAX = %04x\n", mem_mask, mc68328->regs.lymax);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LYMAX = %04x\n", mem_mask, mc68328->regs.lymax);
return mc68328->regs.lymax;
case 0xa18:
- verboselog(device->machine(), 2, "mc68328_r (%04x): LCXP = %04x\n", mem_mask, mc68328->regs.lcxp);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LCXP = %04x\n", mem_mask, mc68328->regs.lcxp);
return mc68328->regs.lcxp;
case 0xa1a:
- verboselog(device->machine(), 2, "mc68328_r (%04x): LCYP = %04x\n", mem_mask, mc68328->regs.lcyp);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LCYP = %04x\n", mem_mask, mc68328->regs.lcyp);
return mc68328->regs.lcyp;
case 0xa1c:
- verboselog(device->machine(), 2, "mc68328_r (%04x): LCWCH = %04x\n", mem_mask, mc68328->regs.lcwch);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LCWCH = %04x\n", mem_mask, mc68328->regs.lcwch);
return mc68328->regs.lcwch;
case 0xa1e:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): LBLKC = %02x\n", mem_mask, mc68328->regs.lblkc);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LBLKC = %02x\n", mem_mask, mc68328->regs.lblkc);
return mc68328->regs.lblkc;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa1e)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa1e)\n", mem_mask);
}
break;
case 0xa20:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): LPOLCF = %02x\n", mem_mask, mc68328->regs.lpolcf);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LPOLCF = %02x\n", mem_mask, mc68328->regs.lpolcf);
return mc68328->regs.lpolcf;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): LPICF = %02x\n", mem_mask, mc68328->regs.lpicf);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LPICF = %02x\n", mem_mask, mc68328->regs.lpicf);
return mc68328->regs.lpicf << 8;
}
break;
@@ -2394,125 +2394,125 @@ READ16_DEVICE_HANDLER( mc68328_r )
case 0xa22:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): LACDRC = %02x\n", mem_mask, mc68328->regs.lacdrc);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LACDRC = %02x\n", mem_mask, mc68328->regs.lacdrc);
return mc68328->regs.lacdrc;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa22)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa22)\n", mem_mask);
}
break;
case 0xa24:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): LPXCD = %02x\n", mem_mask, mc68328->regs.lpxcd);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LPXCD = %02x\n", mem_mask, mc68328->regs.lpxcd);
return mc68328->regs.lpxcd;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa24)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa24)\n", mem_mask);
}
break;
case 0xa26:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): LCKCON = %02x\n", mem_mask, mc68328->regs.lckcon);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LCKCON = %02x\n", mem_mask, mc68328->regs.lckcon);
return mc68328->regs.lckcon;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa26)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa26)\n", mem_mask);
}
break;
case 0xa28:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): LLBAR = %02x\n", mem_mask, mc68328->regs.llbar);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LLBAR = %02x\n", mem_mask, mc68328->regs.llbar);
return mc68328->regs.llbar;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa28)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa28)\n", mem_mask);
}
break;
case 0xa2a:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): LOTCR = %02x\n", mem_mask, mc68328->regs.lotcr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LOTCR = %02x\n", mem_mask, mc68328->regs.lotcr);
return mc68328->regs.lotcr;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa2a)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa2a)\n", mem_mask);
}
break;
case 0xa2c:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): LPOSR = %02x\n", mem_mask, mc68328->regs.lposr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LPOSR = %02x\n", mem_mask, mc68328->regs.lposr);
return mc68328->regs.lposr;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa2c)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa2c)\n", mem_mask);
}
break;
case 0xa30:
if( mem_mask & 0x00ff )
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): LFRCM = %02x\n", mem_mask, mc68328->regs.lfrcm);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LFRCM = %02x\n", mem_mask, mc68328->regs.lfrcm);
return mc68328->regs.lfrcm;
}
else
{
- verboselog(device->machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa30)\n", mem_mask);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): Unknown address (0xfffa30)\n", mem_mask);
}
break;
case 0xa32:
- verboselog(device->machine(), 2, "mc68328_r (%04x): LGPMR = %04x\n", mem_mask, mc68328->regs.lgpmr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): LGPMR = %04x\n", mem_mask, mc68328->regs.lgpmr);
return mc68328->regs.lgpmr;
case 0xb00:
- verboselog(device->machine(), 2, "mc68328_r (%04x): HMSR(0) = %04x\n", mem_mask, mc68328->regs.hmsr & 0x0000ffff);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): HMSR(0) = %04x\n", mem_mask, mc68328->regs.hmsr & 0x0000ffff);
return mc68328->regs.hmsr & 0x0000ffff;
case 0xb02:
- verboselog(device->machine(), 2, "mc68328_r (%04x): HMSR(16) = %04x\n", mem_mask, mc68328->regs.hmsr >> 16);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): HMSR(16) = %04x\n", mem_mask, mc68328->regs.hmsr >> 16);
return mc68328->regs.hmsr >> 16;
case 0xb04:
- verboselog(device->machine(), 2, "mc68328_r (%04x): ALARM(0) = %04x\n", mem_mask, mc68328->regs.alarm & 0x0000ffff);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): ALARM(0) = %04x\n", mem_mask, mc68328->regs.alarm & 0x0000ffff);
return mc68328->regs.alarm & 0x0000ffff;
case 0xb06:
- verboselog(device->machine(), 2, "mc68328_r (%04x): ALARM(16) = %04x\n", mem_mask, mc68328->regs.alarm >> 16);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): ALARM(16) = %04x\n", mem_mask, mc68328->regs.alarm >> 16);
return mc68328->regs.alarm >> 16;
case 0xb0c:
- verboselog(device->machine(), 2, "mc68328_r (%04x): RTCCTL = %04x\n", mem_mask, mc68328->regs.rtcctl);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): RTCCTL = %04x\n", mem_mask, mc68328->regs.rtcctl);
return mc68328->regs.rtcctl;
case 0xb0e:
- verboselog(device->machine(), 2, "mc68328_r (%04x): RTCISR = %04x\n", mem_mask, mc68328->regs.rtcisr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): RTCISR = %04x\n", mem_mask, mc68328->regs.rtcisr);
return mc68328->regs.rtcisr;
case 0xb10:
- verboselog(device->machine(), 2, "mc68328_r (%04x): RTCIENR = %04x\n", mem_mask, mc68328->regs.rtcienr);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): RTCIENR = %04x\n", mem_mask, mc68328->regs.rtcienr);
return mc68328->regs.rtcienr;
case 0xb12:
- verboselog(device->machine(), 2, "mc68328_r (%04x): STPWTCH = %04x\n", mem_mask, mc68328->regs.stpwtch);
+ verboselog(space.machine(), 2, "mc68328_r (%04x): STPWTCH = %04x\n", mem_mask, mc68328->regs.stpwtch);
return mc68328->regs.stpwtch;
default:
- verboselog(device->machine(), 0, "mc68328_r (%04x): Unknown address (0x%06x)\n", mem_mask, 0xfff000 + address);
+ verboselog(space.machine(), 0, "mc68328_r (%04x): Unknown address (0x%06x)\n", mem_mask, 0xfff000 + address);
break;
}
return 0;
diff --git a/src/mess/machine/mc6843.c b/src/mess/machine/mc6843.c
index f196456d45e..8773bfaeed9 100644
--- a/src/mess/machine/mc6843.c
+++ b/src/mess/machine/mc6843.c
@@ -427,7 +427,7 @@ READ8_DEVICE_HANDLER ( mc6843_r )
int cmd = mc6843->CMR & 0x0f;
LOG(( "%f $%04x mc6843_r: data input cmd=%s(%i), pos=%i/%i, GCR=%i, ",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ),
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ),
mc6843_cmd[cmd], cmd, mc6843->data_idx,
mc6843->data_size, mc6843->GCR ));
@@ -480,7 +480,7 @@ READ8_DEVICE_HANDLER ( mc6843_r )
{
/* XXX TODO: other read modes */
data = mc6843->data[0];
- logerror( "$%04x mc6843 read in unsupported command mode %i\n", device->machine().firstcpu->pcbase( ), cmd );
+ logerror( "$%04x mc6843 read in unsupported command mode %i\n", space.machine().firstcpu->pcbase( ), cmd );
}
LOG(( "data=%02X\n", data ));
@@ -491,14 +491,14 @@ READ8_DEVICE_HANDLER ( mc6843_r )
case 1: /* Current-Track Address Register (CTAR) */
data = mc6843->CTAR;
LOG(( "%f $%04x mc6843_r: read CTAR %i (actual=%i)\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), data,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), data,
floppy_drive_get_current_track( mc6843_floppy_image( device ) ) ));
break;
case 2: /* Interrupt Status Register (ISR) */
data = mc6843->ISR;
LOG(( "%f $%04x mc6843_r: read ISR %02X: cmd=%scomplete settle=%scomplete sense-rq=%i STRB=%i\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), data,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), data,
(data & 1) ? "" : "not-" , (data & 2) ? "" : "not-",
(data >> 2) & 1, (data >> 3) & 1 ));
@@ -524,7 +524,7 @@ READ8_DEVICE_HANDLER ( mc6843_r )
data = mc6843->STRA;
LOG(( "%f $%04x mc6843_r: read STRA %02X: data-rq=%i del-dta=%i ready=%i t0=%i wp=%i trk-dif=%i idx=%i busy=%i\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), data,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), data,
data & 1, (data >> 1) & 1, (data >> 2) & 1, (data >> 3) & 1,
(data >> 4) & 1, (data >> 5) & 1, (data >> 6) & 1, (data >> 7) & 1 ));
break;
@@ -533,7 +533,7 @@ READ8_DEVICE_HANDLER ( mc6843_r )
case 4: /* Status Register B (STRB) */
data = mc6843->STRB;
LOG(( "%f $%04x mc6843_r: read STRB %02X: data-err=%i CRC-err=%i dta--mrk-err=%i sect-mrk-err=%i seek-err=%i fi=%i wr-err=%i hard-err=%i\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), data,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), data,
data & 1, (data >> 1) & 1, (data >> 2) & 1, (data >> 3) & 1,
(data >> 4) & 1, (data >> 5) & 1, (data >> 6) & 1, (data >> 7) & 1 ));
@@ -545,12 +545,12 @@ READ8_DEVICE_HANDLER ( mc6843_r )
case 7: /* Logical-Track Address Register (LTAR) */
data = mc6843->LTAR;
LOG(( "%f $%04x mc6843_r: read LTAR %i (actual=%i)\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), data,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), data,
floppy_drive_get_current_track( mc6843_floppy_image( device ) ) ));
break;
default:
- logerror( "$%04x mc6843 invalid read offset %i\n", device->machine().firstcpu->pcbase( ), offset );
+ logerror( "$%04x mc6843 invalid read offset %i\n", space.machine().firstcpu->pcbase( ), offset );
}
return data;
@@ -567,7 +567,7 @@ WRITE8_DEVICE_HANDLER ( mc6843_w )
int FWF = (mc6843->CMR >> 4) & 1;
LOG(( "%f $%04x mc6843_w: data output cmd=%s(%i), pos=%i/%i, GCR=%i, data=%02X\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ),
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ),
mc6843_cmd[cmd], cmd, mc6843->data_idx,
mc6843->data_size, mc6843->GCR, data ));
@@ -584,7 +584,7 @@ WRITE8_DEVICE_HANDLER ( mc6843_w )
/* end of sector write */
device_t* img = mc6843_floppy_image( device );
- LOG(( "%f $%04x mc6843_w: write sector %i\n", device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), mc6843->data_id ));
+ LOG(( "%f $%04x mc6843_w: write sector %i\n", space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), mc6843->data_id ));
floppy_drive_write_sector_data(
img, mc6843->side, mc6843->data_id,
@@ -648,7 +648,7 @@ WRITE8_DEVICE_HANDLER ( mc6843_w )
UINT8 track = mc6843->data[1];
UINT8 sector = mc6843->data[3];
UINT8 filler = 0xe5; /* standard Thomson filler */
- LOG(( "%f $%04x mc6843_w: address id detected track=%i sector=%i\n", device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), track, sector));
+ LOG(( "%f $%04x mc6843_w: address id detected track=%i sector=%i\n", space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), track, sector));
floppy_drive_format_sector( img, mc6843->side, sector, track, 0, sector, 0, filler );
}
else
@@ -670,7 +670,7 @@ WRITE8_DEVICE_HANDLER ( mc6843_w )
else
{
/* XXX TODO: other write modes */
- logerror( "$%04x mc6843 write %02X in unsupported command mode %i (FWF=%i)\n", device->machine().firstcpu->pcbase( ), data, cmd, FWF );
+ logerror( "$%04x mc6843 write %02X in unsupported command mode %i (FWF=%i)\n", space.machine().firstcpu->pcbase( ), data, cmd, FWF );
}
break;
}
@@ -678,7 +678,7 @@ WRITE8_DEVICE_HANDLER ( mc6843_w )
case 1: /* Current-Track Address Register (CTAR) */
mc6843->CTAR = data & 0x7f;
LOG(( "%f $%04x mc6843_w: set CTAR to %i %02X (actual=%i) \n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), mc6843->CTAR, data,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), mc6843->CTAR, data,
floppy_drive_get_current_track( mc6843_floppy_image( device ) ) ));
break;
@@ -687,7 +687,7 @@ WRITE8_DEVICE_HANDLER ( mc6843_w )
int cmd = data & 15;
LOG(( "%f $%04x mc6843_w: set CMR to $%02X: cmd=%s(%i) FWF=%i DMA=%i ISR3-intr=%i fun-intr=%i\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ),
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ),
data, mc6843_cmd[cmd], cmd, (data >> 4) & 1, (data >> 5) & 1,
(data >> 6) & 1, (data >> 7) & 1 ));
@@ -734,36 +734,36 @@ WRITE8_DEVICE_HANDLER ( mc6843_w )
/* assume CLK freq = 1MHz (IBM 3740 compatibility) */
LOG(( "%f $%04x mc6843_w: set SUR to $%02X: head settling time=%fms, track-to-track seek time=%f\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ),
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ),
data, 4.096 * (data & 15), 1.024 * ((data >> 4) & 15) ));
break;
case 4: /* Sector Address Register (SAR) */
mc6843->SAR = data & 0x1f;
- LOG(( "%f $%04x mc6843_w: set SAR to %i (%02X)\n", device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), mc6843->SAR, data ));
+ LOG(( "%f $%04x mc6843_w: set SAR to %i (%02X)\n", space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), mc6843->SAR, data ));
break;
case 5: /* General Count Register (GCR) */
mc6843->GCR = data & 0x7f;
- LOG(( "%f $%04x mc6843_w: set GCR to %i (%02X)\n", device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), mc6843->GCR, data ));
+ LOG(( "%f $%04x mc6843_w: set GCR to %i (%02X)\n", space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), mc6843->GCR, data ));
break;
case 6: /* CRC Control Register (CCR) */
mc6843->CCR = data & 3;
LOG(( "%f $%04x mc6843_w: set CCR to %02X: CRC=%s shift=%i\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), data,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), data,
(data & 1) ? "enabled" : "disabled", (data >> 1) & 1 ));
break;
case 7: /* Logical-Track Address Register (LTAR) */
mc6843->LTAR = data & 0x7f;
LOG(( "%f $%04x mc6843_w: set LTAR to %i %02X (actual=%i)\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), mc6843->LTAR, data,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), mc6843->LTAR, data,
floppy_drive_get_current_track( mc6843_floppy_image( device ) ) ));
break;
default:
- logerror( "$%04x mc6843 invalid write offset %i (data=$%02X)\n", device->machine().firstcpu->pcbase( ), offset, data );
+ logerror( "$%04x mc6843 invalid write offset %i (data=$%02X)\n", space.machine().firstcpu->pcbase( ), offset, data );
}
}
diff --git a/src/mess/machine/mc6846.c b/src/mess/machine/mc6846.c
index dae252320e9..b8324d0d162 100644
--- a/src/mess/machine/mc6846.c
+++ b/src/mess/machine/mc6846.c
@@ -281,7 +281,7 @@ READ8_DEVICE_HANDLER ( mc6846_r )
case 0:
case 4:
LOG (( "$%04x %f: mc6846 CSR read $%02X intr=%i (timer=%i, cp1=%i, cp2=%i)\n",
- device->machine().firstcpu->pcbase( ), device->machine().time().as_double(),
+ space.machine().firstcpu->pcbase( ), space.machine().time().as_double(),
mc6846->csr, (mc6846->csr >> 7) & 1,
mc6846->csr & 1, (mc6846->csr >> 1) & 1, (mc6846->csr >> 2) & 1 ));
mc6846->csr0_to_be_cleared = mc6846->csr & 1;
@@ -290,15 +290,15 @@ READ8_DEVICE_HANDLER ( mc6846_r )
return mc6846->csr;
case 1:
- LOG (( "$%04x %f: mc6846 PCR read $%02X\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), mc6846->pcr ));
+ LOG (( "$%04x %f: mc6846 PCR read $%02X\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), mc6846->pcr ));
return mc6846->pcr;
case 2:
- LOG (( "$%04x %f: mc6846 DDR read $%02X\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), mc6846->ddr ));
+ LOG (( "$%04x %f: mc6846 DDR read $%02X\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), mc6846->ddr ));
return mc6846->ddr;
case 3:
- LOG (( "$%04x %f: mc6846 PORT read $%02X\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), PORT ));
+ LOG (( "$%04x %f: mc6846 PORT read $%02X\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), PORT ));
if ( ! (mc6846->pcr & 0x80) )
{
if ( mc6846->csr1_to_be_cleared )
@@ -312,11 +312,11 @@ READ8_DEVICE_HANDLER ( mc6846_r )
return PORT;
case 5:
- LOG (( "$%04x %f: mc6846 TCR read $%02X\n",device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), mc6846->tcr ));
+ LOG (( "$%04x %f: mc6846 TCR read $%02X\n",space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), mc6846->tcr ));
return mc6846->tcr;
case 6:
- LOG (( "$%04x %f: mc6846 COUNTER hi read $%02X\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), mc6846_counter( device ) >> 8 ));
+ LOG (( "$%04x %f: mc6846 COUNTER hi read $%02X\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), mc6846_counter( device ) >> 8 ));
if ( mc6846->csr0_to_be_cleared )
{
mc6846->csr &= ~1;
@@ -326,7 +326,7 @@ READ8_DEVICE_HANDLER ( mc6846_r )
return mc6846_counter( device ) >> 8;
case 7:
- LOG (( "$%04x %f: mc6846 COUNTER low read $%02X\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), mc6846_counter( device ) & 0xff ));
+ LOG (( "$%04x %f: mc6846 COUNTER low read $%02X\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), mc6846_counter( device ) & 0xff ));
if ( mc6846->csr0_to_be_cleared )
{
mc6846->csr &= ~1;
@@ -336,7 +336,7 @@ READ8_DEVICE_HANDLER ( mc6846_r )
return mc6846_counter( device ) & 0xff;
default:
- logerror( "$%04x mc6846 invalid read offset %i\n", device->machine().firstcpu->pcbase( ), offset );
+ logerror( "$%04x mc6846 invalid read offset %i\n", space.machine().firstcpu->pcbase( ), offset );
}
return 0;
}
@@ -367,7 +367,7 @@ WRITE8_DEVICE_HANDLER ( mc6846_w )
"latcged,pos-edge", "latcged,pos-edge,intr"
};
LOG (( "$%04x %f: mc6846 PCR write $%02X reset=%i cp2=%s cp1=%s\n",
- device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), data,
+ space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), data,
(data >> 7) & 1, cp2[ (data >> 3) & 7 ], cp1[ data & 7 ] ));
}
@@ -380,7 +380,7 @@ WRITE8_DEVICE_HANDLER ( mc6846_w )
mc6846_update_irq( device );
}
if ( data & 4 )
- logerror( "$%04x mc6846 CP1 latching not implemented\n", device->machine().firstcpu->pcbase( ) );
+ logerror( "$%04x mc6846 CP1 latching not implemented\n", space.machine().firstcpu->pcbase( ) );
if (data & 0x20)
{
if (data & 0x10)
@@ -390,12 +390,12 @@ WRITE8_DEVICE_HANDLER ( mc6846_w )
mc6846->out_cp2( 0, mc6846->cp2_cpu );
}
else
- logerror( "$%04x mc6846 acknowledge not implemented\n", device->machine().firstcpu->pcbase( ) );
+ logerror( "$%04x mc6846 acknowledge not implemented\n", space.machine().firstcpu->pcbase( ) );
}
break;
case 2:
- LOG (( "$%04x %f: mc6846 DDR write $%02X\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), data ));
+ LOG (( "$%04x %f: mc6846 DDR write $%02X\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), data ));
if ( ! (mc6846->pcr & 0x80) )
{
mc6846->ddr = data;
@@ -405,7 +405,7 @@ WRITE8_DEVICE_HANDLER ( mc6846_w )
break;
case 3:
- LOG (( "$%04x %f: mc6846 PORT write $%02X (mask=$%02X)\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), data,mc6846->ddr ));
+ LOG (( "$%04x %f: mc6846 PORT write $%02X (mask=$%02X)\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), data,mc6846->ddr ));
if ( ! (mc6846->pcr & 0x80) )
{
mc6846->pdr = data;
@@ -414,12 +414,12 @@ WRITE8_DEVICE_HANDLER ( mc6846_w )
if ( mc6846->csr1_to_be_cleared && (mc6846->csr & 2) )
{
mc6846->csr &= ~2;
- LOG (( "$%04x %f: mc6846 CP1 intr reset\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double() ));
+ LOG (( "$%04x %f: mc6846 CP1 intr reset\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double() ));
}
if ( mc6846->csr2_to_be_cleared && (mc6846->csr & 4) )
{
mc6846->csr &= ~4;
- LOG (( "$%04x %f: mc6846 CP2 intr reset\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double() ));
+ LOG (( "$%04x %f: mc6846 CP2 intr reset\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double() ));
}
mc6846->csr1_to_be_cleared = 0;
mc6846->csr2_to_be_cleared = 0;
@@ -435,7 +435,7 @@ WRITE8_DEVICE_HANDLER ( mc6846_w )
"freq-cmp", "freq-cmp", "pulse-cmp", "pulse-cmp"
};
LOG (( "$%04x %f: mc6846 TCR write $%02X reset=%i clock=%s scale=%i mode=%s out=%s\n",
- device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), data,
+ space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), data,
(data >> 7) & 1, (data & 0x40) ? "extern" : "sys",
(data & 0x40) ? 1 : 8, mode[ (data >> 1) & 7 ],
(data & 1) ? "enabled" : "0" ));
@@ -469,7 +469,7 @@ WRITE8_DEVICE_HANDLER ( mc6846_w )
case 7:
mc6846->latch = ( ((UINT16) mc6846->time_MSB) << 8 ) + data;
- LOG (( "$%04x %f: mc6846 COUNT write %i\n", device->machine().firstcpu->pcbase( ), device->machine().time().as_double(), mc6846->latch ));
+ LOG (( "$%04x %f: mc6846 COUNT write %i\n", space.machine().firstcpu->pcbase( ), space.machine().time().as_double(), mc6846->latch ));
if (!(mc6846->tcr & 0x38))
{
/* timer initialization */
@@ -485,7 +485,7 @@ WRITE8_DEVICE_HANDLER ( mc6846_w )
break;
default:
- logerror( "$%04x mc6846 invalid write offset %i\n", device->machine().firstcpu->pcbase( ), offset );
+ logerror( "$%04x mc6846 invalid write offset %i\n", space.machine().firstcpu->pcbase( ), offset );
}
}
diff --git a/src/mess/machine/mc6854.c b/src/mess/machine/mc6854.c
index 9edea56de16..23569c31d80 100644
--- a/src/mess/machine/mc6854.c
+++ b/src/mess/machine/mc6854.c
@@ -808,7 +808,7 @@ READ8_DEVICE_HANDLER ( mc6854_r )
case 0: /* status register 1 */
mc6854_update_sr1( mc6854 );
LOG(( "%f $%04x mc6854_r: get SR1=$%02X (rda=%i,s2rq=%i,fd=%i,cts=%i,tu=%i,tdra=%i,irq=%i)\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), mc6854->sr1,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), mc6854->sr1,
( mc6854->sr1 & RDA) ? 1 : 0, ( mc6854->sr1 & S2RQ) ? 1 : 0,
( mc6854->sr1 & FD ) ? 1 : 0, ( mc6854->sr1 & CTS ) ? 1 : 0,
( mc6854->sr1 & TU ) ? 1 : 0, ( mc6854->sr1 & TDRA) ? 1 : 0,
@@ -818,7 +818,7 @@ READ8_DEVICE_HANDLER ( mc6854_r )
case 1: /* status register 2 */
mc6854_update_sr2( mc6854 );
LOG(( "%f $%04x mc6854_r: get SR2=$%02X (ap=%i,fv=%i,ridle=%i,rabt=%i,err=%i,dcd=%i,ovrn=%i,rda2=%i)\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), mc6854->sr2,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), mc6854->sr2,
( mc6854->sr2 & AP ) ? 1 : 0, ( mc6854->sr2 & FV ) ? 1 : 0,
( mc6854->sr2 & RIDLE) ? 1 : 0, ( mc6854->sr2 & RABT) ? 1 : 0,
( mc6854->sr2 & ERR ) ? 1 : 0, ( mc6854->sr2 & DCD ) ? 1 : 0,
@@ -830,12 +830,12 @@ READ8_DEVICE_HANDLER ( mc6854_r )
{
UINT8 data = mc6854_rfifo_pop( device );
LOG(( "%f $%04x mc6854_r: get data $%02X\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), data ));
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), data ));
return data;
}
default:
- logerror( "$%04x mc6854 invalid read offset %i\n", device->machine().firstcpu->pcbase( ), offset );
+ logerror( "$%04x mc6854 invalid read offset %i\n", space.machine().firstcpu->pcbase( ), offset );
}
return 0;
}
@@ -851,7 +851,7 @@ WRITE8_DEVICE_HANDLER ( mc6854_w )
case 0: /* control register 1 */
mc6854->cr1 = data;
LOG(( "%f $%04x mc6854_w: set CR1=$%02X (ac=%i,irq=%c%c,%sreset=%c%c)\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), mc6854->cr1,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), mc6854->cr1,
AC ? 1 : 0,
RIE ? 'r' : '-', TIE ? 't' : '-',
DISCONTINUE ? "discontinue," : "",
@@ -859,7 +859,7 @@ WRITE8_DEVICE_HANDLER ( mc6854_w )
));
if ( mc6854->cr1 & 0xc )
logerror( "$%04x mc6854 DMA not handled (CR1=$%02X)\n",
- device->machine().firstcpu->pcbase( ), mc6854->cr1 );
+ space.machine().firstcpu->pcbase( ), mc6854->cr1 );
if ( DISCONTINUE )
{
/* abort receive FIFO but keeps shift register & synchro */
@@ -888,15 +888,15 @@ WRITE8_DEVICE_HANDLER ( mc6854_w )
/* control register 3 */
mc6854->cr3 = data;
LOG(( "%f $%04x mc6854_w: set CR3=$%02X (lcf=%i,aex=%i,idl=%i,fdse=%i,loop=%i,tst=%i,dtr=%i)\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), mc6854->cr3,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), mc6854->cr3,
LCF ? (CEX ? 16 : 8) : 0, AEX ? 1 : 0,
IDL0 ? 0 : 1, FDSE ? 1 : 0, LOOP ? 1 : 0,
TST ? 1 : 0, DTR ? 1 : 0
));
if ( LOOP )
- logerror( "$%04x mc6854 loop mode not handled (CR3=$%02X)\n", device->machine().firstcpu->pcbase( ), mc6854->cr3 );
+ logerror( "$%04x mc6854 loop mode not handled (CR3=$%02X)\n", space.machine().firstcpu->pcbase( ), mc6854->cr3 );
if ( TST )
- logerror( "$%04x mc6854 test mode not handled (CR3=$%02X)\n", device->machine().firstcpu->pcbase( ), mc6854->cr3 );
+ logerror( "$%04x mc6854 test mode not handled (CR3=$%02X)\n", space.machine().firstcpu->pcbase( ), mc6854->cr3 );
mc6854->out_dtr_func( DTR ? 1 : 0 );
@@ -906,13 +906,13 @@ WRITE8_DEVICE_HANDLER ( mc6854_w )
/* control register 2 */
mc6854->cr2 = data;
LOG(( "%f $%04x mc6854_w: set CR2=$%02X (pse=%i,bytes=%i,fmidle=%i,%s,tlast=%i,clr=%c%c,rts=%i)\n",
- device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), mc6854->cr2,
+ space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), mc6854->cr2,
PSE ? 1 : 0, TWOBYTES ? 2 : 1, FMIDLE ? 1 : 0,
FCTDRA ? "fc" : "tdra", TLAST ? 1 : 0,
data & 0x20 ? 'r' : '-', data & 0x40 ? 't' : '-',
RTS ? 1 : 0 ));
if ( PSE )
- logerror( "$%04x mc6854 status prioritization not handled (CR2=$%02X)\n", device->machine().firstcpu->pcbase( ), mc6854->cr2 );
+ logerror( "$%04x mc6854 status prioritization not handled (CR2=$%02X)\n", space.machine().firstcpu->pcbase( ), mc6854->cr2 );
if ( TLAST )
mc6854_tfifo_terminate( device );
if ( data & 0x20 )
@@ -936,7 +936,7 @@ WRITE8_DEVICE_HANDLER ( mc6854_w )
break;
case 2: /* transmitter data: continue data */
- LOG(( "%f $%04xmc6854_w: push data=$%02X\n", device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), data ));
+ LOG(( "%f $%04xmc6854_w: push data=$%02X\n", space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), data ));
mc6854_tfifo_push( device, data );
break;
@@ -945,7 +945,7 @@ WRITE8_DEVICE_HANDLER ( mc6854_w )
{
/* control register 4 */
mc6854->cr4 = data;
- LOG(( "%f $%04x mc6854_w: set CR4=$%02X (interframe=%i,tlen=%i,rlen=%i,%s%s)\n", device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), mc6854->cr4,
+ LOG(( "%f $%04x mc6854_w: set CR4=$%02X (interframe=%i,tlen=%i,rlen=%i,%s%s)\n", space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), mc6854->cr4,
TWOINTER ? 2 : 1,
TWL, RWL,
ABT ? ( ABTEX ? "abort-ext," : "abort,") : "",
@@ -960,14 +960,14 @@ WRITE8_DEVICE_HANDLER ( mc6854_w )
else
{
/* transmitter data: last data */
- LOG(( "%f $%04x mc6854_w: push last-data=$%02X\n", device->machine().time().as_double(), device->machine().firstcpu->pcbase( ), data ));
+ LOG(( "%f $%04x mc6854_w: push last-data=$%02X\n", space.machine().time().as_double(), space.machine().firstcpu->pcbase( ), data ));
mc6854_tfifo_push( device, data );
mc6854_tfifo_terminate( device );
}
break;
default:
- logerror( "$%04x mc6854 invalid write offset %i (data=$%02X)\n", device->machine().firstcpu->pcbase( ), offset, data );
+ logerror( "$%04x mc6854 invalid write offset %i (data=$%02X)\n", space.machine().firstcpu->pcbase( ), offset, data );
}
}
diff --git a/src/mess/machine/micropolis.c b/src/mess/machine/micropolis.c
index 4a026859dd3..04a8732d47b 100644
--- a/src/mess/machine/micropolis.c
+++ b/src/mess/machine/micropolis.c
@@ -295,7 +295,7 @@ WRITE8_DEVICE_HANDLER( micropolis_data_w )
else
{
if (VERBOSE)
- logerror("%s: micropolis_data_w $%02X\n", device->machine().describe_context(), data);
+ logerror("%s: micropolis_data_w $%02X\n", space.machine().describe_context(), data);
}
w->data = data;
}
diff --git a/src/mess/machine/microtan.c b/src/mess/machine/microtan.c
index 00e1ba7c054..afefea20f85 100644
--- a/src/mess/machine/microtan.c
+++ b/src/mess/machine/microtan.c
@@ -163,7 +163,7 @@ static cassette_image_device *cassette_device_image(running_machine &machine)
**************************************************************/
static READ8_DEVICE_HANDLER (via_0_in_a )
{
- int data = device->machine().root_device().ioport("JOY")->read();
+ int data = space.machine().root_device().ioport("JOY")->read();
LOG(("microtan_via_0_in_a %02X\n", data));
return data;
}
@@ -212,7 +212,7 @@ static WRITE8_DEVICE_HANDLER (via_0_out_b )
{
LOG(("microtan_via_0_out_b %02X\n", data));
/* bit #7 is the cassette output signal */
- cassette_device_image(device->machine())->output(data & 0x80 ? +1.0 : -1.0);
+ cassette_device_image(space.machine())->output(data & 0x80 ? +1.0 : -1.0);
}
static WRITE8_DEVICE_HANDLER ( via_0_out_ca2 )
diff --git a/src/mess/machine/mos6530.c b/src/mess/machine/mos6530.c
index 07ab62aa2bb..7158d8dd366 100644
--- a/src/mess/machine/mos6530.c
+++ b/src/mess/machine/mos6530.c
@@ -177,7 +177,7 @@ WRITE8_DEVICE_HANDLER( mos6530_w )
if (offset & 0x04)
{
static const UINT8 timershift[4] = { 0, 3, 6, 10 };
- attotime curtime = device->machine().time();
+ attotime curtime = space.machine().time();
INT64 target;
/* A0-A1 contain the timer divisor */
@@ -225,7 +225,7 @@ WRITE8_DEVICE_HANDLER( mos6530_w )
if (!port->out_port_func.isnull())
port->out_port_func(0, data);
else
- logerror("6530MIOT chip %s: Port %c is being written to but has no handler. PC: %08X - %02X\n", device->tag(), 'A' + (offset & 1), device->machine().firstcpu->pc(), data);
+ logerror("6530MIOT chip %s: Port %c is being written to but has no handler. PC: %08X - %02X\n", device->tag(), 'A' + (offset & 1), space.machine().firstcpu->pc(), data);
}
}
}
@@ -287,7 +287,7 @@ READ8_DEVICE_HANDLER( mos6530_r )
port->in = port->in_port_func(0);
}
else
- logerror("6530MIOT chip %s: Port %c is being read but has no handler. PC: %08X\n", device->tag(), 'A' + (offset & 1), device->machine().firstcpu->pc());
+ logerror("6530MIOT chip %s: Port %c is being read but has no handler. PC: %08X\n", device->tag(), 'A' + (offset & 1), space.machine().firstcpu->pc());
/* apply the DDR to the result */
val = (out & port->ddr) | (port->in & ~port->ddr);
diff --git a/src/mess/machine/msx.c b/src/mess/machine/msx.c
index 1c03209ae6d..31906cadb4d 100644
--- a/src/mess/machine/msx.c
+++ b/src/mess/machine/msx.c
@@ -625,26 +625,26 @@ WRITE8_MEMBER(msx_state::msx_psg_port_b_w)
WRITE8_DEVICE_HANDLER( msx_printer_strobe_w )
{
- device->machine().device<centronics_device>("centronics")->strobe_w(BIT(data, 1));
+ space.machine().device<centronics_device>("centronics")->strobe_w(BIT(data, 1));
}
WRITE8_DEVICE_HANDLER( msx_printer_data_w )
{
- if (device->machine().root_device().ioport("DSW")->read() & 0x80)
+ if (space.machine().root_device().ioport("DSW")->read() & 0x80)
/* SIMPL emulation */
- device->machine().device<dac_device>("dac")->write_signed8(data);
+ space.machine().device<dac_device>("dac")->write_signed8(data);
else
- device->machine().device<centronics_device>("centronics")->write(device->machine().driver_data()->generic_space(), 0, data);
+ space.machine().device<centronics_device>("centronics")->write(space.machine().driver_data()->generic_space(), 0, data);
}
READ8_DEVICE_HANDLER( msx_printer_status_r )
{
UINT8 result = 0xfd;
- if (device->machine().root_device().ioport("DSW")->read() & 0x80)
+ if (space.machine().root_device().ioport("DSW")->read() & 0x80)
return 0xff;
- result |= device->machine().device<centronics_device>("centronics")->busy_r() << 1;
+ result |= space.machine().device<centronics_device>("centronics")->busy_r() << 1;
return result;
}
diff --git a/src/mess/machine/mtx.c b/src/mess/machine/mtx.c
index 6060067535b..b8976ec8e79 100644
--- a/src/mess/machine/mtx.c
+++ b/src/mess/machine/mtx.c
@@ -29,7 +29,7 @@
READ8_DEVICE_HANDLER( mtx_strobe_r )
{
- centronics_device *centronics = device->machine().device<centronics_device>(CENTRONICS_TAG);
+ centronics_device *centronics = space.machine().device<centronics_device>(CENTRONICS_TAG);
/* set STROBE low */
centronics->strobe_w(FALSE);
@@ -116,7 +116,7 @@ WRITE8_MEMBER(mtx_state::mtx_bankswitch_w)
READ8_DEVICE_HANDLER( mtx_sound_strobe_r )
{
- mtx_state *state = device->machine().driver_data<mtx_state>();
+ mtx_state *state = space.machine().driver_data<mtx_state>();
sn76496_w(device, space, 0, state->m_sound_latch);
@@ -148,7 +148,7 @@ WRITE8_DEVICE_HANDLER( mtx_cst_w )
READ8_DEVICE_HANDLER( mtx_prt_r )
{
- centronics_device *centronics = device->machine().device<centronics_device>(CENTRONICS_TAG);
+ centronics_device *centronics = space.machine().device<centronics_device>(CENTRONICS_TAG);
/*
diff --git a/src/mess/machine/mz700.c b/src/mess/machine/mz700.c
index 8c849b34c3a..fbec8946062 100644
--- a/src/mess/machine/mz700.c
+++ b/src/mess/machine/mz700.c
@@ -442,7 +442,7 @@ static READ8_DEVICE_HANDLER( pio_port_b_r )
for(i=0;i<10;i++)
{
if(key_line & (1 << i))
- res |= device->machine().root_device().ioport(keynames[i])->read();
+ res |= space.machine().root_device().ioport(keynames[i])->read();
}
return res;
@@ -456,8 +456,8 @@ static READ8_DEVICE_HANDLER( pio_port_b_r )
*/
static READ8_DEVICE_HANDLER( pio_port_c_r )
{
- cassette_image_device *cas = device->machine().device<cassette_image_device>(CASSETTE_TAG);
- mz_state *mz = device->machine().driver_data<mz_state>();
+ cassette_image_device *cas = space.machine().device<cassette_image_device>(CASSETTE_TAG);
+ mz_state *mz = space.machine().driver_data<mz_state>();
UINT8 data = 0;
/* note: this is actually connected to Q output of the motor-control flip-flop (see below) */
@@ -468,9 +468,9 @@ static READ8_DEVICE_HANDLER( pio_port_c_r )
data |= 0x20; /* set the RDATA status */
data |= mz->m_cursor_timer << 6;
- data |= device->machine().primary_screen->vblank() << 7;
+ data |= space.machine().primary_screen->vblank() << 7;
- LOG(2,"mz700_pio_port_c_r",("%02X\n", data),device->machine());
+ LOG(2,"mz700_pio_port_c_r",("%02X\n", data),space.machine());
return data;
}
@@ -478,9 +478,9 @@ static READ8_DEVICE_HANDLER( pio_port_c_r )
static WRITE8_DEVICE_HANDLER( pio_port_a_w )
{
- timer_device *timer = device->machine().device<timer_device>("cursor");
+ timer_device *timer = space.machine().device<timer_device>("cursor");
- LOG(2,"mz700_pio_port_a_w",("%02X\n", data),device->machine());
+ LOG(2,"mz700_pio_port_a_w",("%02X\n", data),space.machine());
/* the ls145 is connected to PA0-PA3 */
dynamic_cast<ttl74145_device *>(device)->write(data & 0x07);
@@ -499,7 +499,7 @@ static WRITE8_DEVICE_HANDLER( pio_port_c_w )
* bit 0 out unused
*/
-// UINT8 state = cassette_get_state(device->machine().device<cassette_image_device>(CASSETTE_TAG));
+// UINT8 state = cassette_get_state(space.machine().device<cassette_image_device>(CASSETTE_TAG));
// UINT8 action = ((~pio_port_c_output & 8) & (data & 8)); /* detect low-to-high transition */
/* The motor control circuit consists of a resistor, capacitor, invertor, nand-gate, and D flip-flop.
@@ -512,15 +512,15 @@ static WRITE8_DEVICE_HANDLER( pio_port_c_w )
If you load from the command-line or the software-picker, type in L <enter> immediately. */
#if 0
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(
((data & 0x08) && mz700_motor_on) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED,
CASSETTE_MOTOR_DISABLED);
#endif
- LOG(2,"mz700_pio_port_c_w",("%02X\n", data),device->machine());
+ LOG(2,"mz700_pio_port_c_w",("%02X\n", data),space.machine());
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x02) ? +1.0 : -1.0);
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x02) ? +1.0 : -1.0);
}
@@ -545,19 +545,19 @@ static void mz800_z80pio_irq(device_t *device, int which)
static READ8_DEVICE_HANDLER( mz800_z80pio_port_a_r )
{
- centronics_device *centronics = device->machine().device<centronics_device>("centronics");
+ centronics_device *centronics = space.machine().device<centronics_device>("centronics");
UINT8 result = 0;
result |= centronics->busy_r();
result |= centronics->pe_r() << 1;
- result |= device->machine().primary_screen->hblank() << 5;
+ result |= space.machine().primary_screen->hblank() << 5;
return result;
}
static WRITE8_DEVICE_HANDLER( mz800_z80pio_port_a_w )
{
- centronics_device *centronics = device->machine().device<centronics_device>("centronics");
+ centronics_device *centronics = space.machine().device<centronics_device>("centronics");
centronics->init_prime_w(BIT(data, 6));
centronics->strobe_w(BIT(data, 7));
diff --git a/src/mess/machine/oric.c b/src/mess/machine/oric.c
index 5facf797100..875dc372cf0 100644
--- a/src/mess/machine/oric.c
+++ b/src/mess/machine/oric.c
@@ -136,7 +136,7 @@ WRITE8_MEMBER(oric_state::oric_psg_porta_write)
/* this port is also used to read printer data */
static READ8_DEVICE_HANDLER ( oric_via_in_a_func )
{
- oric_state *state = device->machine().driver_data<oric_state>();
+ oric_state *state = space.machine().driver_data<oric_state>();
/*logerror("port a read\r\n"); */
@@ -157,10 +157,10 @@ static READ8_DEVICE_HANDLER ( oric_via_in_a_func )
static READ8_DEVICE_HANDLER ( oric_via_in_b_func )
{
- oric_state *state = device->machine().driver_data<oric_state>();
+ oric_state *state = space.machine().driver_data<oric_state>();
int data;
- oric_keyboard_sense_refresh(device->machine());
+ oric_keyboard_sense_refresh(space.machine());
data = state->m_key_sense_bit;
data |= state->m_keyboard_line & 0x07;
@@ -211,7 +211,7 @@ static void oric_psg_connection_refresh(address_space &space)
static WRITE8_DEVICE_HANDLER ( oric_via_out_a_func )
{
- oric_state *state = device->machine().driver_data<oric_state>();
+ oric_state *state = space.machine().driver_data<oric_state>();
state->m_via_port_a_data = data;
oric_psg_connection_refresh(space);
@@ -220,8 +220,8 @@ static WRITE8_DEVICE_HANDLER ( oric_via_out_a_func )
if (state->m_psg_control==0)
{
/* if psg not selected, write to printer */
- centronics_device *centronics = device->machine().device<centronics_device>("centronics");
- centronics->write(device->machine().driver_data()->generic_space(), 0, data);
+ centronics_device *centronics = space.machine().device<centronics_device>("centronics");
+ centronics->write(space.machine().driver_data()->generic_space(), 0, data);
}
}
@@ -283,20 +283,20 @@ static TIMER_CALLBACK(oric_refresh_tape)
static WRITE8_DEVICE_HANDLER ( oric_via_out_b_func )
{
- oric_state *state = device->machine().driver_data<oric_state>();
- centronics_device *centronics = device->machine().device<centronics_device>("centronics");
+ oric_state *state = space.machine().driver_data<oric_state>();
+ centronics_device *centronics = space.machine().device<centronics_device>("centronics");
/* KEYBOARD */
state->m_keyboard_line = data & 0x07;
/* CASSETTE */
/* cassette motor control */
- cassette_device_image(device->machine())->change_state(
+ cassette_device_image(space.machine())->change_state(
(data & 0x40) ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED,
CASSETTE_MOTOR_DISABLED);
/* cassette data out */
- cassette_device_image(device->machine())->output((data & (1<<7)) ? -1.0 : +1.0);
+ cassette_device_image(space.machine())->output((data & (1<<7)) ? -1.0 : +1.0);
/* centronics STROBE is connected to PB4 */
centronics->strobe_w(BIT(data, 4));
@@ -308,19 +308,19 @@ static WRITE8_DEVICE_HANDLER ( oric_via_out_b_func )
static READ8_DEVICE_HANDLER ( oric_via_in_ca2_func )
{
- oric_state *state = device->machine().driver_data<oric_state>();
+ oric_state *state = space.machine().driver_data<oric_state>();
return state->m_psg_control & 1;
}
static READ8_DEVICE_HANDLER ( oric_via_in_cb2_func )
{
- oric_state *state = device->machine().driver_data<oric_state>();
+ oric_state *state = space.machine().driver_data<oric_state>();
return (state->m_psg_control>>1) & 1;
}
static WRITE8_DEVICE_HANDLER ( oric_via_out_ca2_func )
{
- oric_state *state = device->machine().driver_data<oric_state>();
+ oric_state *state = space.machine().driver_data<oric_state>();
state->m_psg_control &=~1;
if (data)
@@ -331,7 +331,7 @@ static WRITE8_DEVICE_HANDLER ( oric_via_out_ca2_func )
static WRITE8_DEVICE_HANDLER ( oric_via_out_cb2_func )
{
- oric_state *state = device->machine().driver_data<oric_state>();
+ oric_state *state = space.machine().driver_data<oric_state>();
state->m_psg_control &=~2;
if (data)
@@ -1280,7 +1280,7 @@ static void telestrat_refresh_mem(running_machine &machine)
static READ8_DEVICE_HANDLER(telestrat_via2_in_a_func)
{
- oric_state *state = device->machine().driver_data<oric_state>();
+ oric_state *state = space.machine().driver_data<oric_state>();
//logerror("via 2 - port a %02x\n",state->m_telestrat_via2_port_a_data);
return state->m_telestrat_via2_port_a_data;
}
@@ -1288,7 +1288,7 @@ static READ8_DEVICE_HANDLER(telestrat_via2_in_a_func)
static WRITE8_DEVICE_HANDLER(telestrat_via2_out_a_func)
{
- oric_state *state = device->machine().driver_data<oric_state>();
+ oric_state *state = space.machine().driver_data<oric_state>();
//logerror("via 2 - port a w: %02x\n",data);
state->m_telestrat_via2_port_a_data = data;
@@ -1297,13 +1297,13 @@ static WRITE8_DEVICE_HANDLER(telestrat_via2_out_a_func)
{
state->m_telestrat_bank_selection = data & 0x07;
- telestrat_refresh_mem(device->machine());
+ telestrat_refresh_mem(space.machine());
}
}
static READ8_DEVICE_HANDLER(telestrat_via2_in_b_func)
{
- oric_state *state = device->machine().driver_data<oric_state>();
+ oric_state *state = space.machine().driver_data<oric_state>();
unsigned char data = 0x01f;
/* left joystick selected? */
@@ -1315,7 +1315,7 @@ static READ8_DEVICE_HANDLER(telestrat_via2_in_b_func)
/* right joystick selected? */
if (state->m_telestrat_via2_port_b_data & (1<<7))
{
- data &= device->machine().root_device().ioport("JOY1")->read();
+ data &= space.machine().root_device().ioport("JOY1")->read();
}
data |= state->m_telestrat_via2_port_b_data & ((1<<7) | (1<<6) | (1<<5));
@@ -1325,7 +1325,7 @@ static READ8_DEVICE_HANDLER(telestrat_via2_in_b_func)
static WRITE8_DEVICE_HANDLER(telestrat_via2_out_b_func)
{
- oric_state *state = device->machine().driver_data<oric_state>();
+ oric_state *state = space.machine().driver_data<oric_state>();
state->m_telestrat_via2_port_b_data = data;
}
diff --git a/src/mess/machine/orion.c b/src/mess/machine/orion.c
index 20f4b447a1f..4181252c13e 100644
--- a/src/mess/machine/orion.c
+++ b/src/mess/machine/orion.c
@@ -29,20 +29,20 @@
static READ8_DEVICE_HANDLER (orion_romdisk_porta_r )
{
- orion_state *state = device->machine().driver_data<orion_state>();
+ orion_state *state = space.machine().driver_data<orion_state>();
UINT8 *romdisk = state->memregion("maincpu")->base() + 0x10000;
return romdisk[state->m_romdisk_msb*256+state->m_romdisk_lsb];
}
static WRITE8_DEVICE_HANDLER (orion_romdisk_portb_w )
{
- orion_state *state = device->machine().driver_data<orion_state>();
+ orion_state *state = space.machine().driver_data<orion_state>();
state->m_romdisk_lsb = data;
}
static WRITE8_DEVICE_HANDLER (orion_romdisk_portc_w )
{
- orion_state *state = device->machine().driver_data<orion_state>();
+ orion_state *state = space.machine().driver_data<orion_state>();
state->m_romdisk_msb = data;
}
diff --git a/src/mess/machine/pc.c b/src/mess/machine/pc.c
index a8175a900dd..14171a4aed3 100644
--- a/src/mess/machine/pc.c
+++ b/src/mess/machine/pc.c
@@ -200,7 +200,7 @@ WRITE8_MEMBER(pc_state::pc_dma_write_byte)
static READ8_DEVICE_HANDLER( pc_dma8237_fdc_dack_r )
{
- return pc_fdc_dack_r(device->machine(), space);
+ return pc_fdc_dack_r(space.machine(), space);
}
@@ -212,7 +212,7 @@ static READ8_DEVICE_HANDLER( pc_dma8237_hdc_dack_r )
static WRITE8_DEVICE_HANDLER( pc_dma8237_fdc_dack_w )
{
- pc_fdc_dack_w( device->machine(), space, data );
+ pc_fdc_dack_w( space.machine(), space, data );
}
@@ -223,7 +223,7 @@ static WRITE8_DEVICE_HANDLER( pc_dma8237_hdc_dack_w )
static WRITE8_DEVICE_HANDLER( pc_dma8237_0_dack_w )
{
- pc_state *st = device->machine().driver_data<pc_state>();
+ pc_state *st = space.machine().driver_data<pc_state>();
st->m_u73_q2 = 0;
i8237_dreq0_w( st->m_dma8237, st->m_u73_q2 );
}
@@ -757,8 +757,8 @@ WRITE_LINE_MEMBER( pc_state::keyboard_data_w )
static READ8_DEVICE_HANDLER (ibm5160_ppi_porta_r)
{
int data = 0xFF;
- running_machine &machine = device->machine();
- pc_state *st = device->machine().driver_data<pc_state>();
+ running_machine &machine = space.machine();
+ pc_state *st = space.machine().driver_data<pc_state>();
/* KB port A */
if (st->m_ppi_keyboard_clear)
@@ -772,7 +772,7 @@ static READ8_DEVICE_HANDLER (ibm5160_ppi_porta_r)
* 01 - color 40x25
* 6-7 The number of floppy disk drives
*/
- data = device->machine().root_device().ioport("DSW0")->read();
+ data = space.machine().root_device().ioport("DSW0")->read();
}
else
{
@@ -785,10 +785,10 @@ static READ8_DEVICE_HANDLER (ibm5160_ppi_porta_r)
static READ8_DEVICE_HANDLER ( ibm5160_ppi_portc_r )
{
- pc_state *st = device->machine().driver_data<pc_state>();
+ pc_state *st = space.machine().driver_data<pc_state>();
int timer2_output = pit8253_get_output( st->m_pit8253, 2 );
int data=0xff;
- running_machine &machine = device->machine();
+ running_machine &machine = space.machine();
data&=~0x80; // no parity error
data&=~0x40; // no error on expansion board
@@ -797,13 +797,13 @@ static READ8_DEVICE_HANDLER ( ibm5160_ppi_portc_r )
if (st->m_ppi_portc_switch_high)
{
/* read hi nibble of S2 */
- data = (data & 0xf0) | ((device->machine().root_device().ioport("DSW0")->read() >> 4) & 0x0f);
+ data = (data & 0xf0) | ((space.machine().root_device().ioport("DSW0")->read() >> 4) & 0x0f);
PIO_LOG(1,"PIO_C_r (hi)",("$%02x\n", data));
}
else
{
/* read lo nibble of S2 */
- data = (data & 0xf0) | (device->machine().root_device().ioport("DSW0")->read() & 0x0f);
+ data = (data & 0xf0) | (space.machine().root_device().ioport("DSW0")->read() & 0x0f);
PIO_LOG(1,"PIO_C_r (lo)",("$%02x\n", data));
}
@@ -819,7 +819,7 @@ static READ8_DEVICE_HANDLER ( ibm5160_ppi_portc_r )
static WRITE8_DEVICE_HANDLER( ibm5160_ppi_portb_w )
{
- pc_state *st = device->machine().driver_data<pc_state>();
+ pc_state *st = space.machine().driver_data<pc_state>();
/* PPI controller port B*/
st->m_ppi_portb = data;
@@ -827,7 +827,7 @@ static WRITE8_DEVICE_HANDLER( ibm5160_ppi_portb_w )
st->m_ppi_keyboard_clear = data & 0x80;
st->m_ppi_keyb_clock = data & 0x40;
pit8253_gate2_w(st->m_pit8253, BIT(data, 0));
- pc_speaker_set_spkrdata( device->machine(), data & 0x02 );
+ pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
st->m_ppi_clock_signal = ( st->m_ppi_keyb_clock ) ? 1 : 0;
st->m_pc_kbdc->clock_write_from_mb(st->m_ppi_clock_signal);
@@ -856,8 +856,8 @@ I8255_INTERFACE( ibm5160_ppi8255_interface )
static READ8_DEVICE_HANDLER (pc_ppi_porta_r)
{
int data = 0xFF;
- running_machine &machine = device->machine();
- pc_state *st = device->machine().driver_data<pc_state>();
+ running_machine &machine = space.machine();
+ pc_state *st = space.machine().driver_data<pc_state>();
/* KB port A */
if (st->m_ppi_keyboard_clear)
@@ -871,7 +871,7 @@ static READ8_DEVICE_HANDLER (pc_ppi_porta_r)
* 01 - color 40x25
* 6-7 The number of floppy disk drives
*/
- data = device->machine().root_device().ioport("DSW0")->read();
+ data = space.machine().root_device().ioport("DSW0")->read();
}
else
{
@@ -884,14 +884,14 @@ static READ8_DEVICE_HANDLER (pc_ppi_porta_r)
static WRITE8_DEVICE_HANDLER( pc_ppi_portb_w )
{
- pc_state *st = device->machine().driver_data<pc_state>();
+ pc_state *st = space.machine().driver_data<pc_state>();
/* PPI controller port B*/
st->m_ppi_portb = data;
st->m_ppi_portc_switch_high = data & 0x08;
st->m_ppi_keyboard_clear = data & 0x80;
st->m_ppi_keyb_clock = data & 0x40;
pit8253_gate2_w(st->m_pit8253, BIT(data, 0));
- pc_speaker_set_spkrdata( device->machine(), data & 0x02 );
+ pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
pc_keyb_set_clock( st->m_ppi_keyb_clock );
if ( st->m_ppi_keyboard_clear )
@@ -959,7 +959,7 @@ static TIMER_CALLBACK( mc1502_keyb_signal_callback )
static READ8_DEVICE_HANDLER ( mc1502_ppi_porta_r )
{
- running_machine &machine = device->machine();
+ running_machine &machine = space.machine();
DBG_LOG(1,"mc1502_ppi_porta_r",("= %02X\n", mc1502_keyb.latch));
return mc1502_keyb.latch;
@@ -967,8 +967,8 @@ static READ8_DEVICE_HANDLER ( mc1502_ppi_porta_r )
static WRITE8_DEVICE_HANDLER ( mc1502_ppi_porta_w )
{
- pc_state *st = device->machine().driver_data<pc_state>();
- running_machine &machine = device->machine();
+ pc_state *st = space.machine().driver_data<pc_state>();
+ running_machine &machine = space.machine();
DBG_LOG(1,"mc1502_ppi_porta_w",("( %02X )\n", data));
mc1502_keyb.latch = data;
@@ -979,22 +979,22 @@ static WRITE8_DEVICE_HANDLER ( mc1502_ppi_porta_w )
static WRITE8_DEVICE_HANDLER ( mc1502_ppi_portb_w )
{
- pc_state *st = device->machine().driver_data<pc_state>();
- running_machine &machine = device->machine();
+ pc_state *st = space.machine().driver_data<pc_state>();
+ running_machine &machine = space.machine();
DBG_LOG(2,"mc1502_ppi_portb_w",("( %02X )\n", data));
st->m_ppi_portb = data;
- pit8253_gate2_w(device->machine().device("pit8253"), BIT(data, 0));
- pc_speaker_set_spkrdata( device->machine(), data & 0x02 );
+ pit8253_gate2_w(space.machine().device("pit8253"), BIT(data, 0));
+ pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
}
static READ8_DEVICE_HANDLER ( mc1502_ppi_portc_r )
{
- running_machine &machine = device->machine();
- pc_state *st = device->machine().driver_data<pc_state>();
- int timer2_output = pit8253_get_output( device->machine().device("pit8253"), 2 );
+ running_machine &machine = space.machine();
+ pc_state *st = space.machine().driver_data<pc_state>();
+ int timer2_output = pit8253_get_output( space.machine().device("pit8253"), 2 );
int data = 0xff;
- double tap_val = (device->machine().device<cassette_image_device>(CASSETTE_TAG)->input());
+ double tap_val = (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input());
// 0x80 -- serial RxD
// 0x40 -- CASS IN, also loops back T2OUT (gated by CASWR)
@@ -1011,7 +1011,7 @@ static READ8_DEVICE_HANDLER ( mc1502_ppi_portc_r )
static READ8_DEVICE_HANDLER ( mc1502_kppi_porta_r )
{
- running_machine &machine = device->machine();
+ running_machine &machine = space.machine();
UINT8 key = 0;
if (mc1502_keyb.mask & 0x0001) { key |= machine.root_device().ioport("Y1")->read(); }
@@ -1033,7 +1033,7 @@ static READ8_DEVICE_HANDLER ( mc1502_kppi_porta_r )
static WRITE8_DEVICE_HANDLER ( mc1502_kppi_portb_w )
{
- running_machine &machine = device->machine();
+ running_machine &machine = space.machine();
mc1502_keyb.mask &= ~255;
mc1502_keyb.mask |= data ^ 255;
@@ -1046,7 +1046,7 @@ static WRITE8_DEVICE_HANDLER ( mc1502_kppi_portb_w )
static WRITE8_DEVICE_HANDLER ( mc1502_kppi_portc_w )
{
- running_machine &machine = device->machine();
+ running_machine &machine = space.machine();
mc1502_keyb.mask &= ~(7 << 8);
mc1502_keyb.mask |= ((data ^ 7) & 7) << 8;
@@ -1056,14 +1056,14 @@ static WRITE8_DEVICE_HANDLER ( mc1502_kppi_portc_w )
static WRITE8_DEVICE_HANDLER ( pcjr_ppi_portb_w )
{
- pc_state *st = device->machine().driver_data<pc_state>();
+ pc_state *st = space.machine().driver_data<pc_state>();
/* KB controller port B */
st->m_ppi_portb = data;
st->m_ppi_portc_switch_high = data & 0x08;
- pit8253_gate2_w(device->machine().device("pit8253"), BIT(data, 0));
- pc_speaker_set_spkrdata( device->machine(), data & 0x02 );
+ pit8253_gate2_w(space.machine().device("pit8253"), BIT(data, 0));
+ pc_speaker_set_spkrdata( space.machine(), data & 0x02 );
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(( data & 0x08 ) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
}
@@ -1073,7 +1073,7 @@ static WRITE8_DEVICE_HANDLER ( pcjr_ppi_portb_w )
static READ8_DEVICE_HANDLER (pcjr_ppi_porta_r )
{
int data;
- running_machine &machine = device->machine();
+ running_machine &machine = space.machine();
data = 0xff;
PIO_LOG(1,"PIO_A_r",("$%02x\n", data));
@@ -1094,18 +1094,18 @@ static READ8_DEVICE_HANDLER (pcjr_ppi_porta_r )
*/
static READ8_DEVICE_HANDLER ( pcjr_ppi_portc_r )
{
- pc_state *st = device->machine().driver_data<pc_state>();
- int timer2_output = pit8253_get_output( device->machine().device("pit8253"), 2 );
+ pc_state *st = space.machine().driver_data<pc_state>();
+ int timer2_output = pit8253_get_output( space.machine().device("pit8253"), 2 );
int data=0xff;
data&=~0x80;
data &= ~0x04; /* floppy drive installed */
- if ( device->machine().device<ram_device>(RAM_TAG)->size() > 64 * 1024 ) /* more than 64KB ram installed */
+ if ( space.machine().device<ram_device>(RAM_TAG)->size() > 64 * 1024 ) /* more than 64KB ram installed */
data &= ~0x08;
data = ( data & ~0x01 ) | ( pcjr_keyb.latch ? 0x01: 0x00 );
if ( ! ( st->m_ppi_portb & 0x08 ) )
{
- double tap_val = (device->machine().device<cassette_image_device>(CASSETTE_TAG)->input());
+ double tap_val = (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input());
if ( tap_val < 0 )
{
@@ -1265,8 +1265,8 @@ READ8_DEVICE_HANDLER( mc1502_wd17xx_drq_r )
data = wd17xx_drq_r(device);
if (!data && !wd17xx_intrq_r(device)) {
/* fake cpu halt by resetting PC one insn back */
- newpc = device->machine().firstcpu->pc();
- device->machine().firstcpu->set_pc( newpc - 1 );
+ newpc = space.machine().firstcpu->pc();
+ space.machine().firstcpu->set_pc( newpc - 1 );
}
return data;
diff --git a/src/mess/machine/pc_lpt.c b/src/mess/machine/pc_lpt.c
index a4ca98bdfc4..330f45493ba 100644
--- a/src/mess/machine/pc_lpt.c
+++ b/src/mess/machine/pc_lpt.c
@@ -137,7 +137,7 @@ READ8_DEVICE_HANDLER( pc_lpt_data_r )
{
pc_lpt_state *lpt = get_safe_token(device);
// pull up mechanism for input lines, zeros are provided by pheripherial
- return lpt->data & ~lpt->centronics->read(device->machine().driver_data()->generic_space(), 0);
+ return lpt->data & ~lpt->centronics->read(space.machine().driver_data()->generic_space(), 0);
}
@@ -145,7 +145,7 @@ WRITE8_DEVICE_HANDLER( pc_lpt_data_w )
{
pc_lpt_state *lpt = get_safe_token(device);
lpt->data = data;
- lpt->centronics->write(device->machine().driver_data()->generic_space(), 0, data);
+ lpt->centronics->write(space.machine().driver_data()->generic_space(), 0, data);
}
diff --git a/src/mess/machine/pet.c b/src/mess/machine/pet.c
index 7ceed6952c3..497d9045761 100644
--- a/src/mess/machine/pet.c
+++ b/src/mess/machine/pet.c
@@ -47,7 +47,7 @@
*/
static READ8_DEVICE_HANDLER( pia0_pa_r )
{
- pet_state *state = device->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
/*
bit description
@@ -69,10 +69,10 @@ static READ8_DEVICE_HANDLER( pia0_pa_r )
data |= state->m_keyline_select;
/* #1 cassette switch */
- data |= ((device->machine().device<cassette_image_device>(CASSETTE_TAG)->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 4;
+ data |= ((space.machine().device<cassette_image_device>(CASSETTE_TAG)->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 4;
/* #2 cassette switch */
- data |= ((device->machine().device<cassette_image_device>(CASSETTE2_TAG)->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 5;
+ data |= ((space.machine().device<cassette_image_device>(CASSETTE2_TAG)->get_state() & CASSETTE_MASK_UISTATE) == CASSETTE_STOPPED) << 5;
/* end or identify in */
data |= state->m_ieee->eoi_r() << 6;
@@ -85,7 +85,7 @@ static READ8_DEVICE_HANDLER( pia0_pa_r )
static WRITE8_DEVICE_HANDLER( pia0_pa_w )
{
- pet_state *state = device->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
/*
bit description
@@ -108,7 +108,7 @@ static WRITE8_DEVICE_HANDLER( pia0_pa_w )
/* Keyboard reading/handling for regular keyboard */
static READ8_DEVICE_HANDLER( kin_r )
{
- pet_state *state = device->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
/*
bit description
@@ -132,9 +132,9 @@ static READ8_DEVICE_HANDLER( kin_r )
if (state->m_keyline_select < 10)
{
- data = device->machine().root_device().ioport(keynames[state->m_keyline_select])->read();
+ data = space.machine().root_device().ioport(keynames[state->m_keyline_select])->read();
/* Check for left-shift lock */
- if ((state->m_keyline_select == 8) && (device->machine().root_device().ioport("SPECIAL")->read() & 0x80))
+ if ((state->m_keyline_select == 8) && (space.machine().root_device().ioport("SPECIAL")->read() & 0x80))
data &= 0xfe;
}
return data;
@@ -144,7 +144,7 @@ static READ8_DEVICE_HANDLER( kin_r )
static READ8_DEVICE_HANDLER( petb_kin_r )
{
UINT8 data = 0xff;
- pet_state *state = device->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
static const char *const keynames[] = {
"ROW0", "ROW1", "ROW2", "ROW3", "ROW4",
"ROW5", "ROW6", "ROW7", "ROW8", "ROW9"
@@ -152,18 +152,18 @@ static READ8_DEVICE_HANDLER( petb_kin_r )
if (state->m_keyline_select < 10)
{
- data = device->machine().root_device().ioport(keynames[state->m_keyline_select])->read();
+ data = space.machine().root_device().ioport(keynames[state->m_keyline_select])->read();
/* Check for left-shift lock */
/* 2008-05 FP: For some reason, superpet read it in the opposite way!! */
/* While waiting for confirmation from docs, we add a workaround here. */
if (state->m_superpet)
{
- if ((state->m_keyline_select == 6) && !(device->machine().root_device().ioport("SPECIAL")->read() & 0x80))
+ if ((state->m_keyline_select == 6) && !(space.machine().root_device().ioport("SPECIAL")->read() & 0x80))
data &= 0xfe;
}
else
{
- if ((state->m_keyline_select == 6) && (device->machine().root_device().ioport("SPECIAL")->read() & 0x80))
+ if ((state->m_keyline_select == 6) && (space.machine().root_device().ioport("SPECIAL")->read() & 0x80))
data &= 0xfe;
}
}
@@ -173,20 +173,20 @@ static READ8_DEVICE_HANDLER( petb_kin_r )
static READ8_DEVICE_HANDLER( cass1_r )
{
// cassette 1 read
- return (device->machine().device<cassette_image_device>(CASSETTE_TAG)->input() > +0.0) ? 1 : 0;
+ return (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input() > +0.0) ? 1 : 0;
}
static WRITE8_DEVICE_HANDLER( cass1_motor_w )
{
- pet_state *state = device->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
if (!data)
{
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
state->m_datasette1_timer->adjust(attotime::zero, 0, attotime::from_hz(48000)); // I put 48000 because I was given some .wav with this freq
}
else
{
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_DISABLED ,CASSETTE_MASK_MOTOR);
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(CASSETTE_MOTOR_DISABLED ,CASSETTE_MASK_MOTOR);
state->m_datasette1_timer->reset();
}
}
@@ -302,7 +302,7 @@ static READ8_DEVICE_HANDLER( via_pb_r )
*/
- pet_state *state = device->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
UINT8 data = 0;
/* not data accepted in */
@@ -342,7 +342,7 @@ static WRITE8_DEVICE_HANDLER( via_pb_w )
*/
- pet_state *state = device->machine().driver_data<pet_state>();
+ pet_state *state = space.machine().driver_data<pet_state>();
/* not ready for data out */
state->m_ieee->nrfd_w(BIT(data, 1));
@@ -351,18 +351,18 @@ static WRITE8_DEVICE_HANDLER( via_pb_w )
state->m_ieee->atn_w(BIT(data, 2));
/* cassette write */
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
- device->machine().device<cassette_image_device>(CASSETTE2_TAG)->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
+ space.machine().device<cassette_image_device>(CASSETTE2_TAG)->output(BIT(data, 3) ? -(0x5a9e >> 1) : +(0x5a9e >> 1));
/* #2 cassette motor */
if (BIT(data, 4))
{
- device->machine().device<cassette_image_device>(CASSETTE2_TAG)->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
+ space.machine().device<cassette_image_device>(CASSETTE2_TAG)->change_state(CASSETTE_MOTOR_ENABLED, CASSETTE_MASK_MOTOR);
state->m_datasette2_timer->adjust(attotime::zero, 0, attotime::from_hz(48000)); // I put 48000 because I was given some .wav with this freq
}
else
{
- device->machine().device<cassette_image_device>(CASSETTE2_TAG)->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
+ space.machine().device<cassette_image_device>(CASSETTE2_TAG)->change_state(CASSETTE_MOTOR_DISABLED, CASSETTE_MASK_MOTOR);
state->m_datasette2_timer->reset();
}
}
diff --git a/src/mess/machine/pk8020.c b/src/mess/machine/pk8020.c
index 2c61aa0d531..5361cf59d1f 100644
--- a/src/mess/machine/pk8020.c
+++ b/src/mess/machine/pk8020.c
@@ -848,13 +848,13 @@ static void pk8020_set_bank(running_machine &machine,UINT8 data)
static READ8_DEVICE_HANDLER(pk8020_porta_r)
{
- pk8020_state *state = device->machine().driver_data<pk8020_state>();
+ pk8020_state *state = space.machine().driver_data<pk8020_state>();
return 0xf0 | (state->m_takt <<1) | (state->m_text_attr)<<3;
}
static WRITE8_DEVICE_HANDLER(pk8020_portc_w)
{
- pk8020_state *state = device->machine().driver_data<pk8020_state>();
+ pk8020_state *state = space.machine().driver_data<pk8020_state>();
state->m_video_page_access =(data>>6) & 3;
state->m_attr = (data >> 4) & 3;
state->m_wide = (data >> 3) & 1;
@@ -867,35 +867,35 @@ static WRITE8_DEVICE_HANDLER(pk8020_portc_w)
static WRITE8_DEVICE_HANDLER(pk8020_portb_w)
{
- device_t *fdc = device->machine().device("wd1793");
+ device_t *fdc = space.machine().device("wd1793");
// Turn all motors off
- floppy_mon_w(floppy_get_device(device->machine(), 0), 1);
- floppy_mon_w(floppy_get_device(device->machine(), 1), 1);
- floppy_mon_w(floppy_get_device(device->machine(), 2), 1);
- floppy_mon_w(floppy_get_device(device->machine(), 3), 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 0), 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 1), 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 2), 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 3), 1);
wd17xx_set_side(fdc,BIT(data,4));
if (BIT(data,0)) {
wd17xx_set_drive(fdc,0);
- floppy_mon_w(floppy_get_device(device->machine(), 0), 0);
- floppy_drive_set_ready_state(floppy_get_device(device->machine(), 0), 1, 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 0), 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 0), 1, 1);
} else if (BIT(data,1)) {
wd17xx_set_drive(fdc,1);
- floppy_mon_w(floppy_get_device(device->machine(), 1), 0);
- floppy_drive_set_ready_state(floppy_get_device(device->machine(), 1), 1, 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 1), 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 1), 1, 1);
} else if (BIT(data,2)) {
wd17xx_set_drive(fdc,2);
- floppy_mon_w(floppy_get_device(device->machine(), 2), 0);
- floppy_drive_set_ready_state(floppy_get_device(device->machine(), 2), 1, 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 2), 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 2), 1, 1);
} else if (BIT(data,3)) {
wd17xx_set_drive(fdc,3);
- floppy_mon_w(floppy_get_device(device->machine(), 3), 0);
- floppy_drive_set_ready_state(floppy_get_device(device->machine(), 3), 1, 1);
+ floppy_mon_w(floppy_get_device(space.machine(), 3), 0);
+ floppy_drive_set_ready_state(floppy_get_device(space.machine(), 3), 1, 1);
}
}
static READ8_DEVICE_HANDLER(pk8020_portc_r)
{
- pk8020_state *state = device->machine().driver_data<pk8020_state>();
+ pk8020_state *state = space.machine().driver_data<pk8020_state>();
return state->m_portc_data;
}
@@ -912,8 +912,8 @@ I8255A_INTERFACE( pk8020_ppi8255_interface_1 )
static WRITE8_DEVICE_HANDLER(pk8020_2_portc_w)
{
- pk8020_state *state = device->machine().driver_data<pk8020_state>();
- device_t *speaker = device->machine().device(SPEAKER_TAG);
+ pk8020_state *state = space.machine().driver_data<pk8020_state>();
+ device_t *speaker = space.machine().device(SPEAKER_TAG);
state->m_sound_gate = BIT(data,3);
diff --git a/src/mess/machine/pmd85.c b/src/mess/machine/pmd85.c
index e5fb95d330b..987f0596b87 100644
--- a/src/mess/machine/pmd85.c
+++ b/src/mess/machine/pmd85.c
@@ -261,22 +261,22 @@ static READ8_DEVICE_HANDLER ( pmd85_ppi_0_portc_r )
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_0_porta_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[0][0] = data;
}
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_0_portb_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[0][1] = data;
}
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_0_portc_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[0][2] = data;
- set_led_status(device->machine(), PMD85_LED_2, (data & 0x08) ? 1 : 0);
- set_led_status(device->machine(), PMD85_LED_3, (data & 0x04) ? 1 : 0);
+ set_led_status(space.machine(), PMD85_LED_2, (data & 0x08) ? 1 : 0);
+ set_led_status(space.machine(), PMD85_LED_3, (data & 0x04) ? 1 : 0);
}
/*******************************************************************************
@@ -309,10 +309,10 @@ static READ8_DEVICE_HANDLER ( mato_ppi_0_portc_r )
static WRITE8_DEVICE_HANDLER ( mato_ppi_0_portc_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[0][2] = data;
- set_led_status(device->machine(), PMD85_LED_2, BIT(data, 3));
- set_led_status(device->machine(), PMD85_LED_3, BIT(data, 2));
+ set_led_status(space.machine(), PMD85_LED_2, BIT(data, 3));
+ set_led_status(space.machine(), PMD85_LED_3, BIT(data, 2));
}
/*******************************************************************************
@@ -340,19 +340,19 @@ static READ8_DEVICE_HANDLER ( pmd85_ppi_1_portc_r )
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_1_porta_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[1][0] = data;
}
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_1_portb_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[1][1] = data;
}
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_1_portc_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[1][2] = data;
}
@@ -385,19 +385,19 @@ static READ8_DEVICE_HANDLER ( pmd85_ppi_2_portc_r )
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_2_porta_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[2][0] = data;
}
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_2_portb_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[2][1] = data;
}
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_2_portc_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[2][2] = data;
}
@@ -458,7 +458,7 @@ const struct pit8253_config pmd85_pit8253_interface =
static READ8_DEVICE_HANDLER ( pmd85_ppi_3_porta_r )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
if (state->memregion("user1")->base() != NULL)
return state->memregion("user1")->base()[state->m_ppi_port_outputs[3][1] | (state->m_ppi_port_outputs[3][2] << 8)];
else
@@ -477,19 +477,19 @@ static READ8_DEVICE_HANDLER ( pmd85_ppi_3_portc_r )
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_3_porta_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[3][0] = data;
}
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_3_portb_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[3][1] = data;
}
static WRITE8_DEVICE_HANDLER ( pmd85_ppi_3_portc_w )
{
- pmd85_state *state = device->machine().driver_data<pmd85_state>();
+ pmd85_state *state = space.machine().driver_data<pmd85_state>();
state->m_ppi_port_outputs[3][2] = data;
}
diff --git a/src/mess/machine/pokemini.c b/src/mess/machine/pokemini.c
index 20f8c0800e1..49eb2a84b66 100644
--- a/src/mess/machine/pokemini.c
+++ b/src/mess/machine/pokemini.c
@@ -391,7 +391,7 @@ static TIMER_CALLBACK(pokemini_timer3_hi_callback)
WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
{
- pokemini_state *state = device->machine().driver_data<pokemini_state>();
+ pokemini_state *state = space.machine().driver_data<pokemini_state>();
static const int timer_to_cycles_fast[8] = { 2, 8, 32, 64, 128, 256, 1024, 4096 };
static const int timer_to_cycles_slow[8] = { 128, 256, 512, 1024, 2048, 4096, 8192, 16384 };
@@ -409,7 +409,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
case 0x02: /* CPU related?
Bit 0-7 R/W Unknown
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
case 0x08: /* Seconds-timer control
Bit 0 R/W Timer enable
@@ -441,7 +441,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 5 R Battery status: 0 - battery OK, 1 - battery low
Bit 6-7 Unused
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
case 0x18: /* Timer 1 pre-scale + enable
Bit 0-2 R/W low timer 1 prescaler select
@@ -463,7 +463,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = data & 0x07;
int cycles = ( state->m_pm_reg[0x19] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer1->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the high counter */
@@ -472,7 +472,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( data >> 4 ) & 0x07;
int cycles = ( state->m_pm_reg[0x19] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer1_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check if timer1 low should be enabled */
@@ -513,7 +513,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = state->m_pm_reg[0x18] & 0x07;
int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer1->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the low counter */
@@ -522,7 +522,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( state->m_pm_reg[0x18] >> 4 ) & 0x07;
int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer1_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer1_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
{
@@ -592,7 +592,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = data & 0x07;
int cycles = ( state->m_pm_reg[0x1B] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer2->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the high counter */
@@ -601,7 +601,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( data >> 4 ) & 0x07;
int cycles = ( state->m_pm_reg[0x1B] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer2_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check if timer2 low should be enabled */
@@ -638,7 +638,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = state->m_pm_reg[0x1A] & 0x07;
int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer2->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
if ( ( state->m_pm_reg[0x1A] & 0x08 ) && ( state->m_pm_reg[0x38] & 0x04 ) &&
( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x01 ) ) ||
@@ -658,7 +658,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( state->m_pm_reg[0x1A] >> 4 ) & 0x07;
int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer2_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer2_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
if ( ( state->m_pm_reg[0x1A] & 0x80 ) && ( state->m_pm_reg[0x39] & 0x04 ) && ! ( state->m_pm_reg[0x38] & 0x80 ) &&
( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x02 ) ) ||
@@ -692,7 +692,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = data & 0x07;
int cycles = ( state->m_pm_reg[0x1D] & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer3->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check for prescaler change for the high counter */
@@ -701,7 +701,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( data >> 4 ) & 0x07;
int cycles = ( state->m_pm_reg[0x1D] & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer3_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
}
/* Check if timer2 low should be enabled */
@@ -738,7 +738,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = state->m_pm_reg[0x1C] & 0x07;
int cycles = ( data & 0x01 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer3->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
if ( ( state->m_pm_reg[0x1C] & 0x08 ) && ( state->m_pm_reg[0x48] & 0x04 ) &&
( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x01 ) ) ||
@@ -758,7 +758,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
int index = ( state->m_pm_reg[0x1C] >> 4 ) & 0x07;
int cycles = ( data & 0x02 ) ? timer_to_cycles_slow[index] : timer_to_cycles_fast[index];
- state->m_timers.timer3_hi->adjust(attotime::zero, 0, device->machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
+ state->m_timers.timer3_hi->adjust(attotime::zero, 0, space.machine().device<cpu_device>("maincpu")->cycles_to_attotime(cycles));
if ( ( state->m_pm_reg[0x1C] & 0x80 ) && ( state->m_pm_reg[0x49] & 0x04 ) && ! ( state->m_pm_reg[0x48] & 0x80 ) &&
( ( ( state->m_pm_reg[0x19] & 0x10 ) && ( data & 0x02 ) ) ||
@@ -779,7 +779,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 6-7 R/W VDraw/VBlank trigger Interrupt #1-#2
*/
state->m_pm_reg[0x20] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x21: /* Event #15-#22 priority
Bit 0-1 R/W Unknown
@@ -787,14 +787,14 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 4-7 R/W Unknown
*/
state->m_pm_reg[0x21] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x22: /* Event #9-#14 priority
Bit 0-1 R/W All #9 - #14 events - Interrupt #9-#14
Bit 2-7 Unused
*/
state->m_pm_reg[0x22] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x23: /* Event #1-#8 enable
Bit 0 R/W Timer 3 overflow (mirror) - Enable Interrupt #8
@@ -807,14 +807,14 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 R/W V-Blank trigger - Enable Interrupt #1
*/
state->m_pm_reg[0x23] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x24: /* Event #9-#12 enable
Bit 0-5 R/W Unknown
Bit 6-7 Unused
*/
state->m_pm_reg[0x24] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x25: /* Event #15-#22 enable
Bit 0 R/W Press key "A" event - Enable interrupt #22
@@ -827,7 +827,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 R/W Press power button event - Enable interrupt #15
*/
state->m_pm_reg[0x25] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x26: /* Event #13-#14 enable
Bit 0-2 R/W Unknown
@@ -837,7 +837,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 R/W IR receiver - low to high trigger - Enable interrupt #13
*/
state->m_pm_reg[0x26] = data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
break;
case 0x27: /* Interrupt active flag #1-#8
Bit 0 Timer 3 overflow (mirror) / Clear interrupt #8
@@ -850,7 +850,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 VBlank trigger / Clear interrupt #1
*/
state->m_pm_reg[0x27] &= ~data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
return;
case 0x28: /* Interrupt active flag #9-#12
Bit 0-1 Unknown
@@ -861,7 +861,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 6-7 Unknown
*/
state->m_pm_reg[0x28] &= ~data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
return;
case 0x29: /* Interrupt active flag #15-#22
Bit 0 Press key "A" event / Clear interrupt #22
@@ -874,7 +874,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 Press power button event / Clear interrupt #15
*/
state->m_pm_reg[0x29] &= ~data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
return;
case 0x2A: /* Interrupt active flag #13-#14
Bit 0-5 Unknown
@@ -882,7 +882,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 7 Unknown / Clear interrupt #13
*/
state->m_pm_reg[0x2A] &= ~data;
- pokemini_check_irqs(device->machine());
+ pokemini_check_irqs(space.machine());
return;
case 0x30: /* Timer 1 control 1
Bit 0 R/W Unknown
@@ -956,7 +956,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
case 0x35: /* Timer 1 sound-pivot (high, unused)
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
case 0x36: /* Timer 1 counter (low), read only
*/
@@ -1035,7 +1035,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
*/
case 0x3D: /* Timer 2 sound-pivot (high, unused)
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
case 0x3E: /* Timer 2 counter (low), read only
Bit 0-7 R/W Timer 2 counter value bit 0-7
@@ -1095,7 +1095,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
state->m_timers.timer3_hi->enable( 0 );
}
state->m_pm_reg[0x48] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x49: /* Timer 3 control 2
Bit 0 R/W Unknown
@@ -1121,25 +1121,25 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
state->m_timers.timer3_hi->enable( 0 );
}
state->m_pm_reg[0x49] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x4A: /* Timer 3 preset value (low)
Bit 0-7 R/W Timer 3 preset value bit 0-7
*/
state->m_pm_reg[0x4A] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x4B: /* Timer 3 preset value (high)
Bit 0-7 R/W Timer 3 preset value bit 8-15
*/
state->m_pm_reg[0x4B] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x4C: /* Timer 3 sound-pivot (low)
Bit 0-7 R/W Timer 3 sound-pivot value bit 0-7
*/
state->m_pm_reg[0x4C] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x4D: /* Timer 3 sound-pivot (high)
Bit 0-7 R/W Timer 3 sound-pivot value bit 8-15
@@ -1150,7 +1150,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Pulse-Width of 100% = Same as preset-value
*/
state->m_pm_reg[0x4D] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x4E: /* Timer 3 counter (low), read only
Bit 0-7 R/W Timer 3 counter value bit 0-7
@@ -1200,7 +1200,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
break;
case 0x70: /* Sound related */
state->m_pm_reg[0x70] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x71: /* Sound volume
Bit 0-1 R/W Sound volume
@@ -1212,7 +1212,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Bit 3-7 Unused
*/
state->m_pm_reg[0x71] = data;
- pokemini_update_sound(device->machine());
+ pokemini_update_sound(space.machine());
break;
case 0x80: /* LCD control
Bit 0 R/W Invert colors; 0 - normal, 1 - inverted
@@ -1300,7 +1300,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
Map size 2: 0x00 to 0x60
Bit 7 Unused
*/
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
case 0x87: /* Sprite tile data memory offset (low)
Bit 0-5 Always "0"
@@ -1341,7 +1341,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
// lcd_data_w( data );
break;
default:
- logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", device->machine().firstcpu->pc( ), offset, data );
+ logerror( "%0X: Write to unknown hardware address: %02X, %02X\n", space.machine().firstcpu->pc( ), offset, data );
break;
}
state->m_pm_reg[offset] = data;
@@ -1349,7 +1349,7 @@ WRITE8_DEVICE_HANDLER( pokemini_hwreg_w )
READ8_DEVICE_HANDLER( pokemini_hwreg_r )
{
- pokemini_state *state = device->machine().driver_data<pokemini_state>();
+ pokemini_state *state = space.machine().driver_data<pokemini_state>();
UINT8 data = state->m_pm_reg[offset];
switch( offset )
diff --git a/src/mess/machine/pp01.c b/src/mess/machine/pp01.c
index 138abbc44c4..db40b0c5c1b 100644
--- a/src/mess/machine/pp01.c
+++ b/src/mess/machine/pp01.c
@@ -187,24 +187,24 @@ const struct pit8253_config pp01_pit8253_intf =
static READ8_DEVICE_HANDLER (pp01_8255_porta_r )
{
- pp01_state *state = device->machine().driver_data<pp01_state>();
+ pp01_state *state = space.machine().driver_data<pp01_state>();
return state->m_video_scroll;
}
static WRITE8_DEVICE_HANDLER (pp01_8255_porta_w )
{
- pp01_state *state = device->machine().driver_data<pp01_state>();
+ pp01_state *state = space.machine().driver_data<pp01_state>();
state->m_video_scroll = data;
}
static READ8_DEVICE_HANDLER (pp01_8255_portb_r )
{
- pp01_state *state = device->machine().driver_data<pp01_state>();
+ pp01_state *state = space.machine().driver_data<pp01_state>();
static const char *const keynames[] = {
"LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5", "LINE6", "LINE7",
"LINE8", "LINE9", "LINEA", "LINEB", "LINEC", "LINED", "LINEE", "LINEF"
};
- return (device->machine().root_device().ioport(keynames[state->m_key_line])->read() & 0x3F) | (device->machine().root_device().ioport("LINEALL")->read() & 0xC0);
+ return (space.machine().root_device().ioport(keynames[state->m_key_line])->read() & 0x3F) | (space.machine().root_device().ioport("LINEALL")->read() & 0xC0);
}
static WRITE8_DEVICE_HANDLER (pp01_8255_portb_w )
{
@@ -214,7 +214,7 @@ static WRITE8_DEVICE_HANDLER (pp01_8255_portb_w )
static WRITE8_DEVICE_HANDLER (pp01_8255_portc_w )
{
- pp01_state *state = device->machine().driver_data<pp01_state>();
+ pp01_state *state = space.machine().driver_data<pp01_state>();
state->m_key_line = data & 0x0f;
}
diff --git a/src/mess/machine/radio86.c b/src/mess/machine/radio86.c
index e397d33d589..0e7e9c7d65b 100644
--- a/src/mess/machine/radio86.c
+++ b/src/mess/machine/radio86.c
@@ -43,23 +43,23 @@ DRIVER_INIT_MEMBER(radio86_state,radioram)
}
static READ8_DEVICE_HANDLER (radio86_8255_portb_r2 )
{
- radio86_state *state = device->machine().driver_data<radio86_state>();
+ radio86_state *state = space.machine().driver_data<radio86_state>();
UINT8 key = 0xff;
if ((state->m_keyboard_mask & 0x01)!=0) { key &= state->ioport("LINE0")->read(); }
- if ((state->m_keyboard_mask & 0x02)!=0) { key &= device->machine().root_device().ioport("LINE1")->read(); }
- if ((state->m_keyboard_mask & 0x04)!=0) { key &= device->machine().root_device().ioport("LINE2")->read(); }
- if ((state->m_keyboard_mask & 0x08)!=0) { key &= device->machine().root_device().ioport("LINE3")->read(); }
- if ((state->m_keyboard_mask & 0x10)!=0) { key &= device->machine().root_device().ioport("LINE4")->read(); }
- if ((state->m_keyboard_mask & 0x20)!=0) { key &= device->machine().root_device().ioport("LINE5")->read(); }
- if ((state->m_keyboard_mask & 0x40)!=0) { key &= device->machine().root_device().ioport("LINE6")->read(); }
- if ((state->m_keyboard_mask & 0x80)!=0) { key &= device->machine().root_device().ioport("LINE7")->read(); }
+ if ((state->m_keyboard_mask & 0x02)!=0) { key &= space.machine().root_device().ioport("LINE1")->read(); }
+ if ((state->m_keyboard_mask & 0x04)!=0) { key &= space.machine().root_device().ioport("LINE2")->read(); }
+ if ((state->m_keyboard_mask & 0x08)!=0) { key &= space.machine().root_device().ioport("LINE3")->read(); }
+ if ((state->m_keyboard_mask & 0x10)!=0) { key &= space.machine().root_device().ioport("LINE4")->read(); }
+ if ((state->m_keyboard_mask & 0x20)!=0) { key &= space.machine().root_device().ioport("LINE5")->read(); }
+ if ((state->m_keyboard_mask & 0x40)!=0) { key &= space.machine().root_device().ioport("LINE6")->read(); }
+ if ((state->m_keyboard_mask & 0x80)!=0) { key &= space.machine().root_device().ioport("LINE7")->read(); }
return key;
}
static READ8_DEVICE_HANDLER (radio86_8255_portc_r2 )
{
- radio86_state *state = device->machine().driver_data<radio86_state>();
- double level = (device->machine().device<cassette_image_device>(CASSETTE_TAG)->input());
+ radio86_state *state = space.machine().driver_data<radio86_state>();
+ double level = (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input());
UINT8 dat = state->ioport("LINE8")->read();
if (level < 0) {
dat ^= state->m_tape_value;
@@ -69,13 +69,13 @@ static READ8_DEVICE_HANDLER (radio86_8255_portc_r2 )
static WRITE8_DEVICE_HANDLER (radio86_8255_porta_w2 )
{
- radio86_state *state = device->machine().driver_data<radio86_state>();
+ radio86_state *state = space.machine().driver_data<radio86_state>();
state->m_keyboard_mask = data ^ 0xff;
}
static WRITE8_DEVICE_HANDLER (radio86_8255_portc_w2 )
{
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->output(data & 0x01 ? 1 : -1);
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->output(data & 0x01 ? 1 : -1);
}
@@ -103,17 +103,17 @@ I8255A_INTERFACE( mikrosha_ppi8255_interface_1 )
static READ8_DEVICE_HANDLER (rk7007_8255_portc_r )
{
- radio86_state *state = device->machine().driver_data<radio86_state>();
- double level = (device->machine().device<cassette_image_device>(CASSETTE_TAG)->input());
+ radio86_state *state = space.machine().driver_data<radio86_state>();
+ double level = (space.machine().device<cassette_image_device>(CASSETTE_TAG)->input());
UINT8 key = 0xff;
if ((state->m_keyboard_mask & 0x01)!=0) { key &= state->ioport("CLINE0")->read(); }
- if ((state->m_keyboard_mask & 0x02)!=0) { key &= device->machine().root_device().ioport("CLINE1")->read(); }
- if ((state->m_keyboard_mask & 0x04)!=0) { key &= device->machine().root_device().ioport("CLINE2")->read(); }
- if ((state->m_keyboard_mask & 0x08)!=0) { key &= device->machine().root_device().ioport("CLINE3")->read(); }
- if ((state->m_keyboard_mask & 0x10)!=0) { key &= device->machine().root_device().ioport("CLINE4")->read(); }
- if ((state->m_keyboard_mask & 0x20)!=0) { key &= device->machine().root_device().ioport("CLINE5")->read(); }
- if ((state->m_keyboard_mask & 0x40)!=0) { key &= device->machine().root_device().ioport("CLINE6")->read(); }
- if ((state->m_keyboard_mask & 0x80)!=0) { key &= device->machine().root_device().ioport("CLINE7")->read(); }
+ if ((state->m_keyboard_mask & 0x02)!=0) { key &= space.machine().root_device().ioport("CLINE1")->read(); }
+ if ((state->m_keyboard_mask & 0x04)!=0) { key &= space.machine().root_device().ioport("CLINE2")->read(); }
+ if ((state->m_keyboard_mask & 0x08)!=0) { key &= space.machine().root_device().ioport("CLINE3")->read(); }
+ if ((state->m_keyboard_mask & 0x10)!=0) { key &= space.machine().root_device().ioport("CLINE4")->read(); }
+ if ((state->m_keyboard_mask & 0x20)!=0) { key &= space.machine().root_device().ioport("CLINE5")->read(); }
+ if ((state->m_keyboard_mask & 0x40)!=0) { key &= space.machine().root_device().ioport("CLINE6")->read(); }
+ if ((state->m_keyboard_mask & 0x80)!=0) { key &= space.machine().root_device().ioport("CLINE7")->read(); }
key &= 0xe0;
if (level < 0) {
key ^= state->m_tape_value;
@@ -193,7 +193,7 @@ WRITE8_MEMBER(radio86_state::radio86_pagesel)
static READ8_DEVICE_HANDLER (radio86_romdisk_porta_r )
{
- radio86_state *state = device->machine().driver_data<radio86_state>();
+ radio86_state *state = space.machine().driver_data<radio86_state>();
UINT8 *romdisk = state->memregion("maincpu")->base() + 0x10000;
if ((state->m_disk_sel & 0x0f) ==0) {
return romdisk[state->m_romdisk_msb*256+state->m_romdisk_lsb];
@@ -208,13 +208,13 @@ static READ8_DEVICE_HANDLER (radio86_romdisk_porta_r )
static WRITE8_DEVICE_HANDLER (radio86_romdisk_portb_w )
{
- radio86_state *state = device->machine().driver_data<radio86_state>();
+ radio86_state *state = space.machine().driver_data<radio86_state>();
state->m_romdisk_lsb = data;
}
static WRITE8_DEVICE_HANDLER (radio86_romdisk_portc_w )
{
- radio86_state *state = device->machine().driver_data<radio86_state>();
+ radio86_state *state = space.machine().driver_data<radio86_state>();
state->m_romdisk_msb = data;
}
@@ -230,7 +230,7 @@ I8255A_INTERFACE( radio86_ppi8255_interface_2 )
static WRITE8_DEVICE_HANDLER (mikrosha_8255_font_page_w )
{
- radio86_state *state = device->machine().driver_data<radio86_state>();
+ radio86_state *state = space.machine().driver_data<radio86_state>();
state->m_mikrosha_font_page = (data > 7) & 1;
}
diff --git a/src/mess/machine/rmnimbus.c b/src/mess/machine/rmnimbus.c
index 2c5eb29f23a..3df7947108d 100644
--- a/src/mess/machine/rmnimbus.c
+++ b/src/mess/machine/rmnimbus.c
@@ -2217,7 +2217,7 @@ static READ16_DEVICE_HANDLER( sio_serial_receive )
{
if(offset==0)
{
- return keyboard_queue_read(device->machine());
+ return keyboard_queue_read(space.machine());
}
else
return -1;
diff --git a/src/mess/machine/s3c44b0.c b/src/mess/machine/s3c44b0.c
index 1ccd820a81c..3b78eb7b158 100644
--- a/src/mess/machine/s3c44b0.c
+++ b/src/mess/machine/s3c44b0.c
@@ -346,7 +346,7 @@ static READ32_DEVICE_HANDLER( s3c44b0_lcd_r )
}
break;
}
-// verboselog( device->machine(), 9, "(LCD) %08X -> %08X\n", S3C44B0_BASE_LCD + (offset << 2), data);
+// verboselog( space.machine(), 9, "(LCD) %08X -> %08X\n", S3C44B0_BASE_LCD + (offset << 2), data);
return data;
}
@@ -442,7 +442,7 @@ static WRITE32_DEVICE_HANDLER( s3c44b0_lcd_w )
{
s3c44b0_lcd_t *lcd = &(get_token( device)->lcd);
UINT32 old_value = ((UINT32*)&lcd->regs)[offset];
-// verboselog( device->machine(), 9, "(LCD) %08X <- %08X\n", S3C44B0_BASE_LCD + (offset << 2), data);
+// verboselog( space.machine(), 9, "(LCD) %08X <- %08X\n", S3C44B0_BASE_LCD + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&lcd->regs)[offset]);
switch (offset)
{
@@ -474,20 +474,20 @@ static READ32_DEVICE_HANDLER( s3c44b0_clkpow_r )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 data = ((UINT32*)&s3c44b0->clkpow.regs)[offset];
- verboselog( device->machine(), 9, "(CLKPOW) %08X -> %08X\n", S3C44B0_BASE_CLKPOW + (offset << 2), data);
+ verboselog( space.machine(), 9, "(CLKPOW) %08X -> %08X\n", S3C44B0_BASE_CLKPOW + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c44b0_clkpow_w )
{
s3c44b0_t *s3c44b0 = get_token( device);
- verboselog( device->machine(), 9, "(CLKPOW) %08X <- %08X\n", S3C44B0_BASE_CLKPOW + (offset << 2), data);
+ verboselog( space.machine(), 9, "(CLKPOW) %08X <- %08X\n", S3C44B0_BASE_CLKPOW + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c44b0->clkpow.regs)[offset]);
switch (offset)
{
case S3C44B0_PLLCON :
{
- verboselog( device->machine(), 5, "CLKPOW - mclk %d\n", s3c44b0_get_mclk( device));
+ verboselog( space.machine(), 5, "CLKPOW - mclk %d\n", s3c44b0_get_mclk( device));
s3c44b0->cpu->set_unscaled_clock( s3c44b0_get_mclk( device) * CLOCK_MULTIPLIER);
}
break;
@@ -602,14 +602,14 @@ static READ32_DEVICE_HANDLER( s3c44b0_irq_r )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 data = ((UINT32*)&s3c44b0->irq.regs)[offset];
- verboselog( device->machine(), 9, "(IRQ) %08X -> %08X\n", S3C44B0_BASE_INT + (offset << 2), data);
+ verboselog( space.machine(), 9, "(IRQ) %08X -> %08X\n", S3C44B0_BASE_INT + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c44b0_irq_w )
{
s3c44b0_t *s3c44b0 = get_token( device);
- verboselog( device->machine(), 9, "(IRQ) %08X <- %08X\n", S3C44B0_BASE_INT + (offset << 2), data);
+ verboselog( space.machine(), 9, "(IRQ) %08X <- %08X\n", S3C44B0_BASE_INT + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c44b0->irq.regs)[offset]);
switch (offset)
{
@@ -688,7 +688,7 @@ static READ32_DEVICE_HANDLER( s3c44b0_pwm_r )
}
break;
}
- verboselog( device->machine(), 9, "(PWM) %08X -> %08X\n", S3C44B0_BASE_PWM + (offset << 2), data);
+ verboselog( space.machine(), 9, "(PWM) %08X -> %08X\n", S3C44B0_BASE_PWM + (offset << 2), data);
return data;
}
@@ -818,7 +818,7 @@ static WRITE32_DEVICE_HANDLER( s3c44b0_pwm_w )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 old_value = ((UINT32*)&s3c44b0->pwm.regs)[offset];
- verboselog( device->machine(), 9, "(PWM) %08X <- %08X\n", S3C44B0_BASE_PWM + (offset << 2), data);
+ verboselog( space.machine(), 9, "(PWM) %08X <- %08X\n", S3C44B0_BASE_PWM + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c44b0->pwm.regs)[offset]);
switch (offset)
{
@@ -1009,7 +1009,7 @@ static READ32_DEVICE_HANDLER( s3c44b0_iic_r )
}
break;
}
- verboselog( device->machine(), 9, "(IIC) %08X -> %08X\n", S3C44B0_BASE_IIC + (offset << 2), data);
+ verboselog( space.machine(), 9, "(IIC) %08X -> %08X\n", S3C44B0_BASE_IIC + (offset << 2), data);
return data;
}
@@ -1017,7 +1017,7 @@ static WRITE32_DEVICE_HANDLER( s3c44b0_iic_w )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 old_value = ((UINT32*)&s3c44b0->iic.regs)[offset];
- verboselog( device->machine(), 9, "(IIC) %08X <- %08X\n", S3C44B0_BASE_IIC + (offset << 2), data);
+ verboselog( space.machine(), 9, "(IIC) %08X <- %08X\n", S3C44B0_BASE_IIC + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c44b0->iic.regs)[offset]);
switch (offset)
{
@@ -1176,7 +1176,7 @@ static READ32_DEVICE_HANDLER( s3c44b0_gpio_r )
}
break;
}
- verboselog( device->machine(), 9, "(GPIO) %08X -> %08X\n", S3C44B0_BASE_GPIO + (offset << 2), data);
+ verboselog( space.machine(), 9, "(GPIO) %08X -> %08X\n", S3C44B0_BASE_GPIO + (offset << 2), data);
return data;
}
@@ -1184,7 +1184,7 @@ static WRITE32_DEVICE_HANDLER( s3c44b0_gpio_w )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 old_value = ((UINT32*)&s3c44b0->gpio.regs)[offset];
- verboselog( device->machine(), 9, "(GPIO) %08X <- %08X\n", S3C44B0_BASE_GPIO + (offset << 2), data);
+ verboselog( space.machine(), 9, "(GPIO) %08X <- %08X\n", S3C44B0_BASE_GPIO + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c44b0->gpio.regs)[offset]);
switch (offset)
{
@@ -1287,26 +1287,26 @@ static void s3c44b0_uart_w( device_t *device, int ch, UINT32 offset, UINT32 data
static READ32_DEVICE_HANDLER( s3c44b0_uart_0_r )
{
UINT32 data = s3c44b0_uart_r( device, 0, offset);
-// verboselog( device->machine(), 9, "(UART 0) %08X -> %08X\n", S3C44B0_BASE_UART_0 + (offset << 2), data);
+// verboselog( space.machine(), 9, "(UART 0) %08X -> %08X\n", S3C44B0_BASE_UART_0 + (offset << 2), data);
return data;
}
static READ32_DEVICE_HANDLER( s3c44b0_uart_1_r )
{
UINT32 data = s3c44b0_uart_r( device, 1, offset);
-// verboselog( device->machine(), 9, "(UART 1) %08X -> %08X\n", S3C44B0_BASE_UART_1 + (offset << 2), data);
+// verboselog( space.machine(), 9, "(UART 1) %08X -> %08X\n", S3C44B0_BASE_UART_1 + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c44b0_uart_0_w )
{
- verboselog( device->machine(), 9, "(UART 0) %08X <- %08X (%08X)\n", S3C44B0_BASE_UART_0 + (offset << 2), data, mem_mask);
+ verboselog( space.machine(), 9, "(UART 0) %08X <- %08X (%08X)\n", S3C44B0_BASE_UART_0 + (offset << 2), data, mem_mask);
s3c44b0_uart_w( device, 0, offset, data, mem_mask);
}
static WRITE32_DEVICE_HANDLER( s3c44b0_uart_1_w )
{
- verboselog( device->machine(), 9, "(UART 1) %08X <- %08X (%08X)\n", S3C44B0_BASE_UART_1 + (offset << 2), data, mem_mask);
+ verboselog( space.machine(), 9, "(UART 1) %08X <- %08X (%08X)\n", S3C44B0_BASE_UART_1 + (offset << 2), data, mem_mask);
s3c44b0_uart_w( device, 1, offset, data, mem_mask);
}
@@ -1355,7 +1355,7 @@ static READ32_DEVICE_HANDLER( s3c44b0_wdt_r )
}
break;
}
- verboselog( device->machine(), 9, "(WDT) %08X -> %08X\n", S3C44B0_BASE_WDT + (offset << 2), data);
+ verboselog( space.machine(), 9, "(WDT) %08X -> %08X\n", S3C44B0_BASE_WDT + (offset << 2), data);
return data;
}
@@ -1399,7 +1399,7 @@ static WRITE32_DEVICE_HANDLER( s3c44b0_wdt_w )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 old_value = ((UINT32*)&s3c44b0->wdt.regs)[offset];
- verboselog( device->machine(), 9, "(WDT) %08X <- %08X\n", S3C44B0_BASE_WDT + (offset << 2), data);
+ verboselog( space.machine(), 9, "(WDT) %08X <- %08X\n", S3C44B0_BASE_WDT + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c44b0->wdt.regs)[offset]);
switch (offset)
{
@@ -1435,14 +1435,14 @@ static READ32_DEVICE_HANDLER( s3c44b0_cpuwrap_r )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 data = ((UINT32*)&s3c44b0->cpuwrap.regs)[offset];
- verboselog( device->machine(), 9, "(CPUWRAP) %08X -> %08X\n", S3C44B0_BASE_CPU_WRAPPER + (offset << 2), data);
+ verboselog( space.machine(), 9, "(CPUWRAP) %08X -> %08X\n", S3C44B0_BASE_CPU_WRAPPER + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c44b0_cpuwrap_w )
{
s3c44b0_t *s3c44b0 = get_token( device);
- verboselog( device->machine(), 9, "(CPUWRAP) %08X <- %08X\n", S3C44B0_BASE_CPU_WRAPPER + (offset << 2), data);
+ verboselog( space.machine(), 9, "(CPUWRAP) %08X <- %08X\n", S3C44B0_BASE_CPU_WRAPPER + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c44b0->cpuwrap.regs)[offset]);
}
@@ -1452,7 +1452,7 @@ static READ32_DEVICE_HANDLER( s3c44b0_adc_r )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 data = ((UINT32*)&s3c44b0->adc.regs)[offset];
- verboselog( device->machine(), 9, "(ADC) %08X -> %08X\n", S3C44B0_BASE_ADC + (offset << 2), data);
+ verboselog( space.machine(), 9, "(ADC) %08X -> %08X\n", S3C44B0_BASE_ADC + (offset << 2), data);
return data;
}
@@ -1494,7 +1494,7 @@ static WRITE32_DEVICE_HANDLER( s3c44b0_adc_w )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 old_value = ((UINT32*)&s3c44b0->wdt.regs)[offset];
- verboselog( device->machine(), 9, "(ADC) %08X <- %08X\n", S3C44B0_BASE_ADC + (offset << 2), data);
+ verboselog( space.machine(), 9, "(ADC) %08X <- %08X\n", S3C44B0_BASE_ADC + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c44b0->adc.regs)[offset]);
switch (offset)
{
@@ -1525,7 +1525,7 @@ static READ32_DEVICE_HANDLER( s3c44b0_sio_r )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 data = ((UINT32*)&s3c44b0->sio.regs)[offset];
- verboselog( device->machine(), 9, "(SIO) %08X -> %08X\n", S3C44B0_BASE_SIO + (offset << 2), data);
+ verboselog( space.machine(), 9, "(SIO) %08X -> %08X\n", S3C44B0_BASE_SIO + (offset << 2), data);
return data;
}
@@ -1569,7 +1569,7 @@ static WRITE32_DEVICE_HANDLER( s3c44b0_sio_w )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 old_value = ((UINT32*)&s3c44b0->sio.regs)[offset];
- verboselog( device->machine(), 9, "(SIO) %08X <- %08X\n", S3C44B0_BASE_SIO + (offset << 2), data);
+ verboselog( space.machine(), 9, "(SIO) %08X <- %08X\n", S3C44B0_BASE_SIO + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c44b0->sio.regs)[offset]);
switch (offset)
{
@@ -1637,7 +1637,7 @@ static READ32_DEVICE_HANDLER( s3c44b0_iis_r )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 data = ((UINT32*)&s3c44b0->iis.regs)[offset];
- verboselog( device->machine(), 9, "(IIS) %08X -> %08X\n", S3C44B0_BASE_IIS + (offset << 2), data);
+ verboselog( space.machine(), 9, "(IIS) %08X -> %08X\n", S3C44B0_BASE_IIS + (offset << 2), data);
return data;
}
@@ -1645,7 +1645,7 @@ static WRITE32_DEVICE_HANDLER( s3c44b0_iis_w )
{
s3c44b0_t *s3c44b0 = get_token( device);
UINT32 old_value = ((UINT32*)&s3c44b0->iis.regs)[offset];
- verboselog( device->machine(), 9, "(IIS) %08X <- %08X\n", S3C44B0_BASE_IIS + (offset << 2), data);
+ verboselog( space.machine(), 9, "(IIS) %08X <- %08X\n", S3C44B0_BASE_IIS + (offset << 2), data);
COMBINE_DATA(&((UINT32*)&s3c44b0->iis.regs)[offset]);
switch (offset)
{
@@ -1793,26 +1793,26 @@ static void s3c44b0_zdma_w( device_t *device, int ch, UINT32 offset, UINT32 data
static READ32_DEVICE_HANDLER( s3c44b0_zdma_0_r )
{
UINT32 data = s3c44b0_zdma_r( device, 0, offset);
- verboselog( device->machine(), 9, "(ZDMA 0) %08X -> %08X\n", S3C44B0_BASE_ZDMA_0 + (offset << 2), data);
+ verboselog( space.machine(), 9, "(ZDMA 0) %08X -> %08X\n", S3C44B0_BASE_ZDMA_0 + (offset << 2), data);
return data;
}
static READ32_DEVICE_HANDLER( s3c44b0_zdma_1_r )
{
UINT32 data = s3c44b0_zdma_r( device, 1, offset);
- verboselog( device->machine(), 9, "(ZDMA 1) %08X -> %08X\n", S3C44B0_BASE_ZDMA_1 + (offset << 2), data);
+ verboselog( space.machine(), 9, "(ZDMA 1) %08X -> %08X\n", S3C44B0_BASE_ZDMA_1 + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c44b0_zdma_0_w )
{
- verboselog( device->machine(), 9, "(ZDMA 0) %08X <- %08X (%08X)\n", S3C44B0_BASE_ZDMA_0 + (offset << 2), data, mem_mask);
+ verboselog( space.machine(), 9, "(ZDMA 0) %08X <- %08X (%08X)\n", S3C44B0_BASE_ZDMA_0 + (offset << 2), data, mem_mask);
s3c44b0_zdma_w( device, 0, offset, data, mem_mask);
}
static WRITE32_DEVICE_HANDLER( s3c44b0_zdma_1_w )
{
- verboselog( device->machine(), 9, "(ZDMA 1) %08X <- %08X (%08X)\n", S3C44B0_BASE_ZDMA_1 + (offset << 2), data, mem_mask);
+ verboselog( space.machine(), 9, "(ZDMA 1) %08X <- %08X (%08X)\n", S3C44B0_BASE_ZDMA_1 + (offset << 2), data, mem_mask);
s3c44b0_zdma_w( device, 1, offset, data, mem_mask);
}
@@ -1942,26 +1942,26 @@ static void s3c44b0_bdma_w( device_t *device, int ch, UINT32 offset, UINT32 data
static READ32_DEVICE_HANDLER( s3c44b0_bdma_0_r )
{
UINT32 data = s3c44b0_bdma_r( device, 0, offset);
- verboselog( device->machine(), 9, "(BDMA 0) %08X -> %08X\n", S3C44B0_BASE_BDMA_0 + (offset << 2), data);
+ verboselog( space.machine(), 9, "(BDMA 0) %08X -> %08X\n", S3C44B0_BASE_BDMA_0 + (offset << 2), data);
return data;
}
static READ32_DEVICE_HANDLER( s3c44b0_bdma_1_r )
{
UINT32 data = s3c44b0_bdma_r( device, 1, offset);
- verboselog( device->machine(), 9, "(BDMA 1) %08X -> %08X\n", S3C44B0_BASE_BDMA_1 + (offset << 2), data);
+ verboselog( space.machine(), 9, "(BDMA 1) %08X -> %08X\n", S3C44B0_BASE_BDMA_1 + (offset << 2), data);
return data;
}
static WRITE32_DEVICE_HANDLER( s3c44b0_bdma_0_w )
{
- verboselog( device->machine(), 9, "(BDMA 0) %08X <- %08X (%08X)\n", S3C44B0_BASE_BDMA_0 + (offset << 2), data, mem_mask);
+ verboselog( space.machine(), 9, "(BDMA 0) %08X <- %08X (%08X)\n", S3C44B0_BASE_BDMA_0 + (offset << 2), data, mem_mask);
s3c44b0_bdma_w( device, 0, offset, data, mem_mask);
}
static WRITE32_DEVICE_HANDLER( s3c44b0_bdma_1_w )
{
- verboselog( device->machine(), 9, "(BDMA 1) %08X <- %08X (%08X)\n", S3C44B0_BASE_BDMA_1 + (offset << 2), data, mem_mask);
+ verboselog( space.machine(), 9, "(BDMA 1) %08X <- %08X (%08X)\n", S3C44B0_BASE_BDMA_1 + (offset << 2), data, mem_mask);
s3c44b0_bdma_w( device, 1, offset, data, mem_mask);
}
diff --git a/src/mess/machine/samcoupe.c b/src/mess/machine/samcoupe.c
index 37332064f78..da60cfcf0c0 100644
--- a/src/mess/machine/samcoupe.c
+++ b/src/mess/machine/samcoupe.c
@@ -160,7 +160,7 @@ WRITE8_MEMBER(samcoupe_state::samcoupe_ext_mem_w)
static READ8_DEVICE_HANDLER( samcoupe_rtc_r )
{
- address_space &spaceio = device->machine().device("maincpu")->memory().space(AS_IO);
+ address_space &spaceio = space.machine().device("maincpu")->memory().space(AS_IO);
msm6242_device *rtc = dynamic_cast<msm6242_device*>(device);
return rtc->read(spaceio,offset >> 12);
}
@@ -168,7 +168,7 @@ static READ8_DEVICE_HANDLER( samcoupe_rtc_r )
static WRITE8_DEVICE_HANDLER( samcoupe_rtc_w )
{
- address_space &spaceio = device->machine().device("maincpu")->memory().space(AS_IO);
+ address_space &spaceio = space.machine().device("maincpu")->memory().space(AS_IO);
msm6242_device *rtc = dynamic_cast<msm6242_device*>(device);
rtc->write(spaceio,offset >> 12, data);
}
diff --git a/src/mess/machine/super80.c b/src/mess/machine/super80.c
index 16e467af556..4992be0b30d 100644
--- a/src/mess/machine/super80.c
+++ b/src/mess/machine/super80.c
@@ -14,7 +14,7 @@ WRITE8_MEMBER( super80_state::pio_port_a_w )
static READ8_DEVICE_HANDLER( pio_port_b_r ) // cannot be modernised yet as super80 hangs at start
{
- super80_state *state = device->machine().driver_data<super80_state>();
+ super80_state *state = space.machine().driver_data<super80_state>();
char kbdrow[6];
UINT8 i;
UINT8 data = 0xff;
diff --git a/src/mess/machine/svi318.c b/src/mess/machine/svi318.c
index fa3679dc648..6c65add489e 100644
--- a/src/mess/machine/svi318.c
+++ b/src/mess/machine/svi318.c
@@ -148,11 +148,11 @@ static READ8_DEVICE_HANDLER ( svi318_ppi_port_a_r )
{
int data = 0x0f;
- if ((device->machine().device<cassette_image_device>(CASSETTE_TAG))->input() > 0.0038)
+ if ((space.machine().device<cassette_image_device>(CASSETTE_TAG))->input() > 0.0038)
data |= 0x80;
- if (!svi318_cassette_present(device->machine(), 0))
+ if (!svi318_cassette_present(space.machine(), 0))
data |= 0x40;
- data |= device->machine().root_device().ioport("BUTTONS")->read() & 0x30;
+ data |= space.machine().root_device().ioport("BUTTONS")->read() & 0x30;
return data;
}
@@ -172,7 +172,7 @@ static READ8_DEVICE_HANDLER ( svi318_ppi_port_a_r )
static READ8_DEVICE_HANDLER ( svi318_ppi_port_b_r )
{
- svi318_state *state = device->machine().driver_data<svi318_state>();
+ svi318_state *state = space.machine().driver_data<svi318_state>();
int row;
static const char *const keynames[] = {
"LINE0", "LINE1", "LINE2", "LINE3", "LINE4", "LINE5",
@@ -181,7 +181,7 @@ static READ8_DEVICE_HANDLER ( svi318_ppi_port_b_r )
row = state->m_svi.keyboard_row;
if (row <= 10)
- return device->machine().root_device().ioport(keynames[row])->read();
+ return space.machine().root_device().ioport(keynames[row])->read();
return 0xff;
}
@@ -201,25 +201,25 @@ static READ8_DEVICE_HANDLER ( svi318_ppi_port_b_r )
static WRITE8_DEVICE_HANDLER ( svi318_ppi_port_c_w )
{
- svi318_state *state = device->machine().driver_data<svi318_state>();
+ svi318_state *state = space.machine().driver_data<svi318_state>();
int val;
/* key click */
val = (data & 0x80) ? 0x3e : 0;
val += (data & 0x40) ? 0x3e : 0;
- device->machine().device<dac_device>("dac")->write_signed8(val);
+ space.machine().device<dac_device>("dac")->write_signed8(val);
/* cassette motor on/off */
- if (svi318_cassette_present(device->machine(), 0))
+ if (svi318_cassette_present(space.machine(), 0))
{
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->change_state(
(data & 0x10) ? CASSETTE_MOTOR_DISABLED : CASSETTE_MOTOR_ENABLED,
CASSETTE_MOTOR_DISABLED);
}
/* cassette signal write */
- device->machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x20) ? -1.0 : +1.0);
+ space.machine().device<cassette_image_device>(CASSETTE_TAG)->output((data & 0x20) ? -1.0 : +1.0);
state->m_svi.keyboard_row = data & 0x0F;
}
diff --git a/src/mess/machine/sym1.c b/src/mess/machine/sym1.c
index 82b6ff57837..a9ea947507b 100644
--- a/src/mess/machine/sym1.c
+++ b/src/mess/machine/sym1.c
@@ -82,14 +82,14 @@ static TIMER_CALLBACK( led_refresh )
static READ8_DEVICE_HANDLER(sym1_riot_a_r)
{
- sym1_state *state = device->machine().driver_data<sym1_state>();
+ sym1_state *state = space.machine().driver_data<sym1_state>();
int data = 0x7f;
/* scan keypad rows */
- if (!(state->m_riot_port_a & 0x80)) data &= device->machine().root_device().ioport("ROW-0")->read();
- if (!(state->m_riot_port_b & 0x01)) data &= device->machine().root_device().ioport("ROW-1")->read();
- if (!(state->m_riot_port_b & 0x02)) data &= device->machine().root_device().ioport("ROW-2")->read();
- if (!(state->m_riot_port_b & 0x04)) data &= device->machine().root_device().ioport("ROW-3")->read();
+ if (!(state->m_riot_port_a & 0x80)) data &= space.machine().root_device().ioport("ROW-0")->read();
+ if (!(state->m_riot_port_b & 0x01)) data &= space.machine().root_device().ioport("ROW-1")->read();
+ if (!(state->m_riot_port_b & 0x02)) data &= space.machine().root_device().ioport("ROW-2")->read();
+ if (!(state->m_riot_port_b & 0x04)) data &= space.machine().root_device().ioport("ROW-3")->read();
/* determine column */
if ( ((state->m_riot_port_a ^ 0xff) & (state->ioport("ROW-0")->read() ^ 0xff)) & 0x7f )
@@ -101,14 +101,14 @@ static READ8_DEVICE_HANDLER(sym1_riot_a_r)
static READ8_DEVICE_HANDLER(sym1_riot_b_r)
{
- sym1_state *state = device->machine().driver_data<sym1_state>();
+ sym1_state *state = space.machine().driver_data<sym1_state>();
int data = 0xff;
/* determine column */
- if ( ((state->m_riot_port_a ^ 0xff) & (device->machine().root_device().ioport("ROW-1")->read() ^ 0xff)) & 0x7f )
+ if ( ((state->m_riot_port_a ^ 0xff) & (space.machine().root_device().ioport("ROW-1")->read() ^ 0xff)) & 0x7f )
data &= ~0x01;
- if ( ((state->m_riot_port_a ^ 0xff) & (device->machine().root_device().ioport("ROW-2")->read() ^ 0xff)) & 0x3f )
+ if ( ((state->m_riot_port_a ^ 0xff) & (space.machine().root_device().ioport("ROW-2")->read() ^ 0xff)) & 0x3f )
data &= ~0x02;
if ( ((state->m_riot_port_a ^ 0xff) & (state->ioport("ROW-3")->read() ^ 0xff)) & 0x1f )
@@ -122,8 +122,8 @@ static READ8_DEVICE_HANDLER(sym1_riot_b_r)
static WRITE8_DEVICE_HANDLER(sym1_riot_a_w)
{
- sym1_state *state = device->machine().driver_data<sym1_state>();
- logerror("%x: riot_a_w 0x%02x\n", device->machine().device("maincpu") ->safe_pc( ), data);
+ sym1_state *state = space.machine().driver_data<sym1_state>();
+ logerror("%x: riot_a_w 0x%02x\n", space.machine().device("maincpu") ->safe_pc( ), data);
/* save for later use */
state->m_riot_port_a = data;
@@ -132,14 +132,14 @@ static WRITE8_DEVICE_HANDLER(sym1_riot_a_w)
static WRITE8_DEVICE_HANDLER(sym1_riot_b_w)
{
- sym1_state *state = device->machine().driver_data<sym1_state>();
- logerror("%x: riot_b_w 0x%02x\n", device->machine().device("maincpu") ->safe_pc( ), data);
+ sym1_state *state = space.machine().driver_data<sym1_state>();
+ logerror("%x: riot_b_w 0x%02x\n", space.machine().device("maincpu") ->safe_pc( ), data);
/* save for later use */
state->m_riot_port_b = data;
/* first 4 pins are connected to the 74145 */
- device->machine().device<ttl74145_device>("ttl74145")->write(data & 0x0f);
+ space.machine().device<ttl74145_device>("ttl74145")->write(data & 0x0f);
}
@@ -186,7 +186,7 @@ static READ8_DEVICE_HANDLER( sym1_via0_b_r )
static WRITE8_DEVICE_HANDLER( sym1_via0_b_w )
{
- logerror("%s: via0_b_w 0x%02x\n", device->machine().describe_context(), data);
+ logerror("%s: via0_b_w 0x%02x\n", space.machine().describe_context(), data);
}
@@ -197,26 +197,26 @@ static WRITE8_DEVICE_HANDLER( sym1_via0_b_w )
*/
static WRITE8_DEVICE_HANDLER( sym1_via2_a_w )
{
- address_space &cpu0space = device->machine().device( "maincpu")->memory().space( AS_PROGRAM );
+ address_space &cpu0space = space.machine().device( "maincpu")->memory().space( AS_PROGRAM );
logerror("SYM1 VIA2 W 0x%02x\n", data);
- if ((device->machine().root_device().ioport("WP")->read() & 0x01) && !(data & 0x01)) {
+ if ((space.machine().root_device().ioport("WP")->read() & 0x01) && !(data & 0x01)) {
cpu0space.nop_write(0xa600, 0xa67f);
} else {
cpu0space.install_write_bank(0xa600, 0xa67f, "bank5");
}
- if ((device->machine().root_device().ioport("WP")->read() & 0x02) && !(data & 0x02)) {
+ if ((space.machine().root_device().ioport("WP")->read() & 0x02) && !(data & 0x02)) {
cpu0space.nop_write(0x0400, 0x07ff);
} else {
cpu0space.install_write_bank(0x0400, 0x07ff, "bank2");
}
- if ((device->machine().root_device().ioport("WP")->read() & 0x04) && !(data & 0x04)) {
+ if ((space.machine().root_device().ioport("WP")->read() & 0x04) && !(data & 0x04)) {
cpu0space.nop_write(0x0800, 0x0bff);
} else {
cpu0space.install_write_bank(0x0800, 0x0bff, "bank3");
}
- if ((device->machine().root_device().ioport("WP")->read() & 0x08) && !(data & 0x08)) {
+ if ((space.machine().root_device().ioport("WP")->read() & 0x08) && !(data & 0x08)) {
cpu0space.nop_write(0x0c00, 0x0fff);
} else {
cpu0space.install_write_bank(0x0c00, 0x0fff, "bank4");
diff --git a/src/mess/machine/tf20.c b/src/mess/machine/tf20.c
index 29bb3c633a2..bec671478f1 100644
--- a/src/mess/machine/tf20.c
+++ b/src/mess/machine/tf20.c
@@ -94,11 +94,11 @@ static TIMER_CALLBACK( tf20_upd765_tc_reset )
static READ8_DEVICE_HANDLER( tf20_upd765_tc_r )
{
- logerror("%s: tf20_upd765_tc_r\n", device->machine().describe_context());
+ logerror("%s: tf20_upd765_tc_r\n", space.machine().describe_context());
/* toggle tc on read */
upd765_tc_w(device, ASSERT_LINE);
- device->machine().scheduler().timer_set(attotime::zero, FUNC(tf20_upd765_tc_reset), 0, device);
+ space.machine().scheduler().timer_set(attotime::zero, FUNC(tf20_upd765_tc_reset), 0, device);
return 0xff;
}
diff --git a/src/mess/machine/thomson.c b/src/mess/machine/thomson.c
index c9c97270b89..27b5ef5e932 100644
--- a/src/mess/machine/thomson.c
+++ b/src/mess/machine/thomson.c
@@ -147,12 +147,12 @@ static void to7_set_cassette ( running_machine &machine, int data )
static WRITE8_DEVICE_HANDLER ( to7_set_cassette_motor )
{
- cassette_image_device* img = thom_cassette_img(device->machine());
+ cassette_image_device* img = thom_cassette_img(space.machine());
cassette_state state = img->get_state();
double pos = img->get_position();
LOG (( "$%04x %f to7_set_cassette_motor: cassette motor %s bitpos=%i\n",
- device->machine().device("maincpu")->safe_pcbase(), img->machine().time().as_double(), data ? "off" : "on",
+ space.machine().device("maincpu")->safe_pcbase(), img->machine().time().as_double(), data ? "off" : "on",
(int) (pos / TO7_BIT_LENGTH) ));
if ( (state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_DISABLED && !data && pos > 0.3 )
@@ -223,12 +223,12 @@ static void mo5_set_cassette ( running_machine &machine, int data )
static WRITE8_DEVICE_HANDLER ( mo5_set_cassette_motor )
{
- cassette_image_device* img = thom_cassette_img(device->machine());
+ cassette_image_device* img = thom_cassette_img(space.machine());
cassette_state state = img->get_state();
double pos = img->get_position();
LOG (( "$%04x %f mo5_set_cassette_motor: cassette motor %s hbitpos=%i\n",
- device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data ? "off" : "on",
+ space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ? "off" : "on",
(int) (pos / MO5_HBIT_LENGTH) ));
if ( (state & CASSETTE_MASK_MOTOR) == CASSETTE_MOTOR_DISABLED && !data && pos > 0.3 )
@@ -507,9 +507,9 @@ READ8_HANDLER ( to7_cartridge_r )
static WRITE8_DEVICE_HANDLER ( to7_timer_port_out )
{
- thom_set_mode_point( device->machine(), data & 1 ); /* bit 0: video bank switch */
- thom_set_caps_led( device->machine(), (data & 8) ? 1 : 0 ) ; /* bit 3: keyboard led */
- thom_set_border_color( device->machine(),
+ thom_set_mode_point( space.machine(), data & 1 ); /* bit 0: video bank switch */
+ thom_set_caps_led( space.machine(), (data & 8) ? 1 : 0 ) ; /* bit 3: keyboard led */
+ thom_set_border_color( space.machine(),
((data & 0x10) ? 1 : 0) | /* bits 4-6: border color */
((data & 0x20) ? 2 : 0) |
((data & 0x40) ? 4 : 0) );
@@ -519,15 +519,15 @@ static WRITE8_DEVICE_HANDLER ( to7_timer_port_out )
static WRITE8_DEVICE_HANDLER ( to7_timer_cp2_out )
{
- device->machine().device<dac_device>("buzzer")->write_unsigned8(data ? 0x80 : 0); /* 1-bit buzzer */
+ space.machine().device<dac_device>("buzzer")->write_unsigned8(data ? 0x80 : 0); /* 1-bit buzzer */
}
static READ8_DEVICE_HANDLER ( to7_timer_port_in )
{
- int lightpen = (device->machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0;
- int cass = to7_get_cassette(device->machine()) ? 0x80 : 0;
+ int lightpen = (space.machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0;
+ int cass = to7_get_cassette(space.machine()) ? 0x80 : 0;
return lightpen | cass;
}
@@ -536,7 +536,7 @@ static READ8_DEVICE_HANDLER ( to7_timer_port_in )
static WRITE8_DEVICE_HANDLER ( to7_timer_tco_out )
{
/* 1-bit cassette output */
- to7_set_cassette( device->machine(), data );
+ to7_set_cassette( space.machine(), data );
}
@@ -617,7 +617,7 @@ static READ8_DEVICE_HANDLER ( to7_sys_porta_in )
if ( to7_lightpen )
{
/* lightpen hi */
- return to7_lightpen_gpl( device->machine(), TO7_LIGHTPEN_DECAL, to7_lightpen_step ) >> 8;
+ return to7_lightpen_gpl( space.machine(), TO7_LIGHTPEN_DECAL, to7_lightpen_step ) >> 8;
}
else
{
@@ -633,7 +633,7 @@ static READ8_DEVICE_HANDLER ( to7_sys_porta_in )
for ( i = 0; i < 8; i++ )
{
if ( ! (keyline & (1 << i)) )
- val &= device->machine().root_device().ioport(keynames[i])->read();
+ val &= space.machine().root_device().ioport(keynames[i])->read();
}
return val;
}
@@ -644,7 +644,7 @@ static READ8_DEVICE_HANDLER ( to7_sys_porta_in )
static READ8_DEVICE_HANDLER ( to7_sys_portb_in )
{
/* lightpen low */
- return to7_lightpen_gpl( device->machine(), TO7_LIGHTPEN_DECAL, to7_lightpen_step ) & 0xff;
+ return to7_lightpen_gpl( space.machine(), TO7_LIGHTPEN_DECAL, to7_lightpen_step ) & 0xff;
}
@@ -767,21 +767,21 @@ READ8_MEMBER( to7_io_line_device::porta_in )
static WRITE8_DEVICE_HANDLER( to7_io_portb_out )
{
- centronics_device *printer = device->machine().device<centronics_device>("centronics");
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
- LOG_IO(( "$%04x %f to7_io_portb_out: CENTRONICS set data=$%02X\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data ));
+ LOG_IO(( "$%04x %f to7_io_portb_out: CENTRONICS set data=$%02X\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
/* set 8-bit data */
- printer->write( device->machine().driver_data()->generic_space(), 0, data);
+ printer->write( space.machine().driver_data()->generic_space(), 0, data);
}
static WRITE8_DEVICE_HANDLER( to7_io_cb2_out )
{
- centronics_device *printer = device->machine().device<centronics_device>("centronics");
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
- LOG_IO(( "$%04x %f to7_io_cb2_out: CENTRONICS set strobe=%i\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data ));
+ LOG_IO(( "$%04x %f to7_io_cb2_out: CENTRONICS set strobe=%i\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
/* send STROBE to printer */
printer->strobe_w(data);
@@ -1037,16 +1037,16 @@ static void to7_game_sound_update ( running_machine &machine )
static READ8_DEVICE_HANDLER ( to7_game_porta_in )
{
UINT8 data;
- if ( device->machine().root_device().ioport("config")->read() & 1 )
+ if ( space.machine().root_device().ioport("config")->read() & 1 )
{
/* mouse */
- data = to7_get_mouse_signal(device->machine()) & 0x0c; /* XB, YB */
- data |= device->machine().root_device().ioport("mouse_button")->read() & 3; /* buttons */
+ data = to7_get_mouse_signal(space.machine()) & 0x0c; /* XB, YB */
+ data |= space.machine().root_device().ioport("mouse_button")->read() & 3; /* buttons */
}
else
{
/* joystick */
- data = device->machine().root_device().ioport("game_port_directions")->read();
+ data = space.machine().root_device().ioport("game_port_directions")->read();
/* bit 0=0 => P1 up bit 4=0 => P2 up
bit 1=0 => P1 down bit 5=0 => P2 down
bit 2=0 => P1 left bit 6=0 => P2 left
@@ -1078,10 +1078,10 @@ static READ8_DEVICE_HANDLER ( to7_game_porta_in )
static READ8_DEVICE_HANDLER ( to7_game_portb_in )
{
UINT8 data;
- if ( device->machine().root_device().ioport("config")->read() & 1 )
+ if ( space.machine().root_device().ioport("config")->read() & 1 )
{
/* mouse */
- UINT8 mouse = to7_get_mouse_signal(device->machine());
+ UINT8 mouse = to7_get_mouse_signal(space.machine());
data = 0;
if ( mouse & 1 )
data |= 0x04; /* XA */
@@ -1095,7 +1095,7 @@ static READ8_DEVICE_HANDLER ( to7_game_portb_in )
/* bits 2-3: action buttons B (0=pressed) */
/* bits 4-5: unused (ouput) */
/* bits 0-1: unknown! */
- data = device->machine().root_device().ioport("game_port_buttons")->read();
+ data = space.machine().root_device().ioport("game_port_buttons")->read();
}
return data;
}
@@ -1106,7 +1106,7 @@ static WRITE8_DEVICE_HANDLER ( to7_game_portb_out )
{
/* 6-bit DAC sound */
to7_game_sound = data & 0x3f;
- to7_game_sound_update(device->machine());
+ to7_game_sound_update(space.machine());
}
@@ -1546,7 +1546,7 @@ MACHINE_START ( to7 )
static WRITE8_DEVICE_HANDLER ( to770_sys_cb2_out )
{
/* video overlay: black pixels are transparent and show TV image underneath */
- LOG(( "$%04x to770_sys_cb2_out: video overlay %i\n", device->machine().device("maincpu")->safe_pcbase(), data ));
+ LOG(( "$%04x to770_sys_cb2_out: video overlay %i\n", space.machine().device("maincpu")->safe_pcbase(), data ));
}
@@ -1560,7 +1560,7 @@ static READ8_DEVICE_HANDLER ( to770_sys_porta_in )
};
int keyline = downcast<pia6821_device *>(device)->b_output() & 7;
- return device->machine().root_device().ioport(keynames[7 - keyline])->read();
+ return space.machine().root_device().ioport(keynames[7 - keyline])->read();
}
@@ -1620,7 +1620,7 @@ static void to770_update_ram_bank_postload(running_machine *machine)
static WRITE8_DEVICE_HANDLER ( to770_sys_portb_out )
{
- to770_update_ram_bank(device->machine());
+ to770_update_ram_bank(space.machine());
}
@@ -1649,9 +1649,9 @@ const pia6821_interface to770_pia6821_sys =
static WRITE8_DEVICE_HANDLER ( to770_timer_port_out )
{
- thom_set_mode_point( device->machine(), data & 1 ); /* bit 0: video bank switch */
- thom_set_caps_led( device->machine(), (data & 8) ? 1 : 0 ) ; /* bit 3: keyboard led */
- thom_set_border_color( device->machine(),
+ thom_set_mode_point( space.machine(), data & 1 ); /* bit 0: video bank switch */
+ thom_set_caps_led( space.machine(), (data & 8) ? 1 : 0 ) ; /* bit 3: keyboard led */
+ thom_set_border_color( space.machine(),
((data & 0x10) ? 1 : 0) | /* 4-bit border color */
((data & 0x20) ? 2 : 0) |
((data & 0x40) ? 4 : 0) |
@@ -1840,9 +1840,9 @@ static void mo5_init_timer(running_machine &machine)
static WRITE8_DEVICE_HANDLER ( mo5_sys_porta_out )
{
- thom_set_mode_point( device->machine(), data & 1 ); /* bit 0: video bank switch */
- thom_set_border_color( device->machine(), (data >> 1) & 15 ); /* bit 1-4: border color */
- mo5_set_cassette( device->machine(), (data & 0x40) ? 1 : 0 ); /* bit 6: cassette output */
+ thom_set_mode_point( space.machine(), data & 1 ); /* bit 0: video bank switch */
+ thom_set_border_color( space.machine(), (data >> 1) & 15 ); /* bit 1-4: border color */
+ mo5_set_cassette( space.machine(), (data & 0x40) ? 1 : 0 ); /* bit 6: cassette output */
}
@@ -1850,8 +1850,8 @@ static WRITE8_DEVICE_HANDLER ( mo5_sys_porta_out )
static READ8_DEVICE_HANDLER ( mo5_sys_porta_in )
{
return
- (mo5_get_cassette(device->machine()) ? 0x80 : 0) | /* bit 7: cassette input */
- ((device->machine().root_device().ioport("lightpen_button")->read() & 1) ? 0x20 : 0)
+ (mo5_get_cassette(space.machine()) ? 0x80 : 0) | /* bit 7: cassette input */
+ ((space.machine().root_device().ioport("lightpen_button")->read() & 1) ? 0x20 : 0)
/* bit 5: lightpen button */;
}
@@ -1859,7 +1859,7 @@ static READ8_DEVICE_HANDLER ( mo5_sys_porta_in )
static WRITE8_DEVICE_HANDLER ( mo5_sys_portb_out )
{
- device->machine().device<dac_device>("buzzer")->write_unsigned8((data & 1) ? 0x80 : 0); /* 1-bit buzzer */
+ space.machine().device<dac_device>("buzzer")->write_unsigned8((data & 1) ? 0x80 : 0); /* 1-bit buzzer */
}
@@ -1874,7 +1874,7 @@ static READ8_DEVICE_HANDLER ( mo5_sys_portb_in )
"keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7"
};
- return ( device->machine().root_device().ioport(keynames[lin])->read() & (1 << col) ) ? 0x80 : 0;
+ return ( space.machine().root_device().ioport(keynames[lin])->read() & (1 << col) ) ? 0x80 : 0;
}
@@ -3037,7 +3037,7 @@ static void to9_kbd_init ( running_machine &machine )
static READ8_DEVICE_HANDLER ( to9_sys_porta_in )
{
- UINT8 ktest = to9_kbd_ktest(device->machine());
+ UINT8 ktest = to9_kbd_ktest(space.machine());
LOG_KBD(( "to9_sys_porta_in: ktest=%i\n", ktest ));
@@ -3048,20 +3048,20 @@ static READ8_DEVICE_HANDLER ( to9_sys_porta_in )
static WRITE8_DEVICE_HANDLER ( to9_sys_porta_out )
{
- centronics_device *printer = device->machine().device<centronics_device>("centronics");
- printer->write(device->machine().driver_data()->generic_space(), 0, data & 0xfe);
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
+ printer->write(space.machine().driver_data()->generic_space(), 0, data & 0xfe);
}
static WRITE8_DEVICE_HANDLER ( to9_sys_portb_out )
{
- centronics_device *printer = device->machine().device<centronics_device>("centronics");
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
printer->d0_w(BIT(data, 0));
printer->strobe_w(BIT(data, 1));
- to9_update_ram_bank(device->machine());
+ to9_update_ram_bank(space.machine());
if ( data & 4 ) /* bit 2: video overlay (TODO) */
LOG(( "to9_sys_portb_out: video overlay not handled\n" ));
@@ -3095,9 +3095,9 @@ const pia6821_interface to9_pia6821_sys =
static WRITE8_DEVICE_HANDLER ( to9_timer_port_out )
{
- thom_set_mode_point( device->machine(), data & 1 ); /* bit 0: video bank */
- to9_update_ram_bank(device->machine());
- to9_update_cart_bank(device->machine());
+ thom_set_mode_point( space.machine(), data & 1 ); /* bit 0: video bank */
+ to9_update_ram_bank(space.machine());
+ to9_update_cart_bank(space.machine());
}
@@ -4073,9 +4073,9 @@ WRITE8_HANDLER ( to8_vreg_w )
static READ8_DEVICE_HANDLER ( to8_sys_porta_in )
{
- int ktest = to8_kbd_ktest (device->machine());
+ int ktest = to8_kbd_ktest (space.machine());
- LOG_KBD(( "$%04x %f: to8_sys_porta_in ktest=%i\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), ktest ));
+ LOG_KBD(( "$%04x %f: to8_sys_porta_in ktest=%i\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), ktest ));
return ktest;
}
@@ -4084,12 +4084,12 @@ static READ8_DEVICE_HANDLER ( to8_sys_porta_in )
static WRITE8_DEVICE_HANDLER ( to8_sys_portb_out )
{
- centronics_device *printer = device->machine().device<centronics_device>("centronics");
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
printer->d0_w(BIT(data, 0));
printer->strobe_w(BIT(data, 1));
- to8_update_ram_bank(device->machine());
+ to8_update_ram_bank(space.machine());
if ( data & 4 ) /* bit 2: video overlay (TODO) */
LOG(( "to8_sys_portb_out: video overlay not handled\n" ));
@@ -4121,9 +4121,9 @@ const pia6821_interface to8_pia6821_sys =
static READ8_DEVICE_HANDLER ( to8_timer_port_in )
{
- centronics_device *printer = device->machine().device<centronics_device>("centronics");
- int lightpen = (device->machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0;
- int cass = to7_get_cassette(device->machine()) ? 0x80 : 0;
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
+ int lightpen = (space.machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0;
+ int cass = to7_get_cassette(space.machine()) ? 0x80 : 0;
int dtr = printer->busy_r() << 6;
int lock = to8_kbd_caps ? 0 : 8; /* undocumented! */
return lightpen | cass | dtr | lock;
@@ -4135,12 +4135,12 @@ static WRITE8_DEVICE_HANDLER ( to8_timer_port_out )
{
int ack = (data & 0x20) ? 1 : 0; /* bit 5: keyboard ACK */
to8_bios_bank = (data & 0x10) ? 1 : 0; /* bit 4: BIOS bank*/
- thom_set_mode_point( device->machine(), data & 1 ); /* bit 0: video bank switch */
- device->machine().root_device().membank( TO8_BIOS_BANK )->set_entry( to8_bios_bank );
+ thom_set_mode_point( space.machine(), data & 1 ); /* bit 0: video bank switch */
+ space.machine().root_device().membank( TO8_BIOS_BANK )->set_entry( to8_bios_bank );
to8_soft_select = (data & 0x04) ? 1 : 0; /* bit 2: internal ROM select */
- to8_update_floppy_bank(device->machine());
- to8_update_cart_bank(device->machine());
- to8_kbd_set_ack(device->machine(), ack);
+ to8_update_floppy_bank(space.machine());
+ to8_update_cart_bank(space.machine());
+ to8_kbd_set_ack(space.machine(), ack);
}
@@ -4149,7 +4149,7 @@ static WRITE8_DEVICE_HANDLER ( to8_timer_cp2_out )
{
/* mute */
to7_game_mute = data;
- to7_game_sound_update(device->machine());
+ to7_game_sound_update(space.machine());
}
@@ -4322,9 +4322,9 @@ const pia6821_interface to9p_pia6821_sys =
static READ8_DEVICE_HANDLER ( to9p_timer_port_in )
{
- centronics_device *printer = device->machine().device<centronics_device>("centronics");
- int lightpen = (device->machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0;
- int cass = to7_get_cassette(device->machine()) ? 0x80 : 0;
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
+ int lightpen = (space.machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0;
+ int cass = to7_get_cassette(space.machine()) ? 0x80 : 0;
int dtr = printer->busy_r() << 6;
return lightpen | cass | dtr;
}
@@ -4334,11 +4334,11 @@ static READ8_DEVICE_HANDLER ( to9p_timer_port_in )
static WRITE8_DEVICE_HANDLER ( to9p_timer_port_out )
{
int bios_bank = (data & 0x10) ? 1 : 0; /* bit 4: BIOS bank */
- thom_set_mode_point( device->machine(), data & 1 ); /* bit 0: video bank switch */
- device->machine().root_device().membank( TO8_BIOS_BANK )->set_entry( bios_bank );
+ thom_set_mode_point( space.machine(), data & 1 ); /* bit 0: video bank switch */
+ space.machine().root_device().membank( TO8_BIOS_BANK )->set_entry( bios_bank );
to8_soft_select = (data & 0x04) ? 1 : 0; /* bit 2: internal ROM select */
- to8_update_floppy_bank(device->machine());
- to8_update_cart_bank(device->machine());
+ to8_update_floppy_bank(space.machine());
+ to8_update_cart_bank(space.machine());
}
@@ -4755,21 +4755,21 @@ const centronics_interface mo6_centronics_config =
static WRITE8_DEVICE_HANDLER ( mo6_game_porta_out )
{
- centronics_device *printer = device->machine().device<centronics_device>("centronics");
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
- LOG (( "$%04x %f mo6_game_porta_out: CENTRONICS set data=$%02X\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data ));
+ LOG (( "$%04x %f mo6_game_porta_out: CENTRONICS set data=$%02X\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
/* centronics data */
- printer->write( device->machine().driver_data()->generic_space(), 0, data);
+ printer->write( space.machine().driver_data()->generic_space(), 0, data);
}
static WRITE8_DEVICE_HANDLER ( mo6_game_cb2_out )
{
- centronics_device *printer = device->machine().device<centronics_device>("centronics");
+ centronics_device *printer = space.machine().device<centronics_device>("centronics");
- LOG (( "$%04x %f mo6_game_cb2_out: CENTRONICS set strobe=%i\n", device->machine().device("maincpu")->safe_pcbase(), device->machine().time().as_double(), data ));
+ LOG (( "$%04x %f mo6_game_cb2_out: CENTRONICS set strobe=%i\n", space.machine().device("maincpu")->safe_pcbase(), space.machine().time().as_double(), data ));
/* centronics strobe */
printer->strobe_w(data);
@@ -4847,9 +4847,9 @@ static void mo6_game_reset ( running_machine &machine )
static READ8_DEVICE_HANDLER ( mo6_sys_porta_in )
{
return
- (mo5_get_cassette(device->machine()) ? 0x80 : 0) | /* bit 7: cassette input */
+ (mo5_get_cassette(space.machine()) ? 0x80 : 0) | /* bit 7: cassette input */
8 | /* bit 3: kbd-line float up to 1 */
- ((device->machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0);
+ ((space.machine().root_device().ioport("lightpen_button")->read() & 1) ? 2 : 0);
/* bit 1: lightpen button */;
}
@@ -4871,7 +4871,7 @@ static READ8_DEVICE_HANDLER ( mo6_sys_portb_in )
lin = 8; /* A bit 3: 9-th kbd line select */
return
- ( device->machine().root_device().ioport(keynames[lin])->read() & (1 << col) ) ? 0x80 : 0;
+ ( space.machine().root_device().ioport(keynames[lin])->read() & (1 << col) ) ? 0x80 : 0;
/* bit 7: key up */
}
@@ -4879,19 +4879,19 @@ static READ8_DEVICE_HANDLER ( mo6_sys_portb_in )
static WRITE8_DEVICE_HANDLER ( mo6_sys_porta_out )
{
- thom_set_mode_point( device->machine(),data & 1 ); /* bit 0: video bank switch */
+ thom_set_mode_point( space.machine(),data & 1 ); /* bit 0: video bank switch */
to7_game_mute = data & 4; /* bit 2: sound mute */
- thom_set_caps_led( device->machine(),(data & 16) ? 0 : 1 ) ; /* bit 4: keyboard led */
- mo5_set_cassette( device->machine(), (data & 0x40) ? 1 : 0 ); /* bit 6: cassette output */
- mo6_update_cart_bank(device->machine()); /* bit 5: rom bank */
- to7_game_sound_update(device->machine());
+ thom_set_caps_led( space.machine(),(data & 16) ? 0 : 1 ) ; /* bit 4: keyboard led */
+ mo5_set_cassette( space.machine(), (data & 0x40) ? 1 : 0 ); /* bit 6: cassette output */
+ mo6_update_cart_bank(space.machine()); /* bit 5: rom bank */
+ to7_game_sound_update(space.machine());
}
static WRITE8_DEVICE_HANDLER ( mo6_sys_portb_out )
{
- device->machine().device<dac_device>("buzzer")->write_unsigned8((data & 1) ? 0x80 : 0); /* bit 0: buzzer */
+ space.machine().device<dac_device>("buzzer")->write_unsigned8((data & 1) ? 0x80 : 0); /* bit 0: buzzer */
}
@@ -5279,7 +5279,7 @@ static READ8_DEVICE_HANDLER ( mo5nr_sys_portb_in )
"keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7"
};
- return ( device->machine().root_device().ioport(keynames[lin])->read() & (1 << col) ) ? 0x80 : 0;
+ return ( space.machine().root_device().ioport(keynames[lin])->read() & (1 << col) ) ? 0x80 : 0;
/* bit 7: key up */
}
@@ -5288,11 +5288,11 @@ static READ8_DEVICE_HANDLER ( mo5nr_sys_portb_in )
static WRITE8_DEVICE_HANDLER ( mo5nr_sys_porta_out )
{
/* no keyboard LED */
- thom_set_mode_point( device->machine(), data & 1 ); /* bit 0: video bank switch */
+ thom_set_mode_point( space.machine(), data & 1 ); /* bit 0: video bank switch */
to7_game_mute = data & 4; /* bit 2: sound mute */
- mo5_set_cassette( device->machine(), (data & 0x40) ? 1 : 0 ); /* bit 6: cassette output */
- mo6_update_cart_bank(device->machine()); /* bit 5: rom bank */
- to7_game_sound_update(device->machine());
+ mo5_set_cassette( space.machine(), (data & 0x40) ? 1 : 0 ); /* bit 6: cassette output */
+ mo6_update_cart_bank(space.machine()); /* bit 5: rom bank */
+ to7_game_sound_update(space.machine());
}
diff --git a/src/mess/machine/upd7002.c b/src/mess/machine/upd7002.c
index 0e05c5bbe53..67e27571853 100644
--- a/src/mess/machine/upd7002.c
+++ b/src/mess/machine/upd7002.c
@@ -152,10 +152,10 @@ WRITE8_DEVICE_HANDLER ( uPD7002_w )
if (uPD7002->status & 0x08)
{
// 12 bit conversion takes 10ms
- device->machine().scheduler().timer_set(attotime::from_msec(10), FUNC(uPD7002_conversioncomplete), uPD7002->conversion_counter, (void *)device);
+ space.machine().scheduler().timer_set(attotime::from_msec(10), FUNC(uPD7002_conversioncomplete), uPD7002->conversion_counter, (void *)device);
} else {
// 8 bit conversion takes 4ms
- device->machine().scheduler().timer_set(attotime::from_msec(4), FUNC(uPD7002_conversioncomplete), uPD7002->conversion_counter, (void *)device);
+ space.machine().scheduler().timer_set(attotime::from_msec(4), FUNC(uPD7002_conversioncomplete), uPD7002->conversion_counter, (void *)device);
}
break;
diff --git a/src/mess/machine/upd765.c b/src/mess/machine/upd765.c
index ad31afc7415..bb44c341107 100644
--- a/src/mess/machine/upd765.c
+++ b/src/mess/machine/upd765.c
@@ -803,7 +803,7 @@ READ8_DEVICE_HANDLER( upd765_status_r )
{
upd765_t *fdc = get_safe_token(device);
if (LOG_EXTRA)
- logerror("%s: upd765_status_r: %02x\n", device->machine().describe_context(), fdc->FDC_main);
+ logerror("%s: upd765_status_r: %02x\n", space.machine().describe_context(), fdc->FDC_main);
return fdc->FDC_main;
}
diff --git a/src/mess/machine/z80ne.c b/src/mess/machine/z80ne.c
index a5267656c26..fb81ed5fd9e 100644
--- a/src/mess/machine/z80ne.c
+++ b/src/mess/machine/z80ne.c
@@ -613,7 +613,7 @@ WRITE8_MEMBER(z80ne_state::lx385_ctrl_w)
READ8_DEVICE_HANDLER( lx388_mc6847_videoram_r )
{
- z80ne_state *state = device->machine().driver_data<z80ne_state>();
+ z80ne_state *state = space.machine().driver_data<z80ne_state>();
if (offset == ~0) return 0xff;
UINT8 *videoram = state->m_videoram;
@@ -652,7 +652,7 @@ READ8_MEMBER(z80ne_state::lx388_read_field_sync)
WRITE8_DEVICE_HANDLER(lx390_motor_w)
{
- z80ne_state *state = device->machine().driver_data<z80ne_state>();
+ z80ne_state *state = space.machine().driver_data<z80ne_state>();
/* Selection of drive and parameters
A write also causes the selected drive motor to turn on for about 3 seconds.
When the motor turns off, the drive is deselected.
@@ -700,11 +700,11 @@ WRITE8_DEVICE_HANDLER(lx390_motor_w)
READ8_DEVICE_HANDLER(lx390_reset_bank)
{
- z80ne_state *state = device->machine().driver_data<z80ne_state>();
+ z80ne_state *state = space.machine().driver_data<z80ne_state>();
offs_t pc;
/* if PC is not in range, we are under integrated debugger control, DON'T SWAP */
- pc = device->machine().device("z80ne")->safe_pc();
+ pc = space.machine().device("z80ne")->safe_pc();
if((pc >= 0xf000) && (pc <=0xffff))
{
LOG(("lx390_reset_bank, reset memory bank 1\n"));
@@ -755,7 +755,7 @@ READ8_DEVICE_HANDLER(lx390_fdc_r)
WRITE8_DEVICE_HANDLER(lx390_fdc_w)
{
- z80ne_state *state = device->machine().driver_data<z80ne_state>();
+ z80ne_state *state = space.machine().driver_data<z80ne_state>();
UINT8 d;
d = data;
diff --git a/src/mess/video/911_vdt.c b/src/mess/video/911_vdt.c
index c168f37163f..044024b3e05 100644
--- a/src/mess/video/911_vdt.c
+++ b/src/mess/video/911_vdt.c
@@ -420,7 +420,7 @@ WRITE8_DEVICE_HANDLER( vdt911_cru_w )
case 0xc:
/* keyboard interrupt enable */
vdt->keyboard_interrupt_enable = data;
- (*vdt->int_callback)(device->machine(), vdt->keyboard_interrupt_enable && vdt->keyboard_data_ready);
+ (*vdt->int_callback)(space.machine(), vdt->keyboard_interrupt_enable && vdt->keyboard_data_ready);
break;
case 0xd:
@@ -478,14 +478,14 @@ WRITE8_DEVICE_HANDLER( vdt911_cru_w )
{
vdt->keyboard_data_ready = 0;
if (vdt->keyboard_interrupt_enable)
- (*vdt->int_callback)(device->machine(), 0);
+ (*vdt->int_callback)(space.machine(), 0);
}
/*vdt->keyboard_parity_error = 0;*/
break;
case 0xe:
/* beep enable strobe - not tested */
- beep_set_state(device->machine().device(BEEPER_TAG), 1);
+ beep_set_state(space.machine().device(BEEPER_TAG), 1);
vdt->beep_timer->adjust(attotime::from_usec(300));
break;
diff --git a/src/mess/video/cirrus.c b/src/mess/video/cirrus.c
index c8ddcdadce3..afeff5e2eba 100644
--- a/src/mess/video/cirrus.c
+++ b/src/mess/video/cirrus.c
@@ -229,5 +229,5 @@ void cirrus_device::pci_write(pci_bus_device *pcibus, int function, int offset,
WRITE8_DEVICE_HANDLER( cirrus_42E8_w )
{
if (data & 0x80)
- pc_vga_reset(device->machine());
+ pc_vga_reset(space.machine());
}
diff --git a/src/mess/video/vic4567.c b/src/mess/video/vic4567.c
index 6da46553f1e..dcfae2f28cf 100644
--- a/src/mess/video/vic4567.c
+++ b/src/mess/video/vic4567.c
@@ -1281,12 +1281,12 @@ WRITE8_DEVICE_HANDLER( vic3_port_w )
break;
case 0x19:
- vic3_clear_interrupt(device->machine(), data & 0x0f, vic3);
+ vic3_clear_interrupt(space.machine(), data & 0x0f, vic3);
break;
case 0x1a: /* irq mask */
vic3->reg[offset] = data;
- vic3_set_interrupt(device->machine(), 0, vic3); // beamrider needs this
+ vic3_set_interrupt(space.machine(), 0, vic3); // beamrider needs this
break;
case 0x11:
@@ -1380,7 +1380,7 @@ WRITE8_DEVICE_HANDLER( vic3_port_w )
if (vic3->port_changed!=NULL) {
DBG_LOG(2, "vic write", ("%.2x:%.2x\n", offset, data));
vic3->reg[offset] = data;
- vic3->port_changed(device->machine(), data);
+ vic3->port_changed(space.machine(), data);
}
break;
case 0x31:
@@ -1460,13 +1460,13 @@ READ8_DEVICE_HANDLER( vic3_port_r )
case 0x1e: /* sprite to sprite collision detect */
val = vic3->reg[offset];
vic3->reg[offset] = 0;
- vic3_clear_interrupt(device->machine(), 4, vic3);
+ vic3_clear_interrupt(space.machine(), 4, vic3);
break;
case 0x1f: /* sprite to background collision detect */
val = vic3->reg[offset];
vic3->reg[offset] = 0;
- vic3_clear_interrupt(device->machine(), 2, vic3);
+ vic3_clear_interrupt(space.machine(), 2, vic3);
break;
case 0x20:
diff --git a/src/mess/video/vic6567.c b/src/mess/video/vic6567.c
index e86db6e6b8e..f5445dcd699 100644
--- a/src/mess/video/vic6567.c
+++ b/src/mess/video/vic6567.c
@@ -2226,7 +2226,7 @@ int vic2e_k2_r( device_t *device )
WRITE8_DEVICE_HANDLER( vic2_port_w )
{
vic2_state *vic2 = get_safe_token(device);
- running_machine &machine = device->machine();
+ running_machine &machine = space.machine();
DBG_LOG(2, "vic write", ("%.2x:%.2x\n", offset, data));
offset &= 0x3f;
@@ -2451,7 +2451,7 @@ WRITE8_DEVICE_HANDLER( vic2_port_w )
READ8_DEVICE_HANDLER( vic2_port_r )
{
vic2_state *vic2 = get_safe_token(device);
- running_machine &machine = device->machine();
+ running_machine &machine = space.machine();
int val = 0;
offset &= 0x3f;
diff --git a/src/mess/video/vtvideo.c b/src/mess/video/vtvideo.c
index 3ddeec0cf2e..f1d7f158339 100644
--- a/src/mess/video/vtvideo.c
+++ b/src/mess/video/vtvideo.c
@@ -172,7 +172,7 @@ WRITE8_DEVICE_HANDLER( vt_video_dc011_w )
WRITE8_DEVICE_HANDLER( vt_video_brightness_w )
{
- //palette_set_color_rgb(device->machine(), 1, data, data, data);
+ //palette_set_color_rgb(space.machine(), 1, data, data, data);
}
static void vt_video_display_char(device_t *device,bitmap_ind16 &bitmap, UINT8 code,