summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/qix.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2011-03-29 15:50:04 +0000
committer Aaron Giles <aaron@aarongiles.com>2011-03-29 15:50:04 +0000
commit2ad50720237fdd19cf5ab45b8cb6bb21119c00b8 (patch)
treedb21eee69668a06abc3f310ebbd51f5dbadf2de7 /src/mame/video/qix.c
parentb72cf3c5702b749c7bf26383ff05a9ab55022d31 (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/qix.c')
-rw-r--r--src/mame/video/qix.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/mame/video/qix.c b/src/mame/video/qix.c
index daab72c6ea5..29ee8774c4c 100644
--- a/src/mame/video/qix.c
+++ b/src/mame/video/qix.c
@@ -43,7 +43,7 @@ static WRITE_LINE_DEVICE_HANDLER( display_enable_changed );
static VIDEO_START( qix )
{
- qix_state *state = machine->driver_data<qix_state>();
+ qix_state *state = machine.driver_data<qix_state>();
/* allocate memory for the full video RAM */
state->videoram = auto_alloc_array(machine, UINT8, 256 * 256);
@@ -65,7 +65,7 @@ static VIDEO_START( qix )
static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
{
- qix_state *driver_state = device->machine->driver_data<qix_state>();
+ qix_state *driver_state = device->machine().driver_data<qix_state>();
/* on the rising edge, latch the scanline */
if (state)
@@ -88,7 +88,7 @@ static WRITE_LINE_DEVICE_HANDLER( display_enable_changed )
WRITE8_DEVICE_HANDLER( qix_flip_screen_w )
{
- qix_state *state = device->machine->driver_data<qix_state>();
+ qix_state *state = device->machine().driver_data<qix_state>();
state->flip = data;
}
@@ -112,7 +112,7 @@ WRITE8_DEVICE_HANDLER( qix_flip_screen_w )
static READ8_HANDLER( qix_videoram_r )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* add in the upper bit of the address latch */
offset += (state->videoram_address[0] & 0x80) << 8;
@@ -122,11 +122,11 @@ static READ8_HANDLER( qix_videoram_r )
static WRITE8_HANDLER( qix_videoram_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* update the screen in case the game is writing "behind" the beam -
Zookeeper likes to do this */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* add in the upper bit of the address latch */
offset += (state->videoram_address[0] & 0x80) << 8;
@@ -138,11 +138,11 @@ static WRITE8_HANDLER( qix_videoram_w )
static WRITE8_HANDLER( slither_videoram_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* update the screen in case the game is writing "behind" the beam -
Zookeeper likes to do this */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* add in the upper bit of the address latch */
offset += (state->videoram_address[0] & 0x80) << 8;
@@ -170,7 +170,7 @@ static WRITE8_HANDLER( slither_videoram_w )
static READ8_HANDLER( qix_addresslatch_r )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* compute the value at the address latch */
offset = (state->videoram_address[0] << 8) | state->videoram_address[1];
@@ -180,10 +180,10 @@ static READ8_HANDLER( qix_addresslatch_r )
static WRITE8_HANDLER( qix_addresslatch_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* update the screen in case the game is writing "behind" the beam */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* compute the value at the address latch */
offset = (state->videoram_address[0] << 8) | state->videoram_address[1];
@@ -195,10 +195,10 @@ static WRITE8_HANDLER( qix_addresslatch_w )
static WRITE8_HANDLER( slither_addresslatch_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* update the screen in case the game is writing "behind" the beam */
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
/* compute the value at the address latch */
offset = (state->videoram_address[0] << 8) | state->videoram_address[1];
@@ -218,7 +218,7 @@ static WRITE8_HANDLER( slither_addresslatch_w )
static WRITE8_HANDLER( qix_paletteram_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
UINT8 old_data = state->paletteram[offset];
@@ -228,18 +228,18 @@ static WRITE8_HANDLER( qix_paletteram_w )
/* trigger an update if a currently visible pen has changed */
if (((offset >> 8) == state->palette_bank) &&
(old_data != data))
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
}
WRITE8_HANDLER( qix_palettebank_w )
{
- qix_state *state = space->machine->driver_data<qix_state>();
+ qix_state *state = space->machine().driver_data<qix_state>();
/* set the bank value */
if (state->palette_bank != (data & 3))
{
- space->machine->primary_screen->update_now();
+ space->machine().primary_screen->update_now();
state->palette_bank = data & 3;
}
@@ -306,7 +306,7 @@ static void get_pens(qix_state *state, pen_t *pens)
static MC6845_BEGIN_UPDATE( begin_update )
{
- qix_state *state = device->machine->driver_data<qix_state>();
+ qix_state *state = device->machine().driver_data<qix_state>();
#if 0
// note the confusing bit order!
@@ -322,7 +322,7 @@ static MC6845_BEGIN_UPDATE( begin_update )
static MC6845_UPDATE_ROW( update_row )
{
- qix_state *state = device->machine->driver_data<qix_state>();
+ qix_state *state = device->machine().driver_data<qix_state>();
UINT32 *dest = BITMAP_ADDR32(bitmap, y, 0);
UINT16 x;
@@ -346,7 +346,7 @@ static MC6845_UPDATE_ROW( update_row )
static SCREEN_UPDATE( qix )
{
- device_t *mc6845 = screen->machine->device(MC6845_TAG);
+ device_t *mc6845 = screen->machine().device(MC6845_TAG);
mc6845_update(mc6845, bitmap, cliprect);
return 0;