summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/progolf.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/progolf.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/progolf.c')
-rw-r--r--src/mame/drivers/progolf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mame/drivers/progolf.c b/src/mame/drivers/progolf.c
index ee28c4ef725..a3b3ed59fea 100644
--- a/src/mame/drivers/progolf.c
+++ b/src/mame/drivers/progolf.c
@@ -212,7 +212,7 @@ READ8_MEMBER(progolf_state::audio_command_r)
READ8_MEMBER(progolf_state::progolf_videoram_r)
{
UINT8 *videoram = m_videoram;
- UINT8 *gfx_rom = machine().region("gfx1")->base();
+ UINT8 *gfx_rom = memregion("gfx1")->base();
if (offset >= 0x0800)
{
@@ -389,7 +389,7 @@ static const mc6845_interface mc6845_intf =
static PALETTE_INIT( progolf )
{
- const UINT8 *color_prom = machine.region("proms")->base();
+ const UINT8 *color_prom = machine.root_device().memregion("proms")->base();
int i;
for (i = 0;i < machine.total_colors();i++)
@@ -502,7 +502,7 @@ static DRIVER_INIT( progolf )
{
int A;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8* decrypted = auto_alloc_array(machine, UINT8, 0x10000);
space->set_decrypted_region(0x0000,0xffff, decrypted);
@@ -516,7 +516,7 @@ static DRIVER_INIT( progolfa )
{
int A;
address_space *space = machine.device("maincpu")->memory().space(AS_PROGRAM);
- UINT8 *rom = machine.region("maincpu")->base();
+ UINT8 *rom = machine.root_device().memregion("maincpu")->base();
UINT8* decrypted = auto_alloc_array(machine, UINT8, 0x10000);
space->set_decrypted_region(0x0000,0xffff, decrypted);