summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/dsp56k
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-11-06 18:42:37 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-11-06 18:42:37 +0000
commitb44da3b748d0ef6fa95e1c39f556e5e3cff5169b (patch)
tree2a7acc4cfab418620bfc99ec6f460f32475bb934 /src/emu/cpu/dsp56k
parent1228d0ad9ea3fa2fb7a3b88357ba286247fc8826 (diff)
WARNING: This is a significant change. If you are risk-averse and
working on something, hold off syncing. Defined macros for core CPU functions: CPU_INIT, CPU_RESET, CPU_EXIT, CPU_EXECUTE, along with macros for the name and for calling, in the spirit of the devintrf.h macros. More will come later. Changed init, reset, exit, and execute interfaces to be passed a const device_config * object. This is a fake object for the moment, but encapsulates the machine pointer and token. Eventually this will be a real device. Changed the CPU IRQ callbacks to a proper type, and added a device parameter to them. Updated all CPU cores to the new macros and parameters. Note that this changes the way we "pointer"-ify cores. I'll send an update shortly.
Diffstat (limited to 'src/emu/cpu/dsp56k')
-rw-r--r--src/emu/cpu/dsp56k/dsp56def.h2
-rw-r--r--src/emu/cpu/dsp56k/dsp56k.c26
2 files changed, 15 insertions, 13 deletions
diff --git a/src/emu/cpu/dsp56k/dsp56def.h b/src/emu/cpu/dsp56k/dsp56def.h
index 6ec50d6fc63..3cb6ac5bf77 100644
--- a/src/emu/cpu/dsp56k/dsp56def.h
+++ b/src/emu/cpu/dsp56k/dsp56def.h
@@ -46,7 +46,7 @@
/***************************************************************************
PCU
***************************************************************************/
-static void pcu_reset(void);
+static CPU_RESET( pcu );
#define PC (core.PCU.pc)
#define LA (core.PCU.la)
#define LC (core.PCU.lc)
diff --git a/src/emu/cpu/dsp56k/dsp56k.c b/src/emu/cpu/dsp56k/dsp56k.c
index 0ed44f98a7e..8c3bf2255e9 100644
--- a/src/emu/cpu/dsp56k/dsp56k.c
+++ b/src/emu/cpu/dsp56k/dsp56k.c
@@ -38,9 +38,9 @@
/***************************************************************************
LOCAL DECLARATIONS
***************************************************************************/
-static void dsp56k_init(int index, int clock, const void *_config, int (*irqcallback)(int));
-static void dsp56k_reset(void);
-static void dsp56k_exit(void);
+static CPU_INIT( dsp56k );
+static CPU_RESET( dsp56k );
+static CPU_EXIT( dsp56k );
/***************************************************************************
MACROS
@@ -208,6 +208,7 @@ typedef struct
UINT32 op;
int interrupt_cycles;
void (*output_pins_changed)(UINT32 pins);
+ const device_config *device;
} dsp56k_core;
@@ -333,7 +334,7 @@ static void set_irq_line(int irqline, int state)
{
/* If it changes state from asserted to cleared. Call the reset function. */
if (core.reset_state == TRUE)
- dsp56k_reset();
+ cpu_reset_dsp56k(core.device);
core.reset_state = FALSE;
}
@@ -377,7 +378,7 @@ static void dsp56k_set_context(void *src)
/***************************************************************************
INITIALIZATION AND SHUTDOWN
***************************************************************************/
-static void dsp56k_init(int index, int clock, const void *_config, int (*irqcallback)(int))
+static CPU_INIT( dsp56k )
{
// Call specific module inits
pcu_init(index);
@@ -399,6 +400,7 @@ static void dsp56k_init(int index, int clock, const void *_config, int (*irqcall
//core.config = _config;
//core.irq_callback = irqcallback;
+ core.device = device;
}
static void agu_reset(void)
@@ -431,7 +433,7 @@ static void alu_reset(void)
}
-static void dsp56k_reset(void)
+static CPU_RESET( dsp56k )
{
logerror("Dsp56k reset\n");
@@ -451,7 +453,7 @@ static void dsp56k_reset(void)
}
-static void dsp56k_exit(void)
+static CPU_EXIT( dsp56k )
{
}
@@ -468,7 +470,7 @@ static void dsp56k_exit(void)
CORE EXECUTION LOOP
***************************************************************************/
-static int dsp56k_execute(int cycles)
+static CPU_EXECUTE( dsp56k )
{
/* If reset line is asserted, do nothing */
if (core.reset_state)
@@ -675,10 +677,10 @@ void dsp56k_get_info(UINT32 state, cpuinfo *info)
case CPUINFO_PTR_SET_INFO: info->setinfo = dsp56k_set_info; break;
case CPUINFO_PTR_GET_CONTEXT: info->getcontext = dsp56k_get_context; break;
case CPUINFO_PTR_SET_CONTEXT: info->setcontext = dsp56k_set_context; break;
- case CPUINFO_PTR_INIT: info->init = dsp56k_init; break;
- case CPUINFO_PTR_RESET: info->reset = dsp56k_reset; break;
- case CPUINFO_PTR_EXIT: info->exit = dsp56k_exit; break;
- case CPUINFO_PTR_EXECUTE: info->execute = dsp56k_execute; break;
+ case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(dsp56k); break;
+ case CPUINFO_PTR_RESET: info->reset = CPU_RESET_NAME(dsp56k); break;
+ case CPUINFO_PTR_EXIT: info->exit = CPU_EXIT_NAME(dsp56k); break;
+ case CPUINFO_PTR_EXECUTE: info->execute = CPU_EXECUTE_NAME(dsp56k); break;
case CPUINFO_PTR_BURN: info->burn = NULL; break;
case CPUINFO_PTR_DISASSEMBLE: info->disassemble = dsp56k_dasm; break;
case CPUINFO_PTR_DEBUG_SETUP_COMMANDS: info->setup_commands = NULL; break;