summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2018-12-09 16:17:38 -0500
committer AJR <ajrhacker@users.noreply.github.com>2018-12-09 16:17:38 -0500
commit5ecf738de3d8cf0a78fb0105fe322db3e58ec5ae (patch)
tree6bb3d095bcbee45e76bd44eae624cccdb0f771ea
parentb118c0e547729e1d38ec807365e57595a05b6909 (diff)
h8: Internal MCFG elimination (nw)
-rw-r--r--src/devices/cpu/h8/h83002.cpp47
-rw-r--r--src/devices/cpu/h8/h83003.cpp51
-rw-r--r--src/devices/cpu/h8/h83006.cpp47
-rw-r--r--src/devices/cpu/h8/h83008.cpp45
-rw-r--r--src/devices/cpu/h8/h83048.cpp49
-rw-r--r--src/devices/cpu/h8/h83337.cpp41
-rw-r--r--src/devices/cpu/h8/h8_adc.h52
-rw-r--r--src/devices/cpu/h8/h8_dma.h23
-rw-r--r--src/devices/cpu/h8/h8_dtc.h9
-rw-r--r--src/devices/cpu/h8/h8_intc.h15
-rw-r--r--src/devices/cpu/h8/h8_port.h9
-rw-r--r--src/devices/cpu/h8/h8_sci.h9
-rw-r--r--src/devices/cpu/h8/h8_timer16.h41
-rw-r--r--src/devices/cpu/h8/h8_timer8.h20
-rw-r--r--src/devices/cpu/h8/h8_watchdog.h9
-rw-r--r--src/devices/cpu/h8/h8s2245.cpp62
-rw-r--r--src/devices/cpu/h8/h8s2320.cpp83
-rw-r--r--src/devices/cpu/h8/h8s2357.cpp75
-rw-r--r--src/devices/cpu/h8/h8s2655.cpp75
19 files changed, 389 insertions, 373 deletions
diff --git a/src/devices/cpu/h8/h83002.cpp b/src/devices/cpu/h8/h83002.cpp
index e760056eaf2..8a9a18f0678 100644
--- a/src/devices/cpu/h8/h83002.cpp
+++ b/src/devices/cpu/h8/h83002.cpp
@@ -137,30 +137,31 @@ void h83002_device::map(address_map &map)
map(0xfffff8, 0xfffff9).rw("intc", FUNC(h8h_intc_device::icr_r), FUNC(h8h_intc_device::icr_w));
}
-MACHINE_CONFIG_START(h83002_device::device_add_mconfig)
- MCFG_H8H_INTC_ADD("intc")
- MCFG_H8_ADC_3337_ADD("adc", "intc", 60)
- MCFG_H8_DMA_ADD("dma")
+void h83002_device::device_add_mconfig(machine_config &config)
+{
+ H8H_INTC(config, "intc");
+ H8_ADC_3337(config, "adc", "intc", 60);
+ H8_DMA(config, "dma");
// (H8/2002.pdf) Table 8-11 DMAC Activation Sources
- MCFG_H8_DMA_CHANNEL_ADD("dma:0", "intc", 44, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE)
- MCFG_H8_DMA_CHANNEL_ADD("dma:1", "intc", 46, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE)
- MCFG_H8_PORT_ADD("port4", h8_device::PORT_4, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port6", h8_device::PORT_6, 0x80, 0x80)
- MCFG_H8_PORT_ADD("port7", h8_device::PORT_7, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port8", h8_device::PORT_8, 0xf0, 0xe0)
- MCFG_H8_PORT_ADD("port9", h8_device::PORT_9, 0x00, 0xc0)
- MCFG_H8_PORT_ADD("porta", h8_device::PORT_A, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portb", h8_device::PORT_B, 0x00, 0x00)
- MCFG_H8_TIMER16_ADD("timer16", 5, 0xe0)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:0", 2, 2, "intc", 24)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:1", 2, 2, "intc", 28)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:2", 2, 2, "intc", 32)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:3", 2, 2, "intc", 36)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:4", 2, 2, "intc", 40)
- MCFG_H8_SCI_ADD("sci0", "intc", 52, 53, 54, 55)
- MCFG_H8_SCI_ADD("sci1", "intc", 56, 57, 58, 59)
- MCFG_H8_WATCHDOG_ADD("watchdog", "intc", 20, h8_watchdog_device::H)
-MACHINE_CONFIG_END
+ H8_DMA_CHANNEL(config, "dma:0", "intc", 44, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53);
+ H8_DMA_CHANNEL(config, "dma:1", "intc", 46, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53);
+ H8_PORT(config, "port4", h8_device::PORT_4, 0x00, 0x00);
+ H8_PORT(config, "port6", h8_device::PORT_6, 0x80, 0x80);
+ H8_PORT(config, "port7", h8_device::PORT_7, 0x00, 0x00);
+ H8_PORT(config, "port8", h8_device::PORT_8, 0xf0, 0xe0);
+ H8_PORT(config, "port9", h8_device::PORT_9, 0x00, 0xc0);
+ H8_PORT(config, "porta", h8_device::PORT_A, 0x00, 0x00);
+ H8_PORT(config, "portb", h8_device::PORT_B, 0x00, 0x00);
+ H8_TIMER16(config, "timer16", 5, 0xe0);
+ H8H_TIMER16_CHANNEL(config, "timer16:0", 2, 2, "intc", 24);
+ H8H_TIMER16_CHANNEL(config, "timer16:1", 2, 2, "intc", 28);
+ H8H_TIMER16_CHANNEL(config, "timer16:2", 2, 2, "intc", 32);
+ H8H_TIMER16_CHANNEL(config, "timer16:3", 2, 2, "intc", 36);
+ H8H_TIMER16_CHANNEL(config, "timer16:4", 2, 2, "intc", 40);
+ H8_SCI(config, "sci0", "intc", 52, 53, 54, 55);
+ H8_SCI(config, "sci1", "intc", 56, 57, 58, 59);
+ H8_WATCHDOG(config, "watchdog", "intc", 20, h8_watchdog_device::H);
+}
void h83002_device::execute_set_input(int inputnum, int state)
{
diff --git a/src/devices/cpu/h8/h83003.cpp b/src/devices/cpu/h8/h83003.cpp
index 69213cd164e..4e3e59c15cf 100644
--- a/src/devices/cpu/h8/h83003.cpp
+++ b/src/devices/cpu/h8/h83003.cpp
@@ -150,32 +150,33 @@ void h83003_device::map(address_map &map)
map(0xfffff8, 0xfffff9).rw("intc", FUNC(h8h_intc_device::icr_r), FUNC(h8h_intc_device::icr_w));
}
-MACHINE_CONFIG_START(h83003_device::device_add_mconfig)
- MCFG_H8H_INTC_ADD("intc")
- MCFG_H8_ADC_3337_ADD("adc", "intc", 60)
- MCFG_H8_DMA_ADD("dma")
+void h83003_device::device_add_mconfig(machine_config &config)
+{
+ H8H_INTC(config, "intc");
+ H8_ADC_3337(config, "adc", "intc", 60);
+ H8_DMA(config, "dma");
// (H8/2002.pdf) Table 8-11 DMAC Activation Sources
- MCFG_H8_DMA_CHANNEL_ADD("dma:0", "intc", 44, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE)
- MCFG_H8_DMA_CHANNEL_ADD("dma:1", "intc", 46, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE)
- MCFG_H8_DMA_CHANNEL_ADD("dma:2", "intc", 48, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE)
- MCFG_H8_DMA_CHANNEL_ADD("dma:3", "intc", 50, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE)
- MCFG_H8_PORT_ADD("port4", h8_device::PORT_4, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port6", h8_device::PORT_6, 0x80, 0x80)
- MCFG_H8_PORT_ADD("port7", h8_device::PORT_7, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port8", h8_device::PORT_8, 0xf0, 0xe0)
- MCFG_H8_PORT_ADD("port9", h8_device::PORT_9, 0x00, 0xc0)
- MCFG_H8_PORT_ADD("porta", h8_device::PORT_A, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portb", h8_device::PORT_B, 0x00, 0x00)
- MCFG_H8_TIMER16_ADD("timer16", 5, 0xe0)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:0", 2, 2, "intc", 24)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:1", 2, 2, "intc", 28)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:2", 2, 2, "intc", 32)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:3", 2, 2, "intc", 36)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:4", 2, 2, "intc", 40)
- MCFG_H8_SCI_ADD("sci0", "intc", 52, 53, 54, 55)
- MCFG_H8_SCI_ADD("sci1", "intc", 56, 57, 58, 59)
- MCFG_H8_WATCHDOG_ADD("watchdog", "intc", 20, h8_watchdog_device::H)
-MACHINE_CONFIG_END
+ H8_DMA_CHANNEL(config, "dma:0", "intc", 44, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53);
+ H8_DMA_CHANNEL(config, "dma:1", "intc", 46, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53);
+ H8_DMA_CHANNEL(config, "dma:2", "intc", 48, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53);
+ H8_DMA_CHANNEL(config, "dma:3", "intc", 50, h8_dma_channel_device::NONE, 24, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 28, 32, 36, 54, 53);
+ H8_PORT(config, "port4", h8_device::PORT_4, 0x00, 0x00);
+ H8_PORT(config, "port6", h8_device::PORT_6, 0x80, 0x80);
+ H8_PORT(config, "port7", h8_device::PORT_7, 0x00, 0x00);
+ H8_PORT(config, "port8", h8_device::PORT_8, 0xf0, 0xe0);
+ H8_PORT(config, "port9", h8_device::PORT_9, 0x00, 0xc0);
+ H8_PORT(config, "porta", h8_device::PORT_A, 0x00, 0x00);
+ H8_PORT(config, "portb", h8_device::PORT_B, 0x00, 0x00);
+ H8_TIMER16(config, "timer16", 5, 0xe0);
+ H8H_TIMER16_CHANNEL(config, "timer16:0", 2, 2, "intc", 24);
+ H8H_TIMER16_CHANNEL(config, "timer16:1", 2, 2, "intc", 28);
+ H8H_TIMER16_CHANNEL(config, "timer16:2", 2, 2, "intc", 32);
+ H8H_TIMER16_CHANNEL(config, "timer16:3", 2, 2, "intc", 36);
+ H8H_TIMER16_CHANNEL(config, "timer16:4", 2, 2, "intc", 40);
+ H8_SCI(config, "sci0", "intc", 52, 53, 54, 55);
+ H8_SCI(config, "sci1", "intc", 56, 57, 58, 59);
+ H8_WATCHDOG(config, "watchdog", "intc", 20, h8_watchdog_device::H);
+}
void h83003_device::execute_set_input(int inputnum, int state)
{
diff --git a/src/devices/cpu/h8/h83006.cpp b/src/devices/cpu/h8/h83006.cpp
index 8e95c85e545..62db8551ed3 100644
--- a/src/devices/cpu/h8/h83006.cpp
+++ b/src/devices/cpu/h8/h83006.cpp
@@ -136,29 +136,30 @@ void h83006_device::map(address_map &map)
map(0xffffe9, 0xffffe9).rw("adc", FUNC(h8_adc_device::adcr_r), FUNC(h8_adc_device::adcr_w));
}
-MACHINE_CONFIG_START(h83006_device::device_add_mconfig)
- MCFG_H8H_INTC_ADD("intc")
- MCFG_H8_ADC_3006_ADD("adc", "intc", 23)
- MCFG_H8_PORT_ADD("port4", h8_device::PORT_4, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port6", h8_device::PORT_6, 0x80, 0x80)
- MCFG_H8_PORT_ADD("port7", h8_device::PORT_7, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port8", h8_device::PORT_8, 0xf0, 0xe0)
- MCFG_H8_PORT_ADD("port9", h8_device::PORT_9, 0xc0, 0xc0)
- MCFG_H8_PORT_ADD("porta", h8_device::PORT_A, 0x80, 0x00)
- MCFG_H8_PORT_ADD("portb", h8_device::PORT_B, 0x00, 0x00)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_0", "intc", 36, 38, 39, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_1", "intc", 37, 38, 39, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_2", "intc", 40, 42, 43, "timer8_3", h8_timer8_channel_device::CHAIN_OVERFLOW, false, true)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_3", "intc", 41, 42, 43, "timer8_2", h8_timer8_channel_device::CHAIN_A, false, true)
- MCFG_H8_TIMER16_ADD("timer16", 3, 0xf8)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:0", 2, 2, "intc", 24)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:1", 2, 2, "intc", 28)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:2", 2, 2, "intc", 32)
- MCFG_H8_SCI_ADD("sci0", "intc", 52, 53, 54, 55)
- MCFG_H8_SCI_ADD("sci1", "intc", 56, 57, 58, 59)
- MCFG_H8_SCI_ADD("sci2", "intc", 60, 61, 62, 63)
- MCFG_H8_WATCHDOG_ADD("watchdog", "intc", 20, h8_watchdog_device::H)
-MACHINE_CONFIG_END
+void h83006_device::device_add_mconfig(machine_config &config)
+{
+ H8H_INTC(config, "intc");
+ H8_ADC_3006(config, "adc", "intc", 23);
+ H8_PORT(config, "port4", h8_device::PORT_4, 0x00, 0x00);
+ H8_PORT(config, "port6", h8_device::PORT_6, 0x80, 0x80);
+ H8_PORT(config, "port7", h8_device::PORT_7, 0x00, 0x00);
+ H8_PORT(config, "port8", h8_device::PORT_8, 0xf0, 0xe0);
+ H8_PORT(config, "port9", h8_device::PORT_9, 0xc0, 0xc0);
+ H8_PORT(config, "porta", h8_device::PORT_A, 0x80, 0x00);
+ H8_PORT(config, "portb", h8_device::PORT_B, 0x00, 0x00);
+ H8H_TIMER8_CHANNEL(config, "timer8_0", "intc", 36, 38, 39, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false);
+ H8H_TIMER8_CHANNEL(config, "timer8_1", "intc", 37, 38, 39, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false);
+ H8H_TIMER8_CHANNEL(config, "timer8_2", "intc", 40, 42, 43, "timer8_3", h8_timer8_channel_device::CHAIN_OVERFLOW, false, true);
+ H8H_TIMER8_CHANNEL(config, "timer8_3", "intc", 41, 42, 43, "timer8_2", h8_timer8_channel_device::CHAIN_A, false, true);
+ H8_TIMER16(config, "timer16", 3, 0xf8);
+ H8H_TIMER16_CHANNEL(config, "timer16:0", 2, 2, "intc", 24);
+ H8H_TIMER16_CHANNEL(config, "timer16:1", 2, 2, "intc", 28);
+ H8H_TIMER16_CHANNEL(config, "timer16:2", 2, 2, "intc", 32);
+ H8_SCI(config, "sci0", "intc", 52, 53, 54, 55);
+ H8_SCI(config, "sci1", "intc", 56, 57, 58, 59);
+ H8_SCI(config, "sci2", "intc", 60, 61, 62, 63);
+ H8_WATCHDOG(config, "watchdog", "intc", 20, h8_watchdog_device::H);
+}
void h83006_device::execute_set_input(int inputnum, int state)
{
diff --git a/src/devices/cpu/h8/h83008.cpp b/src/devices/cpu/h8/h83008.cpp
index 30fa0c5c047..ea5007b8fb2 100644
--- a/src/devices/cpu/h8/h83008.cpp
+++ b/src/devices/cpu/h8/h83008.cpp
@@ -114,28 +114,29 @@ void h83008_device::map(address_map &map)
map(0xffffe9, 0xffffe9).rw("adc", FUNC(h8_adc_device::adcr_r), FUNC(h8_adc_device::adcr_w));
}
-MACHINE_CONFIG_START(h83008_device::device_add_mconfig)
- MCFG_H8H_INTC_ADD("intc")
- MCFG_H8_ADC_3006_ADD("adc", "intc", 23)
- MCFG_H8_PORT_ADD("port4", h8_device::PORT_4, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port6", h8_device::PORT_6, 0x80, 0x80)
- MCFG_H8_PORT_ADD("port7", h8_device::PORT_7, 0xff, 0x00)
- MCFG_H8_PORT_ADD("port8", h8_device::PORT_8, 0xf0, 0xe0)
- MCFG_H8_PORT_ADD("port9", h8_device::PORT_9, 0xc0, 0xc0)
- MCFG_H8_PORT_ADD("porta", h8_device::PORT_A, 0x80, 0x00)
- MCFG_H8_PORT_ADD("portb", h8_device::PORT_B, 0x00, 0x00)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_0", "intc", 36, 38, 39, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_1", "intc", 37, 38, 39, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_2", "intc", 40, 42, 43, "timer8_3", h8_timer8_channel_device::CHAIN_OVERFLOW, false, true)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_3", "intc", 41, 42, 43, "timer8_2", h8_timer8_channel_device::CHAIN_A, false, true)
- MCFG_H8_TIMER16_ADD("timer16", 3, 0xf8)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:0", 2, 2, "intc", 24)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:1", 2, 2, "intc", 28)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:2", 2, 2, "intc", 32)
- MCFG_H8_SCI_ADD("sci0", "intc", 52, 53, 54, 55)
- MCFG_H8_SCI_ADD("sci1", "intc", 56, 57, 58, 59)
- MCFG_H8_WATCHDOG_ADD("watchdog", "intc", 20, h8_watchdog_device::H)
-MACHINE_CONFIG_END
+void h83008_device::device_add_mconfig(machine_config &config)
+{
+ H8H_INTC(config, "intc");
+ H8_ADC_3006(config, "adc", "intc", 23);
+ H8_PORT(config, "port4", h8_device::PORT_4, 0x00, 0x00);
+ H8_PORT(config, "port6", h8_device::PORT_6, 0x80, 0x80);
+ H8_PORT(config, "port7", h8_device::PORT_7, 0xff, 0x00);
+ H8_PORT(config, "port8", h8_device::PORT_8, 0xf0, 0xe0);
+ H8_PORT(config, "port9", h8_device::PORT_9, 0xc0, 0xc0);
+ H8_PORT(config, "porta", h8_device::PORT_A, 0x80, 0x00);
+ H8_PORT(config, "portb", h8_device::PORT_B, 0x00, 0x00);
+ H8H_TIMER8_CHANNEL(config, "timer8_0", "intc", 36, 38, 39, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false);
+ H8H_TIMER8_CHANNEL(config, "timer8_1", "intc", 37, 38, 39, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false);
+ H8H_TIMER8_CHANNEL(config, "timer8_2", "intc", 40, 42, 43, "timer8_3", h8_timer8_channel_device::CHAIN_OVERFLOW, false, true);
+ H8H_TIMER8_CHANNEL(config, "timer8_3", "intc", 41, 42, 43, "timer8_2", h8_timer8_channel_device::CHAIN_A, false, true);
+ H8_TIMER16(config, "timer16", 3, 0xf8);
+ H8H_TIMER16_CHANNEL(config, "timer16:0", 2, 2, "intc", 24);
+ H8H_TIMER16_CHANNEL(config, "timer16:1", 2, 2, "intc", 28);
+ H8H_TIMER16_CHANNEL(config, "timer16:2", 2, 2, "intc", 32);
+ H8_SCI(config, "sci0", "intc", 52, 53, 54, 55);
+ H8_SCI(config, "sci1", "intc", 56, 57, 58, 59);
+ H8_WATCHDOG(config, "watchdog", "intc", 20, h8_watchdog_device::H);
+}
void h83008_device::execute_set_input(int inputnum, int state)
{
diff --git a/src/devices/cpu/h8/h83048.cpp b/src/devices/cpu/h8/h83048.cpp
index 77c49b9e5a4..84e7eb85b1a 100644
--- a/src/devices/cpu/h8/h83048.cpp
+++ b/src/devices/cpu/h8/h83048.cpp
@@ -152,30 +152,31 @@ void h83048_device::map(address_map &map)
map(0xfffff8, 0xfffff9).rw("intc", FUNC(h8h_intc_device::icr_r), FUNC(h8h_intc_device::icr_w));
}
-MACHINE_CONFIG_START(h83048_device::device_add_mconfig)
- MCFG_H8H_INTC_ADD("intc")
- MCFG_H8_ADC_3337_ADD("adc", "intc", 60)
- MCFG_H8_PORT_ADD("port1", h8_device::PORT_1, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port2", h8_device::PORT_2, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port3", h8_device::PORT_3, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port4", h8_device::PORT_4, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port5", h8_device::PORT_5, 0xf0, 0xf0)
- MCFG_H8_PORT_ADD("port6", h8_device::PORT_6, 0x80, 0x80)
- MCFG_H8_PORT_ADD("port7", h8_device::PORT_7, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port8", h8_device::PORT_8, 0xe0, 0xe0)
- MCFG_H8_PORT_ADD("port9", h8_device::PORT_9, 0xc0, 0xc0)
- MCFG_H8_PORT_ADD("porta", h8_device::PORT_A, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portb", h8_device::PORT_B, 0x00, 0x00)
- MCFG_H8_TIMER16_ADD("timer16", 5, 0xe0)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:0", 2, 2, "intc", 24)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:1", 2, 2, "intc", 28)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:2", 2, 2, "intc", 32)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:3", 2, 2, "intc", 36)
- MCFG_H8H_TIMER16_CHANNEL_ADD("timer16:4", 2, 2, "intc", 40)
- MCFG_H8_SCI_ADD("sci0", "intc", 52, 53, 54, 55)
- MCFG_H8_SCI_ADD("sci1", "intc", 56, 57, 58, 59)
- MCFG_H8_WATCHDOG_ADD("watchdog", "intc", 20, h8_watchdog_device::H)
-MACHINE_CONFIG_END
+void h83048_device::device_add_mconfig(machine_config &config)
+{
+ H8H_INTC(config, "intc");
+ H8_ADC_3337(config, "adc", "intc", 60);
+ H8_PORT(config, "port1", h8_device::PORT_1, 0x00, 0x00);
+ H8_PORT(config, "port2", h8_device::PORT_2, 0x00, 0x00);
+ H8_PORT(config, "port3", h8_device::PORT_3, 0x00, 0x00);
+ H8_PORT(config, "port4", h8_device::PORT_4, 0x00, 0x00);
+ H8_PORT(config, "port5", h8_device::PORT_5, 0xf0, 0xf0);
+ H8_PORT(config, "port6", h8_device::PORT_6, 0x80, 0x80);
+ H8_PORT(config, "port7", h8_device::PORT_7, 0x00, 0x00);
+ H8_PORT(config, "port8", h8_device::PORT_8, 0xe0, 0xe0);
+ H8_PORT(config, "port9", h8_device::PORT_9, 0xc0, 0xc0);
+ H8_PORT(config, "porta", h8_device::PORT_A, 0x00, 0x00);
+ H8_PORT(config, "portb", h8_device::PORT_B, 0x00, 0x00);
+ H8_TIMER16(config, "timer16", 5, 0xe0);
+ H8H_TIMER16_CHANNEL(config, "timer16:0", 2, 2, "intc", 24);
+ H8H_TIMER16_CHANNEL(config, "timer16:1", 2, 2, "intc", 28);
+ H8H_TIMER16_CHANNEL(config, "timer16:2", 2, 2, "intc", 32);
+ H8H_TIMER16_CHANNEL(config, "timer16:3", 2, 2, "intc", 36);
+ H8H_TIMER16_CHANNEL(config, "timer16:4", 2, 2, "intc", 40);
+ H8_SCI(config, "sci0", "intc", 52, 53, 54, 55);
+ H8_SCI(config, "sci1", "intc", 56, 57, 58, 59);
+ H8_WATCHDOG(config, "watchdog", "intc", 20, h8_watchdog_device::H);
+}
void h83048_device::execute_set_input(int inputnum, int state)
{
diff --git a/src/devices/cpu/h8/h83337.cpp b/src/devices/cpu/h8/h83337.cpp
index af47cc5bc97..4a07f099719 100644
--- a/src/devices/cpu/h8/h83337.cpp
+++ b/src/devices/cpu/h8/h83337.cpp
@@ -115,26 +115,27 @@ void h83337_device::map(address_map &map)
map(0xfff2, 0xfff2).rw("port6", FUNC(h8_port_device::pcr_r), FUNC(h8_port_device::pcr_w));
}
-MACHINE_CONFIG_START(h83337_device::device_add_mconfig)
- MCFG_H8_INTC_ADD("intc")
- MCFG_H8_ADC_3337_ADD("adc", "intc", 35)
- MCFG_H8_PORT_ADD("port1", h8_device::PORT_1, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port2", h8_device::PORT_2, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port3", h8_device::PORT_3, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port4", h8_device::PORT_4, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port5", h8_device::PORT_5, 0xf8, 0xf8)
- MCFG_H8_PORT_ADD("port6", h8_device::PORT_6, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port7", h8_device::PORT_7, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port8", h8_device::PORT_8, 0x80, 0x80)
- MCFG_H8_PORT_ADD("port9", h8_device::PORT_9, 0x00, 0x00)
- MCFG_H8_TIMER8_CHANNEL_ADD("timer8_0", "intc", 19, 20, 21, 8, 2, 64, 32, 1024, 256)
- MCFG_H8_TIMER8_CHANNEL_ADD("timer8_1", "intc", 22, 23, 24, 8, 2, 64, 128, 1024, 2048)
- MCFG_H8_TIMER16_ADD("timer16", 1, 0xff)
- MCFG_H8_TIMER16_CHANNEL_ADD("timer16:0", 4, 0, "intc", 32)
- MCFG_H8_SCI_ADD("sci0", "intc", 27, 28, 29, 30)
- MCFG_H8_SCI_ADD("sci1", "intc", 31, 32, 33, 34)
- MCFG_H8_WATCHDOG_ADD("watchdog", "intc", 36, h8_watchdog_device::B)
-MACHINE_CONFIG_END
+void h83337_device::device_add_mconfig(machine_config &config)
+{
+ H8_INTC(config, "intc");
+ H8_ADC_3337(config, "adc", "intc", 35);
+ H8_PORT(config, "port1", h8_device::PORT_1, 0x00, 0x00);
+ H8_PORT(config, "port2", h8_device::PORT_2, 0x00, 0x00);
+ H8_PORT(config, "port3", h8_device::PORT_3, 0x00, 0x00);
+ H8_PORT(config, "port4", h8_device::PORT_4, 0x00, 0x00);
+ H8_PORT(config, "port5", h8_device::PORT_5, 0xf8, 0xf8);
+ H8_PORT(config, "port6", h8_device::PORT_6, 0x00, 0x00);
+ H8_PORT(config, "port7", h8_device::PORT_7, 0x00, 0x00);
+ H8_PORT(config, "port8", h8_device::PORT_8, 0x80, 0x80);
+ H8_PORT(config, "port9", h8_device::PORT_9, 0x00, 0x00);
+ H8_TIMER8_CHANNEL(config, "timer8_0", "intc", 19, 20, 21, 8, 2, 64, 32, 1024, 256);
+ H8_TIMER8_CHANNEL(config, "timer8_1", "intc", 22, 23, 24, 8, 2, 64, 128, 1024, 2048);
+ H8_TIMER16(config, "timer16", 1, 0xff);
+ H8_TIMER16_CHANNEL(config, "timer16:0", 4, 0, "intc", 32);
+ H8_SCI(config, "sci0", "intc", 27, 28, 29, 30);
+ H8_SCI(config, "sci1", "intc", 31, 32, 33, 34);
+ H8_WATCHDOG(config, "watchdog", "intc", 36, h8_watchdog_device::B);
+}
void h83337_device::execute_set_input(int inputnum, int state)
{
diff --git a/src/devices/cpu/h8/h8_adc.h b/src/devices/cpu/h8/h8_adc.h
index 8dbbbc79e5b..f0feb82f213 100644
--- a/src/devices/cpu/h8/h8_adc.h
+++ b/src/devices/cpu/h8/h8_adc.h
@@ -17,28 +17,6 @@
#include "h8.h"
#include "h8_intc.h"
-#define MCFG_H8_ADC_GENERIC_ADD( _tag, _type, intc, vect ) \
- MCFG_DEVICE_ADD( _tag, _type, 0 ) \
- downcast<h8_adc_device *>(device)->set_info(intc, vect);
-
-#define MCFG_H8_ADC_3337_ADD( _tag, intc, vect ) \
- MCFG_H8_ADC_GENERIC_ADD( _tag, H8_ADC_3337, intc, vect )
-
-#define MCFG_H8_ADC_3006_ADD( _tag, intc, vect ) \
- MCFG_H8_ADC_GENERIC_ADD( _tag, H8_ADC_3006, intc, vect )
-
-#define MCFG_H8_ADC_2245_ADD( _tag, intc, vect ) \
- MCFG_H8_ADC_GENERIC_ADD( _tag, H8_ADC_2245, intc, vect )
-
-#define MCFG_H8_ADC_2320_ADD( _tag, intc, vect ) \
- MCFG_H8_ADC_GENERIC_ADD( _tag, H8_ADC_2320, intc, vect )
-
-#define MCFG_H8_ADC_2357_ADD( _tag, intc, vect ) \
- MCFG_H8_ADC_GENERIC_ADD( _tag, H8_ADC_2357, intc, vect )
-
-#define MCFG_H8_ADC_2655_ADD( _tag, intc, vect ) \
- MCFG_H8_ADC_GENERIC_ADD( _tag, H8_ADC_2655, intc, vect )
-
class h8_adc_device : public device_t {
public:
void set_info(const char *intc_tag, int vect);
@@ -116,6 +94,11 @@ protected:
class h8_adc_3337_device : public h8_adc_device {
public:
h8_adc_3337_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_adc_3337_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *intc_tag, int vect)
+ : h8_adc_3337_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc_tag, vect);
+ }
protected:
virtual int conversion_time(bool first, bool poweron) override;
@@ -125,6 +108,11 @@ protected:
class h8_adc_3006_device : public h8_adc_device {
public:
h8_adc_3006_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_adc_3006_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *intc_tag, int vect)
+ : h8_adc_3006_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc_tag, vect);
+ }
protected:
virtual int conversion_time(bool first, bool poweron) override;
@@ -134,6 +122,11 @@ protected:
class h8_adc_2245_device : public h8_adc_device {
public:
h8_adc_2245_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_adc_2245_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *intc_tag, int vect)
+ : h8_adc_2245_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc_tag, vect);
+ }
protected:
virtual int conversion_time(bool first, bool poweron) override;
@@ -143,6 +136,11 @@ protected:
class h8_adc_2320_device : public h8_adc_device {
public:
h8_adc_2320_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_adc_2320_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *intc_tag, int vect)
+ : h8_adc_2320_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc_tag, vect);
+ }
protected:
virtual int conversion_time(bool first, bool poweron) override;
@@ -152,6 +150,11 @@ protected:
class h8_adc_2357_device : public h8_adc_device {
public:
h8_adc_2357_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_adc_2357_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *intc_tag, int vect)
+ : h8_adc_2357_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc_tag, vect);
+ }
protected:
virtual int conversion_time(bool first, bool poweron) override;
@@ -161,6 +164,11 @@ protected:
class h8_adc_2655_device : public h8_adc_device {
public:
h8_adc_2655_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_adc_2655_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *intc_tag, int vect)
+ : h8_adc_2655_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc_tag, vect);
+ }
protected:
virtual int conversion_time(bool first, bool poweron) override;
diff --git a/src/devices/cpu/h8/h8_dma.h b/src/devices/cpu/h8/h8_dma.h
index 375d57a2dd0..d244f53ebd1 100644
--- a/src/devices/cpu/h8/h8_dma.h
+++ b/src/devices/cpu/h8/h8_dma.h
@@ -26,13 +26,6 @@ struct h8_dma_state {
bool mode_16;
};
-#define MCFG_H8_DMA_ADD( _tag ) \
- MCFG_DEVICE_ADD( _tag, H8_DMA, 0 )
-
-#define MCFG_H8_DMA_CHANNEL_ADD( _tag, intc, irq_base, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, va, vb, vc, vd, ve, vf ) \
- MCFG_DEVICE_ADD( _tag, H8_DMA_CHANNEL, 0 ) \
- downcast<h8_dma_channel_device *>(device)->set_info(intc, irq_base, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, va, vb, vc, vd, ve, vf);
-
class h8_dma_channel_device;
enum {
@@ -50,7 +43,7 @@ enum {
class h8_dma_device : public device_t {
public:
- h8_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_dma_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
DECLARE_READ8_MEMBER(dmawer_r);
DECLARE_WRITE8_MEMBER(dmawer_w);
@@ -96,7 +89,19 @@ public:
};
h8_dma_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
+ h8_dma_channel_device(const machine_config &mconfig, const char *tag, device_t *owner,
+ const char *intc, int irq_base, int v0, int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8,
+ int v9 = h8_dma_channel_device::NONE,
+ int va = h8_dma_channel_device::NONE,
+ int vb = h8_dma_channel_device::NONE,
+ int vc = h8_dma_channel_device::NONE,
+ int vd = h8_dma_channel_device::NONE,
+ int ve = h8_dma_channel_device::NONE,
+ int vf = h8_dma_channel_device::NONE)
+ : h8_dma_channel_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc, irq_base, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, va, vb, vc, vd, ve, vf);
+ }
void set_info(const char *intc, int irq_base, int v0, int v1, int v2, int v3, int v4, int v5, int v6, int v7, int v8, int v9, int va, int vb, int vc, int vd, int ve, int vf);
DECLARE_READ16_MEMBER(marah_r);
diff --git a/src/devices/cpu/h8/h8_dtc.h b/src/devices/cpu/h8/h8_dtc.h
index f78478e18ab..f3e33795190 100644
--- a/src/devices/cpu/h8/h8_dtc.h
+++ b/src/devices/cpu/h8/h8_dtc.h
@@ -17,10 +17,6 @@
#include <list>
-#define MCFG_H8_DTC_ADD( _tag, intc, irq ) \
- MCFG_DEVICE_ADD( _tag, H8_DTC, 0 ) \
- downcast<h8_dtc_device *>(device)->set_info(intc, irq);
-
struct h8_dtc_state {
uint32_t base, sra, dar, cr;
int32_t incs, incd;
@@ -34,6 +30,11 @@ public:
enum { DTC_CHAINED = 1000 };
h8_dtc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_dtc_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *intc, int irq)
+ : h8_dtc_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc, irq);
+ }
void set_info(const char *intc, int irq);
DECLARE_READ8_MEMBER(dtcer_r);
diff --git a/src/devices/cpu/h8/h8_intc.h b/src/devices/cpu/h8/h8_intc.h
index ca9452ad61d..20bd830f45f 100644
--- a/src/devices/cpu/h8/h8_intc.h
+++ b/src/devices/cpu/h8/h8_intc.h
@@ -16,19 +16,10 @@
#include "h8.h"
-#define MCFG_H8_INTC_ADD( _tag ) \
- MCFG_DEVICE_ADD( _tag, H8_INTC, 0 )
-
-#define MCFG_H8H_INTC_ADD( _tag ) \
- MCFG_DEVICE_ADD( _tag, H8H_INTC, 0 )
-
-#define MCFG_H8S_INTC_ADD( _tag ) \
- MCFG_DEVICE_ADD( _tag, H8S_INTC, 0 )
-
class h8_intc_device : public device_t {
public:
- h8_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
int interrupt_taken(int vector);
void internal_interrupt(int vector);
@@ -71,7 +62,7 @@ protected:
class h8h_intc_device : public h8_intc_device {
public:
- h8h_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8h_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
DECLARE_READ8_MEMBER(isr_r);
DECLARE_WRITE8_MEMBER(isr_w);
@@ -100,7 +91,7 @@ protected:
class h8s_intc_device : public h8h_intc_device {
public:
- h8s_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8s_intc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
DECLARE_READ8_MEMBER(ipr_r);
DECLARE_WRITE8_MEMBER(ipr_w);
diff --git a/src/devices/cpu/h8/h8_port.h b/src/devices/cpu/h8/h8_port.h
index babd50cdaa3..033aee4484d 100644
--- a/src/devices/cpu/h8/h8_port.h
+++ b/src/devices/cpu/h8/h8_port.h
@@ -16,13 +16,14 @@
#include "h8.h"
-#define MCFG_H8_PORT_ADD( _tag, address, ddr, mask ) \
- MCFG_DEVICE_ADD( _tag, H8_PORT, 0 ) \
- downcast<h8_port_device *>(device)->set_info(address, ddr, mask);
-
class h8_port_device : public device_t {
public:
h8_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_port_device(const machine_config &mconfig, const char *tag, device_t *owner, int address, uint8_t default_ddr, uint8_t mask)
+ : h8_port_device(mconfig, tag, owner, 0)
+ {
+ set_info(address, default_ddr, mask);
+ }
void set_info(int address, uint8_t default_ddr, uint8_t mask);
diff --git a/src/devices/cpu/h8/h8_sci.h b/src/devices/cpu/h8/h8_sci.h
index 065c5e4b305..47603f2d91e 100644
--- a/src/devices/cpu/h8/h8_sci.h
+++ b/src/devices/cpu/h8/h8_sci.h
@@ -17,10 +17,6 @@
#include "h8.h"
#include "h8_intc.h"
-#define MCFG_H8_SCI_ADD( _tag, intc, eri, rxi, txi, tei ) \
- MCFG_DEVICE_ADD( _tag, H8_SCI, 0 ) \
- downcast<h8_sci_device *>(device)->set_info(intc, eri, rxi, txi, tei);
-
#define MCFG_H8_SCI_SET_EXTERNAL_CLOCK_PERIOD(_period) \
downcast<h8_sci_device *>(device)->set_external_clock_period(_period);
@@ -33,6 +29,11 @@
class h8_sci_device : public device_t {
public:
h8_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_sci_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *intc, int eri, int rxi, int txi, int tei)
+ : h8_sci_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc, eri, rxi, txi, tei);
+ }
void set_info(const char *intc, int eri, int rxi, int txi, int tei);
void set_external_clock_period(const attotime &_period);
diff --git a/src/devices/cpu/h8/h8_timer16.h b/src/devices/cpu/h8/h8_timer16.h
index 3741849b186..a22c68eb53d 100644
--- a/src/devices/cpu/h8/h8_timer16.h
+++ b/src/devices/cpu/h8/h8_timer16.h
@@ -17,25 +17,6 @@
#include "h8.h"
#include "h8_intc.h"
-#define MCFG_H8_TIMER16_ADD( _tag, _count, _tstr ) \
- MCFG_DEVICE_ADD( _tag, H8_TIMER16, 0 ) \
- downcast<h8_timer16_device *>(device)->set_info(_count, _tstr);
-
-#define MCFG_H8_TIMER16_CHANNEL_ADD( _tag, tgr_count, tbr_count, intc, irq_base ) \
- MCFG_DEVICE_ADD( _tag, H8_TIMER16_CHANNEL, 0 ) \
- downcast<h8_timer16_channel_device *>(device)->set_info(tgr_count, tbr_count, intc, irq_base);
-
-#define MCFG_H8H_TIMER16_CHANNEL_ADD( _tag, tgr_count, tbr_count, intc, irq_base ) \
- MCFG_DEVICE_ADD( _tag, H8H_TIMER16_CHANNEL, 0 ) \
- downcast<h8h_timer16_channel_device *>(device)->set_info(tgr_count, tbr_count, intc, irq_base);
-
-#define MCFG_H8S_TIMER16_CHANNEL_ADD( _tag, tgr_count, tier_mask, intc, irq_base, t0, t1, t2, t3, t4, t5, t6, t7 ) \
- MCFG_DEVICE_ADD( _tag, H8S_TIMER16_CHANNEL, 0 ) \
- downcast<h8s_timer16_channel_device *>(device)->set_info(tgr_count, tier_mask, intc, irq_base, t0, t1, t2, t3, t4, t5, t6, t7);
-
-#define MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN( _tag ) \
- downcast<h8s_timer16_channel_device *>(device)->set_chain(_tag);
-
class h8_timer16_channel_device : public device_t {
public:
enum {
@@ -76,6 +57,11 @@ public:
h8_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, int tgr_count, int tbr_count, const char *intc, int irq_base)
+ : h8_timer16_channel_device(mconfig, tag, owner, 0)
+ {
+ set_info(tgr_count, tbr_count, intc, irq_base);
+ }
void set_info(int tgr_count, int tbr_count, const char *intc, int irq_base);
@@ -136,6 +122,11 @@ protected:
class h8h_timer16_channel_device : public h8_timer16_channel_device {
public:
h8h_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8h_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, int tgr_count, int tbr_count, const char *intc, int irq_base)
+ : h8h_timer16_channel_device(mconfig, tag, owner, 0)
+ {
+ set_info(tgr_count, tbr_count, intc, irq_base);
+ }
virtual ~h8h_timer16_channel_device();
void set_info(int tgr_count, int tbr_count, const char *intc, int irq_base);
@@ -150,6 +141,12 @@ protected:
class h8s_timer16_channel_device : public h8_timer16_channel_device {
public:
h8s_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8s_timer16_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, int tgr_count, int _tier_mask, const char *intc, int irq_base,
+ int t0, int t1, int t2, int t3, int t4, int t5, int t6, int t7)
+ : h8s_timer16_channel_device(mconfig, tag, owner, 0)
+ {
+ set_info(tgr_count, _tier_mask, intc, irq_base, t0, t1, t2, t3, t4, t5, t6, t7);
+ }
virtual ~h8s_timer16_channel_device();
void set_info(int tgr_count, uint8_t _tier_mask, const char *intc, int irq_base,
@@ -168,7 +165,11 @@ protected:
class h8_timer16_device : public device_t {
public:
h8_timer16_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
-
+ h8_timer16_device(const machine_config &mconfig, const char *tag, device_t *owner, int timer_count, uint8_t default_tstr)
+ : h8_timer16_device(mconfig, tag, owner, 0)
+ {
+ set_info(timer_count, default_tstr);
+ }
void set_info(int timer_count, uint8_t default_tstr);
DECLARE_READ8_MEMBER(tstr_r);
diff --git a/src/devices/cpu/h8/h8_timer8.h b/src/devices/cpu/h8/h8_timer8.h
index cf9f2fd219e..b08c51556d2 100644
--- a/src/devices/cpu/h8/h8_timer8.h
+++ b/src/devices/cpu/h8/h8_timer8.h
@@ -17,14 +17,6 @@
#include "h8.h"
#include "h8_intc.h"
-#define MCFG_H8_TIMER8_CHANNEL_ADD( _tag, intc, irq_ca, irq_cb, irq_v, div1, div2, div3, div4, div5, div6 ) \
- MCFG_DEVICE_ADD( _tag, H8_TIMER8_CHANNEL, 0 ) \
- downcast<h8_timer8_channel_device *>(device)->set_info(intc, irq_ca, irq_cb, irq_v, div1, div2, div3, div4, div5, div6);
-
-#define MCFG_H8H_TIMER8_CHANNEL_ADD( _tag, intc, irq_ca, irq_cb, irq_v, chain, chain_mode, has_adte, has_ice ) \
- MCFG_DEVICE_ADD( _tag, H8H_TIMER8_CHANNEL, 0 ) \
- downcast<h8h_timer8_channel_device *>(device)->set_info(intc, irq_ca, irq_cb, irq_v, chain, chain_mode, has_adte, has_ice);
-
class h8_timer8_channel_device : public device_t {
public:
enum {
@@ -38,6 +30,12 @@ public:
};
h8_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *intc, int irq_ca, int irq_cb, int irq_v,
+ int div1, int div2, int div3, int div4, int div5, int div6)
+ : h8_timer8_channel_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc, irq_ca, irq_cb, irq_v, div1, div2, div3, div4, div5, div6);
+ }
void set_info(const char *intc, int irq_ca, int irq_cb, int irq_v, int div1, int div2, int div3, int div4, int div5, int div6);
@@ -105,6 +103,12 @@ protected:
class h8h_timer8_channel_device : public h8_timer8_channel_device {
public:
h8h_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8h_timer8_channel_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *intc, int irq_ca, int irq_cb, int irq_v,
+ const char *chain_tag, int chain_type, bool has_adte, bool has_ice)
+ : h8h_timer8_channel_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc, irq_ca, irq_cb, irq_v, chain_tag, chain_type, has_adte, has_ice);
+ }
virtual ~h8h_timer8_channel_device();
void set_info(const char *intc, int irq_ca, int irq_cb, int irq_v, const char *chain_tag, int chain_type, bool has_adte, bool has_ice);
diff --git a/src/devices/cpu/h8/h8_watchdog.h b/src/devices/cpu/h8/h8_watchdog.h
index af4cc0b7e35..0cad0e67020 100644
--- a/src/devices/cpu/h8/h8_watchdog.h
+++ b/src/devices/cpu/h8/h8_watchdog.h
@@ -45,15 +45,16 @@
#include "h8.h"
#include "h8_intc.h"
-#define MCFG_H8_WATCHDOG_ADD( _tag, intc, irq, type ) \
- MCFG_DEVICE_ADD( _tag, H8_WATCHDOG, 0 ) \
- downcast<h8_watchdog_device *>(device)->set_info(intc, irq, type);
-
class h8_watchdog_device : public device_t {
public:
enum { B, H, S };
h8_watchdog_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ h8_watchdog_device(const machine_config &mconfig, const char *tag, device_t *owner, const char *intc, int irq, int type)
+ : h8_watchdog_device(mconfig, tag, owner, 0)
+ {
+ set_info(intc, irq, type);
+ }
void set_info(const char *intc, int irq, int type);
diff --git a/src/devices/cpu/h8/h8s2245.cpp b/src/devices/cpu/h8/h8s2245.cpp
index 0ff0987f366..c5e68c9bb4f 100644
--- a/src/devices/cpu/h8/h8s2245.cpp
+++ b/src/devices/cpu/h8/h8s2245.cpp
@@ -176,26 +176,27 @@ void h8s2245_device::map(address_map &map)
map(0xfffff8, 0xfffffb).rw("timer16:2", FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w));
}
-MACHINE_CONFIG_START(h8s2245_device::device_add_mconfig)
- MCFG_H8S_INTC_ADD("intc")
- MCFG_H8_ADC_2245_ADD("adc", "intc", 28)
- MCFG_H8_DTC_ADD("dtc", "intc", 24)
- MCFG_H8_PORT_ADD("port1", h8_device::PORT_1, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port2", h8_device::PORT_2, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port3", h8_device::PORT_3, 0xc0, 0xc0)
- MCFG_H8_PORT_ADD("port4", h8_device::PORT_4, 0xf0, 0xf0)
- MCFG_H8_PORT_ADD("port5", h8_device::PORT_5, 0xf0, 0xf0)
- MCFG_H8_PORT_ADD("porta", h8_device::PORT_A, 0xf0, 0xf0)
- MCFG_H8_PORT_ADD("portb", h8_device::PORT_B, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portc", h8_device::PORT_C, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portd", h8_device::PORT_D, 0x00, 0x00)
- MCFG_H8_PORT_ADD("porte", h8_device::PORT_E, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portf", h8_device::PORT_F, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portg", h8_device::PORT_G, 0xe0, 0x00)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_0", "intc", 64, 65, 66, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false)
- MCFG_H8_TIMER16_ADD("timer16", 3, 0x00)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:0", 4, 0x60, "intc", 32,
+void h8s2245_device::device_add_mconfig(machine_config &config)
+{
+ H8S_INTC(config, "intc");
+ H8_ADC_2245(config, "adc", "intc", 28);
+ H8_DTC(config, "dtc", "intc", 24);
+ H8_PORT(config, "port1", h8_device::PORT_1, 0x00, 0x00);
+ H8_PORT(config, "port2", h8_device::PORT_2, 0x00, 0x00);
+ H8_PORT(config, "port3", h8_device::PORT_3, 0xc0, 0xc0);
+ H8_PORT(config, "port4", h8_device::PORT_4, 0xf0, 0xf0);
+ H8_PORT(config, "port5", h8_device::PORT_5, 0xf0, 0xf0);
+ H8_PORT(config, "porta", h8_device::PORT_A, 0xf0, 0xf0);
+ H8_PORT(config, "portb", h8_device::PORT_B, 0x00, 0x00);
+ H8_PORT(config, "portc", h8_device::PORT_C, 0x00, 0x00);
+ H8_PORT(config, "portd", h8_device::PORT_D, 0x00, 0x00);
+ H8_PORT(config, "porte", h8_device::PORT_E, 0x00, 0x00);
+ H8_PORT(config, "portf", h8_device::PORT_F, 0x00, 0x00);
+ H8_PORT(config, "portg", h8_device::PORT_G, 0xe0, 0x00);
+ H8H_TIMER8_CHANNEL(config, "timer8_0", "intc", 64, 65, 66, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false);
+ H8H_TIMER8_CHANNEL(config, "timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false);
+ H8_TIMER16(config, "timer16", 3, 0x00);
+ H8S_TIMER16_CHANNEL(config, "timer16:0", 4, 0x60, "intc", 32,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -203,8 +204,8 @@ MACHINE_CONFIG_START(h8s2245_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::INPUT_C,
- h8_timer16_channel_device::INPUT_D)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:1", 2, 0x4c, "intc", 40,
+ h8_timer16_channel_device::INPUT_D);
+ H8S_TIMER16_CHANNEL(config, "timer16:1", 2, 0x4c, "intc", 40,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -212,9 +213,8 @@ MACHINE_CONFIG_START(h8s2245_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::DIV_256,
- h8_timer16_channel_device::CHAIN)
- MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:2")
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:2", 2, 0x4c, "intc", 44,
+ h8_timer16_channel_device::CHAIN).set_chain("timer16:2");
+ H8S_TIMER16_CHANNEL(config, "timer16:2", 2, 0x4c, "intc", 44,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -222,12 +222,12 @@ MACHINE_CONFIG_START(h8s2245_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::INPUT_C,
- h8_timer16_channel_device::DIV_1024)
- MCFG_H8_SCI_ADD("sci0", "intc", 80, 81, 82, 83)
- MCFG_H8_SCI_ADD("sci1", "intc", 84, 85, 86, 87)
- MCFG_H8_SCI_ADD("sci2", "intc", 88, 89, 90, 91)
- MCFG_H8_WATCHDOG_ADD("watchdog", "intc", 25, h8_watchdog_device::S)
-MACHINE_CONFIG_END
+ h8_timer16_channel_device::DIV_1024);
+ H8_SCI(config, "sci0", "intc", 80, 81, 82, 83);
+ H8_SCI(config, "sci1", "intc", 84, 85, 86, 87);
+ H8_SCI(config, "sci2", "intc", 88, 89, 90, 91);
+ H8_WATCHDOG(config, "watchdog", "intc", 25, h8_watchdog_device::S);
+}
void h8s2245_device::execute_set_input(int inputnum, int state)
{
diff --git a/src/devices/cpu/h8/h8s2320.cpp b/src/devices/cpu/h8/h8s2320.cpp
index fc718483f82..48b8a299f63 100644
--- a/src/devices/cpu/h8/h8s2320.cpp
+++ b/src/devices/cpu/h8/h8s2320.cpp
@@ -264,30 +264,31 @@ void h8s2320_device::map(address_map &map)
// TODO: the 2321 doesn't have the dma subdevice
-MACHINE_CONFIG_START(h8s2320_device::device_add_mconfig)
- MCFG_H8S_INTC_ADD("intc")
- MCFG_H8_ADC_2320_ADD("adc", "intc", 28)
- MCFG_H8_DMA_ADD("dma")
- MCFG_H8_DMA_CHANNEL_ADD("dma:0", "intc", 72, h8_dma_channel_device::NONE, 28, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, 82, 81, 86, 85, 32, 40, 44, 48, 56, 60, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE)
- MCFG_H8_DMA_CHANNEL_ADD("dma:1", "intc", 74, h8_dma_channel_device::NONE, 28, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 82, 81, 86, 85, 32, 40, 44, 48, 56, 60, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE)
- MCFG_H8_DTC_ADD("dtc", "intc", 24)
- MCFG_H8_PORT_ADD("port1", h8_device::PORT_1, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port2", h8_device::PORT_2, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port3", h8_device::PORT_3, 0xc0, 0xc0)
- MCFG_H8_PORT_ADD("port4", h8_device::PORT_4, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port5", h8_device::PORT_5, 0xf0, 0xf0)
- MCFG_H8_PORT_ADD("port6", h8_device::PORT_6, 0x00, 0x00)
- MCFG_H8_PORT_ADD("porta", h8_device::PORT_A, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portb", h8_device::PORT_B, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portc", h8_device::PORT_C, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portd", h8_device::PORT_D, 0x00, 0x00)
- MCFG_H8_PORT_ADD("porte", h8_device::PORT_E, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portf", h8_device::PORT_F, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portg", h8_device::PORT_G, 0xe0, 0xe0)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_0", "intc", 64, 65, 66, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false)
- MCFG_H8_TIMER16_ADD("timer16", 6, 0x00)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:0", 4, 0x60, "intc", 32,
+void h8s2320_device::device_add_mconfig(machine_config &config)
+{
+ H8S_INTC(config, "intc");
+ H8_ADC_2320(config, "adc", "intc", 28);
+ H8_DMA(config, "dma");
+ H8_DMA_CHANNEL(config, "dma:0", "intc", 72, h8_dma_channel_device::NONE, 28, h8_dma_channel_device::NONE, h8_dma_channel_device::NONE, 82, 81, 86, 85, 32, 40, 44, 48, 56, 60);
+ H8_DMA_CHANNEL(config, "dma:1", "intc", 74, h8_dma_channel_device::NONE, 28, h8_dma_channel_device::DREQ_EDGE, h8_dma_channel_device::DREQ_LEVEL, 82, 81, 86, 85, 32, 40, 44, 48, 56, 60);
+ H8_DTC(config, "dtc", "intc", 24);
+ H8_PORT(config, "port1", h8_device::PORT_1, 0x00, 0x00);
+ H8_PORT(config, "port2", h8_device::PORT_2, 0x00, 0x00);
+ H8_PORT(config, "port3", h8_device::PORT_3, 0xc0, 0xc0);
+ H8_PORT(config, "port4", h8_device::PORT_4, 0x00, 0x00);
+ H8_PORT(config, "port5", h8_device::PORT_5, 0xf0, 0xf0);
+ H8_PORT(config, "port6", h8_device::PORT_6, 0x00, 0x00);
+ H8_PORT(config, "porta", h8_device::PORT_A, 0x00, 0x00);
+ H8_PORT(config, "portb", h8_device::PORT_B, 0x00, 0x00);
+ H8_PORT(config, "portc", h8_device::PORT_C, 0x00, 0x00);
+ H8_PORT(config, "portd", h8_device::PORT_D, 0x00, 0x00);
+ H8_PORT(config, "porte", h8_device::PORT_E, 0x00, 0x00);
+ H8_PORT(config, "portf", h8_device::PORT_F, 0x00, 0x00);
+ H8_PORT(config, "portg", h8_device::PORT_G, 0xe0, 0xe0);
+ H8H_TIMER8_CHANNEL(config, "timer8_0", "intc", 64, 65, 66, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false);
+ H8H_TIMER8_CHANNEL(config, "timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false);
+ H8_TIMER16(config, "timer16", 6, 0x00);
+ H8S_TIMER16_CHANNEL(config, "timer16:0", 4, 0x60, "intc", 32,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -295,8 +296,8 @@ MACHINE_CONFIG_START(h8s2320_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::INPUT_C,
- h8_timer16_channel_device::INPUT_D)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:1", 2, 0x4c, "intc", 40,
+ h8_timer16_channel_device::INPUT_D);
+ H8S_TIMER16_CHANNEL(config, "timer16:1", 2, 0x4c, "intc", 40,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -304,9 +305,8 @@ MACHINE_CONFIG_START(h8s2320_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::DIV_256,
- h8_timer16_channel_device::CHAIN)
- MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:2")
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:2", 2, 0x4c, "intc", 44,
+ h8_timer16_channel_device::CHAIN).set_chain("timer16:2");
+ H8S_TIMER16_CHANNEL(config, "timer16:2", 2, 0x4c, "intc", 44,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -314,8 +314,8 @@ MACHINE_CONFIG_START(h8s2320_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::INPUT_C,
- h8_timer16_channel_device::DIV_1024)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:3", 4, 0x60, "intc", 48,
+ h8_timer16_channel_device::DIV_1024);
+ H8S_TIMER16_CHANNEL(config, "timer16:3", 4, 0x60, "intc", 48,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -323,8 +323,8 @@ MACHINE_CONFIG_START(h8s2320_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::DIV_1024,
h8_timer16_channel_device::DIV_256,
- h8_timer16_channel_device::DIV_4096)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:4", 2, 0x4c, "intc", 56,
+ h8_timer16_channel_device::DIV_4096);
+ H8S_TIMER16_CHANNEL(config, "timer16:4", 2, 0x4c, "intc", 56,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -332,9 +332,8 @@ MACHINE_CONFIG_START(h8s2320_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_C,
h8_timer16_channel_device::DIV_1024,
- h8_timer16_channel_device::CHAIN)
- MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:5")
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:5", 2, 0x4c, "intc", 60,
+ h8_timer16_channel_device::CHAIN).set_chain("timer16:5");
+ H8S_TIMER16_CHANNEL(config, "timer16:5", 2, 0x4c, "intc", 60,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -342,12 +341,12 @@ MACHINE_CONFIG_START(h8s2320_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_C,
h8_timer16_channel_device::DIV_256,
- h8_timer16_channel_device::INPUT_D)
- MCFG_H8_SCI_ADD("sci0", "intc", 80, 81, 82, 83)
- MCFG_H8_SCI_ADD("sci1", "intc", 84, 85, 86, 87)
- MCFG_H8_SCI_ADD("sci2", "intc", 88, 89, 90, 91)
- MCFG_H8_WATCHDOG_ADD("watchdog", "intc", 25, h8_watchdog_device::H)
-MACHINE_CONFIG_END
+ h8_timer16_channel_device::INPUT_D);
+ H8_SCI(config, "sci0", "intc", 80, 81, 82, 83);
+ H8_SCI(config, "sci1", "intc", 84, 85, 86, 87);
+ H8_SCI(config, "sci2", "intc", 88, 89, 90, 91);
+ H8_WATCHDOG(config, "watchdog", "intc", 25, h8_watchdog_device::H);
+}
void h8s2320_device::execute_set_input(int inputnum, int state)
{
diff --git a/src/devices/cpu/h8/h8s2357.cpp b/src/devices/cpu/h8/h8s2357.cpp
index 75dde9f91ff..02b9e7bf09b 100644
--- a/src/devices/cpu/h8/h8s2357.cpp
+++ b/src/devices/cpu/h8/h8s2357.cpp
@@ -209,26 +209,27 @@ void h8s2357_device::map(address_map &map)
map(0xfffff8, 0xfffffb).rw("timer16:2", FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w));
}
-MACHINE_CONFIG_START(h8s2357_device::device_add_mconfig)
- MCFG_H8S_INTC_ADD("intc")
- MCFG_H8_ADC_2357_ADD("adc", "intc", 28)
- MCFG_H8_PORT_ADD("port1", h8_device::PORT_1, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port2", h8_device::PORT_2, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port3", h8_device::PORT_3, 0xc0, 0xc0)
- MCFG_H8_PORT_ADD("port4", h8_device::PORT_4, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port5", h8_device::PORT_5, 0xf0, 0xf0)
- MCFG_H8_PORT_ADD("port6", h8_device::PORT_6, 0x00, 0x00)
- MCFG_H8_PORT_ADD("porta", h8_device::PORT_A, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portb", h8_device::PORT_B, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portc", h8_device::PORT_C, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portd", h8_device::PORT_D, 0x00, 0x00)
- MCFG_H8_PORT_ADD("porte", h8_device::PORT_E, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portf", h8_device::PORT_F, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portg", h8_device::PORT_G, 0xe0, 0xe0)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_0", "intc", 64, 65, 66, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false)
- MCFG_H8_TIMER16_ADD("timer16", 6, 0x00)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:0", 4, 0x60, "intc", 32,
+void h8s2357_device::device_add_mconfig(machine_config &config)
+{
+ H8S_INTC(config, "intc");
+ H8_ADC_2357(config, "adc", "intc", 28);
+ H8_PORT(config, "port1", h8_device::PORT_1, 0x00, 0x00);
+ H8_PORT(config, "port2", h8_device::PORT_2, 0x00, 0x00);
+ H8_PORT(config, "port3", h8_device::PORT_3, 0xc0, 0xc0);
+ H8_PORT(config, "port4", h8_device::PORT_4, 0x00, 0x00);
+ H8_PORT(config, "port5", h8_device::PORT_5, 0xf0, 0xf0);
+ H8_PORT(config, "port6", h8_device::PORT_6, 0x00, 0x00);
+ H8_PORT(config, "porta", h8_device::PORT_A, 0x00, 0x00);
+ H8_PORT(config, "portb", h8_device::PORT_B, 0x00, 0x00);
+ H8_PORT(config, "portc", h8_device::PORT_C, 0x00, 0x00);
+ H8_PORT(config, "portd", h8_device::PORT_D, 0x00, 0x00);
+ H8_PORT(config, "porte", h8_device::PORT_E, 0x00, 0x00);
+ H8_PORT(config, "portf", h8_device::PORT_F, 0x00, 0x00);
+ H8_PORT(config, "portg", h8_device::PORT_G, 0xe0, 0xe0);
+ H8H_TIMER8_CHANNEL(config, "timer8_0", "intc", 64, 65, 66, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false);
+ H8H_TIMER8_CHANNEL(config, "timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false);
+ H8_TIMER16(config, "timer16", 6, 0x00);
+ H8S_TIMER16_CHANNEL(config, "timer16:0", 4, 0x60, "intc", 32,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -236,8 +237,8 @@ MACHINE_CONFIG_START(h8s2357_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::INPUT_C,
- h8_timer16_channel_device::INPUT_D)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:1", 2, 0x4c, "intc", 40,
+ h8_timer16_channel_device::INPUT_D);
+ H8S_TIMER16_CHANNEL(config, "timer16:1", 2, 0x4c, "intc", 40,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -245,9 +246,8 @@ MACHINE_CONFIG_START(h8s2357_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::DIV_256,
- h8_timer16_channel_device::CHAIN)
- MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:2")
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:2", 2, 0x4c, "intc", 44,
+ h8_timer16_channel_device::CHAIN).set_chain("timer16:2");
+ H8S_TIMER16_CHANNEL(config, "timer16:2", 2, 0x4c, "intc", 44,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -255,8 +255,8 @@ MACHINE_CONFIG_START(h8s2357_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::INPUT_C,
- h8_timer16_channel_device::DIV_1024)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:3", 4, 0x60, "intc", 48,
+ h8_timer16_channel_device::DIV_1024);
+ H8S_TIMER16_CHANNEL(config, "timer16:3", 4, 0x60, "intc", 48,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -264,8 +264,8 @@ MACHINE_CONFIG_START(h8s2357_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::DIV_1024,
h8_timer16_channel_device::DIV_256,
- h8_timer16_channel_device::DIV_4096)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:4", 2, 0x4c, "intc", 56,
+ h8_timer16_channel_device::DIV_4096);
+ H8S_TIMER16_CHANNEL(config, "timer16:4", 2, 0x4c, "intc", 56,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -273,9 +273,8 @@ MACHINE_CONFIG_START(h8s2357_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_C,
h8_timer16_channel_device::DIV_1024,
- h8_timer16_channel_device::CHAIN)
- MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:5")
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:5", 2, 0x4c, "intc", 60,
+ h8_timer16_channel_device::CHAIN).set_chain("timer16:5");
+ H8S_TIMER16_CHANNEL(config, "timer16:5", 2, 0x4c, "intc", 60,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -283,12 +282,12 @@ MACHINE_CONFIG_START(h8s2357_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_C,
h8_timer16_channel_device::DIV_256,
- h8_timer16_channel_device::INPUT_D)
- MCFG_H8_SCI_ADD("sci0", "intc", 80, 81, 82, 83)
- MCFG_H8_SCI_ADD("sci1", "intc", 84, 85, 86, 87)
- MCFG_H8_SCI_ADD("sci2", "intc", 88, 89, 90, 91)
- MCFG_H8_WATCHDOG_ADD("watchdog", "intc", 25, h8_watchdog_device::S)
-MACHINE_CONFIG_END
+ h8_timer16_channel_device::INPUT_D);
+ H8_SCI(config, "sci0", "intc", 80, 81, 82, 83);
+ H8_SCI(config, "sci1", "intc", 84, 85, 86, 87);
+ H8_SCI(config, "sci2", "intc", 88, 89, 90, 91);
+ H8_WATCHDOG(config, "watchdog", "intc", 25, h8_watchdog_device::S);
+}
void h8s2357_device::execute_set_input(int inputnum, int state)
{
diff --git a/src/devices/cpu/h8/h8s2655.cpp b/src/devices/cpu/h8/h8s2655.cpp
index 54dbada716e..f09b08bcab0 100644
--- a/src/devices/cpu/h8/h8s2655.cpp
+++ b/src/devices/cpu/h8/h8s2655.cpp
@@ -188,26 +188,27 @@ void h8s2655_device::map(address_map &map)
map(0xfffff8, 0xfffffb).rw("timer16:2", FUNC(h8_timer16_channel_device::tgr_r), FUNC(h8_timer16_channel_device::tgr_w));
}
-MACHINE_CONFIG_START(h8s2655_device::device_add_mconfig)
- MCFG_H8S_INTC_ADD("intc")
- MCFG_H8_ADC_2655_ADD("adc", "intc", 28)
- MCFG_H8_PORT_ADD("port1", h8_device::PORT_1, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port2", h8_device::PORT_2, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port3", h8_device::PORT_3, 0xc0, 0xc0)
- MCFG_H8_PORT_ADD("port4", h8_device::PORT_4, 0x00, 0x00)
- MCFG_H8_PORT_ADD("port5", h8_device::PORT_5, 0xf0, 0xf0)
- MCFG_H8_PORT_ADD("port6", h8_device::PORT_6, 0x00, 0x00)
- MCFG_H8_PORT_ADD("porta", h8_device::PORT_A, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portb", h8_device::PORT_B, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portc", h8_device::PORT_C, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portd", h8_device::PORT_D, 0x00, 0x00)
- MCFG_H8_PORT_ADD("porte", h8_device::PORT_E, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portf", h8_device::PORT_F, 0x00, 0x00)
- MCFG_H8_PORT_ADD("portg", h8_device::PORT_G, 0xe0, 0xe0)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_0", "intc", 64, 65, 66, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false)
- MCFG_H8H_TIMER8_CHANNEL_ADD("timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false)
- MCFG_H8_TIMER16_ADD("timer16", 6, 0x00)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:0", 4, 0x60, "intc", 32,
+void h8s2655_device::device_add_mconfig(machine_config &config)
+{
+ H8S_INTC(config, "intc");
+ H8_ADC_2655(config, "adc", "intc", 28);
+ H8_PORT(config, "port1", h8_device::PORT_1, 0x00, 0x00);
+ H8_PORT(config, "port2", h8_device::PORT_2, 0x00, 0x00);
+ H8_PORT(config, "port3", h8_device::PORT_3, 0xc0, 0xc0);
+ H8_PORT(config, "port4", h8_device::PORT_4, 0x00, 0x00);
+ H8_PORT(config, "port5", h8_device::PORT_5, 0xf0, 0xf0);
+ H8_PORT(config, "port6", h8_device::PORT_6, 0x00, 0x00);
+ H8_PORT(config, "porta", h8_device::PORT_A, 0x00, 0x00);
+ H8_PORT(config, "portb", h8_device::PORT_B, 0x00, 0x00);
+ H8_PORT(config, "portc", h8_device::PORT_C, 0x00, 0x00);
+ H8_PORT(config, "portd", h8_device::PORT_D, 0x00, 0x00);
+ H8_PORT(config, "porte", h8_device::PORT_E, 0x00, 0x00);
+ H8_PORT(config, "portf", h8_device::PORT_F, 0x00, 0x00);
+ H8_PORT(config, "portg", h8_device::PORT_G, 0xe0, 0xe0);
+ H8H_TIMER8_CHANNEL(config, "timer8_0", "intc", 64, 65, 66, "timer8_1", h8_timer8_channel_device::CHAIN_OVERFLOW, true, false);
+ H8H_TIMER8_CHANNEL(config, "timer8_1", "intc", 68, 69, 70, "timer8_0", h8_timer8_channel_device::CHAIN_A, false, false);
+ H8_TIMER16(config, "timer16", 6, 0x00);
+ H8S_TIMER16_CHANNEL(config, "timer16:0", 4, 0x60, "intc", 32,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -215,8 +216,8 @@ MACHINE_CONFIG_START(h8s2655_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::INPUT_C,
- h8_timer16_channel_device::INPUT_D)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:1", 2, 0x4c, "intc", 40,
+ h8_timer16_channel_device::INPUT_D);
+ H8S_TIMER16_CHANNEL(config, "timer16:1", 2, 0x4c, "intc", 40,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -224,9 +225,8 @@ MACHINE_CONFIG_START(h8s2655_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::DIV_256,
- h8_timer16_channel_device::CHAIN)
- MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:2")
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:2", 2, 0x4c, "intc", 44,
+ h8_timer16_channel_device::CHAIN).set_chain("timer16:2");
+ H8S_TIMER16_CHANNEL(config, "timer16:2", 2, 0x4c, "intc", 44,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -234,8 +234,8 @@ MACHINE_CONFIG_START(h8s2655_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_B,
h8_timer16_channel_device::INPUT_C,
- h8_timer16_channel_device::DIV_1024)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:3", 4, 0x60, "intc", 48,
+ h8_timer16_channel_device::DIV_1024);
+ H8S_TIMER16_CHANNEL(config, "timer16:3", 4, 0x60, "intc", 48,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -243,8 +243,8 @@ MACHINE_CONFIG_START(h8s2655_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::DIV_1024,
h8_timer16_channel_device::DIV_256,
- h8_timer16_channel_device::DIV_4096)
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:4", 2, 0x4c, "intc", 56,
+ h8_timer16_channel_device::DIV_4096);
+ H8S_TIMER16_CHANNEL(config, "timer16:4", 2, 0x4c, "intc", 56,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -252,9 +252,8 @@ MACHINE_CONFIG_START(h8s2655_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_C,
h8_timer16_channel_device::DIV_1024,
- h8_timer16_channel_device::CHAIN)
- MCFG_H8S_TIMER16_CHANNEL_SET_CHAIN("timer16:5")
- MCFG_H8S_TIMER16_CHANNEL_ADD("timer16:5", 2, 0x4c, "intc", 60,
+ h8_timer16_channel_device::CHAIN).set_chain("timer16:5");
+ H8S_TIMER16_CHANNEL(config, "timer16:5", 2, 0x4c, "intc", 60,
h8_timer16_channel_device::DIV_1,
h8_timer16_channel_device::DIV_4,
h8_timer16_channel_device::DIV_16,
@@ -262,12 +261,12 @@ MACHINE_CONFIG_START(h8s2655_device::device_add_mconfig)
h8_timer16_channel_device::INPUT_A,
h8_timer16_channel_device::INPUT_C,
h8_timer16_channel_device::DIV_256,
- h8_timer16_channel_device::INPUT_D)
- MCFG_H8_SCI_ADD("sci0", "intc", 80, 81, 82, 83)
- MCFG_H8_SCI_ADD("sci1", "intc", 84, 85, 86, 87)
- MCFG_H8_SCI_ADD("sci2", "intc", 88, 89, 90, 91)
- MCFG_H8_WATCHDOG_ADD("watchdog", "intc", 25, h8_watchdog_device::S)
-MACHINE_CONFIG_END
+ h8_timer16_channel_device::INPUT_D);
+ H8_SCI(config, "sci0", "intc", 80, 81, 82, 83);
+ H8_SCI(config, "sci1", "intc", 84, 85, 86, 87);
+ H8_SCI(config, "sci2", "intc", 88, 89, 90, 91);
+ H8_WATCHDOG(config, "watchdog", "intc", 25, h8_watchdog_device::S);
+}
void h8s2655_device::execute_set_input(int inputnum, int state)
{