From 2b6d5ee27c194564aa9fa6c72f64f64d8e058bef Mon Sep 17 00:00:00 2001 From: iq_132 <1191709+iq132@users.noreply.github.com> Date: Sat, 19 Apr 2014 01:39:02 +0000 Subject: [PATCH] Fix Ash No Joe save states. --- src/burn/drv/taito/d_ashnojoe.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/burn/drv/taito/d_ashnojoe.cpp b/src/burn/drv/taito/d_ashnojoe.cpp index ea2b9a4d1..5244e2b2a 100644 --- a/src/burn/drv/taito/d_ashnojoe.cpp +++ b/src/burn/drv/taito/d_ashnojoe.cpp @@ -220,6 +220,8 @@ void DrvYM2203WritePortA(UINT32, UINT32 d) void DrvYM2203WritePortB(UINT32, UINT32 d) { + if (ZetGetActive() == -1) return; // fix crash on init + INT32 bank = (d & 0x0f) * 0x8000; ZetMapArea(0x8000, 0xffff, 0, DrvZ80Banks + bank); @@ -237,11 +239,15 @@ inline static void DrvIRQHandler(INT32, INT32 nStatus) static INT32 DrvSynchroniseStream(INT32 nSoundRate) { + if (ZetGetActive() == -1) return 0; + return (INT64)(double)ZetTotalCycles() * nSoundRate / 4000000; } static double DrvGetTime() { + if (ZetGetActive() == -1) return 0; + return (double)ZetTotalCycles() / 4000000.0; }