small machine().root_device() cleanup (nw)

This commit is contained in:
Miodrag Milanovic 2013-04-18 09:49:16 +00:00
parent 71f50fd916
commit 7a02dc72d7
23 changed files with 95 additions and 95 deletions

View File

@ -106,13 +106,13 @@ bool apexc_cylinder_image_device::call_load()
/* load RAM contents */ /* load RAM contents */
m_writable = !is_readonly(); m_writable = !is_readonly();
fread( machine().root_device().memregion("maincpu")->base(), 0x1000); fread( memregion("maincpu")->base(), 0x1000);
#ifdef LSB_FIRST #ifdef LSB_FIRST
{ /* fix endianness */ { /* fix endianness */
UINT32 *RAM; UINT32 *RAM;
int i; int i;
RAM = (UINT32 *)(*machine().root_device().memregion("maincpu")); RAM = (UINT32 *)(*memregion("maincpu"));
for (i=0; i < 0x0400; i++) for (i=0; i < 0x0400; i++)
RAM[i] = BIG_ENDIANIZE_INT32(RAM[i]); RAM[i] = BIG_ENDIANIZE_INT32(RAM[i]);
@ -136,14 +136,14 @@ void apexc_cylinder_image_device::call_unload()
UINT32 *RAM; UINT32 *RAM;
int i; int i;
RAM = (UINT32 *)(*machine().root_device().memregion("maincpu")); RAM = (UINT32 *)(*memregion("maincpu"));
for (i=0; i < /*0x2000*/0x0400; i++) for (i=0; i < /*0x2000*/0x0400; i++)
RAM[i] = BIG_ENDIANIZE_INT32(RAM[i]); RAM[i] = BIG_ENDIANIZE_INT32(RAM[i]);
} }
#endif #endif
/* write */ /* write */
fwrite(machine().root_device().memregion("maincpu")->base(), /*0x8000*/0x1000); fwrite(memregion("maincpu")->base(), /*0x8000*/0x1000);
} }
} }

View File

@ -205,39 +205,39 @@ int c65_state::c64_paddle_read( device_t *device, address_space &space, int whic
{ {
int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp; int pot1 = 0xff, pot2 = 0xff, pot3 = 0xff, pot4 = 0xff, temp;
UINT8 cia0porta = mos6526_pa_r(machine().device("cia_0"), space, 0); UINT8 cia0porta = mos6526_pa_r(machine().device("cia_0"), space, 0);
int controller1 = machine().root_device().ioport("CTRLSEL")->read() & 0x07; int controller1 = ioport("CTRLSEL")->read() & 0x07;
int controller2 = machine().root_device().ioport("CTRLSEL")->read() & 0x70; int controller2 = ioport("CTRLSEL")->read() & 0x70;
/* Notice that only a single input is defined for Mouse & Lightpen in both ports */ /* Notice that only a single input is defined for Mouse & Lightpen in both ports */
switch (controller1) switch (controller1)
{ {
case 0x01: case 0x01:
if (which) if (which)
pot2 = machine().root_device().ioport("PADDLE2")->read(); pot2 = ioport("PADDLE2")->read();
else else
pot1 = machine().root_device().ioport("PADDLE1")->read(); pot1 = ioport("PADDLE1")->read();
break; break;
case 0x02: case 0x02:
if (which) if (which)
pot2 = machine().root_device().ioport("TRACKY")->read(); pot2 = ioport("TRACKY")->read();
else else
pot1 = machine().root_device().ioport("TRACKX")->read(); pot1 = ioport("TRACKX")->read();
break; break;
case 0x03: case 0x03:
if (which && (machine().root_device().ioport("JOY1_2B")->read() & 0x20)) /* Joy1 Button 2 */ if (which && (ioport("JOY1_2B")->read() & 0x20)) /* Joy1 Button 2 */
pot1 = 0x00; pot1 = 0x00;
break; break;
case 0x04: case 0x04:
if (which) if (which)
pot2 = machine().root_device().ioport("LIGHTY")->read(); pot2 = ioport("LIGHTY")->read();
else else
pot1 = machine().root_device().ioport("LIGHTX")->read(); pot1 = ioport("LIGHTX")->read();
break; break;
case 0x06: case 0x06:
if (which && (machine().root_device().ioport("OTHER")->read() & 0x04)) /* Lightpen Signal */ if (which && (ioport("OTHER")->read() & 0x04)) /* Lightpen Signal */
pot2 = 0x00; pot2 = 0x00;
break; break;
@ -254,32 +254,32 @@ int c65_state::c64_paddle_read( device_t *device, address_space &space, int whic
{ {
case 0x10: case 0x10:
if (which) if (which)
pot4 = machine().root_device().ioport("PADDLE4")->read(); pot4 = ioport("PADDLE4")->read();
else else
pot3 = machine().root_device().ioport("PADDLE3")->read(); pot3 = ioport("PADDLE3")->read();
break; break;
case 0x20: case 0x20:
if (which) if (which)
pot4 = machine().root_device().ioport("TRACKY")->read(); pot4 = ioport("TRACKY")->read();
else else
pot3 = machine().root_device().ioport("TRACKX")->read(); pot3 = ioport("TRACKX")->read();
break; break;
case 0x30: case 0x30:
if (which && (machine().root_device().ioport("JOY2_2B")->read() & 0x20)) /* Joy2 Button 2 */ if (which && (ioport("JOY2_2B")->read() & 0x20)) /* Joy2 Button 2 */
pot4 = 0x00; pot4 = 0x00;
break; break;
case 0x40: case 0x40:
if (which) if (which)
pot4 = machine().root_device().ioport("LIGHTY")->read(); pot4 = ioport("LIGHTY")->read();
else else
pot3 = machine().root_device().ioport("LIGHTX")->read(); pot3 = ioport("LIGHTX")->read();
break; break;
case 0x60: case 0x60:
if (which && (machine().root_device().ioport("OTHER")->read() & 0x04)) /* Lightpen Signal */ if (which && (ioport("OTHER")->read() & 0x04)) /* Lightpen Signal */
pot4 = 0x00; pot4 = 0x00;
break; break;
@ -292,7 +292,7 @@ int c65_state::c64_paddle_read( device_t *device, address_space &space, int whic
break; break;
} }
if (machine().root_device().ioport("CTRLSEL")->read() & 0x80) /* Swap */ if (ioport("CTRLSEL")->read() & 0x80) /* Swap */
{ {
temp = pot1; pot1 = pot3; pot3 = temp; temp = pot1; pot1 = pot3; pot3 = temp;
temp = pot2; pot2 = pot4; pot4 = temp; temp = pot2; pot2 = pot4; pot4 = temp;
@ -345,17 +345,17 @@ UINT32 c65_state::screen_update_c65(screen_device &screen, bitmap_ind16 &bitmap,
READ8_MEMBER(c65_state::c65_lightpen_x_cb) READ8_MEMBER(c65_state::c65_lightpen_x_cb)
{ {
return machine().root_device().ioport("LIGHTX")->read() & ~0x01; return ioport("LIGHTX")->read() & ~0x01;
} }
READ8_MEMBER(c65_state::c65_lightpen_y_cb) READ8_MEMBER(c65_state::c65_lightpen_y_cb)
{ {
return machine().root_device().ioport("LIGHTY")->read() & ~0x01; return ioport("LIGHTY")->read() & ~0x01;
} }
READ8_MEMBER(c65_state::c65_lightpen_button_cb) READ8_MEMBER(c65_state::c65_lightpen_button_cb)
{ {
return machine().root_device().ioport("OTHER")->read() & 0x04; return ioport("OTHER")->read() & 0x04;
} }
READ8_MEMBER(c65_state::c65_c64_mem_r) READ8_MEMBER(c65_state::c65_c64_mem_r)

View File

@ -1233,12 +1233,12 @@ void fm7_state::fm7_keyboard_poll_scan()
int bit = 0; int bit = 0;
int x,y; int x,y;
UINT32 keys; UINT32 keys;
UINT32 modifiers = machine().root_device().ioport("key_modifiers")->read(); UINT32 modifiers = ioport("key_modifiers")->read();
static const UINT16 modscancodes[6] = { 0x52, 0x53, 0x54, 0x55, 0x56, 0x5a }; static const UINT16 modscancodes[6] = { 0x52, 0x53, 0x54, 0x55, 0x56, 0x5a };
for(x=0;x<3;x++) for(x=0;x<3;x++)
{ {
keys = machine().root_device().ioport(portnames[x])->read(); keys = ioport(portnames[x])->read();
for(y=0;y<32;y++) // loop through each bit in the port for(y=0;y<32;y++) // loop through each bit in the port
{ {

View File

@ -371,7 +371,7 @@ void nc_state::nc_refresh_memory_bank_config(int bank)
membank(bank1)->set_base(addr); membank(bank1)->set_base(addr);
/* write enabled? */ /* write enabled? */
if (machine().root_device().ioport("EXTRA")->read() & 0x02) if (ioport("EXTRA")->read() & 0x02)
{ {
/* yes */ /* yes */
membank(bank5)->set_base(addr); membank(bank5)->set_base(addr);
@ -534,7 +534,7 @@ void nc_state::nc_common_init_machine()
m_memory_config[2] = 0; m_memory_config[2] = 0;
m_memory_config[3] = 0; m_memory_config[3] = 0;
m_previous_inputport_10_state = machine().root_device().ioport("EXTRA")->read(); m_previous_inputport_10_state = ioport("EXTRA")->read();
/* setup reset state ints are masked */ /* setup reset state ints are masked */
m_irq_mask = 0; m_irq_mask = 0;

View File

@ -145,7 +145,7 @@ void palm_state::machine_start()
void palm_state::machine_reset() void palm_state::machine_reset()
{ {
// Copy boot ROM // Copy boot ROM
UINT8* bios = machine().root_device().memregion("bios")->base(); UINT8* bios = memregion("bios")->base();
memset(m_ram->pointer(), 0, m_ram->size()); memset(m_ram->pointer(), 0, m_ram->size());
memcpy(m_ram->pointer(), bios, 0x20000); memcpy(m_ram->pointer(), bios, 0x20000);

View File

@ -328,7 +328,7 @@ void pcw_state::pcw_update_mem(int block, int data)
{ {
unsigned char *FakeROM; unsigned char *FakeROM;
FakeROM = &machine().root_device().memregion("maincpu")->base()[0x010000]; FakeROM = &memregion("maincpu")->base()[0x010000];
membank("bank1")->set_base(FakeROM); membank("bank1")->set_base(FakeROM);
}*/ }*/
@ -340,7 +340,7 @@ int pcw_state::pcw_get_sys_status()
return return
m_interrupt_counter m_interrupt_counter
| (m_screen->vblank() ? 0x40 : 0x00) | (m_screen->vblank() ? 0x40 : 0x00)
| (machine().root_device().ioport("EXTRA")->read() & 0x010) | (ioport("EXTRA")->read() & 0x010)
| (m_system_status & 0x20); | (m_system_status & 0x20);
} }

View File

@ -1705,7 +1705,7 @@ void pdp1_state::pdp1_keyboard()
for (i=0; i<4; i++) for (i=0; i<4; i++)
{ {
typewriter_keys[i] = machine().root_device().ioport(twrnames[i])->read(); typewriter_keys[i] = ioport(twrnames[i])->read();
} }
for (i=0; i<4; i++) for (i=0; i<4; i++)
@ -1735,9 +1735,9 @@ void pdp1_state::pdp1_lightpen()
int x_delta, y_delta; int x_delta, y_delta;
int current_state; int current_state;
m_lightpen.active = (machine().root_device().ioport("CFG")->read() >> pdp1_config_lightpen_bit) & pdp1_config_lightpen_mask; m_lightpen.active = (ioport("CFG")->read() >> pdp1_config_lightpen_bit) & pdp1_config_lightpen_mask;
current_state = machine().root_device().ioport("LIGHTPEN")->read(); current_state = ioport("LIGHTPEN")->read();
/* update pen down state */ /* update pen down state */
m_lightpen.down = m_lightpen.active && (current_state & pdp1_lightpen_down); m_lightpen.down = m_lightpen.active && (current_state & pdp1_lightpen_down);
@ -1759,8 +1759,8 @@ void pdp1_state::pdp1_lightpen()
m_old_lightpen = current_state; m_old_lightpen = current_state;
/* update pen position */ /* update pen position */
x_delta = machine().root_device().ioport("LIGHTX")->read(); x_delta = ioport("LIGHTX")->read();
y_delta = machine().root_device().ioport("LIGHTY")->read(); y_delta = ioport("LIGHTY")->read();
if (x_delta >= 0x80) if (x_delta >= 0x80)
x_delta -= 0x100; x_delta -= 0x100;

View File

@ -58,7 +58,7 @@ void ssystem3_state::ssystem3_playfield_reset()
{ {
memset(&m_playfield, 0, sizeof(m_playfield)); memset(&m_playfield, 0, sizeof(m_playfield));
m_playfield.signal=FALSE; m_playfield.signal=FALSE;
// m_playfield.on=TRUE; //machine().root_device().ioport("Configuration")->read()&1; // m_playfield.on=TRUE; //ioport("Configuration")->read()&1;
} }
void ssystem3_state::ssystem3_playfield_write(int reset, int signal) void ssystem3_state::ssystem3_playfield_write(int reset, int signal)
@ -108,7 +108,7 @@ void ssystem3_state::ssystem3_playfield_write(int reset, int signal)
void ssystem3_state::ssystem3_playfield_read(int *on, int *ready) void ssystem3_state::ssystem3_playfield_read(int *on, int *ready)
{ {
*on=!(machine().root_device().ioport("Configuration")->read()&1); *on=!(ioport("Configuration")->read()&1);
// *on=!m_playfield.on; // *on=!m_playfield.on;
*ready=FALSE; *ready=FALSE;
} }

View File

@ -1465,7 +1465,7 @@ void tx0_state::tx0_keyboard()
for (i=0; i<4; i++) for (i=0; i<4; i++)
{ {
typewriter_keys[i] = machine().root_device().ioport(twrnames[i])->read(); typewriter_keys[i] = ioport(twrnames[i])->read();
} }
for (i=0; i<4; i++) for (i=0; i<4; i++)

View File

@ -1565,7 +1565,7 @@ UINT8 *apple2gs_state::apple2gs_getslotmem(offs_t address)
assert(address <= 0xCFFF); assert(address <= 0xCFFF);
rom = m_rom; rom = m_rom;
rom += 0x030000 % machine().root_device().memregion("maincpu")->bytes(); rom += 0x030000 % memregion("maincpu")->bytes();
return &rom[address]; return &rom[address];
} }

View File

@ -438,7 +438,7 @@ void apple3_state::apple3_update_memory()
else else
space.install_write_bank(0xF000, 0xFFFF, "bank7"); space.install_write_bank(0xF000, 0xFFFF, "bank7");
if (m_via_0_a & 0x01) if (m_via_0_a & 0x01)
membank("bank7")->set_base(machine().root_device().memregion("maincpu")->base()); membank("bank7")->set_base(memregion("maincpu")->base());
else else
apple3_setbank("bank7", ~0, 0x7000); apple3_setbank("bank7", ~0, 0x7000);

View File

@ -1140,7 +1140,7 @@ void bbc_state::bbc_TMSint(int status)
{ {
TMSint=(!status)&1; TMSint=(!status)&1;
TMSrdy=(!tms5220_readyq_r())&1; TMSrdy=(!tms5220_readyq_r())&1;
via_0_portb_w(0,(0xf | machine().root_device().ioport("IN0")->read()|(TMSint<<6)|(TMSrdy<<7))); via_0_portb_w(0,(0xf | ioport("IN0")->read()|(TMSint<<6)|(TMSrdy<<7)));
} }
#endif #endif

View File

@ -43,11 +43,11 @@ void c65_state::c65_nmi( )
device_t *cia_1 = machine().device("cia_1"); device_t *cia_1 = machine().device("cia_1");
int cia1irq = mos6526_irq_r(cia_1); int cia1irq = mos6526_irq_r(cia_1);
if (m_nmilevel != (machine().root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq) /* KEY_RESTORE */ if (m_nmilevel != (ioport("SPECIAL")->read() & 0x80) || cia1irq) /* KEY_RESTORE */
{ {
m_maincpu->set_input_line(INPUT_LINE_NMI, (machine().root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq); m_maincpu->set_input_line(INPUT_LINE_NMI, (ioport("SPECIAL")->read() & 0x80) || cia1irq);
m_nmilevel = (machine().root_device().ioport("SPECIAL")->read() & 0x80) || cia1irq; m_nmilevel = (ioport("SPECIAL")->read() & 0x80) || cia1irq;
} }
} }
@ -372,7 +372,7 @@ int c65_state::c65_6511_port_r( int offset )
if (offset == 7) if (offset == 7)
{ {
if (machine().root_device().ioport("SPECIAL")->read() & 0x20) if (ioport("SPECIAL")->read() & 0x20)
data &= ~1; data &= ~1;
} }
DBG_LOG(machine(), 2, "r6511 read", ("%.2x\n", offset)); DBG_LOG(machine(), 2, "r6511 read", ("%.2x\n", offset));

View File

@ -327,7 +327,7 @@ READ8_MEMBER( cgenie_state::cgenie_status_r )
{ {
device_t *fdc = machine().device("wd179x"); device_t *fdc = machine().device("wd179x");
/* If the floppy isn't emulated, return 0 */ /* If the floppy isn't emulated, return 0 */
if( (machine().root_device().ioport("DSW0")->read() & 0x80) == 0 ) if( (ioport("DSW0")->read() & 0x80) == 0 )
return 0; return 0;
return wd17xx_status_r(fdc, space, offset); return wd17xx_status_r(fdc, space, offset);
} }
@ -336,7 +336,7 @@ READ8_MEMBER( cgenie_state::cgenie_track_r )
{ {
device_t *fdc = machine().device("wd179x"); device_t *fdc = machine().device("wd179x");
/* If the floppy isn't emulated, return 0xff */ /* If the floppy isn't emulated, return 0xff */
if( (machine().root_device().ioport("DSW0")->read() & 0x80) == 0 ) if( (ioport("DSW0")->read() & 0x80) == 0 )
return 0xff; return 0xff;
return wd17xx_track_r(fdc, space, offset); return wd17xx_track_r(fdc, space, offset);
} }
@ -345,7 +345,7 @@ READ8_MEMBER( cgenie_state::cgenie_sector_r )
{ {
device_t *fdc = machine().device("wd179x"); device_t *fdc = machine().device("wd179x");
/* If the floppy isn't emulated, return 0xff */ /* If the floppy isn't emulated, return 0xff */
if( (machine().root_device().ioport("DSW0")->read() & 0x80) == 0 ) if( (ioport("DSW0")->read() & 0x80) == 0 )
return 0xff; return 0xff;
return wd17xx_sector_r(fdc, space, offset); return wd17xx_sector_r(fdc, space, offset);
} }
@ -354,7 +354,7 @@ READ8_MEMBER( cgenie_state::cgenie_data_r )
{ {
device_t *fdc = machine().device("wd179x"); device_t *fdc = machine().device("wd179x");
/* If the floppy isn't emulated, return 0xff */ /* If the floppy isn't emulated, return 0xff */
if( (machine().root_device().ioport("DSW0")->read() & 0x80) == 0 ) if( (ioport("DSW0")->read() & 0x80) == 0 )
return 0xff; return 0xff;
return wd17xx_data_r(fdc, space, offset); return wd17xx_data_r(fdc, space, offset);
} }
@ -363,7 +363,7 @@ WRITE8_MEMBER( cgenie_state::cgenie_command_w )
{ {
device_t *fdc = machine().device("wd179x"); device_t *fdc = machine().device("wd179x");
/* If the floppy isn't emulated, return immediately */ /* If the floppy isn't emulated, return immediately */
if( (machine().root_device().ioport("DSW0")->read() & 0x80) == 0 ) if( (ioport("DSW0")->read() & 0x80) == 0 )
return; return;
wd17xx_command_w(fdc, space, offset, data); wd17xx_command_w(fdc, space, offset, data);
} }
@ -372,7 +372,7 @@ WRITE8_MEMBER( cgenie_state::cgenie_track_w )
{ {
device_t *fdc = machine().device("wd179x"); device_t *fdc = machine().device("wd179x");
/* If the floppy isn't emulated, ignore the write */ /* If the floppy isn't emulated, ignore the write */
if( (machine().root_device().ioport("DSW0")->read() & 0x80) == 0 ) if( (ioport("DSW0")->read() & 0x80) == 0 )
return; return;
wd17xx_track_w(fdc, space, offset, data); wd17xx_track_w(fdc, space, offset, data);
} }
@ -381,7 +381,7 @@ WRITE8_MEMBER( cgenie_state::cgenie_sector_w )
{ {
device_t *fdc = machine().device("wd179x"); device_t *fdc = machine().device("wd179x");
/* If the floppy isn't emulated, ignore the write */ /* If the floppy isn't emulated, ignore the write */
if( (machine().root_device().ioport("DSW0")->read() & 0x80) == 0 ) if( (ioport("DSW0")->read() & 0x80) == 0 )
return; return;
wd17xx_sector_w(fdc, space, offset, data); wd17xx_sector_w(fdc, space, offset, data);
} }
@ -390,7 +390,7 @@ WRITE8_MEMBER( cgenie_state::cgenie_data_w )
{ {
device_t *fdc = machine().device("wd179x"); device_t *fdc = machine().device("wd179x");
/* If the floppy isn't emulated, ignore the write */ /* If the floppy isn't emulated, ignore the write */
if( (machine().root_device().ioport("DSW0")->read() & 0x80) == 0 ) if( (ioport("DSW0")->read() & 0x80) == 0 )
return; return;
wd17xx_data_w(fdc, space, offset, data); wd17xx_data_w(fdc, space, offset, data);
} }
@ -477,28 +477,28 @@ WRITE8_MEMBER( cgenie_state::cgenie_motor_w )
int result = 0; int result = 0;
if( offset & 0x01 ) if( offset & 0x01 )
result |= machine().root_device().ioport("ROW0")->read(); result |= ioport("ROW0")->read();
if( offset & 0x02 ) if( offset & 0x02 )
result |= machine().root_device().ioport("ROW1")->read(); result |= ioport("ROW1")->read();
if( offset & 0x04 ) if( offset & 0x04 )
result |= machine().root_device().ioport("ROW2")->read(); result |= ioport("ROW2")->read();
if( offset & 0x08 ) if( offset & 0x08 )
result |= machine().root_device().ioport("ROW3")->read(); result |= ioport("ROW3")->read();
if( offset & 0x10 ) if( offset & 0x10 )
result |= machine().root_device().ioport("ROW4")->read(); result |= ioport("ROW4")->read();
if( offset & 0x20 ) if( offset & 0x20 )
result |= machine().root_device().ioport("ROW5")->read(); result |= ioport("ROW5")->read();
if( offset & 0x40 ) if( offset & 0x40 )
result |= machine().root_device().ioport("ROW6")->read(); result |= ioport("ROW6")->read();
if( offset & 0x80 ) if( offset & 0x80 )
result |= machine().root_device().ioport("ROW7")->read(); result |= ioport("ROW7")->read();
return result; return result;
} }
@ -576,7 +576,7 @@ WRITE8_MEMBER( cgenie_state::cgenie_fontram_w )
INTERRUPT_GEN_MEMBER(cgenie_state::cgenie_frame_interrupt) INTERRUPT_GEN_MEMBER(cgenie_state::cgenie_frame_interrupt)
{ {
if( m_tv_mode != (machine().root_device().ioport("DSW0")->read() & 0x10) ) if( m_tv_mode != (ioport("DSW0")->read() & 0x10) )
{ {
m_tv_mode = ioport("DSW0")->read() & 0x10; m_tv_mode = ioport("DSW0")->read() & 0x10;
/* force setting of background color */ /* force setting of background color */

View File

@ -141,7 +141,7 @@ void concept_state::poll_keyboard()
for(i = 0; (i < /*4*/3) && (m_KeyQueueLen <= (KeyQueueSize-MaxKeyMessageLen)); i++) for(i = 0; (i < /*4*/3) && (m_KeyQueueLen <= (KeyQueueSize-MaxKeyMessageLen)); i++)
{ {
keystate = machine().root_device().ioport(keynames[2*i])->read() | (machine().root_device().ioport(keynames[2*i + 1])->read() << 16); keystate = ioport(keynames[2*i])->read() | (ioport(keynames[2*i + 1])->read() << 16);
key_transitions = keystate ^ m_KeyStateSave[i]; key_transitions = keystate ^ m_KeyStateSave[i];
if(key_transitions) if(key_transitions)
{ {

View File

@ -944,7 +944,7 @@ void dgn_beta_state::ScanInKeyboard(void)
for(Idx=0; Idx<NoKeyrows; Idx++) for(Idx=0; Idx<NoKeyrows; Idx++)
{ {
if (Idx < 10) if (Idx < 10)
Row = machine().root_device().ioport(keynames[Idx])->read(); Row = ioport(keynames[Idx])->read();
else else
Row = 0x7f; Row = 0x7f;

View File

@ -250,18 +250,18 @@ int hp48_state::hp48_get_in( )
int in = 0; int in = 0;
/* regular keys */ /* regular keys */
if ( (m_out >> 0) & 1 ) in |= machine().root_device().ioport( "LINE0" )->read(); if ( (m_out >> 0) & 1 ) in |= ioport( "LINE0" )->read();
if ( (m_out >> 1) & 1 ) in |= machine().root_device().ioport( "LINE1" )->read(); if ( (m_out >> 1) & 1 ) in |= ioport( "LINE1" )->read();
if ( (m_out >> 2) & 1 ) in |= machine().root_device().ioport( "LINE2" )->read(); if ( (m_out >> 2) & 1 ) in |= ioport( "LINE2" )->read();
if ( (m_out >> 3) & 1 ) in |= machine().root_device().ioport( "LINE3" )->read(); if ( (m_out >> 3) & 1 ) in |= ioport( "LINE3" )->read();
if ( (m_out >> 4) & 1 ) in |= machine().root_device().ioport( "LINE4" )->read(); if ( (m_out >> 4) & 1 ) in |= ioport( "LINE4" )->read();
if ( (m_out >> 5) & 1 ) in |= machine().root_device().ioport( "LINE5" )->read(); if ( (m_out >> 5) & 1 ) in |= ioport( "LINE5" )->read();
if ( (m_out >> 6) & 1 ) in |= machine().root_device().ioport( "LINE6" )->read(); if ( (m_out >> 6) & 1 ) in |= ioport( "LINE6" )->read();
if ( (m_out >> 7) & 1 ) in |= machine().root_device().ioport( "LINE7" )->read(); if ( (m_out >> 7) & 1 ) in |= ioport( "LINE7" )->read();
if ( (m_out >> 8) & 1 ) in |= machine().root_device().ioport( "LINE8" )->read(); if ( (m_out >> 8) & 1 ) in |= ioport( "LINE8" )->read();
/* on key */ /* on key */
in |= machine().root_device().ioport( "ON" )->read(); in |= ioport( "ON" )->read();
return in; return in;
} }

View File

@ -2037,7 +2037,7 @@ void mac_state::mac_driver_init(model_t model)
/* set up ROM at 0x400000-0x43ffff (-0x5fffff for mac 128k/512k/512ke) */ /* set up ROM at 0x400000-0x43ffff (-0x5fffff for mac 128k/512k/512ke) */
mac_install_memory(0x400000, (model >= MODEL_MAC_PLUS) ? 0x43ffff : 0x5fffff, mac_install_memory(0x400000, (model >= MODEL_MAC_PLUS) ? 0x43ffff : 0x5fffff,
machine().root_device().memregion("bootrom")->bytes(), machine().root_device().memregion("bootrom")->base(), TRUE, "bank3"); memregion("bootrom")->bytes(), memregion("bootrom")->base(), TRUE, "bank3");
} }
m_overlay = -1; m_overlay = -1;

View File

@ -258,11 +258,11 @@ void mbc55x_state::scan_keyboard()
// First read shift, control and graph // First read shift, control and graph
m_keyboard.key_special = machine().root_device().ioport(KEY_SPECIAL_TAG)->read(); m_keyboard.key_special = ioport(KEY_SPECIAL_TAG)->read();
for(row=0; row<MBC55X_KEYROWS; row++) for(row=0; row<MBC55X_KEYROWS; row++)
{ {
keyrow = machine().root_device().ioport(keynames[row])->read(); keyrow = ioport(keynames[row])->read();
for(mask=0x80, bitno=7;mask>0;mask=mask>>1, bitno-=1) for(mask=0x80, bitno=7;mask>0;mask=mask>>1, bitno-=1)
{ {

View File

@ -134,7 +134,7 @@ UINT8 microtan_state::read_dsw()
{ {
case MACHINE_PHASE_RESET: case MACHINE_PHASE_RESET:
case MACHINE_PHASE_RUNNING: case MACHINE_PHASE_RUNNING:
result = machine().root_device().ioport("DSW")->read(); result = ioport("DSW")->read();
break; break;
default: default:

View File

@ -50,15 +50,15 @@ void primo_state::primo_update_memory()
{ {
case 0x00: /* Original ROM */ case 0x00: /* Original ROM */
space.unmap_write(0x0000, 0x3fff); space.unmap_write(0x0000, 0x3fff);
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base()+0x10000); membank("bank1")->set_base(memregion("maincpu")->base()+0x10000);
break; break;
case 0x01: /* EPROM extension 1 */ case 0x01: /* EPROM extension 1 */
space.unmap_write(0x0000, 0x3fff); space.unmap_write(0x0000, 0x3fff);
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base()+0x14000); membank("bank1")->set_base(memregion("maincpu")->base()+0x14000);
break; break;
case 0x02: /* RAM */ case 0x02: /* RAM */
space.install_write_bank(0x0000, 0x3fff, "bank1"); space.install_write_bank(0x0000, 0x3fff, "bank1");
membank("bank1")->set_base(machine().root_device().memregion("maincpu")->base()); membank("bank1")->set_base(memregion("maincpu")->base());
break; break;
case 0x03: /* EPROM extension 2 */ case 0x03: /* EPROM extension 2 */
space.unmap_write(0x0000, 0x3fff); space.unmap_write(0x0000, 0x3fff);
@ -235,10 +235,10 @@ DRIVER_INIT_MEMBER(primo_state,primo64)
void primo_state::primo_common_machine_init () void primo_state::primo_common_machine_init ()
{ {
if (machine().root_device().ioport("MEMORY_EXPANSION")->read()) if (ioport("MEMORY_EXPANSION")->read())
m_port_FD = 0x00; m_port_FD = 0x00;
primo_update_memory(); primo_update_memory();
machine().device("maincpu")->set_clock_scale(machine().root_device().ioport("CPU_CLOCK")->read() ? 1.5 : 1.0); machine().device("maincpu")->set_clock_scale(ioport("CPU_CLOCK")->read() ? 1.5 : 1.0);
} }
void primo_state::machine_reset() void primo_state::machine_reset()

View File

@ -259,8 +259,8 @@ UINT8 samcoupe_state::samcoupe_mouse_r()
if (m_mouse_index == 2) if (m_mouse_index == 2)
{ {
/* update values */ /* update values */
int mouse_x = machine().root_device().ioport("mouse_x")->read(); int mouse_x = ioport("mouse_x")->read();
int mouse_y = machine().root_device().ioport("mouse_y")->read(); int mouse_y = ioport("mouse_y")->read();
int mouse_dx = m_mouse_x - mouse_x; int mouse_dx = m_mouse_x - mouse_x;
int mouse_dy = m_mouse_y - mouse_y; int mouse_dy = m_mouse_y - mouse_y;
@ -269,7 +269,7 @@ UINT8 samcoupe_state::samcoupe_mouse_r()
m_mouse_y = mouse_y; m_mouse_y = mouse_y;
/* button state */ /* button state */
m_mouse_data[2] = machine().root_device().ioport("mouse_buttons")->read(); m_mouse_data[2] = ioport("mouse_buttons")->read();
/* y-axis */ /* y-axis */
m_mouse_data[3] = (mouse_dy & 0xf00) >> 8; m_mouse_data[3] = (mouse_dy & 0xf00) >> 8;

View File

@ -366,12 +366,12 @@ void apple2_state::apple2_video_start(const UINT8 *vram, const UINT8 *aux_vram,
m_fgcolor = 15; m_fgcolor = 15;
m_bgcolor = 0; m_bgcolor = 0;
m_flash = 0; m_flash = 0;
apple2_font = machine().root_device().memregion("gfx1")->base(); apple2_font = memregion("gfx1")->base();
m_alt_charset_value = machine().root_device().memregion("gfx1")->bytes() / 16; m_alt_charset_value = memregion("gfx1")->bytes() / 16;
m_a2_videoram = vram; m_a2_videoram = vram;
m_a2_videoaux = aux_vram; m_a2_videoaux = aux_vram;
m_textgfx_data = machine().root_device().memregion("gfx1")->base(); m_textgfx_data = memregion("gfx1")->base();
m_textgfx_datalen = memregion("gfx1")->bytes(); m_textgfx_datalen = memregion("gfx1")->bytes();
/* 2^3 dependent pixels * 2 color sets * 2 offsets */ /* 2^3 dependent pixels * 2 color sets * 2 offsets */
@ -406,7 +406,7 @@ void apple2_state::apple2_video_start(const UINT8 *vram, const UINT8 *aux_vram,
/* Fix for Ivel Ultra */ /* Fix for Ivel Ultra */
if (!strcmp(machine().system().name, "ivelultr")) { if (!strcmp(machine().system().name, "ivelultr")) {
int len = machine().root_device().memregion("gfx1")->bytes(); int len = memregion("gfx1")->bytes();
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
apple2_font[i] = BITSWAP8(apple2_font[i], 7, 7, 6, 5, 4, 3, 2, 1); apple2_font[i] = BITSWAP8(apple2_font[i], 7, 7, 6, 5, 4, 3, 2, 1);
@ -421,7 +421,7 @@ void apple2_state::apple2_video_start(const UINT8 *vram, const UINT8 *aux_vram,
|| !strcmp(machine().system().name, "ace100") || !strcmp(machine().system().name, "ace100")
|| !strcmp(machine().system().name, "apple2jp")) || !strcmp(machine().system().name, "apple2jp"))
{ {
int len = machine().root_device().memregion("gfx1")->bytes(); int len = memregion("gfx1")->bytes();
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
apple2_font[i] = BITSWAP8(apple2_font[i], 7, 0, 1, 2, 3, 4, 5, 6); apple2_font[i] = BITSWAP8(apple2_font[i], 7, 0, 1, 2, 3, 4, 5, 6);