summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/fcombat.c
diff options
context:
space:
mode:
authorGravatarGravatar Aaron Giles <aaron@aarongiles.com>2012-04-20 05:54:39 +0000
committerGravatarGravatar Aaron Giles <aaron@aarongiles.com>2012-04-20 05:54:39 +0000
commit18f33f4eff805592f984a31f55513bce4a219ee5 (patch) (github)
tree9e8dfdf1452e3d97a95936db2e9c740efa258306 /src/mame/drivers/fcombat.c
parent776d29c90f2a6c3c234597eb950410b95c5addec (diff)
downloadmame-18f33f4eff805592f984a31f55513bce4a219ee5.tar.bz2
mame-18f33f4eff805592f984a31f55513bce4a219ee5.zip
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/fcombat.c')
-rw-r--r--src/mame/drivers/fcombat.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/mame/drivers/fcombat.c b/src/mame/drivers/fcombat.c
index adaae371c98..1c69aa3e049 100644
--- a/src/mame/drivers/fcombat.c
+++ b/src/mame/drivers/fcombat.c
@@ -100,7 +100,7 @@ READ8_MEMBER(fcombat_state::e300_r)
int wx = (m_tx + m_fcombat_sh) / 16;
int wy = (m_ty * 2 + m_fcombat_sv) / 16;
- return machine().region("user2")->base()[wx * 32 * 16 + wy];
+ return memregion("user2")->base()[wx * 32 * 16 + wy];
}
WRITE8_MEMBER(fcombat_state::ee00_w)
@@ -339,8 +339,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the character data */
src = temp;
- dst = machine.region("gfx1")->base();
- length = machine.region("gfx1")->bytes();
+ dst = machine.root_device().memregion("gfx1")->base();
+ length = machine.root_device().memregion("gfx1")->bytes();
memcpy(src, dst, length);
/* decode the characters */
@@ -357,8 +357,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the sprite data */
src = temp;
- dst = machine.region("gfx2")->base();
- length = machine.region("gfx2")->bytes();
+ dst = machine.root_device().memregion("gfx2")->base();
+ length = machine.root_device().memregion("gfx2")->bytes();
memcpy(src, dst, length);
/* decode the sprites */
@@ -378,8 +378,8 @@ static DRIVER_INIT( fcombat )
/* make a temporary copy of the character data */
src = temp;
- dst = machine.region("gfx3")->base();
- length = machine.region("gfx3")->bytes();
+ dst = machine.root_device().memregion("gfx3")->base();
+ length = machine.root_device().memregion("gfx3")->bytes();
memcpy(src, dst, length);
/* decode the characters */
@@ -397,8 +397,8 @@ static DRIVER_INIT( fcombat )
}
src = temp;
- dst = machine.region("user1")->base();
- length = machine.region("user1")->bytes();
+ dst = machine.root_device().memregion("user1")->base();
+ length = machine.root_device().memregion("user1")->bytes();
memcpy(src, dst, length);
for (oldaddr = 0; oldaddr < 32; oldaddr++)
@@ -409,8 +409,8 @@ static DRIVER_INIT( fcombat )
src = temp;
- dst = machine.region("user2")->base();
- length = machine.region("user2")->bytes();
+ dst = machine.root_device().memregion("user2")->base();
+ length = machine.root_device().memregion("user2")->bytes();
memcpy(src, dst, length);
for (oldaddr = 0; oldaddr < 32; oldaddr++)