From 0d18b4828dafaa399fc7511010f224528b48600a Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 7 Nov 2024 03:23:45 -0500 Subject: [PATCH] OPN: fix 30xx --- src/engine/platform/fmsharedbase.h | 4 ++-- src/engine/platform/ym2203.cpp | 6 +++--- src/engine/platform/ym2203ext.cpp | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/engine/platform/fmsharedbase.h b/src/engine/platform/fmsharedbase.h index f8e0268dd..baddd6798 100644 --- a/src/engine/platform/fmsharedbase.h +++ b/src/engine/platform/fmsharedbase.h @@ -77,7 +77,7 @@ class DivPlatformFMBase: public DivDispatch { struct QueuedWrite { unsigned int addr; - unsigned char val; + unsigned short val; bool addrOrVal; QueuedWrite(): addr(0), val(0), addrOrVal(false) {} QueuedWrite(unsigned int a, unsigned char v): addr(a), val(v), addrOrVal(false) {} @@ -97,7 +97,7 @@ class DivPlatformFMBase: public DivDispatch { pendingWrites[a]=v; } } - inline void immWrite(unsigned int a, unsigned char v) { + inline void immWrite(unsigned int a, unsigned short v) { if (!skipRegisterWrites) { writes.push_back(QueuedWrite(a,v)); if (dumpWrites) { diff --git a/src/engine/platform/ym2203.cpp b/src/engine/platform/ym2203.cpp index c85ba93cb..17f742b02 100644 --- a/src/engine/platform/ym2203.cpp +++ b/src/engine/platform/ym2203.cpp @@ -188,7 +188,7 @@ void DivPlatformYM2203::acquire_combo(short** buf, size_t len) { QueuedWrite& w=writes.front(); if (w.addr==0xfffffffe) { - delay=w.val; + delay=w.val*24; writes.pop_front(); } else if (w.addr<=0x1c || w.addr==0x2d || w.addr==0x2e || w.addr==0x2f) { // ymfm write @@ -271,7 +271,7 @@ void DivPlatformYM2203::acquire_ymfm(short** buf, size_t len) { if (--delay<1) { QueuedWrite& w=writes.front(); if (w.addr==0xfffffffe) { - delay=w.val*6; + delay=w.val*3; } else { fm->write(0x0,w.addr); fm->write(0x1,w.val); @@ -668,7 +668,7 @@ void DivPlatformYM2203::tick(bool sysTick) { // hard reset handling if (mustHardReset) { - immWrite(0xfffffffe,hardResetCycles-hardResetElapsed); + immWrite(0xfffffffe,(hardResetCycles-hardResetElapsed)*3); for (int i=0; i<3; i++) { if (i==2 && extMode) continue; if ((chan[i].keyOn || chan[i].opMaskChanged) && chan[i].hardReset) { diff --git a/src/engine/platform/ym2203ext.cpp b/src/engine/platform/ym2203ext.cpp index 9e4da8d24..09198e8d4 100644 --- a/src/engine/platform/ym2203ext.cpp +++ b/src/engine/platform/ym2203ext.cpp @@ -595,7 +595,7 @@ void DivPlatformYM2203Ext::tick(bool sysTick) { // hard reset handling if (mustHardReset) { - immWrite(0xfffffffe,hardResetCycles-hardResetElapsed); + immWrite(0xfffffffe,(hardResetCycles-hardResetElapsed)*3); for (int i=0; i<4; i++) { if (opChan[i].keyOn && opChan[i].hardReset) { // restore SL/RR