From b98ff137531b85b3d7c8a7c25d4b1228d2646753 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Wed, 21 May 2025 15:28:27 -0500 Subject: [PATCH] command stream ALG/FMS/AMS effects --- papers/export-tech.md | 7 +++++++ src/engine/cmdStream.cpp | 5 +++++ src/engine/cmdStreamOps.cpp | 10 ++++++++++ 3 files changed, 22 insertions(+) diff --git a/papers/export-tech.md b/papers/export-tech.md index 128cee02b..309d8e6bb 100644 --- a/papers/export-tech.md +++ b/papers/export-tech.md @@ -405,4 +405,11 @@ hex | description dc | resonance scaling (b) ----|------------------------------------ dd | WonderSwan speaker volume (b) +----|------------------------------------ + | **FM commands (continued)** + de | ALG (b) + df | FMS (b) + e0 | AMS (b) + e1 | FMS2 (b) + e2 | AMS2 (b) ``` diff --git a/src/engine/cmdStream.cpp b/src/engine/cmdStream.cpp index 475761608..f1605426e 100644 --- a/src/engine/cmdStream.cpp +++ b/src/engine/cmdStream.cpp @@ -447,6 +447,11 @@ bool DivCSPlayer::tick() { case DIV_CMD_SID3_CUTOFF_SCALING: case DIV_CMD_SID3_RESONANCE_SCALING: case DIV_CMD_WS_GLOBAL_SPEAKER_VOLUME: + case DIV_CMD_FM_ALG: + case DIV_CMD_FM_FMS: + case DIV_CMD_FM_AMS: + case DIV_CMD_FM_FMS2: + case DIV_CMD_FM_AMS2: arg0=(unsigned char)stream.readC(); break; // TWO BYTE COMMANDS diff --git a/src/engine/cmdStreamOps.cpp b/src/engine/cmdStreamOps.cpp index 3c1439b15..4a7dc1718 100644 --- a/src/engine/cmdStreamOps.cpp +++ b/src/engine/cmdStreamOps.cpp @@ -163,6 +163,11 @@ int DivCS::getCmdLength(unsigned char ext) { case DIV_CMD_SID3_CUTOFF_SCALING: case DIV_CMD_SID3_RESONANCE_SCALING: case DIV_CMD_WS_GLOBAL_SPEAKER_VOLUME: + case DIV_CMD_FM_ALG: + case DIV_CMD_FM_FMS: + case DIV_CMD_FM_AMS: + case DIV_CMD_FM_FMS2: + case DIV_CMD_FM_AMS2: return 1; case DIV_CMD_FM_TL: case DIV_CMD_FM_AM: @@ -545,6 +550,11 @@ void writeCommandValues(SafeWriter* w, const DivCommand& c, bool bigEndian) { case DIV_CMD_SID3_CUTOFF_SCALING: case DIV_CMD_SID3_RESONANCE_SCALING: case DIV_CMD_WS_GLOBAL_SPEAKER_VOLUME: + case DIV_CMD_FM_ALG: + case DIV_CMD_FM_FMS: + case DIV_CMD_FM_AMS: + case DIV_CMD_FM_FMS2: + case DIV_CMD_FM_AMS2: w->writeC(c.value); break; case DIV_CMD_FM_TL: