diff --git a/src/mess/drivers/apexc.c b/src/mess/drivers/apexc.c index a2b34a5baff..053e75a6b38 100644 --- a/src/mess/drivers/apexc.c +++ b/src/mess/drivers/apexc.c @@ -106,13 +106,13 @@ bool apexc_cylinder_image_device::call_load() /* load RAM contents */ m_writable = !is_readonly(); - fread( machine().root_device().memregion("maincpu")->base(), 0x1000); + fread( memregion("maincpu")->base(), 0x1000); #ifdef LSB_FIRST { /* fix endianness */ UINT32 *RAM; int i; - RAM = (UINT32 *)(*machine().root_device().memregion("maincpu")); + RAM = (UINT32 *)(*memregion("maincpu")); for (i=0; i < 0x0400; i++) RAM[i] = BIG_ENDIANIZE_INT32(RAM[i]); @@ -136,14 +136,14 @@ void apexc_cylinder_image_device::call_unload() UINT32 *RAM; int i; - RAM = (UINT32 *)(*machine().root_device().memregion("maincpu")); + RAM = (UINT32 *)(*memregion("maincpu")); for (i=0; i < /*0x2000*/0x0400; i++) RAM[i] = BIG_ENDIANIZE_INT32(RAM[i]); } #endif /* write */ - fwrite(machine().root_device().memregion("maincpu")->base(), /*0x8000*/0x1000); + fwrite(memregion("maincpu")->base(), /*0x8000*/0x1000); } } diff --git a/src/mess/drivers/c65.c b/src/mess/drivers/c65.c index 16f7455c8ea..a94fb3662fc 100644 --- a/src/mess/drivers/c65.c +++ b/src/mess/drivers/c65.c @@ -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; UINT8 cia0porta = mos6526_pa_r(machine().device("cia_0"), space, 0); - int controller1 = machine().root_device().ioport("CTRLSEL")->read() & 0x07; - int controller2 = machine().root_device().ioport("CTRLSEL")->read() & 0x70; + int controller1 = ioport("CTRLSEL")->read() & 0x07; + int controller2 = ioport("CTRLSEL")->read() & 0x70; /* Notice that only a single input is defined for Mouse & Lightpen in both ports */ switch (controller1) { case 0x01: if (which) - pot2 = machine().root_device().ioport("PADDLE2")->read(); + pot2 = ioport("PADDLE2")->read(); else - pot1 = machine().root_device().ioport("PADDLE1")->read(); + pot1 = ioport("PADDLE1")->read(); break; case 0x02: if (which) - pot2 = machine().root_device().ioport("TRACKY")->read(); + pot2 = ioport("TRACKY")->read(); else - pot1 = machine().root_device().ioport("TRACKX")->read(); + pot1 = ioport("TRACKX")->read(); break; 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; break; case 0x04: if (which) - pot2 = machine().root_device().ioport("LIGHTY")->read(); + pot2 = ioport("LIGHTY")->read(); else - pot1 = machine().root_device().ioport("LIGHTX")->read(); + pot1 = ioport("LIGHTX")->read(); break; case 0x06: - if (which && (machine().root_device().ioport("OTHER")->read() & 0x04)) /* Lightpen Signal */ + if (which && (ioport("OTHER")->read() & 0x04)) /* Lightpen Signal */ pot2 = 0x00; break; @@ -254,32 +254,32 @@ int c65_state::c64_paddle_read( device_t *device, address_space &space, int whic { case 0x10: if (which) - pot4 = machine().root_device().ioport("PADDLE4")->read(); + pot4 = ioport("PADDLE4")->read(); else - pot3 = machine().root_device().ioport("PADDLE3")->read(); + pot3 = ioport("PADDLE3")->read(); break; case 0x20: if (which) - pot4 = machine().root_device().ioport("TRACKY")->read(); + pot4 = ioport("TRACKY")->read(); else - pot3 = machine().root_device().ioport("TRACKX")->read(); + pot3 = ioport("TRACKX")->read(); break; 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; break; case 0x40: if (which) - pot4 = machine().root_device().ioport("LIGHTY")->read(); + pot4 = ioport("LIGHTY")->read(); else - pot3 = machine().root_device().ioport("LIGHTX")->read(); + pot3 = ioport("LIGHTX")->read(); break; case 0x60: - if (which && (machine().root_device().ioport("OTHER")->read() & 0x04)) /* Lightpen Signal */ + if (which && (ioport("OTHER")->read() & 0x04)) /* Lightpen Signal */ pot4 = 0x00; break; @@ -292,7 +292,7 @@ int c65_state::c64_paddle_read( device_t *device, address_space &space, int whic break; } - if (machine().root_device().ioport("CTRLSEL")->read() & 0x80) /* Swap */ + if (ioport("CTRLSEL")->read() & 0x80) /* Swap */ { temp = pot1; pot1 = pot3; pot3 = 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) { - return machine().root_device().ioport("LIGHTX")->read() & ~0x01; + return ioport("LIGHTX")->read() & ~0x01; } 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) { - return machine().root_device().ioport("OTHER")->read() & 0x04; + return ioport("OTHER")->read() & 0x04; } READ8_MEMBER(c65_state::c65_c64_mem_r) diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c index ce7dc7b4011..7c07652dd1b 100644 --- a/src/mess/drivers/fm7.c +++ b/src/mess/drivers/fm7.c @@ -1233,12 +1233,12 @@ void fm7_state::fm7_keyboard_poll_scan() int bit = 0; int x,y; 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 }; 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 { diff --git a/src/mess/drivers/nc.c b/src/mess/drivers/nc.c index 1f5bfa220ca..e195929e1b5 100644 --- a/src/mess/drivers/nc.c +++ b/src/mess/drivers/nc.c @@ -371,7 +371,7 @@ void nc_state::nc_refresh_memory_bank_config(int bank) membank(bank1)->set_base(addr); /* write enabled? */ - if (machine().root_device().ioport("EXTRA")->read() & 0x02) + if (ioport("EXTRA")->read() & 0x02) { /* yes */ membank(bank5)->set_base(addr); @@ -534,7 +534,7 @@ void nc_state::nc_common_init_machine() m_memory_config[2] = 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 */ m_irq_mask = 0; diff --git a/src/mess/drivers/palm.c b/src/mess/drivers/palm.c index 9b252a6a6a9..d2235d6f2af 100644 --- a/src/mess/drivers/palm.c +++ b/src/mess/drivers/palm.c @@ -145,7 +145,7 @@ void palm_state::machine_start() void palm_state::machine_reset() { // Copy boot ROM - UINT8* bios = machine().root_device().memregion("bios")->base(); + UINT8* bios = memregion("bios")->base(); memset(m_ram->pointer(), 0, m_ram->size()); memcpy(m_ram->pointer(), bios, 0x20000); diff --git a/src/mess/drivers/pcw.c b/src/mess/drivers/pcw.c index 67fd0d9d283..5d8e8b43c08 100644 --- a/src/mess/drivers/pcw.c +++ b/src/mess/drivers/pcw.c @@ -328,7 +328,7 @@ void pcw_state::pcw_update_mem(int block, int data) { unsigned char *FakeROM; - FakeROM = &machine().root_device().memregion("maincpu")->base()[0x010000]; + FakeROM = &memregion("maincpu")->base()[0x010000]; membank("bank1")->set_base(FakeROM); }*/ @@ -340,7 +340,7 @@ int pcw_state::pcw_get_sys_status() return m_interrupt_counter | (m_screen->vblank() ? 0x40 : 0x00) - | (machine().root_device().ioport("EXTRA")->read() & 0x010) + | (ioport("EXTRA")->read() & 0x010) | (m_system_status & 0x20); } diff --git a/src/mess/drivers/pdp1.c b/src/mess/drivers/pdp1.c index d6b588392f0..9a0ba8d5bee 100644 --- a/src/mess/drivers/pdp1.c +++ b/src/mess/drivers/pdp1.c @@ -1705,7 +1705,7 @@ void pdp1_state::pdp1_keyboard() 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++) @@ -1735,9 +1735,9 @@ void pdp1_state::pdp1_lightpen() int x_delta, y_delta; 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 */ 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; /* update pen position */ - x_delta = machine().root_device().ioport("LIGHTX")->read(); - y_delta = machine().root_device().ioport("LIGHTY")->read(); + x_delta = ioport("LIGHTX")->read(); + y_delta = ioport("LIGHTY")->read(); if (x_delta >= 0x80) x_delta -= 0x100; diff --git a/src/mess/drivers/ssystem3.c b/src/mess/drivers/ssystem3.c index 984de853d93..86c6ce6cd0d 100644 --- a/src/mess/drivers/ssystem3.c +++ b/src/mess/drivers/ssystem3.c @@ -58,7 +58,7 @@ void ssystem3_state::ssystem3_playfield_reset() { memset(&m_playfield, 0, sizeof(m_playfield)); 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) @@ -108,7 +108,7 @@ void ssystem3_state::ssystem3_playfield_write(int reset, int signal) 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; *ready=FALSE; } diff --git a/src/mess/drivers/tx0.c b/src/mess/drivers/tx0.c index e69078bbc64..a72fbc44385 100644 --- a/src/mess/drivers/tx0.c +++ b/src/mess/drivers/tx0.c @@ -1465,7 +1465,7 @@ void tx0_state::tx0_keyboard() 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++) diff --git a/src/mess/machine/apple2gs.c b/src/mess/machine/apple2gs.c index 98ac15695cc..aa9a6a26eea 100644 --- a/src/mess/machine/apple2gs.c +++ b/src/mess/machine/apple2gs.c @@ -1565,7 +1565,7 @@ UINT8 *apple2gs_state::apple2gs_getslotmem(offs_t address) assert(address <= 0xCFFF); rom = m_rom; - rom += 0x030000 % machine().root_device().memregion("maincpu")->bytes(); + rom += 0x030000 % memregion("maincpu")->bytes(); return &rom[address]; } diff --git a/src/mess/machine/apple3.c b/src/mess/machine/apple3.c index a8097fb9e2b..2cd46dbf98a 100644 --- a/src/mess/machine/apple3.c +++ b/src/mess/machine/apple3.c @@ -438,7 +438,7 @@ void apple3_state::apple3_update_memory() else space.install_write_bank(0xF000, 0xFFFF, "bank7"); if (m_via_0_a & 0x01) - membank("bank7")->set_base(machine().root_device().memregion("maincpu")->base()); + membank("bank7")->set_base(memregion("maincpu")->base()); else apple3_setbank("bank7", ~0, 0x7000); diff --git a/src/mess/machine/bbc.c b/src/mess/machine/bbc.c index 3e1842e7722..03044f24483 100644 --- a/src/mess/machine/bbc.c +++ b/src/mess/machine/bbc.c @@ -1140,7 +1140,7 @@ void bbc_state::bbc_TMSint(int status) { TMSint=(!status)&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 diff --git a/src/mess/machine/c65.c b/src/mess/machine/c65.c index b4925810c3e..83290e8f842 100644 --- a/src/mess/machine/c65.c +++ b/src/mess/machine/c65.c @@ -43,11 +43,11 @@ void c65_state::c65_nmi( ) device_t *cia_1 = machine().device("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 (machine().root_device().ioport("SPECIAL")->read() & 0x20) + if (ioport("SPECIAL")->read() & 0x20) data &= ~1; } DBG_LOG(machine(), 2, "r6511 read", ("%.2x\n", offset)); diff --git a/src/mess/machine/cgenie.c b/src/mess/machine/cgenie.c index 9e6a5853fd7..8c64cc327de 100644 --- a/src/mess/machine/cgenie.c +++ b/src/mess/machine/cgenie.c @@ -327,7 +327,7 @@ READ8_MEMBER( cgenie_state::cgenie_status_r ) { device_t *fdc = machine().device("wd179x"); /* 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 wd17xx_status_r(fdc, space, offset); } @@ -336,7 +336,7 @@ READ8_MEMBER( cgenie_state::cgenie_track_r ) { device_t *fdc = machine().device("wd179x"); /* 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 wd17xx_track_r(fdc, space, offset); } @@ -345,7 +345,7 @@ READ8_MEMBER( cgenie_state::cgenie_sector_r ) { device_t *fdc = machine().device("wd179x"); /* 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 wd17xx_sector_r(fdc, space, offset); } @@ -354,7 +354,7 @@ READ8_MEMBER( cgenie_state::cgenie_data_r ) { device_t *fdc = machine().device("wd179x"); /* 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 wd17xx_data_r(fdc, space, offset); } @@ -363,7 +363,7 @@ WRITE8_MEMBER( cgenie_state::cgenie_command_w ) { device_t *fdc = machine().device("wd179x"); /* If the floppy isn't emulated, return immediately */ - if( (machine().root_device().ioport("DSW0")->read() & 0x80) == 0 ) + if( (ioport("DSW0")->read() & 0x80) == 0 ) return; wd17xx_command_w(fdc, space, offset, data); } @@ -372,7 +372,7 @@ WRITE8_MEMBER( cgenie_state::cgenie_track_w ) { device_t *fdc = machine().device("wd179x"); /* 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; wd17xx_track_w(fdc, space, offset, data); } @@ -381,7 +381,7 @@ WRITE8_MEMBER( cgenie_state::cgenie_sector_w ) { device_t *fdc = machine().device("wd179x"); /* 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; wd17xx_sector_w(fdc, space, offset, data); } @@ -390,7 +390,7 @@ WRITE8_MEMBER( cgenie_state::cgenie_data_w ) { device_t *fdc = machine().device("wd179x"); /* 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; wd17xx_data_w(fdc, space, offset, data); } @@ -472,33 +472,33 @@ WRITE8_MEMBER( cgenie_state::cgenie_motor_w ) /************************************* * Keyboard * *************************************/ - READ8_MEMBER( cgenie_state::cgenie_keyboard_r ) +READ8_MEMBER( cgenie_state::cgenie_keyboard_r ) { int result = 0; if( offset & 0x01 ) - result |= machine().root_device().ioport("ROW0")->read(); + result |= ioport("ROW0")->read(); if( offset & 0x02 ) - result |= machine().root_device().ioport("ROW1")->read(); + result |= ioport("ROW1")->read(); if( offset & 0x04 ) - result |= machine().root_device().ioport("ROW2")->read(); + result |= ioport("ROW2")->read(); if( offset & 0x08 ) - result |= machine().root_device().ioport("ROW3")->read(); + result |= ioport("ROW3")->read(); if( offset & 0x10 ) - result |= machine().root_device().ioport("ROW4")->read(); + result |= ioport("ROW4")->read(); if( offset & 0x20 ) - result |= machine().root_device().ioport("ROW5")->read(); + result |= ioport("ROW5")->read(); if( offset & 0x40 ) - result |= machine().root_device().ioport("ROW6")->read(); + result |= ioport("ROW6")->read(); if( offset & 0x80 ) - result |= machine().root_device().ioport("ROW7")->read(); + result |= ioport("ROW7")->read(); return result; } @@ -576,7 +576,7 @@ WRITE8_MEMBER( cgenie_state::cgenie_fontram_w ) 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; /* force setting of background color */ diff --git a/src/mess/machine/concept.c b/src/mess/machine/concept.c index 21ed0f413c6..ca4414c7bdc 100644 --- a/src/mess/machine/concept.c +++ b/src/mess/machine/concept.c @@ -141,7 +141,7 @@ void concept_state::poll_keyboard() 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]; if(key_transitions) { diff --git a/src/mess/machine/dgn_beta.c b/src/mess/machine/dgn_beta.c index e5fa66e9236..5210908b21f 100644 --- a/src/mess/machine/dgn_beta.c +++ b/src/mess/machine/dgn_beta.c @@ -944,7 +944,7 @@ void dgn_beta_state::ScanInKeyboard(void) for(Idx=0; Idxread(); + Row = ioport(keynames[Idx])->read(); else Row = 0x7f; diff --git a/src/mess/machine/hp48.c b/src/mess/machine/hp48.c index ab5e85e2180..caa0593e3bc 100644 --- a/src/mess/machine/hp48.c +++ b/src/mess/machine/hp48.c @@ -250,18 +250,18 @@ int hp48_state::hp48_get_in( ) int in = 0; /* regular keys */ - if ( (m_out >> 0) & 1 ) in |= machine().root_device().ioport( "LINE0" )->read(); - if ( (m_out >> 1) & 1 ) in |= machine().root_device().ioport( "LINE1" )->read(); - if ( (m_out >> 2) & 1 ) in |= machine().root_device().ioport( "LINE2" )->read(); - if ( (m_out >> 3) & 1 ) in |= machine().root_device().ioport( "LINE3" )->read(); - if ( (m_out >> 4) & 1 ) in |= machine().root_device().ioport( "LINE4" )->read(); - if ( (m_out >> 5) & 1 ) in |= machine().root_device().ioport( "LINE5" )->read(); - if ( (m_out >> 6) & 1 ) in |= machine().root_device().ioport( "LINE6" )->read(); - if ( (m_out >> 7) & 1 ) in |= machine().root_device().ioport( "LINE7" )->read(); - if ( (m_out >> 8) & 1 ) in |= machine().root_device().ioport( "LINE8" )->read(); + if ( (m_out >> 0) & 1 ) in |= ioport( "LINE0" )->read(); + if ( (m_out >> 1) & 1 ) in |= ioport( "LINE1" )->read(); + if ( (m_out >> 2) & 1 ) in |= ioport( "LINE2" )->read(); + if ( (m_out >> 3) & 1 ) in |= ioport( "LINE3" )->read(); + if ( (m_out >> 4) & 1 ) in |= ioport( "LINE4" )->read(); + if ( (m_out >> 5) & 1 ) in |= ioport( "LINE5" )->read(); + if ( (m_out >> 6) & 1 ) in |= ioport( "LINE6" )->read(); + if ( (m_out >> 7) & 1 ) in |= ioport( "LINE7" )->read(); + if ( (m_out >> 8) & 1 ) in |= ioport( "LINE8" )->read(); /* on key */ - in |= machine().root_device().ioport( "ON" )->read(); + in |= ioport( "ON" )->read(); return in; } diff --git a/src/mess/machine/mac.c b/src/mess/machine/mac.c index ff10ec82ce8..3daea6a39a9 100644 --- a/src/mess/machine/mac.c +++ b/src/mess/machine/mac.c @@ -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) */ 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; diff --git a/src/mess/machine/mbc55x.c b/src/mess/machine/mbc55x.c index df26867358b..5905d21e39b 100644 --- a/src/mess/machine/mbc55x.c +++ b/src/mess/machine/mbc55x.c @@ -258,11 +258,11 @@ void mbc55x_state::scan_keyboard() // 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; rowread(); + keyrow = ioport(keynames[row])->read(); for(mask=0x80, bitno=7;mask>0;mask=mask>>1, bitno-=1) { diff --git a/src/mess/machine/microtan.c b/src/mess/machine/microtan.c index c1f7948ea25..dc653c148ef 100644 --- a/src/mess/machine/microtan.c +++ b/src/mess/machine/microtan.c @@ -134,7 +134,7 @@ UINT8 microtan_state::read_dsw() { case MACHINE_PHASE_RESET: case MACHINE_PHASE_RUNNING: - result = machine().root_device().ioport("DSW")->read(); + result = ioport("DSW")->read(); break; default: diff --git a/src/mess/machine/primo.c b/src/mess/machine/primo.c index 4590aa3ae03..b3c9eaf25ef 100644 --- a/src/mess/machine/primo.c +++ b/src/mess/machine/primo.c @@ -50,15 +50,15 @@ void primo_state::primo_update_memory() { case 0x00: /* Original ROM */ 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; case 0x01: /* EPROM extension 1 */ 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; case 0x02: /* RAM */ 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; case 0x03: /* EPROM extension 2 */ space.unmap_write(0x0000, 0x3fff); @@ -235,10 +235,10 @@ DRIVER_INIT_MEMBER(primo_state,primo64) void primo_state::primo_common_machine_init () { - if (machine().root_device().ioport("MEMORY_EXPANSION")->read()) + if (ioport("MEMORY_EXPANSION")->read()) m_port_FD = 0x00; 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() diff --git a/src/mess/machine/samcoupe.c b/src/mess/machine/samcoupe.c index b8f9eff327f..8ee96a7b0e2 100644 --- a/src/mess/machine/samcoupe.c +++ b/src/mess/machine/samcoupe.c @@ -259,8 +259,8 @@ UINT8 samcoupe_state::samcoupe_mouse_r() if (m_mouse_index == 2) { /* update values */ - int mouse_x = machine().root_device().ioport("mouse_x")->read(); - int mouse_y = machine().root_device().ioport("mouse_y")->read(); + int mouse_x = ioport("mouse_x")->read(); + int mouse_y = ioport("mouse_y")->read(); int mouse_dx = m_mouse_x - mouse_x; int mouse_dy = m_mouse_y - mouse_y; @@ -269,7 +269,7 @@ UINT8 samcoupe_state::samcoupe_mouse_r() m_mouse_y = mouse_y; /* button state */ - m_mouse_data[2] = machine().root_device().ioport("mouse_buttons")->read(); + m_mouse_data[2] = ioport("mouse_buttons")->read(); /* y-axis */ m_mouse_data[3] = (mouse_dy & 0xf00) >> 8; diff --git a/src/mess/video/apple2.c b/src/mess/video/apple2.c index c8b543dad2c..864825fe0f7 100644 --- a/src/mess/video/apple2.c +++ b/src/mess/video/apple2.c @@ -366,12 +366,12 @@ void apple2_state::apple2_video_start(const UINT8 *vram, const UINT8 *aux_vram, m_fgcolor = 15; m_bgcolor = 0; m_flash = 0; - apple2_font = machine().root_device().memregion("gfx1")->base(); - m_alt_charset_value = machine().root_device().memregion("gfx1")->bytes() / 16; + apple2_font = memregion("gfx1")->base(); + m_alt_charset_value = memregion("gfx1")->bytes() / 16; m_a2_videoram = 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(); /* 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 */ 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++) { 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, "apple2jp")) { - int len = machine().root_device().memregion("gfx1")->bytes(); + int len = memregion("gfx1")->bytes(); for (i = 0; i < len; i++) { apple2_font[i] = BITSWAP8(apple2_font[i], 7, 0, 1, 2, 3, 4, 5, 6);