summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/adsp2100/adsp2100.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-12-18 08:28:50 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-12-18 08:28:50 +0000
commitcf9fc5861805c5e344fab6e96d084a372c2683aa (patch)
treed1fd7dd4b3d409b5cdc49be0441a5fccee7e2188 /src/emu/cpu/adsp2100/adsp2100.c
parentd9fbf0dba5d2e98f1fe0a2f7107ac17db1146e03 (diff)
Made the concept of a "clock" native to devices. The clock is now
specified when the device is added, and the clock is available in the device_config directly via device->clock. Updated all devices that have a clock to specify it when adding the device, rather than as part of their configuration. As part of this work, also created device-specific _ADD and _REMOVE macros to simplify configuration. Dfined a generic device execute function callback, though it is not used yet. The long term plan is that any device with an execute callback will be scheduled along with the CPUs. Now that CPUs are devices, their scheduling will be moved over to this logic eventually. Changed various NVRAM devices to fetch their default memory region from the device->region rather than specifying it in the configuration. Moved a number of CPUINFO_PTR_* constants to CPUINFO_FCT_*. Fixed several drivers that manually created their own gfx_elements to fill in the machine object, so they no longer crash. Fixed incorrect CPU display on info screen (recently broken). Moved device startup to *before* the DRIVER_INIT is called. This is to allow the DRIVER_INIT to configure devices that have been properly allocated. So far I don't see any negative effects, but be on the lookout if something weird shows up. Rewrote the device iteration logic to make use of the typenext field and the newly-introduced classnext field for iterating more efficiently through devices of a given type or class. Fixed behavior of MDRV_CPU_REPLACE so it does not delete and then re-add a CPU (causing the order to change).
Diffstat (limited to 'src/emu/cpu/adsp2100/adsp2100.c')
-rw-r--r--src/emu/cpu/adsp2100/adsp2100.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/emu/cpu/adsp2100/adsp2100.c b/src/emu/cpu/adsp2100/adsp2100.c
index 853cf23bae9..c6a2922c057 100644
--- a/src/emu/cpu/adsp2100/adsp2100.c
+++ b/src/emu/cpu/adsp2100/adsp2100.c
@@ -2111,9 +2111,9 @@ static CPU_SET_INFO( adsp2101 )
case CPUINFO_INT_INPUT_STATE + ADSP2101_TIMER: set_irq_line(adsp, ADSP2101_TIMER, info->i); break;
/* --- the following bits of info are set as pointers to data or functions --- */
- case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break;
- case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break;
- case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break;
default:
CPU_SET_INFO_CALL(adsp21xx);
@@ -2139,9 +2139,9 @@ CPU_GET_INFO( adsp2101 )
case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(adsp2101); break;
case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp2101); break;
- case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break;
- case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break;
- case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break;
+ case CPUINFO_FCT_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break;
+ case CPUINFO_FCT_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break;
+ case CPUINFO_FCT_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2101"); break;
@@ -2186,9 +2186,9 @@ static CPU_SET_INFO( adsp2104 )
case CPUINFO_INT_INPUT_STATE + ADSP2104_TIMER: set_irq_line(adsp, ADSP2104_TIMER, info->i); break;
/* --- the following bits of info are set as pointers to data or functions --- */
- case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break;
- case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break;
- case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break;
default:
CPU_SET_INFO_CALL(adsp21xx);
@@ -2214,9 +2214,9 @@ CPU_GET_INFO( adsp2104 )
case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(adsp2104); break;
case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp2104); break;
- case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break;
- case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break;
- case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break;
+ case CPUINFO_FCT_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break;
+ case CPUINFO_FCT_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break;
+ case CPUINFO_FCT_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2104"); break;
@@ -2258,9 +2258,9 @@ static CPU_SET_INFO( adsp2105 )
case CPUINFO_INT_INPUT_STATE + ADSP2105_IRQ2: set_irq_line(adsp, ADSP2105_IRQ2, info->i); break;
/* --- the following bits of info are set as pointers to data or functions --- */
- case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break;
- case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break;
- case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break;
default:
CPU_SET_INFO_CALL(adsp21xx);
@@ -2283,9 +2283,9 @@ CPU_GET_INFO( adsp2105 )
case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(adsp2105); break;
case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp2105); break;
- case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break;
- case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break;
- case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break;
+ case CPUINFO_FCT_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break;
+ case CPUINFO_FCT_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break;
+ case CPUINFO_FCT_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2105"); break;
@@ -2330,9 +2330,9 @@ static CPU_SET_INFO( adsp2115 )
case CPUINFO_INT_INPUT_STATE + ADSP2115_TIMER: set_irq_line(adsp, ADSP2115_TIMER, info->i); break;
/* --- the following bits of info are set as pointers to data or functions --- */
- case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break;
- case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break;
- case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break;
default:
CPU_SET_INFO_CALL(adsp21xx);
@@ -2358,9 +2358,9 @@ CPU_GET_INFO( adsp2115 )
case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(adsp2115); break;
case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp2115); break;
- case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break;
- case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break;
- case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break;
+ case CPUINFO_FCT_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break;
+ case CPUINFO_FCT_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break;
+ case CPUINFO_FCT_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2115"); break;
@@ -2408,9 +2408,9 @@ static CPU_SET_INFO( adsp2181 )
case CPUINFO_INT_INPUT_STATE + ADSP2181_IRQL2: set_irq_line(adsp, ADSP2181_IRQL2, info->i); break;
/* --- the following bits of info are set as pointers to data or functions --- */
- case CPUINFO_PTR_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break;
- case CPUINFO_PTR_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break;
- case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_RX_HANDLER: adsp->sport_rx_callback = (adsp21xx_rx_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_TX_HANDLER: adsp->sport_tx_callback = (adsp21xx_tx_func)info->f; break;
+ case CPUINFO_FCT_ADSP2100_TIMER_HANDLER: adsp->timer_fired = (adsp21xx_timer_func)info->f; break;
default:
CPU_SET_INFO_CALL(adsp21xx);
@@ -2443,9 +2443,9 @@ CPU_GET_INFO( adsp2181 )
case CPUINFO_PTR_INIT: info->init = CPU_INIT_NAME(adsp2181); break;
case CPUINFO_PTR_SET_INFO: info->setinfo = CPU_SET_INFO_NAME(adsp2181); break;
- case CPUINFO_PTR_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break;
- case CPUINFO_PTR_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break;
- case CPUINFO_PTR_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break;
+ case CPUINFO_FCT_ADSP2100_RX_HANDLER: info->f = (genf *)adsp->sport_rx_callback; break;
+ case CPUINFO_FCT_ADSP2100_TX_HANDLER: info->f = (genf *)adsp->sport_tx_callback; break;
+ case CPUINFO_FCT_ADSP2100_TIMER_HANDLER: info->f = (genf *)adsp->timer_fired; break;
/* --- the following bits of info are returned as NULL-terminated strings --- */
case CPUINFO_STR_NAME: strcpy(info->s, "ADSP2181"); break;