mirror of
https://github.com/holub/mame
synced 2025-05-28 16:43:04 +03:00
First step in supporting master cycle delays in the SNES driver [Angelo Salese]
This commit is contained in:
parent
d48e9a885f
commit
13c095c03c
@ -100,7 +100,7 @@ INLINE g65816i_cpu_struct *get_safe_token(running_device *device)
|
||||
assert(device != NULL);
|
||||
assert(device->token != NULL);
|
||||
assert(device->type == CPU);
|
||||
assert(cpu_get_type(device) == CPU_G65816);
|
||||
assert(cpu_get_type(device) == CPU_G65816 || cpu_get_type(device) == CPU_5A22);
|
||||
return (g65816i_cpu_struct *)device->token;
|
||||
}
|
||||
|
||||
@ -339,6 +339,7 @@ static CPU_INIT( g65816 )
|
||||
g65816_set_irq_callback(cpustate, irqcallback);
|
||||
cpustate->device = device;
|
||||
cpustate->program = device->space(AS_PROGRAM);
|
||||
cpustate->cpu_type = CPU_TYPE_G65816;
|
||||
|
||||
state_save_register_device_item(device, 0, cpustate->a);
|
||||
state_save_register_device_item(device, 0, cpustate->b);
|
||||
@ -523,6 +524,34 @@ CPU_GET_INFO( g65816 )
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
SNES specific, used to handle master cycles
|
||||
*/
|
||||
|
||||
static CPU_INIT( 5a22 )
|
||||
{
|
||||
g65816i_cpu_struct *cpustate = get_safe_token(device);
|
||||
|
||||
CPU_INIT_CALL(g65816);
|
||||
|
||||
cpustate->cpu_type = CPU_TYPE_5A22;
|
||||
}
|
||||
|
||||
|
||||
CPU_GET_INFO( 5a22 )
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
/* --- the following bits of info are returned as pointers to data or functions --- */
|
||||
case CPUINFO_FCT_INIT: info->init = CPU_INIT_NAME(5a22); break;
|
||||
|
||||
/* --- the following bits of info are returned as NULL-terminated strings --- */
|
||||
case DEVINFO_STR_NAME: strcpy(info->s, "5A22"); break;
|
||||
|
||||
default: CPU_GET_INFO_CALL(g65816); break;
|
||||
}
|
||||
}
|
||||
|
||||
/* ======================================================================== */
|
||||
/* ============================== END OF FILE ============================= */
|
||||
/* ======================================================================== */
|
||||
|
@ -59,6 +59,12 @@ enum
|
||||
/* Main interface function */
|
||||
CPU_GET_INFO( g65816 );
|
||||
#define CPU_G65816 CPU_GET_INFO_NAME( g65816 )
|
||||
CPU_GET_INFO( 5a22 );
|
||||
#define CPU_5A22 CPU_GET_INFO_NAME( 5a22 )
|
||||
|
||||
#define CPU_TYPE_G65816 0
|
||||
#define CPU_TYPE_5A22 1
|
||||
|
||||
|
||||
void g65816_set_read_vector_callback(running_device *device, read8_space_func read_vector);
|
||||
|
||||
|
@ -106,6 +106,7 @@ struct _g65816i_cpu_struct
|
||||
uint source;
|
||||
uint destination;
|
||||
int ICount;
|
||||
int cpu_type;
|
||||
};
|
||||
|
||||
extern void (*const *const g65816i_opcodes[])(g65816i_cpu_struct *cpustate);
|
||||
@ -242,7 +243,7 @@ INLINE void g65816i_set_execution_mode(g65816i_cpu_struct *cpustate, uint mode)
|
||||
#define CLK_W_S 2
|
||||
#define CLK_W_SIY 5
|
||||
|
||||
#define CLK(A) CLOCKS -= (A)
|
||||
#define CLK(A) CLOCKS -= (cpustate->cpu_type == CPU_TYPE_G65816 ? A : A*6)
|
||||
#define USE_ALL_CLKS() CLOCKS = 0
|
||||
|
||||
|
||||
|
@ -449,7 +449,7 @@ static MACHINE_DRIVER_START( snes )
|
||||
MDRV_DRIVER_DATA(snes_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", G65816, 3580000) /* 2.68Mhz, also 3.58Mhz */
|
||||
MDRV_CPU_ADD("maincpu", 5A22, 3580000*6) /* 2.68Mhz, also 3.58Mhz */
|
||||
MDRV_CPU_PROGRAM_MAP(snes_map)
|
||||
|
||||
MDRV_CPU_ADD("soundcpu", SPC700, 2048000/2) /* 2.048 Mhz, but internal divider */
|
||||
|
@ -503,7 +503,7 @@ static MACHINE_DRIVER_START( kinstb )
|
||||
MDRV_DRIVER_DATA(snes_state)
|
||||
|
||||
/* basic machine hardware */
|
||||
MDRV_CPU_ADD("maincpu", G65816, 3580000) /* 2.68Mhz, also 3.58Mhz */
|
||||
MDRV_CPU_ADD("maincpu", 5A22, 3580000*6) /* 2.68Mhz, also 3.58Mhz */
|
||||
MDRV_CPU_PROGRAM_MAP(snesb_map)
|
||||
|
||||
/* audio CPU */
|
||||
|
Loading…
Reference in New Issue
Block a user