diff options
Diffstat (limited to 'src/devices/machine/spg2xx.cpp')
-rw-r--r-- | src/devices/machine/spg2xx.cpp | 64 |
1 files changed, 37 insertions, 27 deletions
diff --git a/src/devices/machine/spg2xx.cpp b/src/devices/machine/spg2xx.cpp index dc38e8b4a85..42b05c7e9a2 100644 --- a/src/devices/machine/spg2xx.cpp +++ b/src/devices/machine/spg2xx.cpp @@ -18,37 +18,39 @@ DEFINE_DEVICE_TYPE(SPG24X, spg24x_device, "spg24x", "SPG240-series System-on-a-C DEFINE_DEVICE_TYPE(SPG28X, spg28x_device, "spg28x", "SPG280-series System-on-a-Chip") -spg2xx_device::spg2xx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint16_t sprite_limit, address_map_constructor internal) - : unsp_device(mconfig, type, tag, owner, clock, internal) - , device_mixer_interface(mconfig, *this, 2) - , m_spg_audio(*this, "spgaudio") - , m_spg_io(*this, "spgio") - , m_spg_sysdma(*this, "spgsysdma") - , m_spg_video(*this, "spgvideo") - , m_sprite_limit(sprite_limit) - , m_rowscrolloffset(15) - , m_porta_out(*this) - , m_portb_out(*this) - , m_portc_out(*this) - , m_porta_in(*this) - , m_portb_in(*this) - , m_portc_in(*this) - , m_adc_in(*this) - , m_i2c_w(*this) - , m_i2c_r(*this) - , m_uart_tx(*this) - , m_chip_sel(*this) - , m_screen(*this, finder_base::DUMMY_TAG) +spg2xx_device::spg2xx_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint16_t sprite_limit, address_map_constructor internal) : + unsp_device(mconfig, type, tag, owner, clock, internal), + device_mixer_interface(mconfig, *this, 2), + m_spg_audio(*this, "spgaudio"), + m_spg_io(*this, "spgio"), + m_spg_sysdma(*this, "spgsysdma"), + m_spg_video(*this, "spgvideo"), + m_sprite_limit(sprite_limit), + m_rowscrolloffset(15), + m_porta_out(*this), + m_portb_out(*this), + m_portc_out(*this), + m_porta_in(*this), + m_portb_in(*this), + m_portc_in(*this), + m_adc_in(*this), + m_guny_in(*this), + m_gunx_in(*this), + m_i2c_w(*this), + m_i2c_r(*this), + m_uart_tx(*this), + m_chip_sel(*this), + m_screen(*this, finder_base::DUMMY_TAG) { } -spg24x_device::spg24x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : spg2xx_device(mconfig, SPG24X, tag, owner, clock, 256, address_map_constructor(FUNC(spg24x_device::internal_map), this)) +spg24x_device::spg24x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + spg2xx_device(mconfig, SPG24X, tag, owner, clock, 256, address_map_constructor(FUNC(spg24x_device::internal_map), this)) { } -spg28x_device::spg28x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : spg2xx_device(mconfig, SPG28X, tag, owner, clock, 64, address_map_constructor(FUNC(spg28x_device::internal_map), this)) +spg28x_device::spg28x_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) : + spg2xx_device(mconfig, SPG28X, tag, owner, clock, 64, address_map_constructor(FUNC(spg28x_device::internal_map), this)) { } @@ -78,6 +80,8 @@ void spg2xx_device::device_start() m_portb_in.resolve_safe(0); m_portc_in.resolve_safe(0); m_adc_in.resolve_all_safe(0x0fff); + m_guny_in.resolve_safe(0); + m_gunx_in.resolve_safe(0); m_i2c_w.resolve_safe(); m_i2c_r.resolve_safe(0); m_uart_tx.resolve_safe(); @@ -175,6 +179,9 @@ void spg2xx_device::configure_spg_io(spg2xx_io_device* io) io->write_ffrq_tmr1_irq_callback().set(FUNC(spg2xx_device::ffreq1_w)); io->write_ffrq_tmr2_irq_callback().set(FUNC(spg2xx_device::ffreq2_w)); io->write_fiq_vector_callback().set(FUNC(spg2xx_device::fiq_vector_w)); + + m_spg_video->guny_in().set(FUNC(spg2xx_device::guny_in_r)); + m_spg_video->gunx_in().set(FUNC(spg2xx_device::gunx_in_r)); } void spg24x_device::device_add_mconfig(machine_config &config) @@ -188,7 +195,6 @@ void spg24x_device::device_add_mconfig(machine_config &config) m_spg_audio->add_route(1, *this, 1.0, AUTO_ALLOC_INPUT, 1); SPG24X_IO(config, m_spg_io, DERIVED_CLOCK(1, 1), DEVICE_SELF, m_screen); - configure_spg_io(m_spg_io); SPG2XX_SYSDMA(config, m_spg_sysdma, DERIVED_CLOCK(1, 1), DEVICE_SELF); @@ -196,6 +202,9 @@ void spg24x_device::device_add_mconfig(machine_config &config) m_spg_video->sprlimit_read_callback().set(FUNC(spg24x_device::get_sprlimit)); m_spg_video->rowscrolloffset_read_callback().set(FUNC(spg24x_device::get_rowscrolloffset)); m_spg_video->write_video_irq_callback().set(FUNC(spg24x_device::videoirq_w)); + + configure_spg_io(m_spg_io); + } void spg28x_device::device_add_mconfig(machine_config &config) @@ -209,7 +218,6 @@ void spg28x_device::device_add_mconfig(machine_config &config) m_spg_audio->add_route(1, *this, 1.0, AUTO_ALLOC_INPUT, 1); SPG28X_IO(config, m_spg_io, DERIVED_CLOCK(1, 1), DEVICE_SELF, m_screen); - configure_spg_io(m_spg_io); SPG2XX_SYSDMA(config, m_spg_sysdma, DERIVED_CLOCK(1, 1), DEVICE_SELF); @@ -217,4 +225,6 @@ void spg28x_device::device_add_mconfig(machine_config &config) m_spg_video->sprlimit_read_callback().set(FUNC(spg28x_device::get_sprlimit)); m_spg_video->rowscrolloffset_read_callback().set(FUNC(spg28x_device::get_rowscrolloffset)); m_spg_video->write_video_irq_callback().set(FUNC(spg28x_device::videoirq_w)); + + configure_spg_io(m_spg_io); } |