summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/cd32.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/cd32.c')
-rw-r--r--src/mame/drivers/cd32.c104
1 files changed, 52 insertions, 52 deletions
diff --git a/src/mame/drivers/cd32.c b/src/mame/drivers/cd32.c
index 0e097900e95..af92b1ca24e 100644
--- a/src/mame/drivers/cd32.c
+++ b/src/mame/drivers/cd32.c
@@ -46,7 +46,7 @@
#define MGNUMBER_USE_JOY 1
-static void handle_cd32_joystick_cia(running_machine *machine, UINT8 pra, UINT8 dra);
+static void handle_cd32_joystick_cia(running_machine &machine, UINT8 pra, UINT8 dra);
static WRITE32_HANDLER( aga_overlay_w )
{
@@ -55,7 +55,7 @@ static WRITE32_HANDLER( aga_overlay_w )
data = (data >> 16) & 1;
/* switch banks as appropriate */
- memory_set_bank(space->machine, "bank1", data & 1);
+ memory_set_bank(space->machine(), "bank1", data & 1);
/* swap the write handlers between ROM and bank 1 based on the bit */
if ((data & 1) == 0)
@@ -85,12 +85,12 @@ static WRITE32_HANDLER( aga_overlay_w )
static WRITE8_DEVICE_HANDLER( cd32_cia_0_porta_w )
{
/* bit 1 = cd audio mute */
- device->machine->device<cdda_device>("cdda")->set_output_gain( 0, ( data & 1 ) ? 0.0 : 1.0 );
+ device->machine().device<cdda_device>("cdda")->set_output_gain( 0, ( data & 1 ) ? 0.0 : 1.0 );
/* bit 2 = Power Led on Amiga */
- set_led_status(device->machine, 0, (data & 2) ? 0 : 1);
+ set_led_status(device->machine(), 0, (data & 2) ? 0 : 1);
- handle_cd32_joystick_cia(device->machine, data, mos6526_r(device, 2));
+ handle_cd32_joystick_cia(device->machine(), data, mos6526_r(device, 2));
}
/*************************************
@@ -111,14 +111,14 @@ static WRITE8_DEVICE_HANDLER( cd32_cia_0_porta_w )
static READ8_DEVICE_HANDLER( cd32_cia_0_portb_r )
{
/* parallel port */
- logerror("%s:CIA0_portb_r\n", device->machine->describe_context());
+ logerror("%s:CIA0_portb_r\n", device->machine().describe_context());
return 0xff;
}
static WRITE8_DEVICE_HANDLER( cd32_cia_0_portb_w )
{
/* parallel port */
- logerror("%s:CIA0_portb_w(%02x)\n", device->machine->describe_context(), data);
+ logerror("%s:CIA0_portb_w(%02x)\n", device->machine().describe_context(), data);
}
static ADDRESS_MAP_START( cd32_map, AS_PROGRAM, 32 )
@@ -141,9 +141,9 @@ ADDRESS_MAP_END
*
*************************************/
-static void cd32_potgo_w(running_machine *machine, UINT16 data)
+static void cd32_potgo_w(running_machine &machine, UINT16 data)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
int i;
if (state->input_hack != NULL)
@@ -171,9 +171,9 @@ static void cd32_potgo_w(running_machine *machine, UINT16 data)
}
}
-static void handle_cd32_joystick_cia(running_machine *machine, UINT8 pra, UINT8 dra)
+static void handle_cd32_joystick_cia(running_machine &machine, UINT8 pra, UINT8 dra)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
int i;
for (i = 0; i < 2; i++)
@@ -198,9 +198,9 @@ static void handle_cd32_joystick_cia(running_machine *machine, UINT8 pra, UINT8
}
}
-static UINT16 handle_joystick_potgor(running_machine *machine, UINT16 potgor)
+static UINT16 handle_joystick_potgor(running_machine &machine, UINT16 potgor)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
static const char *const player_portname[] = { "P2", "P1" };
int i;
@@ -230,8 +230,8 @@ static UINT16 handle_joystick_potgor(running_machine *machine, UINT16 potgor)
static CUSTOM_INPUT(cubo_input)
{
- cd32_state *state = field->port->machine->driver_data<cd32_state>();
- return handle_joystick_potgor(field->port->machine, state->potgo_value) >> 10;
+ cd32_state *state = field->port->machine().driver_data<cd32_state>();
+ return handle_joystick_potgor(field->port->machine(), state->potgo_value) >> 10;
}
static INPUT_PORTS_START( cd32 )
@@ -825,7 +825,7 @@ ROM_END
static DRIVER_INIT( cd32 )
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
static const amiga_machine_interface cd32_intf =
{
AGA_CHIP_RAM_MASK,
@@ -841,7 +841,7 @@ static DRIVER_INIT( cd32 )
/* set up memory */
memory_configure_bank(machine, "bank1", 0, 1, state->chip_ram, 0);
- memory_configure_bank(machine, "bank1", 1, 1, machine->region("user1")->base(), 0);
+ memory_configure_bank(machine, "bank1", 1, 1, machine.region("user1")->base(), 0);
/* input hack */
state->input_hack = NULL;
@@ -1221,35 +1221,35 @@ ROM_END
*
*************************************/
-static void cndypuzl_input_hack(running_machine *machine)
+static void cndypuzl_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//(*state->chip_ram_w)(0x051c02, 0x0000);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
(*state->chip_ram_w)(state, r_A5 - 0x7ebe, 0x0000);
}
}
static DRIVER_INIT(cndypuzl)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = cndypuzl_input_hack;
}
-static void haremchl_input_hack(running_machine *machine)
+static void haremchl_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x002907, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7f00 + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7f00 + 2));
amiga_chip_ram_w8(state, r_A2 + 0x1f, 0x00);
}
@@ -1257,20 +1257,20 @@ static void haremchl_input_hack(running_machine *machine)
static DRIVER_INIT(haremchl)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = haremchl_input_hack;
}
-static void lsrquiz_input_hack(running_machine *machine)
+static void lsrquiz_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x001e1b, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7fe0 + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7fe0 + 2));
amiga_chip_ram_w8(state, r_A2 + 0x13, 0x00);
}
@@ -1278,21 +1278,21 @@ static void lsrquiz_input_hack(running_machine *machine)
static DRIVER_INIT(lsrquiz)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = lsrquiz_input_hack;
}
/* The hack isn't working if you exit the test mode with P1 button 2 ! */
-static void lsrquiz2_input_hack(running_machine *machine)
+static void lsrquiz2_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x046107, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7fdc + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7fdc + 2));
amiga_chip_ram_w8(state, r_A2 + 0x17, 0x00);
}
@@ -1300,20 +1300,20 @@ static void lsrquiz2_input_hack(running_machine *machine)
static DRIVER_INIT(lsrquiz2)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = lsrquiz2_input_hack;
}
-static void lasstixx_input_hack(running_machine *machine)
+static void lasstixx_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x00281c, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
UINT32 r_A2 = ((*state->chip_ram_r)(state, r_A5 - 0x7fa2 + 0) << 16) | ((*state->chip_ram_r)(state, r_A5 - 0x7fa2 + 2));
amiga_chip_ram_w8(state, r_A2 + 0x24, 0x00);
}
@@ -1321,47 +1321,47 @@ static void lasstixx_input_hack(running_machine *machine)
static DRIVER_INIT(lasstixx)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = lasstixx_input_hack;
}
-static void mgnumber_input_hack(running_machine *machine)
+static void mgnumber_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//(*state->chip_ram_w)(0x04bfa0, 0x0000);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
(*state->chip_ram_w)(state, r_A5 - 0x7ed8, 0x0000);
}
}
static DRIVER_INIT(mgnumber)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = mgnumber_input_hack;
}
-static void mgprem11_input_hack(running_machine *machine)
+static void mgprem11_input_hack(running_machine &machine)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
- if (cpu_get_pc(machine->device("maincpu")) < state->chip_ram_size)
+ if (cpu_get_pc(machine.device("maincpu")) < state->chip_ram_size)
{
//amiga_chip_ram_w8(state, 0x044f7e, 0x00);
- UINT32 r_A5 = cpu_get_reg(machine->device("maincpu"), M68K_A5);
+ UINT32 r_A5 = cpu_get_reg(machine.device("maincpu"), M68K_A5);
amiga_chip_ram_w8(state, r_A5 - 0x7eca, 0x00);
}
}
static DRIVER_INIT(mgprem11)
{
- cd32_state *state = machine->driver_data<cd32_state>();
+ cd32_state *state = machine.driver_data<cd32_state>();
DRIVER_INIT_CALL(cd32);
state->input_hack = mgprem11_input_hack;
}