summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/drgnmst.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/drivers/drgnmst.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/drivers/drgnmst.c')
-rw-r--r--src/mame/drivers/drgnmst.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/mame/drivers/drgnmst.c b/src/mame/drivers/drgnmst.c
index bfcb8e0fe0e..9305354bf48 100644
--- a/src/mame/drivers/drgnmst.c
+++ b/src/mame/drivers/drgnmst.c
@@ -43,14 +43,14 @@ Notes:
static WRITE16_HANDLER( drgnmst_coin_w )
{
- coin_counter_w(space->machine, 0, data & 0x100);
- coin_lockout_w(space->machine, 0, ~data & 0x400);
- coin_lockout_w(space->machine, 1, ~data & 0x800);
+ coin_counter_w(space->machine(), 0, data & 0x100);
+ coin_lockout_w(space->machine(), 0, ~data & 0x400);
+ coin_lockout_w(space->machine(), 1, ~data & 0x800);
}
static WRITE16_HANDLER( drgnmst_snd_command_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
if (ACCESSING_BITS_0_7)
{
@@ -61,7 +61,7 @@ static WRITE16_HANDLER( drgnmst_snd_command_w )
static WRITE16_HANDLER( drgnmst_snd_flag_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
/* Enables the following 68K write operation to latch through to the PIC */
if (ACCESSING_BITS_0_7)
@@ -71,13 +71,13 @@ static WRITE16_HANDLER( drgnmst_snd_flag_w )
static READ8_HANDLER( pic16c5x_port0_r )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
return state->pic16c5x_port0;
}
static READ8_HANDLER( drgnmst_snd_command_r )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
int data = 0;
switch (state->oki_control & 0x1f)
@@ -94,7 +94,7 @@ static READ8_HANDLER( drgnmst_snd_command_r )
static READ8_HANDLER( drgnmst_snd_flag_r )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
if (state->snd_flag)
{
state->snd_flag = 0;
@@ -106,7 +106,7 @@ static READ8_HANDLER( drgnmst_snd_flag_r )
static WRITE8_HANDLER( drgnmst_pcm_banksel_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
/* This is a 4 bit port.
Each pair of bits is used in part of the OKI PCM ROM bank selectors.
See the Port 2 write handler below (drgnmst_snd_control_w) for details.
@@ -117,7 +117,7 @@ static WRITE8_HANDLER( drgnmst_pcm_banksel_w )
static WRITE8_HANDLER( drgnmst_oki_w )
{
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
state->oki_command = data;
}
@@ -146,7 +146,7 @@ static WRITE8_HANDLER( drgnmst_snd_control_w )
The OKI0 banks are pre-configured below in the driver init.
*/
- drgnmst_state *state = space->machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = space->machine().driver_data<drgnmst_state>();
int oki_new_bank;
state->oki_control = data;
@@ -379,7 +379,7 @@ GFXDECODE_END
static MACHINE_START( drgnmst )
{
- drgnmst_state *state = machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = machine.driver_data<drgnmst_state>();
state->save_item(NAME(state->snd_flag));
state->save_item(NAME(state->snd_command));
@@ -392,7 +392,7 @@ static MACHINE_START( drgnmst )
static MACHINE_RESET( drgnmst )
{
- drgnmst_state *state = machine->driver_data<drgnmst_state>();
+ drgnmst_state *state = machine.driver_data<drgnmst_state>();
state->snd_flag = 0;
state->snd_command = 0;
@@ -495,9 +495,9 @@ static UINT8 drgnmst_asciitohex( UINT8 data )
static DRIVER_INIT( drgnmst )
{
- UINT8 *drgnmst_PICROM_HEX = machine->region("user1")->base();
- UINT16 *drgnmst_PICROM = (UINT16 *)machine->region("audiocpu")->base();
- UINT8 *drgnmst_PCM = machine->region("oki1")->base();
+ UINT8 *drgnmst_PICROM_HEX = machine.region("user1")->base();
+ UINT16 *drgnmst_PICROM = (UINT16 *)machine.region("audiocpu")->base();
+ UINT8 *drgnmst_PCM = machine.region("oki1")->base();
INT32 offs, data;
UINT16 src_pos = 0;
UINT16 dst_pos = 0;
@@ -563,7 +563,7 @@ static DRIVER_INIT( drgnmst )
data_lo = drgnmst_asciitohex((drgnmst_PICROM_HEX[src_pos + 3]));
data |= (data_hi << 12) | (data_lo << 8);
- pic16c5x_set_config(machine->device("audiocpu"), data);
+ pic16c5x_set_config(machine.device("audiocpu"), data);
src_pos = 0x7fff; /* Force Exit */
}