diff options
author | 2011-03-29 15:50:04 +0000 | |
---|---|---|
committer | 2011-03-29 15:50:04 +0000 | |
commit | 2ad50720237fdd19cf5ab45b8cb6bb21119c00b8 (patch) | |
tree | db21eee69668a06abc3f310ebbd51f5dbadf2de7 /src/mame/video/exprraid.c | |
parent | b72cf3c5702b749c7bf26383ff05a9ab55022d31 (diff) |
BIG update.
Remove redundant machine items from address_space and device_t.
Neither machine nor m_machine are directly accessible anymore.
Instead a new getter machine() is available which returns a
machine reference. So:
space->machine->xxx ==> space->machine().xxx
device->machine->yyy ==> device->machine().yyy
Globally changed all running_machine pointers to running_machine
references. Any function/method that takes a running_machine takes
it as a required parameter (1 or 2 exceptions). Being consistent
here gets rid of a lot of odd &machine or *machine, but it does
mean a very large bulk change across the project.
Structs which have a running_machine * now have that variable
renamed to m_machine, and now have a shiny new machine() method
that works like the space and device methods above. Since most of
these are things that should eventually be devices anyway, consider
this a step in that direction.
98% of the update was done with regex searches. The changes are
architected such that the compiler will catch the remaining
errors:
// find things that use an embedded machine directly and replace
// with a machine() getter call
S: ->machine->
R: ->machine\(\)\.
// do the same if via a reference
S: \.machine->
R: \.machine\(\)\.
// convert function parameters to running_machine &
S: running_machine \*machine([^;])
R: running_machine \&machine\1
// replace machine-> with machine.
S: machine->
R: machine\.
// replace &machine() with machine()
S: \&([()->a-z0-9_]+machine\(\))
R: \1
// sanity check: look for this used as a cast
(running_machine &)
// and change to this:
*(running_machine *)
Diffstat (limited to 'src/mame/video/exprraid.c')
-rw-r--r-- | src/mame/video/exprraid.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/mame/video/exprraid.c b/src/mame/video/exprraid.c index b9ea4a90ea4..486d1f9103e 100644 --- a/src/mame/video/exprraid.c +++ b/src/mame/video/exprraid.c @@ -4,30 +4,30 @@ WRITE8_HANDLER( exprraid_videoram_w ) { - exprraid_state *state = space->machine->driver_data<exprraid_state>(); + exprraid_state *state = space->machine().driver_data<exprraid_state>(); state->videoram[offset] = data; tilemap_mark_tile_dirty(state->fg_tilemap, offset); } WRITE8_HANDLER( exprraid_colorram_w ) { - exprraid_state *state = space->machine->driver_data<exprraid_state>(); + exprraid_state *state = space->machine().driver_data<exprraid_state>(); state->colorram[offset] = data; tilemap_mark_tile_dirty(state->fg_tilemap, offset); } WRITE8_HANDLER( exprraid_flipscreen_w ) { - if (flip_screen_get(space->machine) != (data & 0x01)) + if (flip_screen_get(space->machine()) != (data & 0x01)) { - flip_screen_set(space->machine, data & 0x01); - tilemap_mark_all_tiles_dirty_all(space->machine); + flip_screen_set(space->machine(), data & 0x01); + tilemap_mark_all_tiles_dirty_all(space->machine()); } } WRITE8_HANDLER( exprraid_bgselect_w ) { - exprraid_state *state = space->machine->driver_data<exprraid_state>(); + exprraid_state *state = space->machine().driver_data<exprraid_state>(); if (state->bg_index[offset] != data) { state->bg_index[offset] = data; @@ -37,20 +37,20 @@ WRITE8_HANDLER( exprraid_bgselect_w ) WRITE8_HANDLER( exprraid_scrollx_w ) { - exprraid_state *state = space->machine->driver_data<exprraid_state>(); + exprraid_state *state = space->machine().driver_data<exprraid_state>(); tilemap_set_scrollx(state->bg_tilemap, offset, data); } WRITE8_HANDLER( exprraid_scrolly_w ) { - exprraid_state *state = space->machine->driver_data<exprraid_state>(); + exprraid_state *state = space->machine().driver_data<exprraid_state>(); tilemap_set_scrolly(state->bg_tilemap, 0, data); } static TILE_GET_INFO( get_bg_tile_info ) { - exprraid_state *state = machine->driver_data<exprraid_state>(); - UINT8 *tilerom = machine->region("gfx4")->base(); + exprraid_state *state = machine.driver_data<exprraid_state>(); + UINT8 *tilerom = machine.region("gfx4")->base(); int data, attr, bank, code, color, flags; int quadrant = 0, offs; @@ -77,7 +77,7 @@ static TILE_GET_INFO( get_bg_tile_info ) static TILE_GET_INFO( get_fg_tile_info ) { - exprraid_state *state = machine->driver_data<exprraid_state>(); + exprraid_state *state = machine.driver_data<exprraid_state>(); int attr = state->colorram[tile_index]; int code = state->videoram[tile_index] + ((attr & 0x07) << 8); int color = (attr & 0x10) >> 4; @@ -87,7 +87,7 @@ static TILE_GET_INFO( get_fg_tile_info ) VIDEO_START( exprraid ) { - exprraid_state *state = machine->driver_data<exprraid_state>(); + exprraid_state *state = machine.driver_data<exprraid_state>(); state->bg_tilemap = tilemap_create(machine, get_bg_tile_info, tilemap_scan_rows, 16, 16, 32, 32); state->fg_tilemap = tilemap_create(machine, get_fg_tile_info, tilemap_scan_rows, 8, 8, 32, 32); @@ -96,9 +96,9 @@ VIDEO_START( exprraid ) tilemap_set_transparent_pen(state->fg_tilemap, 0); } -static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect ) +static void draw_sprites( running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect ) { - exprraid_state *state = machine->driver_data<exprraid_state>(); + exprraid_state *state = machine.driver_data<exprraid_state>(); int offs; for (offs = 0; offs < state->spriteram_size; offs += 4) @@ -119,7 +119,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect flipy = !flipy; } - drawgfx_transpen(bitmap, 0, machine->gfx[1], + drawgfx_transpen(bitmap, 0, machine.gfx[1], code, color, flipx, flipy, sx, sy, 0); @@ -128,7 +128,7 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect if (attr & 0x10) { - drawgfx_transpen(bitmap,cliprect, machine->gfx[1], + drawgfx_transpen(bitmap,cliprect, machine.gfx[1], code + 1, color, flipx, flipy, sx, sy + (flip_screen_get(machine) ? -16 : 16), 0); @@ -138,9 +138,9 @@ static void draw_sprites( running_machine *machine, bitmap_t *bitmap, const rect SCREEN_UPDATE( exprraid ) { - exprraid_state *state = screen->machine->driver_data<exprraid_state>(); + exprraid_state *state = screen->machine().driver_data<exprraid_state>(); tilemap_draw(bitmap, cliprect, state->bg_tilemap, 0, 0); - draw_sprites(screen->machine, bitmap, cliprect); + draw_sprites(screen->machine(), bitmap, cliprect); tilemap_draw(bitmap, cliprect, state->bg_tilemap, 1, 0); tilemap_draw(bitmap, cliprect, state->fg_tilemap, 0, 0); return 0; |