summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/vrender0.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/vrender0.cpp')
-rw-r--r--src/devices/machine/vrender0.cpp66
1 files changed, 16 insertions, 50 deletions
diff --git a/src/devices/machine/vrender0.cpp b/src/devices/machine/vrender0.cpp
index c97a40a5736..81ffdea1af0 100644
--- a/src/devices/machine/vrender0.cpp
+++ b/src/devices/machine/vrender0.cpp
@@ -130,10 +130,8 @@ void vrender0soc_device::device_add_mconfig(machine_config &config)
m_screen->screen_vblank().set(FUNC(vrender0soc_device::screen_vblank));
m_screen->set_palette(m_palette);
- VIDEO_VRENDER0(config, m_vr0vid, 14318180);
-#ifdef IDLE_LOOP_SPEEDUP
- m_vr0vid->idleskip_cb().set(FUNC(vrender0soc_device::idle_skip_speedup_w));
-#endif
+ // runs at double speed wrt of the CPU clock
+ VIDEO_VRENDER0(config, m_vr0vid, DERIVED_CLOCK(2, 1));
PALETTE(config, m_palette, palette_device::RGB_565);
@@ -164,10 +162,10 @@ void vrender0soc_device::device_start()
if (this->clock() == 0)
fatalerror("%s: bus clock not setup properly",this->tag());
- for (int i = 0; i < 4; i++)
- m_Timer[i] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(vrender0soc_device::Timercb),this), (void*)(uintptr_t)i);
-
- write_tx.resolve_all_safe();
+ m_Timer[0] = timer_alloc(FUNC(vrender0soc_device::Timercb<0>), this);
+ m_Timer[1] = timer_alloc(FUNC(vrender0soc_device::Timercb<1>), this);
+ m_Timer[2] = timer_alloc(FUNC(vrender0soc_device::Timercb<2>), this);
+ m_Timer[3] = timer_alloc(FUNC(vrender0soc_device::Timercb<3>), this);
for (int i = 0; i < 2; i++)
{
@@ -190,10 +188,6 @@ void vrender0soc_device::device_start()
save_item(NAME(m_dma[1].src));
save_item(NAME(m_dma[1].dst));
save_item(NAME(m_dma[1].size));
-
-#ifdef IDLE_LOOP_SPEEDUP
- save_item(NAME(m_FlipCntRead));
-#endif
}
void vrender0soc_device::write_line_tx(int port, uint8_t value)
@@ -224,10 +218,6 @@ void vrender0soc_device::device_reset()
m_timer_control[i] = 0xff << 8;
m_Timer[i]->adjust(attotime::never);
}
-
-#ifdef IDLE_LOOP_SPEEDUP
- m_FlipCntRead = 0;
-#endif
}
@@ -316,10 +306,6 @@ void vrender0soc_device::IntReq( int num )
m_intst |= (1 << num);
m_host_cpu->set_input_line(SE3208_INT, ASSERT_LINE);
}
-
-#ifdef IDLE_LOOP_SPEEDUP
- idle_skip_resume_w(ASSERT_LINE);
-#endif
}
@@ -336,7 +322,7 @@ uint8_t vrender0soc_device::irq_callback()
}
-WRITE_LINE_MEMBER(vrender0soc_device::soundirq_cb)
+void vrender0soc_device::soundirq_cb(int state)
{
if (state)
{
@@ -362,17 +348,17 @@ void vrender0soc_device::TimerStart(int which)
// printf("timer %d start, PD = %x TCV = %x period = %s\n", which, PD, TCV, period.as_string());
}
+template<int Which>
TIMER_CALLBACK_MEMBER(vrender0soc_device::Timercb)
{
- int which = (int)(uintptr_t)ptr;
static const int num[] = { 0, 1, 9, 10 };
- if (m_timer_control[which] & 2)
- TimerStart(which);
+ if (m_timer_control[Which] & 2)
+ TimerStart(Which);
else
- m_timer_control[which] &= ~1;
+ m_timer_control[Which] &= ~1;
- IntReq(num[which]);
+ IntReq(num[Which]);
}
template<int Which>
@@ -720,35 +706,15 @@ uint32_t vrender0soc_device::screen_update(screen_device &screen, bitmap_ind16 &
return 0;
}
-WRITE_LINE_MEMBER(vrender0soc_device::screen_vblank)
+void vrender0soc_device::screen_vblank(int state)
{
// rising edge
if (state)
{
if (crt_active_vblank_irq() == true)
+ {
IntReq(24); //VRender0 VBlank
-
- m_vr0vid->execute_flipping();
+ m_vr0vid->execute_flipping();
+ }
}
}
-
-/*
- *
- * Hacks
- *
- */
-
-#ifdef IDLE_LOOP_SPEEDUP
-WRITE_LINE_MEMBER(vrender0soc_device::idle_skip_resume_w)
-{
- m_FlipCntRead = 0;
- m_host_cpu->resume(SUSPEND_REASON_SPIN);
-}
-
-WRITE_LINE_MEMBER(vrender0soc_device::idle_skip_speedup_w)
-{
- m_FlipCntRead++;
- if (m_FlipCntRead >= 16 && irq_pending() == false && state == ASSERT_LINE)
- m_host_cpu->suspend(SUSPEND_REASON_SPIN, 1);
-}
-#endif