From 6d1d91ca68cd613936eaa56690bd97ccc6be2386 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 31 Mar 2022 17:14:45 -0500 Subject: [PATCH] AY8930: add TEST register effect --- src/engine/platform/ay.cpp | 1 + src/engine/platform/ay8930.cpp | 7 +++++++ src/engine/playback.cpp | 3 +++ 3 files changed, 11 insertions(+) diff --git a/src/engine/platform/ay.cpp b/src/engine/platform/ay.cpp index 3e53e8fe3..4a70faebc 100644 --- a/src/engine/platform/ay.cpp +++ b/src/engine/platform/ay.cpp @@ -427,6 +427,7 @@ int DivPlatformAY8910::dispatch(DivCommand c) { chan[c.chan].freqChanged=true; break; case DIV_CMD_AY_IO_WRITE: + if (c.value==255) break; if (c.value) { // port B ioPortB=true; portBVal=c.value2; diff --git a/src/engine/platform/ay8930.cpp b/src/engine/platform/ay8930.cpp index 3e114e61b..1849d0cdc 100644 --- a/src/engine/platform/ay8930.cpp +++ b/src/engine/platform/ay8930.cpp @@ -100,6 +100,9 @@ const char* DivPlatformAY8930::getEffectName(unsigned char effect) { case 0x29: return "29xy: Set auto-envelope (x: numerator; y: denominator)"; break; + case 0x2d: + return "2Dxx: NOT TO BE EMPLOYED BY THE COMPOSER"; + break; case 0x2e: return "2Exx: Write to I/O port A"; break; @@ -446,6 +449,10 @@ int DivPlatformAY8930::dispatch(DivCommand c) { chan[c.chan].freqChanged=true; break; case DIV_CMD_AY_IO_WRITE: + if (c.value==255) { + immWrite(0x1f,c.value2); + break; + } if (c.value) { // port B ioPortB=true; portBVal=c.value2; diff --git a/src/engine/playback.cpp b/src/engine/playback.cpp index 6dddcfcbb..cf02fa6ae 100644 --- a/src/engine/playback.cpp +++ b/src/engine/playback.cpp @@ -730,6 +730,9 @@ bool DivEngine::perSystemPostEffect(int ch, unsigned char effect, unsigned char case 0x29: // auto-envelope dispatchCmd(DivCommand(DIV_CMD_AY_AUTO_ENVELOPE,ch,effectVal)); break; + case 0x2d: // TEST + dispatchCmd(DivCommand(DIV_CMD_AY_IO_WRITE,ch,255,effectVal)); + break; case 0x2e: // I/O port A dispatchCmd(DivCommand(DIV_CMD_AY_IO_WRITE,ch,0,effectVal)); break;