OPN: fix 30xx

This commit is contained in:
tildearrow 2024-11-07 03:23:45 -05:00
parent 89298b18ed
commit 0d18b4828d
3 changed files with 6 additions and 6 deletions

View file

@ -77,7 +77,7 @@ class DivPlatformFMBase: public DivDispatch {
struct QueuedWrite { struct QueuedWrite {
unsigned int addr; unsigned int addr;
unsigned char val; unsigned short val;
bool addrOrVal; bool addrOrVal;
QueuedWrite(): addr(0), val(0), addrOrVal(false) {} QueuedWrite(): addr(0), val(0), addrOrVal(false) {}
QueuedWrite(unsigned int a, unsigned char v): addr(a), val(v), 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; pendingWrites[a]=v;
} }
} }
inline void immWrite(unsigned int a, unsigned char v) { inline void immWrite(unsigned int a, unsigned short v) {
if (!skipRegisterWrites) { if (!skipRegisterWrites) {
writes.push_back(QueuedWrite(a,v)); writes.push_back(QueuedWrite(a,v));
if (dumpWrites) { if (dumpWrites) {

View file

@ -188,7 +188,7 @@ void DivPlatformYM2203::acquire_combo(short** buf, size_t len) {
QueuedWrite& w=writes.front(); QueuedWrite& w=writes.front();
if (w.addr==0xfffffffe) { if (w.addr==0xfffffffe) {
delay=w.val; delay=w.val*24;
writes.pop_front(); writes.pop_front();
} else if (w.addr<=0x1c || w.addr==0x2d || w.addr==0x2e || w.addr==0x2f) { } else if (w.addr<=0x1c || w.addr==0x2d || w.addr==0x2e || w.addr==0x2f) {
// ymfm write // ymfm write
@ -271,7 +271,7 @@ void DivPlatformYM2203::acquire_ymfm(short** buf, size_t len) {
if (--delay<1) { if (--delay<1) {
QueuedWrite& w=writes.front(); QueuedWrite& w=writes.front();
if (w.addr==0xfffffffe) { if (w.addr==0xfffffffe) {
delay=w.val*6; delay=w.val*3;
} else { } else {
fm->write(0x0,w.addr); fm->write(0x0,w.addr);
fm->write(0x1,w.val); fm->write(0x1,w.val);
@ -668,7 +668,7 @@ void DivPlatformYM2203::tick(bool sysTick) {
// hard reset handling // hard reset handling
if (mustHardReset) { if (mustHardReset) {
immWrite(0xfffffffe,hardResetCycles-hardResetElapsed); immWrite(0xfffffffe,(hardResetCycles-hardResetElapsed)*3);
for (int i=0; i<3; i++) { for (int i=0; i<3; i++) {
if (i==2 && extMode) continue; if (i==2 && extMode) continue;
if ((chan[i].keyOn || chan[i].opMaskChanged) && chan[i].hardReset) { if ((chan[i].keyOn || chan[i].opMaskChanged) && chan[i].hardReset) {

View file

@ -595,7 +595,7 @@ void DivPlatformYM2203Ext::tick(bool sysTick) {
// hard reset handling // hard reset handling
if (mustHardReset) { if (mustHardReset) {
immWrite(0xfffffffe,hardResetCycles-hardResetElapsed); immWrite(0xfffffffe,(hardResetCycles-hardResetElapsed)*3);
for (int i=0; i<4; i++) { for (int i=0; i<4; i++) {
if (opChan[i].keyOn && opChan[i].hardReset) { if (opChan[i].keyOn && opChan[i].hardReset) {
// restore SL/RR // restore SL/RR