mirror of
https://github.com/holub/mame
synced 2025-05-25 15:25:33 +03:00
Added running_machine callbacks for the Amiga code
This commit is contained in:
parent
b501c8dd73
commit
c9c8b50669
@ -157,7 +157,7 @@ static void serial_w(running_machine *machine, UINT16 data)
|
|||||||
*
|
*
|
||||||
*************************************/
|
*************************************/
|
||||||
|
|
||||||
static void alg_potgo_w(UINT16 data)
|
static void alg_potgo_w(running_machine *machine, UINT16 data)
|
||||||
{
|
{
|
||||||
/* bit 15 controls whether pin 9 is input/output */
|
/* bit 15 controls whether pin 9 is input/output */
|
||||||
/* bit 14 controls the value, which selects which player's controls to read */
|
/* bit 14 controls the value, which selects which player's controls to read */
|
||||||
|
@ -175,7 +175,7 @@ static INPUT_CHANGED( coin_changed_callback )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void arcadia_reset_coins(void)
|
static void arcadia_reset_coins(running_machine *machine)
|
||||||
{
|
{
|
||||||
/* reset coin counters */
|
/* reset coin counters */
|
||||||
coin_counter[0] = coin_counter[1] = 0;
|
coin_counter[0] = coin_counter[1] = 0;
|
||||||
|
@ -59,7 +59,7 @@ static UINT8 nvram_data_latch;
|
|||||||
*
|
*
|
||||||
*************************************/
|
*************************************/
|
||||||
|
|
||||||
static void upscope_reset(void)
|
static void upscope_reset(running_machine *machine)
|
||||||
{
|
{
|
||||||
prev_cia1_porta = 0xff;
|
prev_cia1_porta = 0xff;
|
||||||
}
|
}
|
||||||
|
@ -309,18 +309,18 @@ struct _amiga_machine_interface
|
|||||||
{
|
{
|
||||||
UINT32 chip_ram_mask;
|
UINT32 chip_ram_mask;
|
||||||
|
|
||||||
UINT16 (*joy0dat_r)(void);
|
UINT16 (*joy0dat_r)(running_machine *machine);
|
||||||
UINT16 (*joy1dat_r)(void);
|
UINT16 (*joy1dat_r)(running_machine *machine);
|
||||||
void (*potgo_w)(UINT16 data);
|
void (*potgo_w)(running_machine *machine, UINT16 data);
|
||||||
|
|
||||||
UINT16 (*dskbytr_r)(void);
|
UINT16 (*dskbytr_r)(running_machine *machine);
|
||||||
void (*dsklen_w)(UINT16 data);
|
void (*dsklen_w)(running_machine *machine, UINT16 data);
|
||||||
|
|
||||||
void (*serdat_w)(running_machine *, UINT16 data);
|
void (*serdat_w)(running_machine *machine, UINT16 data);
|
||||||
|
|
||||||
void (*scanline0_callback)(running_machine *);
|
void (*scanline0_callback)(running_machine *machine);
|
||||||
void (*reset_callback)(void);
|
void (*reset_callback)(running_machine *machine);
|
||||||
void (*nmi_callback)(void);
|
void (*nmi_callback)(running_machine *machine);
|
||||||
|
|
||||||
UINT32 flags;
|
UINT32 flags;
|
||||||
};
|
};
|
||||||
@ -342,10 +342,10 @@ struct _amiga_autoconfig_device
|
|||||||
UINT16 mfr_number; /* manufacturers number */
|
UINT16 mfr_number; /* manufacturers number */
|
||||||
UINT32 serial_number; /* serial number */
|
UINT32 serial_number; /* serial number */
|
||||||
UINT16 rom_vector; /* ROM vector offset */
|
UINT16 rom_vector; /* ROM vector offset */
|
||||||
UINT8 (*int_control_r)(void); /* interrupt control read */
|
UINT8 (*int_control_r)(running_machine *machine); /* interrupt control read */
|
||||||
void (*int_control_w)(UINT8 data); /* interrupt control write */
|
void (*int_control_w)(running_machine *machine, UINT8 data); /* interrupt control write */
|
||||||
void (*install)(offs_t base); /* memory installation */
|
void (*install)(running_machine *machine, offs_t base); /* memory installation */
|
||||||
void (*uninstall)(offs_t base); /* memory uninstallation */
|
void (*uninstall)(running_machine *machine, offs_t base); /* memory uninstallation */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ const char *const amiga_custom_names[0x100] =
|
|||||||
*************************************/
|
*************************************/
|
||||||
|
|
||||||
static void custom_reset(running_machine *machine);
|
static void custom_reset(running_machine *machine);
|
||||||
static void autoconfig_reset(void);
|
static void autoconfig_reset(running_machine *machine);
|
||||||
static TIMER_CALLBACK( amiga_irq_proc );
|
static TIMER_CALLBACK( amiga_irq_proc );
|
||||||
static TIMER_CALLBACK( amiga_blitter_proc );
|
static TIMER_CALLBACK( amiga_blitter_proc );
|
||||||
static TIMER_CALLBACK( scanline_callback );
|
static TIMER_CALLBACK( scanline_callback );
|
||||||
@ -284,7 +284,7 @@ static void amiga_m68k_reset(const device_config *device)
|
|||||||
devtag_reset(device->machine, CIA8520, "cia_0");
|
devtag_reset(device->machine, CIA8520, "cia_0");
|
||||||
devtag_reset(device->machine, CIA8520, "cia_1");
|
devtag_reset(device->machine, CIA8520, "cia_1");
|
||||||
custom_reset(device->machine);
|
custom_reset(device->machine);
|
||||||
autoconfig_reset();
|
autoconfig_reset(device->machine);
|
||||||
|
|
||||||
/* set the overlay bit */
|
/* set the overlay bit */
|
||||||
if ( IS_AGA(amiga_intf) )
|
if ( IS_AGA(amiga_intf) )
|
||||||
@ -309,7 +309,7 @@ MACHINE_RESET( amiga )
|
|||||||
|
|
||||||
/* call the system-specific callback */
|
/* call the system-specific callback */
|
||||||
if (amiga_intf->reset_callback)
|
if (amiga_intf->reset_callback)
|
||||||
(*amiga_intf->reset_callback)();
|
(*amiga_intf->reset_callback)(machine);
|
||||||
|
|
||||||
/* start the scanline timer */
|
/* start the scanline timer */
|
||||||
timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), NULL, 0, scanline_callback);
|
timer_set(machine, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), NULL, 0, scanline_callback);
|
||||||
@ -1175,12 +1175,12 @@ READ16_HANDLER( amiga_custom_r )
|
|||||||
|
|
||||||
case REG_JOY0DAT:
|
case REG_JOY0DAT:
|
||||||
if (amiga_intf->joy0dat_r != NULL)
|
if (amiga_intf->joy0dat_r != NULL)
|
||||||
return (*amiga_intf->joy0dat_r)();
|
return (*amiga_intf->joy0dat_r)(space->machine);
|
||||||
return input_port_read_safe(space->machine, "JOY0DAT", 0xffff);
|
return input_port_read_safe(space->machine, "JOY0DAT", 0xffff);
|
||||||
|
|
||||||
case REG_JOY1DAT:
|
case REG_JOY1DAT:
|
||||||
if (amiga_intf->joy1dat_r != NULL)
|
if (amiga_intf->joy1dat_r != NULL)
|
||||||
return (*amiga_intf->joy1dat_r)();
|
return (*amiga_intf->joy1dat_r)(space->machine);
|
||||||
return input_port_read_safe(space->machine, "JOY1DAT", 0xffff);
|
return input_port_read_safe(space->machine, "JOY1DAT", 0xffff);
|
||||||
|
|
||||||
case REG_ADKCONR:
|
case REG_ADKCONR:
|
||||||
@ -1197,7 +1197,7 @@ READ16_HANDLER( amiga_custom_r )
|
|||||||
|
|
||||||
case REG_DSKBYTR:
|
case REG_DSKBYTR:
|
||||||
if (amiga_intf->dskbytr_r != NULL)
|
if (amiga_intf->dskbytr_r != NULL)
|
||||||
return (*amiga_intf->dskbytr_r)();
|
return (*amiga_intf->dskbytr_r)(space->machine);
|
||||||
return 0x0000;
|
return 0x0000;
|
||||||
|
|
||||||
case REG_INTENAR:
|
case REG_INTENAR:
|
||||||
@ -1269,12 +1269,12 @@ WRITE16_HANDLER( amiga_custom_w )
|
|||||||
|
|
||||||
case REG_DSKLEN:
|
case REG_DSKLEN:
|
||||||
if (amiga_intf->dsklen_w != NULL)
|
if (amiga_intf->dsklen_w != NULL)
|
||||||
(*amiga_intf->dsklen_w)(data);
|
(*amiga_intf->dsklen_w)(space->machine, data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REG_POTGO:
|
case REG_POTGO:
|
||||||
if (amiga_intf->potgo_w != NULL)
|
if (amiga_intf->potgo_w != NULL)
|
||||||
(*amiga_intf->potgo_w)(data);
|
(*amiga_intf->potgo_w)(space->machine, data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case REG_SERDAT:
|
case REG_SERDAT:
|
||||||
@ -1532,7 +1532,7 @@ void amiga_add_autoconfig(running_machine *machine, const amiga_autoconfig_devic
|
|||||||
*
|
*
|
||||||
*************************************/
|
*************************************/
|
||||||
|
|
||||||
static void autoconfig_reset(void)
|
static void autoconfig_reset(running_machine *machine)
|
||||||
{
|
{
|
||||||
autoconfig_device *dev;
|
autoconfig_device *dev;
|
||||||
|
|
||||||
@ -1540,7 +1540,7 @@ static void autoconfig_reset(void)
|
|||||||
for (dev = autoconfig_list; dev; dev = dev->next)
|
for (dev = autoconfig_list; dev; dev = dev->next)
|
||||||
if (dev->base && dev->device.uninstall)
|
if (dev->base && dev->device.uninstall)
|
||||||
{
|
{
|
||||||
(*dev->device.uninstall)(dev->base);
|
(*dev->device.uninstall)(machine, dev->base);
|
||||||
dev->base = 0;
|
dev->base = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1672,7 +1672,7 @@ READ16_HANDLER( amiga_autoconfig_r )
|
|||||||
case 0x40/4:
|
case 0x40/4:
|
||||||
byte = 0x00;
|
byte = 0x00;
|
||||||
if (cur_autoconfig->device.int_control_r)
|
if (cur_autoconfig->device.int_control_r)
|
||||||
byte = (*cur_autoconfig->device.int_control_r)();
|
byte = (*cur_autoconfig->device.int_control_r)(space->machine);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -1731,7 +1731,7 @@ WRITE16_HANDLER( amiga_autoconfig_w )
|
|||||||
{
|
{
|
||||||
logerror("Install to %06X\n", cur_autoconfig->base);
|
logerror("Install to %06X\n", cur_autoconfig->base);
|
||||||
if (cur_autoconfig->base && cur_autoconfig->device.install)
|
if (cur_autoconfig->base && cur_autoconfig->device.install)
|
||||||
(*cur_autoconfig->device.install)(cur_autoconfig->base);
|
(*cur_autoconfig->device.install)(space->machine, cur_autoconfig->base);
|
||||||
cur_autoconfig = cur_autoconfig->next;
|
cur_autoconfig = cur_autoconfig->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user