summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/mazerbla.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2012-04-20 05:54:39 +0000
committer Aaron Giles <aaron@aarongiles.com>2012-04-20 05:54:39 +0000
commit18f33f4eff805592f984a31f55513bce4a219ee5 (patch)
tree9e8dfdf1452e3d97a95936db2e9c740efa258306 /src/mame/drivers/mazerbla.c
parent776d29c90f2a6c3c234597eb950410b95c5addec (diff)
Changed device->subregion to device->memregion. Moved
memory_region management into the memory manager instead of directly in the machine. Hid the global region method; now all regions must be looked up relative to a device. If you're a member function, you can just use memregion("tag") directly. If you're a global function or a device referencing global regions, use machine().root_device().memregion("tag") to look up regions relative to the root. S&R to convert all references: machine([()]*)\.region machine\1\.root_device\(\).subregion Then remove redundant machine().root_device() within src/mame: ([ \t])machine\(\)\.root_device\(\)\. \1 And use state->memregion() if we have a state variable present: (state *= *[^;]+driver_data[^}]+)([^ \t]*)machine[()]*\.root_device\(\)\. \1state-> Finally some cleanup: screen.state-> state-> device->state-> state-> space->state-> state-> And a few hand-tweaks.
Diffstat (limited to 'src/mame/drivers/mazerbla.c')
-rw-r--r--src/mame/drivers/mazerbla.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mame/drivers/mazerbla.c b/src/mame/drivers/mazerbla.c
index 9215c77586b..8b700dec6b3 100644
--- a/src/mame/drivers/mazerbla.c
+++ b/src/mame/drivers/mazerbla.c
@@ -361,14 +361,14 @@ WRITE8_MEMBER(mazerbla_state::cfb_rom_bank_sel_w)/* mazer blazer */
{
m_gfx_rom_bank = data;
- membank("bank1")->set_base(machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
}
WRITE8_MEMBER(mazerbla_state::cfb_rom_bank_sel_w_gg)/* great guns */
{
m_gfx_rom_bank = data >> 1;
- membank("bank1")->set_base(machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
+ membank("bank1")->set_base(machine().root_device().memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000);
}
@@ -411,7 +411,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_cmd_param_r)
READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r)
{
- UINT8 * rom = machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
+ UINT8 * rom = memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
int offs;
int x, y;
int bits = 0;
@@ -557,7 +557,7 @@ READ8_MEMBER(mazerbla_state::vcu_set_gfx_addr_r)
READ8_MEMBER(mazerbla_state::vcu_set_clr_addr_r)
{
- UINT8 * rom = machine().region("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
+ UINT8 * rom = memregion("sub2")->base() + (m_gfx_rom_bank * 0x2000) + 0x10000;
int offs;
int x, y;
int bits = 0;
@@ -1713,7 +1713,7 @@ static DRIVER_INIT( mazerbla )
static DRIVER_INIT( greatgun )
{
mazerbla_state *state = machine.driver_data<mazerbla_state>();
- UINT8 *rom = machine.region("sub2")->base();
+ UINT8 *rom = state->memregion("sub2")->base();
state->m_game_id = GREATGUN;