diff options
Diffstat (limited to 'src/devices/machine/spg2xx_video.cpp')
-rw-r--r-- | src/devices/machine/spg2xx_video.cpp | 53 |
1 files changed, 20 insertions, 33 deletions
diff --git a/src/devices/machine/spg2xx_video.cpp b/src/devices/machine/spg2xx_video.cpp index da3bb29f7df..f165e930654 100644 --- a/src/devices/machine/spg2xx_video.cpp +++ b/src/devices/machine/spg2xx_video.cpp @@ -11,12 +11,12 @@ DEFINE_DEVICE_TYPE(SPG24X_VIDEO, spg24x_video_device, "spg24x_video", "SPG240-series System-on-a-Chip (Video)") -#define LOG_IRQS (1U << 4) -#define LOG_VLINES (1U << 5) -#define LOG_DMA (1U << 9) -#define LOG_PPU_READS (1U << 22) -#define LOG_PPU_WRITES (1U << 23) -#define LOG_UNKNOWN_PPU (1U << 24) +#define LOG_IRQS (1U << 1) +#define LOG_VLINES (1U << 2) +#define LOG_DMA (1U << 3) +#define LOG_PPU_READS (1U << 4) +#define LOG_PPU_WRITES (1U << 5) +#define LOG_UNKNOWN_PPU (1U << 6) #define LOG_PPU (LOG_PPU_READS | LOG_PPU_WRITES | LOG_UNKNOWN_PPU) #define LOG_ALL (LOG_IRQS | LOG_PPU | LOG_VLINES | LOG_DMA ) @@ -28,16 +28,16 @@ DEFINE_DEVICE_TYPE(SPG24X_VIDEO, spg24x_video_device, "spg24x_video", "SPG240-se spg2xx_video_device::spg2xx_video_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : device_t(mconfig, type, tag, owner, clock), - m_guny_in(*this), - m_gunx_in(*this), - m_sprlimit_read_cb(*this), + m_guny_in(*this, 0), + m_gunx_in(*this, 0), + m_sprlimit_read_cb(*this, 0), + m_video_irq_cb(*this), m_cpu(*this, finder_base::DUMMY_TAG), m_screen(*this, finder_base::DUMMY_TAG), m_scrollram(*this, "scrollram"), m_hcompram(*this, "hcompram"), m_paletteram(*this, "paletteram"), m_spriteram(*this, "spriteram"), - m_video_irq_cb(*this), m_renderer(*this, "renderer") { } @@ -49,16 +49,10 @@ spg24x_video_device::spg24x_video_device(const machine_config &mconfig, const ch void spg2xx_video_device::device_start() { - m_guny_in.resolve_safe(0); - m_gunx_in.resolve_safe(0); - - m_screenpos_timer = timer_alloc(TIMER_SCREENPOS); + m_screenpos_timer = timer_alloc(FUNC(spg2xx_video_device::screenpos_hit), this); m_screenpos_timer->adjust(attotime::never); save_item(NAME(m_video_regs)); - - m_sprlimit_read_cb.resolve_safe(0); - m_video_irq_cb.resolve(); } void spg2xx_video_device::device_reset() @@ -439,7 +433,7 @@ void spg2xx_video_device::video_w(offs_t offset, uint16_t data) } } -WRITE_LINE_MEMBER(spg2xx_video_device::vblank) +void spg2xx_video_device::vblank(int state) { if (!state) { @@ -463,24 +457,17 @@ void spg2xx_video_device::check_video_irq() m_video_irq_cb((VIDEO_IRQ_STATUS & VIDEO_IRQ_ENABLE) ? ASSERT_LINE : CLEAR_LINE); } -void spg2xx_video_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +TIMER_CALLBACK_MEMBER(spg2xx_video_device::screenpos_hit) { - switch (id) + if (VIDEO_IRQ_ENABLE & 2) { - case TIMER_SCREENPOS: - { - if (VIDEO_IRQ_ENABLE & 2) - { - VIDEO_IRQ_STATUS |= 2; - check_video_irq(); - } - m_screen->update_partial(m_screen->vpos()); - - // fire again, jak_dbz pinball needs this - m_screenpos_timer->adjust(m_screen->time_until_pos(m_video_regs[0x36], m_video_regs[0x37] << 1)); - break; - } + VIDEO_IRQ_STATUS |= 2; + check_video_irq(); } + m_screen->update_partial(m_screen->vpos()); + + // fire again, jak_dbz pinball needs this + m_screenpos_timer->adjust(m_screen->time_until_pos(m_video_regs[0x36], m_video_regs[0x37] << 1)); } |