summaryrefslogtreecommitdiffstats
path: root/src/mame/drivers/gridlee.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/gridlee.c')
-rw-r--r--src/mame/drivers/gridlee.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/mame/drivers/gridlee.c b/src/mame/drivers/gridlee.c
index ac561c3171d..eafd070a7b0 100644
--- a/src/mame/drivers/gridlee.c
+++ b/src/mame/drivers/gridlee.c
@@ -89,7 +89,7 @@
/* local prototypes */
-static void poly17_init(running_machine *machine);
+static void poly17_init(running_machine &machine);
/*************************************
*
@@ -105,18 +105,18 @@ static TIMER_CALLBACK( irq_off_tick )
static TIMER_CALLBACK( irq_timer_tick )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
/* next interrupt after scanline 256 is scanline 64 */
if (param == 256)
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(64), 64);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(64), 64);
else
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(param + 64), param + 64);
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(param + 64), param + 64);
/* IRQ starts on scanline 0, 64, 128, etc. */
cputag_set_input_line(machine, "maincpu", M6809_IRQ_LINE, ASSERT_LINE);
/* it will turn off on the next HBLANK */
- state->irq_off->adjust(machine->primary_screen->time_until_pos(param, GRIDLEE_HBSTART));
+ state->irq_off->adjust(machine.primary_screen->time_until_pos(param, GRIDLEE_HBSTART));
}
@@ -128,21 +128,21 @@ static TIMER_CALLBACK( firq_off_tick )
static TIMER_CALLBACK( firq_timer_tick )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
/* same time next frame */
- state->firq_timer->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE));
+ state->firq_timer->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE));
/* IRQ starts on scanline FIRQ_SCANLINE? */
cputag_set_input_line(machine, "maincpu", M6809_FIRQ_LINE, ASSERT_LINE);
/* it will turn off on the next HBLANK */
- state->firq_off->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE, GRIDLEE_HBSTART));
+ state->firq_off->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE, GRIDLEE_HBSTART));
}
static MACHINE_START( gridlee )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
- state->maincpu = machine->device<cpu_device>("maincpu");
+ gridlee_state *state = machine.driver_data<gridlee_state>();
+ state->maincpu = machine.device<cpu_device>("maincpu");
/* create the polynomial tables */
poly17_init(machine);
@@ -150,19 +150,19 @@ static MACHINE_START( gridlee )
state_save_register_global_array(machine, state->last_analog_input);
state_save_register_global_array(machine, state->last_analog_output);
- state->irq_off = machine->scheduler().timer_alloc(FUNC(irq_off_tick));
- state->irq_timer = machine->scheduler().timer_alloc(FUNC(irq_timer_tick));
- state->firq_off = machine->scheduler().timer_alloc(FUNC(firq_off_tick));
- state->firq_timer = machine->scheduler().timer_alloc(FUNC(firq_timer_tick));
+ state->irq_off = machine.scheduler().timer_alloc(FUNC(irq_off_tick));
+ state->irq_timer = machine.scheduler().timer_alloc(FUNC(irq_timer_tick));
+ state->firq_off = machine.scheduler().timer_alloc(FUNC(firq_off_tick));
+ state->firq_timer = machine.scheduler().timer_alloc(FUNC(firq_timer_tick));
}
static MACHINE_RESET( gridlee )
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
/* start timers to generate interrupts */
- state->irq_timer->adjust(machine->primary_screen->time_until_pos(0));
- state->firq_timer->adjust(machine->primary_screen->time_until_pos(FIRQ_SCANLINE));
+ state->irq_timer->adjust(machine.primary_screen->time_until_pos(0));
+ state->firq_timer->adjust(machine.primary_screen->time_until_pos(FIRQ_SCANLINE));
}
@@ -175,13 +175,13 @@ static MACHINE_RESET( gridlee )
static READ8_HANDLER( analog_port_r )
{
- gridlee_state *state = space->machine->driver_data<gridlee_state>();
+ gridlee_state *state = space->machine().driver_data<gridlee_state>();
int delta, sign, magnitude;
UINT8 newval;
static const char *const portnames[] = { "TRACK0_Y", "TRACK0_X", "TRACK1_Y", "TRACK1_X" };
/* first read the new trackball value and compute the signed delta */
- newval = input_port_read(space->machine, portnames[offset + 2 * state->cocktail_flip]);
+ newval = input_port_read(space->machine(), portnames[offset + 2 * state->cocktail_flip]);
delta = (int)newval - (int)state->last_analog_input[offset];
/* handle the case where we wrap around from 0x00 to 0xff, or vice versa */
@@ -226,9 +226,9 @@ static READ8_HANDLER( analog_port_r )
#define POLY17_SHR 10
#define POLY17_ADD 0x18000
-static void poly17_init(running_machine *machine)
+static void poly17_init(running_machine &machine)
{
- gridlee_state *state = machine->driver_data<gridlee_state>();
+ gridlee_state *state = machine.driver_data<gridlee_state>();
UINT32 i, x = 0;
UINT8 *p, *r;
@@ -258,7 +258,7 @@ static void poly17_init(running_machine *machine)
static READ8_HANDLER( random_num_r )
{
- gridlee_state *state = space->machine->driver_data<gridlee_state>();
+ gridlee_state *state = space->machine().driver_data<gridlee_state>();
UINT32 cc;
/* CPU runs at 1.25MHz, noise source at 100kHz --> multiply by 12.5 */
@@ -279,21 +279,21 @@ static READ8_HANDLER( random_num_r )
static WRITE8_HANDLER( led_0_w )
{
- set_led_status(space->machine, 0, data & 1);
+ set_led_status(space->machine(), 0, data & 1);
logerror("LED 0 %s\n", (data & 1) ? "on" : "off");
}
static WRITE8_HANDLER( led_1_w )
{
- set_led_status(space->machine, 1, data & 1);
+ set_led_status(space->machine(), 1, data & 1);
logerror("LED 1 %s\n", (data & 1) ? "on" : "off");
}
static WRITE8_HANDLER( gridlee_coin_counter_w )
{
- coin_counter_w(space->machine, 0, data & 1);
+ coin_counter_w(space->machine(), 0, data & 1);
logerror("coin counter %s\n", (data & 1) ? "on" : "off");
}