[Scummvm-git-logs] scummvm master -> 4d71bfa71b90bbf614afa456673496d5c303b77c
dreammaster
noreply at scummvm.org
Tue Jul 28 07:44:18 UTC 2026
This automated email contains information about 5 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
5853a88afe MADS: DRAGONSPHERE: Implemented RSound5
e6d31bd22a MADS: DRAGONSPHERE: Implemented RSound6 and RSound9
a7cf266640 MADS: Create sound/ subfolders for each game and move sound files there
19e96502a2 MADS: DRAGONSPHERE: Hooking up RSound, ASound init fix
4d71bfa71b MADS: PHANTOM: Hooking up RSound, ASound init fix
Commit: 5853a88afe5c505eb047f12da799acfcec93c2ea
https://github.com/scummvm/scummvm/commit/5853a88afe5c505eb047f12da799acfcec93c2ea
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-28T16:43:38+10:00
Commit Message:
MADS: DRAGONSPHERE: Implemented RSound5
Assisted-by: Claude Code:claude-opus-4.8
Changed paths:
engines/mads/dragonsphere/rsound.cpp
engines/mads/dragonsphere/rsound.h
engines/mads/dragonsphere/rsound_dragonsphere.cpp
engines/mads/dragonsphere/rsound_dragonsphere.h
diff --git a/engines/mads/dragonsphere/rsound.cpp b/engines/mads/dragonsphere/rsound.cpp
index bf5729c2f0d..0e8ff5c5ca0 100644
--- a/engines/mads/dragonsphere/rsound.cpp
+++ b/engines/mads/dragonsphere/rsound.cpp
@@ -426,6 +426,16 @@ void RSound::resetChannelRange(int first, int last) {
}
}
+void RSound::disableChannelTo(int channelIndex, byte flag, int offset) {
+ Channel &ch = _channels[channelIndex];
+ if (!ch._activeCount)
+ return;
+ if (ch._activeCount == 1)
+ ch._pSrc = loadData(offset);
+ ch._pendingStop = flag;
+ ch._soundData = loadData(offset);
+}
+
void RSound::resetHeldNotes() {
// Zeroes (0xFF-fills) the logically-used region of _heldNotes; the
// real table has extra unused padding rows beyond channel 9 that
diff --git a/engines/mads/dragonsphere/rsound.h b/engines/mads/dragonsphere/rsound.h
index cee728e3f9a..730b0136ee1 100644
--- a/engines/mads/dragonsphere/rsound.h
+++ b/engines/mads/dragonsphere/rsound.h
@@ -283,6 +283,17 @@ protected:
*/
void resetChannelRange(int first, int last);
+ /**
+ * A driver-specific variant of Channel::enable() confirmed across
+ * multiple drivers so far (RSound4's sub_1092A targeting 0x1F8B,
+ * RSound5's sub_10854 targeting 0x20C9) - redirects _soundData (and,
+ * if the channel is about to expire this tick, _pSrc too) to
+ * loadData(offset) instead of nullptr. The specific offset is always
+ * driver-specific "silence"/placeholder sound data, passed explicitly
+ * rather than hardcoded here.
+ */
+ void disableChannelTo(int channelIndex, byte flag, int offset);
+
/**
* Resets the _heldNotes table (see its field comment). Protected so
* per-driver reset helpers with a different channel range can still
diff --git a/engines/mads/dragonsphere/rsound_dragonsphere.cpp b/engines/mads/dragonsphere/rsound_dragonsphere.cpp
index 53c4814f087..f711f347718 100644
--- a/engines/mads/dragonsphere/rsound_dragonsphere.cpp
+++ b/engines/mads/dragonsphere/rsound_dragonsphere.cpp
@@ -76,15 +76,15 @@ int RSound1::command16() {
byte *pData = loadData(0x7BA);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x90);
loadCommand16();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand16));
return 0;
}
void RSound1::loadCommand16() {
- resetCallbackTimer(0x90);
setMusicIndex(0x10);
command3();
_channels[0].load(loadData(0x7BA));
@@ -169,15 +169,15 @@ int RSound1::command32() {
byte *pData = loadData(0xA14);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xB0);
loadCommand32();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand32));
return 0;
}
void RSound1::loadCommand32() {
- resetCallbackTimer(0xB0);
setMusicIndex(0x20);
command3();
_channels[0].load(loadData(0xA14));
@@ -190,15 +190,15 @@ int RSound1::command33() {
byte *pData = loadData(0xAFC);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xB0);
loadCommand33();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand33));
return 0;
}
void RSound1::loadCommand33() {
- resetCallbackTimer(0xB0);
command3();
_channels[0].load(loadData(0xAFC));
_channels[1].load(loadData(0xB9E));
@@ -226,15 +226,15 @@ int RSound1::command35() {
byte *pData = loadData(0xDDA);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x60);
loadCommand35();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand35));
return 0;
}
void RSound1::loadCommand35() {
- resetCallbackTimer(0x60);
command3();
_channels[0].load(loadData(0xDDA));
_channels[1].load(loadData(0xE6F));
@@ -246,15 +246,15 @@ int RSound1::command36() {
byte *pData = loadData(0xF66);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x80);
loadCommand36();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand36));
return 0;
}
void RSound1::loadCommand36() {
- resetCallbackTimer(0x80);
command3();
_channels[0].load(loadData(0xF66));
_channels[1].load(loadData(0x1028));
@@ -266,15 +266,15 @@ int RSound1::command37() {
byte *pData = loadData(0x120C);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xC0);
loadCommand37();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand37));
return 0;
}
void RSound1::loadCommand37() {
- resetCallbackTimer(0xC0);
command3();
_channels[0].load(loadData(0x120C));
_channels[1].load(loadData(0x1267));
@@ -286,15 +286,15 @@ int RSound1::command38() {
byte *pData = loadData(0x12CE);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x60);
loadCommand38();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand38));
return 0;
}
void RSound1::loadCommand38() {
- resetCallbackTimer(0x60);
command3();
_channels[4].load(loadData(0x12CE));
_channels[2].load(loadData(0x1373));
@@ -306,15 +306,15 @@ int RSound1::command39() {
byte *pData = loadData(0x1622);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xB0);
loadCommand39();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand39));
return 0;
}
void RSound1::loadCommand39() {
- resetCallbackTimer(0xB0);
command3();
_channels[0].load(loadData(0x1622));
_channels[1].load(loadData(0x1678));
@@ -325,15 +325,15 @@ int RSound1::command40() {
byte *pData = loadData(0x172E);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xA8);
loadCommand40();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand40));
return 0;
}
void RSound1::loadCommand40() {
- resetCallbackTimer(0xA8);
command3();
_channels[0].load(loadData(0x172E));
_channels[1].load(loadData(0x189C));
@@ -348,15 +348,15 @@ int RSound1::command41() {
byte *pData = loadData(0x219E);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x90);
loadCommand41();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand41));
return 0;
}
void RSound1::loadCommand41() {
- resetCallbackTimer(0x90);
command3();
_channels[0].load(loadData(0x219E));
_channels[1].load(loadData(0x220C));
@@ -369,15 +369,15 @@ int RSound1::command42() {
byte *pData = loadData(0x2400);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x90);
loadCommand42();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand42));
return 0;
}
void RSound1::loadCommand42() {
- resetCallbackTimer(0x90);
setMusicIndex(0x29);
command3();
_channels[0].load(loadData(0x2400));
@@ -411,7 +411,6 @@ int RSound1::command48() {
}
void RSound1::loadCommand43_48() {
- resetCallbackTimer(0x54);
setMusicIndex(0x28);
command3();
_channels[0].load(loadData(0x24EC));
@@ -425,16 +424,16 @@ int RSound1::command44() {
byte *pData = loadData(0x268C);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ // Asymmetric timer: counter=0x60, period=0xE0.
+ resetCallbackTimerEx(0x60, 0xE0);
loadCommand44();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand44));
return 0;
}
void RSound1::loadCommand44() {
- // Asymmetric timer: counter=0x60, period=0xE0.
- resetCallbackTimerEx(0x60, 0xE0);
command3();
_channels[0].load(loadData(0x268C));
_channels[1].load(loadData(0x26D2));
@@ -447,15 +446,15 @@ int RSound1::command45() {
byte *pData = loadData(0x28F6);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x60);
loadCommand45();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand45));
return 0;
}
void RSound1::loadCommand45() {
- resetCallbackTimer(0x60);
command3();
_channels[0].load(loadData(0x28F6));
_channels[1].load(loadData(0x2A60));
@@ -468,15 +467,15 @@ int RSound1::command46() {
byte *pData = loadData(0x2EC6);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x90);
loadCommand46();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand46));
return 0;
}
void RSound1::loadCommand46() {
- resetCallbackTimer(0x90);
command3();
_channels[0].load(loadData(0x2EC6));
_channels[1].load(loadData(0x2F1B));
@@ -488,15 +487,15 @@ int RSound1::command47() {
byte *pData = loadData(0x1342);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x60);
loadCommand47();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound1, loadCommand47));
return 0;
}
void RSound1::loadCommand47() {
- resetCallbackTimer(0x60);
command3();
_channels[4].load(loadData(0x1342));
_channels[2].load(loadData(0x13EC));
@@ -761,15 +760,15 @@ int RSound2::command16() {
byte *pData = loadData(0xEE0);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x90);
loadCommand16();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound2, loadCommand16));
return 0;
}
void RSound2::loadCommand16() {
- resetCallbackTimer(96);
command3();
_channels[0].load(loadData(0xEE0));
_channels[1].load(loadData(0xF2F));
@@ -841,15 +840,15 @@ int RSound2::command32() {
// callback was already scheduled before proceeding.
if (isCallbackScheduled())
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xB0);
loadCommand32();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound2, loadCommand32));
return 0;
}
void RSound2::loadCommand32() {
- resetCallbackTimer(96);
command3();
_channels[0].load(loadData(0x7BA));
_channels[1].load(loadData(0x80B));
@@ -863,15 +862,15 @@ int RSound2::command33() {
byte *pData = loadData(0xA54);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xB0);
loadCommand33();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound2, loadCommand33));
return 0;
}
void RSound2::loadCommand33() {
- resetCallbackTimer(96);
command3();
_channels[0].load(loadData(0xA54));
_channels[1].load(loadData(0xAF3));
@@ -885,15 +884,15 @@ int RSound2::command34() {
byte *pData = loadData(0xE4A);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(96);
loadCommand34();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound2, loadCommand34));
return 0;
}
void RSound2::loadCommand34() {
- resetCallbackTimer(96);
command3();
_channels[0].load(loadData(0xE4A));
_channels[1].load(loadData(0xEE2));
@@ -909,9 +908,10 @@ int RSound2::command35() {
// its comment).
if (isCallbackScheduled())
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x60);
loadCommand35();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound2, loadCommand35));
return 0;
}
@@ -1054,9 +1054,10 @@ int RSound3::command16() {
byte *pData = loadData(0x7BF);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x90);
loadCommand16();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound3, loadCommand16));
return 0;
}
@@ -1145,15 +1146,15 @@ int RSound3::command32() {
byte *pData = loadData(0xCAE);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xB0);
loadCommand32();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound3, loadCommand32));
return 0;
}
void RSound3::loadCommand32() {
- resetCallbackTimerEx(0x1C, 0x54);
command3();
_channels[0].load(loadData(0xCAE));
_channels[1].load(loadData(0xD68));
@@ -1167,15 +1168,15 @@ int RSound3::command33() {
byte *pData = loadData(0x102A);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xB0);
loadCommand33();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound3, loadCommand33));
return 0;
}
void RSound3::loadCommand33() {
- resetCallbackTimerEx(0x1C, 0x54);
command3();
_channels[0].load(loadData(0x102A));
_channels[1].load(loadData(0x10FE));
@@ -1263,16 +1264,6 @@ int RSound3::command(int commandId, int param) {
RSound4::RSound4(Audio::Mixer *mixer) : RSound(mixer, "rsound.dr4", 0x2930, 0x2370, 0xAC) {
}
-void RSound4::disableChannel(int channelIndex, byte flag) {
- Channel &ch = _channels[channelIndex];
- if (!ch._activeCount)
- return;
- if (ch._activeCount == 1)
- ch._pSrc = loadData(0x1F8B);
- ch._pendingStop = flag;
- ch._soundData = loadData(0x1F8B);
-}
-
int RSound4::command1() {
// Must call THIS driver's own command3() (not virtual in the base -
// see class comment).
@@ -1280,9 +1271,9 @@ int RSound4::command1() {
if (isSoundActive(loadData(0x1F4F)))
return 0;
_fadeCheckPeriod = 1; // armFadeCheck
- disableChannel(5, 0xFF); // channel 6 (redundant re-disable if command3's own gate already did it - harmless)
- disableChannel(6, 0xFF); // channel 7
- disableChannel(7, 0xFF); // channel 8
+ disableChannelTo(5, 0xFF, 0x1F8B); // channel 6 (redundant re-disable if command3's own gate already did it - harmless)
+ disableChannelTo(6, 0xFF, 0x1F8B); // channel 7
+ disableChannelTo(7, 0xFF, 0x1F8B); // channel 8
return 0;
}
@@ -1297,15 +1288,15 @@ int RSound4::command3() {
// familiar "lower" group), then conditionally disables channel 6 too -
// only if loadData(0x1F4F) isn't already playing.
_fadeCheckPeriod = 1; // armFadeCheck
- disableChannel(0, 0xFF); // ch1
- disableChannel(1, 0xFF); // ch2
- disableChannel(2, 0xFF); // ch3
- disableChannel(3, 0xFF); // ch4
- disableChannel(4, 0xFF); // ch5
- disableChannel(8, 0xFF); // ch9
+ disableChannelTo(0, 0xFF, 0x1F8B); // ch1
+ disableChannelTo(1, 0xFF, 0x1F8B); // ch2
+ disableChannelTo(2, 0xFF, 0x1F8B); // ch3
+ disableChannelTo(3, 0xFF, 0x1F8B); // ch4
+ disableChannelTo(4, 0xFF, 0x1F8B); // ch5
+ disableChannelTo(8, 0xFF, 0x1F8B); // ch9
if (isSoundActive(loadData(0x1F4F)))
return 0;
- disableChannel(5, 0xFF); // ch6 (conditional)
+ disableChannelTo(5, 0xFF, 0x1F8B); // ch6 (conditional)
return 0;
}
@@ -1385,7 +1376,6 @@ int RSound4::command16() {
}
void RSound4::loadCommand16() {
- resetCallbackTimer(192);
command3();
_channels[0].load(loadData(0x7C4));
_channels[1].load(loadData(0x804));
@@ -1465,15 +1455,15 @@ int RSound4::command32() {
byte *pData = loadData(0x964);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xB0);
loadCommand32();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound4, loadCommand32));
return 0;
}
void RSound4::loadCommand32() {
- resetCallbackTimer(96);
command3();
_channels[0].load(loadData(0x964));
_channels[1].load(loadData(0xA44));
@@ -1487,15 +1477,15 @@ int RSound4::command33() {
byte *pData = loadData(0xE10);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xB0);
loadCommand33();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound4, loadCommand33));
return 0;
}
void RSound4::loadCommand33() {
- resetCallbackTimer(192);
command3();
_channels[0].load(loadData(0xE10));
_channels[1].load(loadData(0xE2E));
@@ -1508,15 +1498,15 @@ int RSound4::command35() {
byte *pData = loadData(0xFFA);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x60);
loadCommand35();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound4, loadCommand35));
return 0;
}
void RSound4::loadCommand35() {
- resetCallbackTimer(84);
// NOTE: calls command1(), not command3() - unlike every other
// bucket-4 command in this driver, confirmed directly from the
// disassembly.
@@ -1531,15 +1521,15 @@ int RSound4::command36() {
byte *pData = loadData(0x25F1);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x80);
loadCommand36();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound4, loadCommand36));
return 0;
}
void RSound4::loadCommand36() {
- resetCallbackTimer(84);
command3();
_channels[0].load(loadData(0x1950));
_channels[1].load(loadData(0x1BB6));
@@ -1552,15 +1542,15 @@ int RSound4::command37() {
byte *pData = loadData(0x1062);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xC0);
loadCommand37();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound4, loadCommand37));
return 0;
}
void RSound4::loadCommand37() {
- resetCallbackTimer(64);
command3();
_channels[0].load(loadData(0x1062));
_channels[1].load(loadData(0x10A0));
@@ -1573,15 +1563,15 @@ int RSound4::command38() {
byte *pData = loadData(0x1172);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0x60);
loadCommand38();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound4, loadCommand38));
return 0;
}
void RSound4::loadCommand38() {
- resetCallbackTimer(64);
command3();
_channels[0].load(loadData(0x1172));
_channels[1].load(loadData(0x11C9));
@@ -1594,15 +1584,15 @@ int RSound4::command39() {
byte *pData = loadData(0x14DE);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xB0);
loadCommand39();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound4, loadCommand39));
return 0;
}
void RSound4::loadCommand39() {
- resetCallbackTimer(72);
command3();
_channels[0].load(loadData(0x14DE));
_channels[1].load(loadData(0x1550));
@@ -1616,15 +1606,15 @@ int RSound4::command40() {
byte *pData = loadData(0x7BF);
if (isSoundActive(pData))
return 0;
- if (!isMusicChannelsActive())
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(0xA8);
loadCommand40();
- else
+ } else
scheduleCallback(MAKE_CALLBACK(RSound4, loadCommand40));
return 0;
}
void RSound4::loadCommand40() {
- resetCallbackTimer(192);
command3();
_channels[0].load(loadData(0x7BF));
_channels[1].load(loadData(0x7FF));
@@ -1712,5 +1702,414 @@ int RSound4::command78() {
return 0;
}
+/*-----------------------------------------------------------------------*/
+
+RSound5::RSound5(Audio::Mixer *mixer) : RSound(mixer, "rsound.dr5", 0x2910, 0x2530, 0x9C) {
+}
+
+int RSound5::command1() {
+ // Must call THIS driver's own command5() (not virtual in the base -
+ // see class comment).
+ command3();
+ command5();
+ return 0;
+}
+
+int RSound5::command5() {
+ // Matches sub_10854: same disableChannelTo mechanic as RSound4's
+ // sub_1092A, but targeting loadData(0x20C9) - for channels 6,7,8.
+ _fadeCheckPeriod = 1; // armFadeCheck
+ disableChannelTo(5, 0xFF, 0x20C9);
+ disableChannelTo(6, 0xFF, 0x20C9);
+ disableChannelTo(7, 0xFF, 0x20C9);
+ return 0;
+}
+
+const RSound5::CommandPtr RSound5::_commandList[79] = {
+ &RSound5::command0, &RSound5::command1, &RSound5::command2, &RSound5::command3,
+ &RSound5::command4, &RSound5::command5, &RSound5::command6, &RSound5::command7,
+ &RSound5::command8, &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand,
+ &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand,
+ &RSound5::command16, &RSound5::command17, &RSound5::command18, &RSound5::nullCommand,
+ &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand,
+ &RSound5::command24, &RSound5::command25, &RSound5::command26, &RSound5::command27,
+ &RSound5::command28, &RSound5::command29, &RSound5::command30, &RSound5::command31,
+ &RSound5::command32, &RSound5::command33, &RSound5::command34, &RSound5::command35,
+ &RSound5::command36, &RSound5::command37, &RSound5::command38, &RSound5::nullCommand,
+ &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand,
+ &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand,
+ &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand,
+ &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand,
+ &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand,
+ &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand, &RSound5::nullCommand,
+ &RSound5::command64, &RSound5::command65, &RSound5::command66, &RSound5::command67,
+ &RSound5::command68, &RSound5::command69, &RSound5::command70, &RSound5::command71,
+ &RSound5::command72, &RSound5::command73, &RSound5::command74, &RSound5::command75,
+ &RSound5::command76, &RSound5::command77, &RSound5::command78
+};
+
+int RSound5::command(int commandId, int param) {
+ if (commandId < 0 || commandId >= ARRAYSIZE(_commandList))
+ return 0;
+
+ _commandParam = param;
+ return (this->*_commandList[commandId])();
+}
+
+int RSound5::command16() {
+ // Matches byte_134D8's first-time-vs-every-other-time selection -
+ // see class comment. Both variants check the SAME two offsets
+ // (0x7DC, 0x7E9) as an OR-gate before proceeding, just in reversed
+ // order.
+ if (_command16Played) {
+ if (isSoundActive(loadData(0x7E9)))
+ return 0;
+ if (isSoundActive(loadData(0x7DC)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(192);
+ loadCommand16B();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound5, loadCommand16B));
+ } else {
+ _command16Played = true;
+ if (isSoundActive(loadData(0x7DC)))
+ return 0;
+ if (isSoundActive(loadData(0x7E9)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(192);
+ loadCommand16A();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound5, loadCommand16A));
+ }
+ return 0;
+}
+
+void RSound5::loadCommand16A() {
+ command3();
+ _channels[0].load(loadData(0x7DC));
+ _channels[1].load(loadData(0x935));
+ _channels[2].load(loadData(0x9B8));
+ _channels[3].load(loadData(0xA85));
+ _channels[4].load(loadData(0xAFA));
+ _channels[8].load(loadData(0xD15));
+}
+
+void RSound5::loadCommand16B() {
+ setMusicIndex(0x10);
+ command3();
+ _channels[0].load(loadData(0x7E9));
+ _channels[1].load(loadData(0x93B));
+ _channels[2].load(loadData(0x9BE));
+ _channels[3].load(loadData(0xA8B));
+ _channels[4].load(loadData(0xB08));
+ _channels[8].load(loadData(0xD1B));
+}
+
+int RSound5::command17() {
+ // Ungated scheduling (Pattern A), matching every other driver's
+ // command17 shape.
+ if (isSoundActive(loadData(0x1F5A)))
+ return 0;
+ command3();
+ resetCallbackTimerEx(0xC0, 0x60);
+ _channels[0].load(loadData(0x1F5A));
+ _channels[1].load(loadData(0x1F8A));
+ _channels[2].load(loadData(0x1FBB));
+ _channels[3].load(loadData(0x1FD2));
+ return 0;
+}
+
+int RSound5::command18() {
+ // See RSound1::command18 - the flat _commandList[] collapses the
+ // original's two-table branch into a single array lookup.
+ command3();
+ return (this->*_commandList[getMusicIndex()])();
+}
+
+int RSound5::command24() {
+ playSoundChannels6to8(0x200A);
+ playSoundChannels6to8(0x201E);
+ return 0;
+}
+
+int RSound5::command25() {
+ playSoundChannels6to8(0x2030);
+ playSoundChannels6to8(0x2044);
+ return 0;
+}
+
+int RSound5::command26() {
+ playSoundChannels6to8(0x2056);
+ return 0;
+}
+
+int RSound5::command27() {
+ playSoundChannels6to8(0x2060);
+ return 0;
+}
+
+int RSound5::command28() {
+ playSoundChannels6to8(0x2079);
+ playSoundChannels6to8(0x2083);
+ return 0;
+}
+
+int RSound5::command29() {
+ // Reuses 0x208D both as the isSoundActive gate and the play target,
+ // matching RSound4's command29 exactly.
+ if (isSoundActive(loadData(0x208D)))
+ return 0;
+ playSoundChannels6to8(0x208D);
+ return 0;
+}
+
+int RSound5::command30() {
+ playSoundChannels6to8(0x22D4);
+ return 0;
+}
+
+void RSound5::command31_78Tail(byte variant) {
+ *loadData(0x2301) = variant;
+ playSoundChannels6to8(0x22FE);
+}
+
+int RSound5::command31() {
+ command31_78Tail(0x5A);
+ return 0;
+}
+
+int RSound5::command32() {
+ // NOTE: calls command1(), not command3(), unlike most other bucket-4
+ // commands in this driver.
+ byte *pData = loadData(0xDCA);
+ if (isSoundActive(pData))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(72);
+ loadCommand32();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound5, loadCommand32));
+ return 0;
+}
+
+void RSound5::loadCommand32() {
+ setMusicIndex(0x10);
+ command1();
+ _channels[0].load(loadData(0xDCA));
+ _channels[1].load(loadData(0xE0B));
+ _channels[2].load(loadData(0xE37));
+ _channels[3].load(loadData(0xE5F));
+ _channels[8].load(loadData(0xEE4));
+}
+
+int RSound5::command33() {
+ byte *pData = loadData(0xFDA);
+ if (isSoundActive(pData))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(96);
+ loadCommand33();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound5, loadCommand33));
+ return 0;
+}
+
+void RSound5::loadCommand33() {
+ setMusicIndex(0x10);
+ command3();
+ _channels[0].load(loadData(0xFDA));
+ _channels[1].load(loadData(0x1080));
+ _channels[2].load(loadData(0x1112));
+ _channels[3].load(loadData(0x129E));
+ _channels[4].load(loadData(0x136A));
+ _channels[8].load(loadData(0x1408));
+}
+
+int RSound5::command34() {
+ byte *pData = loadData(0x16EA);
+ if (isSoundActive(pData))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(192);
+ loadCommand34();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound5, loadCommand34));
+ return 0;
+}
+
+void RSound5::loadCommand34() {
+ setMusicIndex(0x10);
+ command1();
+ _channels[0].load(loadData(0x16EA));
+ _channels[1].load(loadData(0x1785));
+ _channels[2].load(loadData(0x1832));
+ _channels[3].load(loadData(0x1915));
+ _channels[4].load(loadData(0x19A9));
+ _channels[8].load(loadData(0x1B30));
+}
+
+int RSound5::command35() {
+ byte *pData = loadData(0x1B54);
+ if (isSoundActive(pData))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(96);
+ loadCommand35();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound5, loadCommand35));
+ return 0;
+}
+
+void RSound5::loadCommand35() {
+ setMusicIndex(0x10);
+ command1();
+ _channels[0].load(loadData(0x1B54));
+ _channels[1].load(loadData(0x1B86));
+ _channels[2].load(loadData(0x1BCB));
+ _channels[3].load(loadData(0x1BE6));
+}
+
+int RSound5::command36() {
+ // No gate at all - direct single-channel load.
+ _channels[3].load(loadData(0x1BFD));
+ return 0;
+}
+
+int RSound5::command37() {
+ // No gate at all (unlike every other bucket-4 command here): just
+ // clears _callbackFnPtr directly (counter/period untouched), calls
+ // command1(), then 4x playSoundChannels1To5().
+ scheduleCallback(nullptr);
+ command1();
+ playSoundChannels1To5(0x1C2C);
+ playSoundChannels1To5(0x1C67);
+ playSoundChannels1To5(0x1C99);
+ playSoundChannels1To5(0x1CCB);
+ return 0;
+}
+
+int RSound5::command38() {
+ byte *pData = loadData(0x1CDC);
+ if (isSoundActive(pData))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(192);
+ loadCommand38();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound5, loadCommand38));
+ return 0;
+}
+
+void RSound5::loadCommand38() {
+ setMusicIndex(0x10);
+ command1();
+ _channels[0].load(loadData(0x1CDC));
+ _channels[1].load(loadData(0x1D26));
+ _channels[2].load(loadData(0x1D62));
+ _channels[3].load(loadData(0x1E1C));
+ _channels[4].load(loadData(0x1E34));
+ _channels[8].load(loadData(0x1F44));
+}
+
+int RSound5::command64() {
+ playSoundChannels6to8(0x2150);
+ return 0;
+}
+
+int RSound5::command65() {
+ playSoundChannels6to8(0x212E);
+ return 0;
+}
+
+int RSound5::command66() {
+ playSoundChannels6to8(0x216A);
+ return 0;
+}
+
+int RSound5::command67() {
+ playSoundChannels6to8(0x2260);
+ playSoundChannels6to8(0x223C);
+ playSoundChannels6to8(0x2213);
+ return 0;
+}
+
+int RSound5::command68() {
+ playSoundChannels6to8(0x22AD);
+ playSoundChannels6to8(0x22AD);
+ return 0;
+}
+
+int RSound5::command69() {
+ playSoundChannels6to8(0x2280);
+ return 0;
+}
+
+int RSound5::command70() {
+ // Confirmed bug in the original (missing retn/jmp after the second,
+ // redundant call) - treated as a single play, matching the intended
+ // final action.
+ playSoundChannels6to8(0x21C4);
+ return 0;
+}
+
+int RSound5::command71() {
+ playSoundChannels6to8(0x217E);
+ playSoundChannels6to8(0x219D);
+ return 0;
+}
+
+int RSound5::command72() {
+ playSoundChannels6to8(0x21E4);
+ return 0;
+}
+
+int RSound5::command73() {
+ playSoundChannels6to8(0x20DE);
+ return 0;
+}
+
+int RSound5::command74() {
+ playSoundChannels6to8(0x210E);
+ playSoundChannels6to8(0x211E);
+ return 0;
+}
+
+int RSound5::command75() {
+ playSoundChannels6to8(0x20F2);
+ return 0;
+}
+
+int RSound5::command76() {
+ playSoundChannels6to8(0x21D4);
+ playSoundChannels6to8(0x21B8);
+ return 0;
+}
+
+int RSound5::command77() {
+ // Uses _commandParam directly.
+ int param = _commandParam;
+ if (param == 0) {
+ if (_channels[7]._loopStartPtr == loadData(0x20CB))
+ _channels[7]._innerLoopPtr = loadData(0x20C9);
+ return 0;
+ }
+
+ if ((uint16)param >= 0x8000)
+ param = 0;
+ *loadData(0x20D6) = (byte)(param & 0x7F);
+
+ if (isSoundActive(loadData(0x20CB)))
+ return 0;
+ _channels[7].load(loadData(0x20CB));
+ return 0;
+}
+
+int RSound5::command78() {
+ command31_78Tail(0x78);
+ return 0;
+}
+
} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/dragonsphere/rsound_dragonsphere.h b/engines/mads/dragonsphere/rsound_dragonsphere.h
index 35463eff180..c9bd37e79b6 100644
--- a/engines/mads/dragonsphere/rsound_dragonsphere.h
+++ b/engines/mads/dragonsphere/rsound_dragonsphere.h
@@ -334,10 +334,8 @@ public:
*
* command1/command2/command3/command4 are all genuinely different from
* the base class, in two ways:
- * - They use a NEW driver-specific channel-disable mechanic
- * (disableChannel(), matching sub_1092A) instead of Channel::enable() -
- * it redirects _soundData (and, if the channel is about to expire
- * this tick, _pSrc too) to loadData(0x1F8B) instead of nullptr.
+ * - They use the base class's disableChannelTo() (matching sub_1092A)
+ * instead of Channel::enable(), targeting loadData(0x1F8B).
* - Channel 6 (the boundary between the "lower" 1-5,9 group and
* "upper" 6,7,8 group) is conditionally included/excluded based on
* isSoundActive(loadData(0x1F4F)) in command1/command3, and based on
@@ -355,13 +353,6 @@ public:
*/
class RSound4 : public RSound {
private:
- /**
- * Matches sub_1092A: a driver-specific variant of Channel::enable()
- * that redirects _soundData (and _pSrc, if the channel is about to
- * expire this tick) to loadData(0x1F8B) instead of nullptr.
- */
- void disableChannel(int channelIndex, byte flag);
-
int command1();
int command2();
int command3();
@@ -443,6 +434,105 @@ public:
int command(int commandId, int param) override;
};
+/**
+ * RSound5 (rsound.dr5)
+ *
+ * command0/command3/command4/command6/command7/command8 all confirmed
+ * to match the shared RSound base exactly (no overrides needed),
+ * including command4 (whose resetChannels6to8 matches the base class's
+ * unconditional 3-channel version exactly, unlike RSound4's conditional
+ * one) and command3 (matches the base's default 1-5,9 lower-group
+ * enable exactly).
+ *
+ * command5 uses the base class's disableChannelTo() (matching
+ * sub_10854) instead of Channel::enable(), targeting loadData(0x20C9) -
+ * for channels 6,7,8 (three channels, matching the base's default upper
+ * group range, just via a different mechanic).
+ *
+ * command1/2/3 are not virtual in the base class, so this driver's own
+ * command1() must be overridden too (calling THIS class's command5()) -
+ * same pitfall as every other Dragonsphere RSound driver so far.
+ */
+class RSound5 : public RSound {
+private:
+ typedef int (RSound5:: *CommandPtr)();
+ static const CommandPtr _commandList[79];
+
+ int command1();
+ int command5();
+
+ /**
+ * Matches byte_134D8: false the first time command16 is ever called,
+ * true forever after (there is no code path that resets it back to
+ * false) - selects between two near-identical variants (A the first
+ * time, B every time after).
+ */
+ bool _command16Played = false;
+
+ int command16();
+ void loadCommand16A();
+ void loadCommand16B();
+
+ int command17();
+ int command18();
+
+ int command24();
+ int command25();
+ int command26();
+ int command27();
+ int command28();
+ int command29();
+ int command30();
+
+ /**
+ * Shared tail of command31()/command78() (matches loc_126FF): writes
+ * a variant byte (0x5A for command31, 0x78 for command78) into the
+ * sound data at offset 0x2301 (3 bytes into the block about to be
+ * played) before playing 0x22FE.
+ */
+ void command31_78Tail(byte variant);
+ int command31();
+
+ int command32();
+ void loadCommand32();
+ int command33();
+ void loadCommand33();
+ int command34();
+ void loadCommand34();
+ int command35();
+ void loadCommand35();
+ int command36();
+
+ /** No gate at all (unlike every other bucket-4 command here): just clears _callbackFnPtr, calls command1(), then 4x playSoundChannels1To5(). */
+ int command37();
+
+ int command38();
+ void loadCommand38();
+
+ int command64();
+ int command65();
+ int command66();
+ int command67();
+ int command68();
+ int command69();
+ int command70();
+ int command71();
+ int command72();
+ int command73();
+ int command74();
+ int command75();
+ int command76();
+
+ /** Uses _commandParam: if 0, conditionally redirects channel 8's inner loop pointer; otherwise writes a clamped 7-bit value into the sound data at offset 0x20D6 (11 bytes into the block about to be played) and gate-loads channel 8. */
+ int command77();
+ int command78();
+
+public:
+ RSound5(Audio::Mixer *mixer);
+
+ int command(int commandId, int param) override;
+};
+
} // namespace Dragonsphere
} // namespace MADS
Commit: e6d31bd22a321c343d7334289e38601a3372dded
https://github.com/scummvm/scummvm/commit/e6d31bd22a321c343d7334289e38601a3372dded
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-28T16:43:38+10:00
Commit Message:
MADS: DRAGONSPHERE: Implemented RSound6 and RSound9
Assisted-by: Claude Code:claude-opus-4.8
Changed paths:
engines/mads/dragonsphere/rsound.cpp
engines/mads/dragonsphere/rsound.h
engines/mads/dragonsphere/rsound_dragonsphere.cpp
engines/mads/dragonsphere/rsound_dragonsphere.h
diff --git a/engines/mads/dragonsphere/rsound.cpp b/engines/mads/dragonsphere/rsound.cpp
index 0e8ff5c5ca0..a24382cd9fa 100644
--- a/engines/mads/dragonsphere/rsound.cpp
+++ b/engines/mads/dragonsphere/rsound.cpp
@@ -178,6 +178,12 @@ Channel *RSound::playSoundChannels6to8(int offset) {
return playSoundData(loadData(offset), 5, 7, 7);
}
+Channel *RSound::playSoundChannels7to8(int offset) {
+ // Channels 7,8 (0-based 6-7), symmetric free/fallback scan. Matches
+ // the disassembly's own playSoundChannels7to8 exactly.
+ return playSoundData(loadData(offset), 6, 7, 7);
+}
+
Channel *RSound::playSoundChannels1To5(int offset) {
// Matches the disassembly's own playSoundAny exactly: channels 1-5
// (0-based 0-4), fully symmetric free/fallback scan. Renamed from
@@ -287,9 +293,13 @@ void RSound::muteChannel(int midiChannel) {
}
void RSound::sendGmReset(int count) {
- // Matches sendGmReset: counts DOWN from count to 1, using the counter
- // itself as the MIDI channel number each iteration.
- for (int midiChannel = count; midiChannel >= 1; --midiChannel) {
+ sendGmResetRange(count, 1);
+}
+
+void RSound::sendGmResetRange(int high, int low) {
+ // Matches sendGmReset: counts DOWN from high to low, using the
+ // counter itself as the MIDI channel number each iteration.
+ for (int midiChannel = high; midiChannel >= low; --midiChannel) {
_fadeCheckPeriod = 0;
byte status = 0xB0 | midiChannel;
diff --git a/engines/mads/dragonsphere/rsound.h b/engines/mads/dragonsphere/rsound.h
index 730b0136ee1..a9f97cc2a59 100644
--- a/engines/mads/dragonsphere/rsound.h
+++ b/engines/mads/dragonsphere/rsound.h
@@ -388,6 +388,14 @@ protected:
*/
Channel *playSoundChannels6to8(int offset);
+ /**
+ * Plays the specified sound, using any free channel from 7 to 8.
+ * Matches playSoundChannels7to8: symmetric free/fallback scan (free
+ * scan ch7 then ch8; fallback scan ch8 then ch7). Confirmed
+ * identical across 2 drivers so far (RSound2, RSound6).
+ */
+ Channel *playSoundChannels7to8(int offset);
+
/**
* Plays the specified sound, using any free channel from 1 to 5, with
* a fully symmetric free/fallback scan. Matches the disassembly's own
@@ -438,10 +446,20 @@ protected:
/**
* Sends the GM-reset Control Change sequence (all notes off, reset all
* controllers, volume=100, pan=center) to `count` MIDI channels,
- * counting down from `count` to 1.
+ * counting down from `count` to 1. Implemented in terms of
+ * sendGmResetRange(count, 1).
*/
void sendGmReset(int count);
+ /**
+ * Sends the GM-reset Control Change sequence to MIDI channels
+ * `high` down to `low` (inclusive), using each count value as the
+ * MIDI channel number - a generalization of sendGmReset() confirmed
+ * needed by RSound6's command4() (which only resets channels 8-6,
+ * not 1..count like every other driver's command4()).
+ */
+ void sendGmResetRange(int high, int low);
+
/**
* Sends a single Roland DT1-style SysEx message from a raw buffer:
* the fixed header, then bytes from pData up to (not including) a
diff --git a/engines/mads/dragonsphere/rsound_dragonsphere.cpp b/engines/mads/dragonsphere/rsound_dragonsphere.cpp
index f711f347718..9d6f643a6ec 100644
--- a/engines/mads/dragonsphere/rsound_dragonsphere.cpp
+++ b/engines/mads/dragonsphere/rsound_dragonsphere.cpp
@@ -746,14 +746,6 @@ int RSound2::command5() {
return 0;
}
-Channel *RSound2::playSoundChannels7to8(int offset) {
- // CONFIRMED: channels 7,8 (0-based 6-7), symmetric free/fallback
- // scan (free scan ch7 then ch8; fallback scan ch8 then ch7). A
- // trailing "load channel 9" block immediately after this function's
- // retn is unreachable dead code (no jump targets it) - not ported.
- return playSoundData(loadData(offset), 6, 7, 7);
-}
-
/*-----------------------------------------------------------------------*/
int RSound2::command16() {
@@ -2111,5 +2103,1163 @@ int RSound5::command78() {
return 0;
}
+/*-----------------------------------------------------------------------*/
+
+RSound6::RSound6(Audio::Mixer *mixer) : RSound(mixer, "rsound.dr6", 0x2B60, 0x2840, 0xAC) {
+}
+
+int RSound6::command1() {
+ // Must call THIS driver's own command3() (not virtual in the base -
+ // see class comment).
+ command3();
+ command5();
+ return 0;
+}
+
+int RSound6::command2() {
+ // Matches this driver's own resetChannels1to5: channels 1-6 AND 9
+ // (seven channels) - one more than the base class's default (1-5,9).
+ _isDisabled = true;
+ resetChannelRange(0, 5);
+ _channels[8]._activeCount = 0;
+ _channels[8]._pitchBendFadeStep = 0;
+ _channels[8]._volumeFadeStep = 0;
+ _channels[8]._panFadeStep = 0;
+ resetHeldNotes();
+ _isDisabled = false;
+ sendGmReset(4);
+ return 0;
+}
+
+int RSound6::command3() {
+ // Confirmed via symbolic names: enables channels 1,2,3,4,5,6 AND 9
+ // (seven channels) - one more than the base class's default (1-5,9).
+ _fadeCheckPeriod = 1; // armFadeCheck
+ _channels[0].enable(0xFF);
+ _channels[1].enable(0xFF);
+ _channels[2].enable(0xFF);
+ _channels[3].enable(0xFF);
+ _channels[4].enable(0xFF);
+ _channels[5].enable(0xFF);
+ _channels[8].enable(0xFF);
+ return 0;
+}
+
+void RSound6::resetChannels6to8() {
+ // Confirmed to match the base class's exact shape (channels 6,7,8
+ // unconditionally).
+ _isDisabled = true;
+ resetChannelRange(5, 7);
+ _isDisabled = false;
+}
+
+int RSound6::command4() {
+ // Custom inline GM-reset loop bounded 8 down to 6 (three channels),
+ // not the shared sendGmReset(count) - see class comment.
+ resetChannels6to8();
+ sendGmResetRange(8, 6);
+ return 0;
+}
+
+int RSound6::command5() {
+ // Confirmed via address arithmetic against command3's range: enables
+ // only channels 7,8 (two channels) - one fewer than the base class's
+ // default (6,7,8).
+ _fadeCheckPeriod = 1; // armFadeCheck
+ _channels[6].enable(0xFF);
+ _channels[7].enable(0xFF);
+ return 0;
+}
+
+Channel *RSound6::playSoundAny(int offset) {
+ // Matches this driver's own playSoundAny exactly: channels 1-8
+ // (0-based 0-7), symmetric free/fallback scan.
+ return playSoundData(loadData(offset), 0, 7, 7);
+}
+
+Channel *RSound6::playSoundChannels1To6(int offset) {
+ // Matches playSoundChannesl1to6 (sic): channels 1-6 (0-based 0-5),
+ // symmetric free/fallback scan.
+ return playSoundData(loadData(offset), 0, 5, 5);
+}
+
+int RSound6::isMusicChannelsActive() {
+ // Matches sub_10539: channels 1-6 AND 9 (seven channels), matching
+ // command3()'s own wider group.
+ return _channels[0]._activeCount || _channels[1]._activeCount ||
+ _channels[2]._activeCount || _channels[3]._activeCount ||
+ _channels[4]._activeCount || _channels[5]._activeCount ||
+ _channels[8]._activeCount;
+}
+
+const RSound6::CommandPtr RSound6::_commandList[99] = {
+ &RSound6::command0, &RSound6::command1, &RSound6::command2, &RSound6::command3,
+ &RSound6::command4, &RSound6::command5, &RSound6::command6, &RSound6::command7,
+ &RSound6::command8, &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand,
+ &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand,
+ &RSound6::command16, &RSound6::command17, &RSound6::command18, &RSound6::nullCommand,
+ &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand,
+ &RSound6::command24, &RSound6::command25, &RSound6::command26, &RSound6::command27,
+ &RSound6::command28, &RSound6::nullCommand, &RSound6::command30, &RSound6::command31,
+ &RSound6::command32, &RSound6::command33, &RSound6::command34, &RSound6::command35,
+ &RSound6::command36, &RSound6::command37, &RSound6::command38, &RSound6::command39,
+ &RSound6::command40, &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand,
+ &RSound6::command44, &RSound6::command45, &RSound6::nullCommand, &RSound6::nullCommand,
+ &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand,
+ &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand,
+ &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand,
+ &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand, &RSound6::nullCommand,
+ &RSound6::command64, &RSound6::command65, &RSound6::command66, &RSound6::command67,
+ &RSound6::command68, &RSound6::command69, &RSound6::command70, &RSound6::command71,
+ &RSound6::command72, &RSound6::command73, &RSound6::command74, &RSound6::command75,
+ &RSound6::command76, &RSound6::command77, &RSound6::command78, &RSound6::command79,
+ &RSound6::command80, &RSound6::command81, &RSound6::command82, &RSound6::command83,
+ &RSound6::command84, &RSound6::command85, &RSound6::command86, &RSound6::command87,
+ &RSound6::command88, &RSound6::command89, &RSound6::command90, &RSound6::command91,
+ &RSound6::command92, &RSound6::command93, &RSound6::command94, &RSound6::command95,
+ &RSound6::command96, &RSound6::command97, &RSound6::command98
+};
+
+int RSound6::command(int commandId, int param) {
+ if (commandId < 0 || commandId >= ARRAYSIZE(_commandList))
+ return 0;
+
+ _commandParam = param;
+ return (this->*_commandList[commandId])();
+}
+
+int RSound6::command16() {
+ // Three chained isSoundActive gates (an OR: any match early-exits)
+ // before the isMusicChannelsActive() branch.
+ if (isSoundActive(loadData(0x7BA)))
+ return 0;
+ if (isSoundActive(loadData(0x34C0)))
+ return 0;
+ if (isSoundActive(loadData(0x3636)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(200);
+ loadCommand16();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound6, loadCommand16));
+ return 0;
+}
+
+void RSound6::loadCommand16() {
+ setMusicIndex(0x10);
+ command3();
+ _channels[0].load(loadData(0x7BA));
+ _channels[1].load(loadData(0x842));
+ _channels[2].load(loadData(0x881));
+}
+
+int RSound6::command17() {
+ // Ungated scheduling (Pattern A), matching every other driver's
+ // command17 shape.
+ if (isSoundActive(loadData(0x1E98)))
+ return 0;
+ command3();
+ resetCallbackTimerEx(0xC0, 0x60);
+ _channels[0].load(loadData(0x1E98));
+ _channels[1].load(loadData(0x1EC8));
+ _channels[2].load(loadData(0x1EF9));
+ _channels[3].load(loadData(0x1F10));
+ return 0;
+}
+
+int RSound6::command18() {
+ // See RSound1::command18 - the flat _commandList[] collapses the
+ // original's two-table branch into a single array lookup.
+ command3();
+ return (this->*_commandList[getMusicIndex()])();
+}
+
+int RSound6::command24() {
+ playSoundAny(0x20E4);
+ playSoundAny(0x20F8);
+ return 0;
+}
+
+int RSound6::command25() {
+ playSoundAny(0x210A);
+ playSoundAny(0x211E);
+ return 0;
+}
+
+int RSound6::command26() {
+ playSoundAny(0x2130);
+ return 0;
+}
+
+int RSound6::command27() {
+ playSoundAny(0x213A);
+ return 0;
+}
+
+int RSound6::command28() {
+ playSoundChannels7to8(0x2153);
+ playSoundChannels7to8(0x215D);
+ return 0;
+}
+
+int RSound6::command30() {
+ playSoundAny(0x23DF);
+ return 0;
+}
+
+int RSound6::command31() {
+ playSoundChannels7to8(0x25E1);
+ return 0;
+}
+
+/*-----------------------------------------------------------------------*/
+// command32/command33 share an intricate tail - see the class comment.
+
+void RSound6::command32_33LoadCh4() {
+ // Matches loc_124B2.
+ _command33Flag = 0;
+ _channels[3].load(loadData(0x9FB));
+}
+
+void RSound6::command32_33Load() {
+ // Matches loc_12490 (falls through to the byte_13378 check at its end).
+ command3();
+ _channels[0].load(loadData(0x8CE));
+ _channels[1].load(loadData(0x914));
+ _channels[2].load(loadData(0x953));
+ _channels[8].load(loadData(0x96E));
+ if (_command33Flag == 0xFF)
+ command32_33LoadCh4();
+}
+
+int RSound6::command32() {
+ // Matches rsound_command32's own entry point.
+ if (_channels[3]._soundData == loadData(0x9FB)) {
+ _channels[3]._pendingStop = 0xFF;
+ _channels[3]._soundData = loadData(0x250C);
+ }
+ if (_channels[0]._activeCount) {
+ if (_channels[0]._soundData == loadData(0x8CE))
+ return 0;
+ scheduleCallback(MAKE_CALLBACK(RSound6, command32_33Load));
+ return 0;
+ }
+ resetCallbackTimer(60);
+ command32_33Load();
+ return 0;
+}
+
+int RSound6::command33() {
+ // Matches rsound_command33's own entry point: gates, sets the shared
+ // flag, then either falls into loc_1247E (command32's immediate
+ // setup) or loc_124B2 (command32's "load channel 4" tail) directly,
+ // or - if neither condition holds - falls all the way through into
+ // command32's own body from the top (equivalent to calling it).
+ if (isSoundActive(loadData(0x9FB)))
+ return 0;
+ _command33Flag = 0xFF;
+ if (!_channels[0]._activeCount) {
+ resetCallbackTimer(60);
+ command32_33Load();
+ return 0;
+ }
+ if (_channels[0]._soundData == loadData(0x8CE)) {
+ command32_33LoadCh4();
+ return 0;
+ }
+ return command32();
+}
+
+/*-----------------------------------------------------------------------*/
+
+void RSound6::command34LoadCh1AndRest() {
+ // Matches loc_12524 falling through to loc_1252D.
+ command3();
+ _channels[0].load(loadData(0xA1A));
+ _channels[1].load(loadData(0xA5C));
+ _channels[2].load(loadData(0xA95));
+ _channels[3].load(loadData(0xB22));
+}
+
+void RSound6::command34LoadRestOnly() {
+ // Matches loc_1252D reached directly (already-looping skip path).
+ _channels[1].load(loadData(0xA5C));
+ _channels[2].load(loadData(0xA95));
+ _channels[3].load(loadData(0xB22));
+}
+
+int RSound6::command34() {
+ if (isSoundActive(loadData(0xA5C)))
+ return 0;
+ if (_channels[0]._loopStartPtr == loadData(0xA1A) && _channels[0]._activeCount != 0) {
+ command34LoadRestOnly();
+ return 0;
+ }
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(30);
+ command34LoadCh1AndRest();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound6, command34LoadCh1AndRest));
+ return 0;
+}
+
+int RSound6::command35() {
+ if (isSoundActive(loadData(0xA1A)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(30);
+ command3();
+ _channels[0].load(loadData(0xA1A));
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound6, command35));
+ return 0;
+}
+
+int RSound6::command36() {
+ // Two chained isSoundActive gates (an OR).
+ if (isSoundActive(loadData(0xB60)))
+ return 0;
+ if (isSoundActive(loadData(0xCD6)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(200);
+ command3();
+ _channels[0].load(loadData(0xB60));
+ _channels[1].load(loadData(0xBA8));
+ _channels[2].load(loadData(0xC42));
+ _channels[3].load(loadData(0xCB3));
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound6, command36));
+ return 0;
+}
+
+int RSound6::command37() {
+ if (isSoundActive(loadData(0xCD6)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(200);
+ command3();
+ _channels[0].load(loadData(0xCD6));
+ _channels[1].load(loadData(0xD26));
+ _channels[2].load(loadData(0xD82));
+ _channels[3].load(loadData(0xE7E));
+ _channels[4].load(loadData(0xF7B));
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound6, command37));
+ return 0;
+}
+
+int RSound6::command38() {
+ if (isSoundActive(loadData(0xFC0)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(200);
+ command3();
+ _channels[0].load(loadData(0xFC0));
+ _channels[1].load(loadData(0x1018));
+ _channels[2].load(loadData(0x1070));
+ _channels[3].load(loadData(0x10FA));
+ _channels[4].load(loadData(0x11B3));
+ _channels[5].load(loadData(0x139C));
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound6, command38));
+ return 0;
+}
+
+int RSound6::command39() {
+ if (isSoundActive(loadData(0x13EC)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(100);
+ command3();
+ _channels[0].load(loadData(0x13EC));
+ _channels[1].load(loadData(0x1515));
+ _channels[2].load(loadData(0x1717));
+ _channels[3].load(loadData(0x179F));
+ _channels[4].load(loadData(0x17C3));
+ _channels[8].load(loadData(0x18DD));
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound6, command39));
+ return 0;
+}
+
+int RSound6::command40() {
+ if (isSoundActive(loadData(0x195A)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(100);
+ command3();
+ _channels[0].load(loadData(0x195A));
+ _channels[1].load(loadData(0x1A2E));
+ _channels[2].load(loadData(0x1B0C));
+ _channels[3].load(loadData(0x1BF6));
+ _channels[4].load(loadData(0x1D12));
+ _channels[5].load(loadData(0x1E0E));
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound6, command40));
+ return 0;
+}
+
+int RSound6::command44() {
+ if (isSoundActive(loadData(0x1F48)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(48);
+ loadCommand44();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound6, loadCommand44));
+ return 0;
+}
+
+void RSound6::loadCommand44() {
+ setMusicIndex(0x10);
+ command3();
+ _channels[0].load(loadData(0x1F48));
+ _channels[1].load(loadData(0x1F9D));
+ _channels[2].load(loadData(0x1FC1));
+ _channels[3].load(loadData(0x1FEF));
+ _channels[4].load(loadData(0x201D));
+ _channels[8].load(loadData(0x2073));
+}
+
+int RSound6::command45() {
+ if (isSoundActive(loadData(0x20AA)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(30);
+ command3();
+ playSoundChannels1To6(0x20AA);
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound6, command45));
+ return 0;
+}
+
+int RSound6::command64() {
+ // Uses _commandParam directly: masks the low 7 bits into the sound
+ // data at offset 0x23D7 (11 bytes into the block about to be played)
+ // before the gated play.
+ *loadData(0x23D7) = (byte)(_commandParam & 0x7F);
+ if (isSoundActive(loadData(0x23CC)))
+ return 0;
+ playSoundChannels7to8(0x23CC);
+ return 0;
+}
+
+int RSound6::command65() {
+ // Complements (and re-masks to 7 bits) a persistent byte within the
+ // sound data at offset 0x2592 on every call, before playing 0x2584.
+ byte *pByte = loadData(0x2592);
+ *pByte = (~*pByte) & 0x7F;
+ playSoundAny(0x2584);
+ return 0;
+}
+
+int RSound6::command66() {
+ playSoundAny(0x2357);
+ return 0;
+}
+
+int RSound6::command67() {
+ playSoundAny(0x25A9);
+ playSoundAny(0x25C5);
+ return 0;
+}
+
+int RSound6::command68() {
+ playSoundAny(0x2167);
+ playSoundAny(0x2176);
+ playSoundAny(0x218D);
+ return 0;
+}
+
+int RSound6::command69() {
+ playSoundAny(0x23B7);
+ return 0;
+}
+
+int RSound6::command70() {
+ playSoundAny(0x21E1);
+ return 0;
+}
+
+int RSound6::command71() {
+ playSoundAny(0x239B);
+ return 0;
+}
+
+int RSound6::command72() {
+ _channels[6].load(loadData(0x22A4));
+ _channels[7].load(loadData(0x22D8));
+ return 0;
+}
+
+int RSound6::command73() {
+ playSoundAny(0x223D);
+ return 0;
+}
+
+int RSound6::command74() {
+ playSoundAny(0x2258);
+ playSoundAny(0x2264);
+ return 0;
+}
+
+int RSound6::command75() {
+ playSoundAny(0x21D1);
+ return 0;
+}
+
+int RSound6::command76() {
+ playSoundAny(0x232C);
+ return 0;
+}
+
+int RSound6::command77() {
+ playSoundChannels7to8(0x230C);
+ return 0;
+}
+
+int RSound6::command78() {
+ playSoundAny(0x21FF);
+ playSoundAny(0x2209);
+ return 0;
+}
+
+int RSound6::command79() {
+ _channels[6].load(loadData(0x2219));
+ _channels[7].load(loadData(0x222B));
+ return 0;
+}
+
+int RSound6::command80() {
+ // Confirmed: jmp rsound_command4.
+ return command4();
+}
+
+int RSound6::command81() {
+ playSoundAny(0x219C);
+ return 0;
+}
+
+int RSound6::command82() {
+ playSoundAny(0x21AF);
+ return 0;
+}
+
+int RSound6::command83() {
+ playSoundAny(0x2278);
+ playSoundAny(0x228F);
+ return 0;
+}
+
+int RSound6::command84() {
+ playSoundAny(0x2365);
+ return 0;
+}
+
+int RSound6::command85() {
+ playSoundAny(0x2380);
+ return 0;
+}
+
+int RSound6::command86() {
+ playSoundAny(0x2409);
+ playSoundAny(0x2423);
+ return 0;
+}
+
+int RSound6::command87() {
+ playSoundAny(0x247D);
+ return 0;
+}
+
+int RSound6::command88() {
+ playSoundAny(0x243D);
+ playSoundAny(0x245D);
+ return 0;
+}
+
+int RSound6::command89() {
+ playSoundAny(0x2489);
+ return 0;
+}
+
+int RSound6::command90() {
+ // 0x249F is called three times in a row - a genuine quirk, preserved
+ // exactly rather than collapsed to a single call.
+ playSoundAny(0x249C);
+ playSoundAny(0x249F);
+ playSoundAny(0x249F);
+ playSoundAny(0x249F);
+ return 0;
+}
+
+int RSound6::command91() {
+ playSoundAny(0x24C0);
+ return 0;
+}
+
+int RSound6::command92() {
+ playSoundAny(0x24DC);
+ playSoundAny(0x24EB);
+ return 0;
+}
+
+int RSound6::command93() {
+ playSoundAny(0x24FA);
+ return 0;
+}
+
+int RSound6::command94() {
+ playSoundAny(0x250E);
+ return 0;
+}
+
+int RSound6::command95() {
+ playSoundAny(0x2539);
+ return 0;
+}
+
+int RSound6::command96() {
+ if (isSoundActive(loadData(0x26DF)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(90);
+ command1();
+ // 0x1E70 is played four times in a row - a genuine quirk,
+ // preserved exactly rather than collapsed to a single call.
+ playSoundChannels1To6(0x1E70);
+ playSoundChannels1To6(0x1E70);
+ playSoundChannels1To6(0x1E70);
+ playSoundChannels1To6(0x1E70);
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound6, command96));
+ return 0;
+}
+
+int RSound6::command97() {
+ // 0x2563 is called three times in a row - same quirk shape as
+ // command90.
+ playSoundAny(0x2560);
+ playSoundAny(0x2563);
+ playSoundAny(0x2563);
+ playSoundAny(0x2563);
+ return 0;
+}
+
+int RSound6::command98() {
+ _channels[3].load(loadData(0x2633));
+ _channels[4].load(loadData(0x2646));
+ return 0;
+}
+
+/*-----------------------------------------------------------------------*/
+
+RSound9::RSound9(Audio::Mixer *mixer) : RSound(mixer, "rsound.dr9", 0x2BC0, 0x52D0, 0x9A) {
+}
+
+int RSound9::command1() {
+ // Must call THIS driver's own command3()/command5() (not virtual in
+ // the base - see class comment).
+ command3();
+ command5();
+ return 0;
+}
+
+int RSound9::command3() {
+ // Confirmed via symbolic names: enables only channels 1,2,3,4,9 (five
+ // channels) - channel 5 has moved to command5()'s group, unlike the
+ // base class's default (1-5,9).
+ _fadeCheckPeriod = 1; // armFadeCheck
+ _channels[0].enable(0xFF);
+ _channels[1].enable(0xFF);
+ _channels[2].enable(0xFF);
+ _channels[3].enable(0xFF);
+ _channels[8].enable(0xFF);
+ return 0;
+}
+
+int RSound9::command5() {
+ // Confirmed via explicit Channel_enable calls: enables channels
+ // 5,6,7,8 (four channels) - one more than the base class's default
+ // (6,7,8).
+ _fadeCheckPeriod = 1; // armFadeCheck
+ _channels[4].enable(0xFF);
+ _channels[5].enable(0xFF);
+ _channels[6].enable(0xFF);
+ _channels[7].enable(0xFF);
+ return 0;
+}
+
+int RSound9::command32() {
+ // No gate at all (unlike every other bucket-4 command in this
+ // driver): unconditionally arms the timer and loads.
+ resetCallbackTimerEx(98, 84);
+ command1();
+ _channels[0].load(loadData(0x572));
+ _channels[1].load(loadData(0x597));
+ _channels[2].load(loadData(0x64B));
+ _channels[3].load(loadData(0x67E));
+ _channels[4].load(loadData(0x7B1));
+ _channels[8].load(loadData(0x898));
+ return 0;
+}
+
+void RSound9::variantSetupA() {
+ *loadData(0x97E) = 0x29;
+ *loadData(0x990) = 0x29;
+ *loadData(0xA89) = 0x29;
+ *loadData(0xA8F) = 0x29;
+ *loadData(0x8EC) = 0x41;
+ *loadData(0x902) = 0x41;
+ *loadData(0x948) = 0x3A;
+ *loadData(0x95E) = 0x3A;
+}
+
+void RSound9::variantSetupB() {
+ *loadData(0x97E) = 0x2A;
+ *loadData(0x990) = 0x2A;
+ *loadData(0xA89) = 0x2A;
+ *loadData(0xA8F) = 0x2A;
+ *loadData(0x8EC) = 0x42;
+ *loadData(0x902) = 0x42;
+ *loadData(0x948) = 0x3B;
+ *loadData(0x95E) = 0x3B;
+}
+
+void RSound9::command33_47_60Load() {
+ command1();
+ _channels[0].load(loadData(0x8E2));
+ _channels[1].load(loadData(0x940));
+ _channels[2].load(loadData(0x976));
+ _channels[8].load(loadData(0xA37));
+ _channels[4].load(loadData(0xA83));
+ _channels[5].load(loadData(0xAE1));
+ _channels[6].load(loadData(0xC43));
+}
+
+int RSound9::command60() {
+ variantSetupA();
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimerEx(98, 84);
+ command33_47_60Load();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, command33_47_60Load));
+ return 0;
+}
+
+int RSound9::command33Or47() {
+ variantSetupB();
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimerEx(98, 84);
+ command33_47_60Load();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, command33_47_60Load));
+ return 0;
+}
+
+int RSound9::command34Or54() {
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(56);
+ loadCommand34Or54();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand34Or54));
+ return 0;
+}
+
+void RSound9::loadCommand34Or54() {
+ command1();
+ _channels[0].load(loadData(0xD1E));
+ _channels[1].load(loadData(0xF0D));
+ _channels[2].load(loadData(0x110C));
+ _channels[4].load(loadData(0x1470));
+ _channels[5].load(loadData(0x15A5));
+ _channels[6].load(loadData(0x15F0));
+ _channels[8].load(loadData(0x130B));
+}
+
+int RSound9::command35() {
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(80);
+ loadCommand35();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand35));
+ return 0;
+}
+
+void RSound9::loadCommand35() {
+ command1();
+ _channels[0].load(loadData(0x1644));
+ _channels[1].load(loadData(0x16B0));
+ _channels[2].load(loadData(0x16DC));
+ _channels[3].load(loadData(0x17A0));
+ _channels[8].load(loadData(0x180E));
+ _channels[5].load(loadData(0x1830));
+ _channels[6].load(loadData(0x18AC));
+}
+
+int RSound9::command36() {
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(40);
+ loadCommand36();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand36));
+ return 0;
+}
+
+void RSound9::loadCommand36() {
+ command1();
+ _channels[0].load(loadData(0x1A0E));
+ _channels[1].load(loadData(0x1A84));
+ _channels[2].load(loadData(0x1B00));
+ _channels[3].load(loadData(0x1B34));
+ _channels[4].load(loadData(0x1DEA));
+ _channels[5].load(loadData(0x1E56));
+ _channels[6].load(loadData(0x1EC2));
+}
+
+int RSound9::command37() {
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(80);
+ loadCommand37();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand37));
+ return 0;
+}
+
+void RSound9::loadCommand37() {
+ command1();
+ _channels[0].load(loadData(0x1F04));
+ _channels[1].load(loadData(0x1F94));
+ _channels[2].load(loadData(0x2028));
+ _channels[3].load(loadData(0x206A));
+ _channels[8].load(loadData(0x213C));
+ _channels[5].load(loadData(0x219E));
+}
+
+int RSound9::command38() {
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(40);
+ loadCommand38();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand38));
+ return 0;
+}
+
+void RSound9::loadCommand38() {
+ command1();
+ _channels[0].load(loadData(0x22D2));
+ _channels[1].load(loadData(0x234A));
+ _channels[2].load(loadData(0x23C8));
+ _channels[3].load(loadData(0x1B34));
+ _channels[4].load(loadData(0x23FA));
+ _channels[8].load(loadData(0x245C));
+ _channels[6].load(loadData(0x24BC));
+}
+
+int RSound9::command39() {
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(40);
+ loadCommand39();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand39));
+ return 0;
+}
+
+void RSound9::loadCommand39() {
+ command1();
+ _channels[0].load(loadData(0x24F8));
+ _channels[1].load(loadData(0x2584));
+ _channels[2].load(loadData(0x2616));
+ _channels[3].load(loadData(0x2710));
+ _channels[4].load(loadData(0x2B8A));
+ _channels[8].load(loadData(0x2C22));
+ _channels[6].load(loadData(0x2C66));
+}
+
+int RSound9::command40() {
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(56);
+ loadCommand40();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand40));
+ return 0;
+}
+
+void RSound9::loadCommand40() {
+ command1();
+ _channels[0].load(loadData(0xD1E));
+ _channels[1].load(loadData(0xF0D));
+ _channels[2].load(loadData(0x110C));
+ _channels[8].load(loadData(0x2D60));
+ _channels[4].load(loadData(0x2E54));
+ _channels[5].load(loadData(0x2F33));
+ _channels[6].load(loadData(0x2F6B));
+}
+
+int RSound9::command41() {
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(84);
+ loadCommand41();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand41));
+ return 0;
+}
+
+void RSound9::loadCommand41() {
+ command1();
+ _channels[0].load(loadData(0x2F94));
+ _channels[2].load(loadData(0x3460));
+ _channels[8].load(loadData(0x3605));
+ _channels[4].load(loadData(0x369A));
+ _channels[5].load(loadData(0x3773));
+ _channels[6].load(loadData(0x39F6));
+}
+
+int RSound9::command53() {
+ // See class comment: this is the unlabeled function directly
+ // following command41() in the disassembly, assigned to index 53 by
+ // elimination.
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(84);
+ loadCommand53();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand53));
+ return 0;
+}
+
+void RSound9::loadCommand53() {
+ command1();
+ _channels[1].load(loadData(0x33C0));
+ _channels[2].load(loadData(0x3575));
+ _channels[8].load(loadData(0x3686));
+ _channels[4].load(loadData(0x36FF));
+ _channels[5].load(loadData(0x3966));
+ _channels[6].load(loadData(0x3B89));
+}
+
+int RSound9::command42() {
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimerEx(168, 80);
+ loadCommand42();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand42));
+ return 0;
+}
+
+void RSound9::loadCommand42() {
+ command1();
+ _channels[0].load(loadData(0x2FDD));
+ _channels[1].load(loadData(0x3031));
+ _channels[2].load(loadData(0x34D9));
+ _channels[8].load(loadData(0x3634));
+ _channels[4].load(loadData(0x36D1));
+ _channels[5].load(loadData(0x3856));
+ _channels[6].load(loadData(0x3A93));
+}
+
+int RSound9::command43() {
+ // No gate at all: unconditionally arms the timer and loads.
+ resetCallbackTimer(20);
+ command1();
+ _channels[0].load(loadData(0x3BF0));
+ _channels[1].load(loadData(0x3C4A));
+ _channels[2].load(loadData(0x3C92));
+ _channels[3].load(loadData(0x3F64));
+ return 0;
+}
+
+int RSound9::command45() {
+ // No gate, no timer setup, no command1() call - just two direct
+ // channel loads.
+ _channels[4].load(loadData(0x3F70));
+ _channels[5].load(loadData(0x3FD0));
+ return 0;
+}
+
+int RSound9::command46() {
+ _channels[4].load(loadData(0x401B));
+ _channels[5].load(loadData(0x4070));
+ return 0;
+}
+
+int RSound9::command48() {
+ playSoundChannels6to8(0x507A);
+ return 0;
+}
+
+int RSound9::command49() {
+ playSoundChannels6to8(0x50B0);
+ return 0;
+}
+
+int RSound9::command50() {
+ playSoundChannels6to8(0x50A4);
+ return 0;
+}
+
+int RSound9::command51() {
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(96);
+ loadCommand51();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand51));
+ return 0;
+}
+
+void RSound9::loadCommand51() {
+ command1();
+ _channels[0].load(loadData(0x458E));
+ _channels[1].load(loadData(0x4623));
+ _channels[2].load(loadData(0x46A8));
+ _channels[3].load(loadData(0x46F3));
+}
+
+int RSound9::command52() {
+ // The original's spurious lea bx/call isSoundActive on the
+ // deferred-schedule branch (dead/vestigial - see class comment) is
+ // intentionally omitted here.
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(84);
+ loadCommand52();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand52));
+ return 0;
+}
+
+void RSound9::loadCommand52() {
+ command1();
+ _channels[0].load(loadData(0x40C6));
+ _channels[1].load(loadData(0x432C));
+ _channels[2].load(loadData(0x4375));
+ _channels[3].load(loadData(0x438E));
+ _channels[4].load(loadData(0x4587));
+}
+
+int RSound9::command55() {
+ if (isSoundActive(loadData(0x471A)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(96);
+ loadCommand55();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand55));
+ return 0;
+}
+
+void RSound9::loadCommand55() {
+ command1();
+ _channels[0].load(loadData(0x471A));
+ _channels[1].load(loadData(0x47EE));
+ _channels[2].load(loadData(0x4A21));
+ _channels[3].load(loadData(0x4ABF));
+ _channels[4].load(loadData(0x4ADB));
+ _channels[5].load(loadData(0x4B35));
+}
+
+int RSound9::command57() {
+ if (isSoundActive(loadData(0x4B96)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(48);
+ loadCommand57();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand57));
+ return 0;
+}
+
+void RSound9::loadCommand57() {
+ command1();
+ _channels[0].load(loadData(0x4B96));
+ _channels[1].load(loadData(0x4BF0));
+ _channels[2].load(loadData(0x4C20));
+ _channels[3].load(loadData(0x4C8A));
+ _channels[4].load(loadData(0x4CBC));
+ _channels[8].load(loadData(0x4D16));
+}
+
+int RSound9::command58() {
+ if (isSoundActive(loadData(0x4D94)))
+ return 0;
+ if (!isMusicChannelsActive()) {
+ resetCallbackTimer(144);
+ loadCommand58();
+ } else
+ scheduleCallback(MAKE_CALLBACK(RSound9, loadCommand58));
+ return 0;
+}
+
+void RSound9::loadCommand58() {
+ // Calls the full command0() reset (not command1(), unlike every
+ // other command in this batch) before loading.
+ command0();
+ _channels[0].load(loadData(0x4D94));
+ _channels[1].load(loadData(0x4DD1));
+ _channels[2].load(loadData(0x4DEB));
+ _channels[3].load(loadData(0x4E2C));
+}
+
+int RSound9::command59() {
+ command1();
+ _channels[6].load(loadData(0x4D52));
+ _channels[7].load(loadData(0x4D78));
+ return 0;
+}
+
+int RSound9::command61() {
+ _channels[8].load(loadData(0x50C0));
+ return 0;
+}
+
+int RSound9::command62() {
+ // No gate at all: unconditionally arms the (asymmetric) timer and loads.
+ resetCallbackTimerEx(112, 96);
+ command1();
+ _channels[0].load(loadData(0x4E44));
+ _channels[1].load(loadData(0x4E61));
+ _channels[2].load(loadData(0x4F92));
+ return 0;
+}
+
+int RSound9::command63() {
+ playSoundChannels6to8(0x50CF);
+ return 0;
+}
+
+const RSound9::CommandPtr RSound9::_commandList[96] = {
+ &RSound9::command0, &RSound9::command1, &RSound9::command2, &RSound9::command3,
+ &RSound9::command4, &RSound9::command5, &RSound9::command6, &RSound9::command7,
+ &RSound9::command8, &RSound9::nullCommand, &RSound9::nullCommand, &RSound9::nullCommand,
+ &RSound9::nullCommand, &RSound9::nullCommand, &RSound9::nullCommand, &RSound9::nullCommand,
+ &RSound9::nullCommand, &RSound9::nullCommand, &RSound9::nullCommand, &RSound9::nullCommand,
+ &RSound9::nullCommand, &RSound9::nullCommand, &RSound9::nullCommand, &RSound9::nullCommand,
+ &RSound9::nullCommand, &RSound9::nullCommand, &RSound9::nullCommand, &RSound9::nullCommand,
+ &RSound9::nullCommand, &RSound9::nullCommand, &RSound9::nullCommand, &RSound9::nullCommand,
+ &RSound9::command32, &RSound9::command33Or47, &RSound9::command34Or54, &RSound9::command35,
+ &RSound9::command36, &RSound9::command37, &RSound9::command38, &RSound9::command39,
+ &RSound9::command40, &RSound9::command41, &RSound9::command42, &RSound9::command43,
+ &RSound9::nullCommand, &RSound9::command45, &RSound9::command46, &RSound9::command33Or47,
+ &RSound9::command48, &RSound9::command49, &RSound9::command50, &RSound9::command51,
+ &RSound9::command52, &RSound9::command53, &RSound9::command34Or54, &RSound9::command55,
+ &RSound9::nullCommand, &RSound9::command57, &RSound9::command58, &RSound9::command59,
+ &RSound9::command60, &RSound9::command61, &RSound9::command62, &RSound9::command63,
+ &RSound9::command32, &RSound9::command33Or47, &RSound9::command34Or54, &RSound9::command35,
+ &RSound9::command36, &RSound9::command37, &RSound9::command38, &RSound9::command39,
+ &RSound9::command40, &RSound9::command41, &RSound9::command42, &RSound9::command43,
+ &RSound9::nullCommand, &RSound9::command45, &RSound9::command46, &RSound9::command33Or47,
+ &RSound9::command48, &RSound9::command49, &RSound9::command50, &RSound9::command51,
+ &RSound9::command52, &RSound9::command53, &RSound9::command34Or54, &RSound9::command55,
+ &RSound9::nullCommand, &RSound9::command57, &RSound9::command58, &RSound9::command59,
+ &RSound9::command60, &RSound9::command61, &RSound9::command62, &RSound9::command63
+};
+
+int RSound9::command(int commandId, int param) {
+ if (commandId < 0 || commandId >= ARRAYSIZE(_commandList))
+ return 0;
+
+ _commandParam = param;
+ return (this->*_commandList[commandId])();
+}
+
} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/dragonsphere/rsound_dragonsphere.h b/engines/mads/dragonsphere/rsound_dragonsphere.h
index c9bd37e79b6..4e07cd2ef38 100644
--- a/engines/mads/dragonsphere/rsound_dragonsphere.h
+++ b/engines/mads/dragonsphere/rsound_dragonsphere.h
@@ -203,13 +203,6 @@ private:
int command30();
int command31();
- /**
- * Plays the specified sound, using any free channel from 7 to 8.
- * Matches playSoundChannels7to8: symmetric free/fallback scan (free
- * scan ch7 then ch8; fallback scan ch8 then ch7).
- */
- Channel *playSoundChannels7to8(int offset);
-
int command32();
void loadCommand32();
int command33();
@@ -533,6 +526,306 @@ public:
int command(int commandId, int param) override;
};
+/**
+ * RSound6 (rsound.dr6)
+ *
+ * command0/command6/command7/command8 all confirmed to match the shared
+ * RSound base exactly (no overrides needed).
+ *
+ * command2/command3 use a genuinely wider group than the base class's
+ * default: channels 1-6 AND 9 (seven channels, confirmed via symbolic
+ * names) rather than 1-5,9 (six). command5 enables only channels 7,8
+ * (two channels, confirmed via address arithmetic against command3's
+ * range - channel spacing and the absence of any other channel
+ * unaccounted for).
+ *
+ * command4 uses a custom inline GM-reset loop bounded 8 down to 6
+ * (matches the new sendGmResetRange() helper) rather than the shared
+ * sendGmReset(count) (which always counts from count down to 1) -
+ * confirmed via resetChannels6to8(), which matches the base class
+ * exactly (channels 6,7,8).
+ *
+ * command1/2/3 are not virtual in the base class, so command1() must be
+ * overridden too (calling THIS class's command3()) - same pitfall as
+ * every other Dragonsphere RSound driver so far. isMusicChannelsActive()
+ * is likewise overridden (hiding the base's private method) to match
+ * command3()'s wider 7-channel group.
+ *
+ * Dispatch table layout (funcs_10A43/10A59/10A6F/10A89/10A9F):
+ * commands 0-8 (base class, except command1-5 - see above)
+ * commands 16-18 (this class)
+ * commands 24-31 (this class); 29 confirmed nullsub_1
+ * commands 32-46 (this class); 41,42,43,46 confirmed nullsub_1
+ * commands 64-98 (this class, all populated)
+ */
+class RSound6 : public RSound {
+private:
+ int command1();
+ int command2();
+ int command3();
+ int command4();
+ int command5();
+
+ /**
+ * Hides the base class's private method (inaccessible from here
+ * otherwise). Confirmed to match the base class's exact shape
+ * (channels 6,7,8 unconditionally).
+ */
+ void resetChannels6to8();
+
+ /**
+ * Hides the base class's method: matches sub_10539 - channels 1-6
+ * AND 9 (seven channels), matching command3()'s own wider group,
+ * not the base class's default (1-5,9).
+ */
+ int isMusicChannelsActive();
+
+ /**
+ * Plays the specified sound, using any free channel from 1 to 6.
+ * Matches the disassembly's own playSoundChannesl1to6 (sic - a typo
+ * in the disassembly's own symbol name, fixed here): symmetric
+ * free/fallback scan.
+ */
+ Channel *playSoundChannels1To6(int offset);
+
+ /**
+ * Plays the specified sound, using any free channel from 1 to 8
+ * (everything except channel 9). Matches this driver's own
+ * playSoundAny exactly - a genuinely different (fuller) range than
+ * RSound1's identically-named playSoundAny (renamed there to
+ * playSoundChannels1To5 since it only reached channels 1-5).
+ */
+ Channel *playSoundAny(int offset);
+
+ typedef int (RSound6:: *CommandPtr)();
+ static const CommandPtr _commandList[99];
+
+ int command16();
+ void loadCommand16();
+ int command17();
+ int command18();
+
+ int command24();
+ int command25();
+ int command26();
+ int command27();
+ int command28();
+ int command30();
+ int command31();
+
+ /**
+ * command32/command33 share an intricate tail: command33's entry
+ * gate falls through into command32's own shared-load logic (and,
+ * in one branch, directly into command32's "load channel 4" tail,
+ * skipping the main load) - see the .cpp for the full breakdown.
+ */
+ int command32();
+ int command33();
+ void command32_33Load();
+ void command32_33LoadCh4();
+ byte _command33Flag = 0; // matches byte_13378
+
+ int command34();
+ void command34LoadCh1AndRest();
+ void command34LoadRestOnly();
+
+ int command35();
+
+ int command36();
+ int command37();
+ int command38();
+ int command39();
+ int command40();
+
+ int command44();
+ void loadCommand44();
+ int command45();
+
+ int command64();
+ int command65();
+ int command66();
+ int command67();
+ int command68();
+ int command69();
+ int command70();
+ int command71();
+ int command72();
+ int command73();
+ int command74();
+ int command75();
+ int command76();
+ int command77();
+ int command78();
+ int command79();
+ int command80();
+ int command81();
+ int command82();
+ int command83();
+ int command84();
+ int command85();
+ int command86();
+ int command87();
+ int command88();
+ int command89();
+ int command90();
+ int command91();
+ int command92();
+ int command93();
+ int command94();
+ int command95();
+ int command96();
+ int command97();
+ int command98();
+
+public:
+ RSound6(Audio::Mixer *mixer);
+
+ int command(int commandId, int param) override;
+};
+
+/**
+ * RSound9 (rsound.dr9)
+ *
+ * command0/command2/command4/command6/command7/command8 all confirmed to
+ * match the shared RSound base exactly (no overrides needed) - including
+ * command2's resetChannels1to5 (channels 1-5 AND 9, six channels) and
+ * command4's resetChannels6to8 (channels 6,7,8), both confirmed directly
+ * from the disassembly.
+ *
+ * command3/command5 are a genuinely different split from the base
+ * class's default (1-5,9 lower / 6,7,8 upper): here command3 enables
+ * only channels 1,2,3,4,9 (five channels - channel 5 is NOT included),
+ * and command5 enables channels 5,6,7,8 (four channels) - channel 5 has
+ * moved from the lower group into the upper group compared to the base.
+ *
+ * command1/2/3 are not virtual in the base class, so this driver's own
+ * command1() must be overridden too (calling THIS class's command3()/
+ * command5()) - same pitfall as every other Dragonsphere RSound driver
+ * so far.
+ *
+ * Dispatch table layout (funcs_10936/1094C/10962/10978):
+ * commands 0-8 (base class, except command1/3/5 - see above)
+ * commands 16-31 entirely unreachable (both bucket tables are 100%
+ * nullsub_2, regardless of exactly where the
+ * internal split between them falls)
+ * commands 32-63 (this class); 44,56 confirmed nullsub_2. Two shared
+ * handlers: commands 33 and 47 point to the exact
+ * same function (command33Or47()); commands 34 and
+ * 54 likewise (command34Or54()). command53's body is
+ * an unlabeled function in the disassembly (no proc
+ * name/index shown) - assigned to index 53 by
+ * elimination (the only index in this range with no
+ * other confirmed body), not from an explicit label;
+ * flag if that's wrong.
+ * commands 64-95 CONFIRMED by the user to be an exact duplicate of
+ * the 32-63 table (index 64+N behaves identically to
+ * index 32+N) - the flat _commandList[] below just
+ * reuses the same function pointers for that range,
+ * no separate implementation needed.
+ */
+class RSound9 : public RSound {
+private:
+ int command1();
+ int command3();
+ int command5();
+
+ int command32();
+
+ /** Matches sub_123E0: writes a "variant A" set of bytes into the shared command33Or47()/command60() sound block, at the same 8 offsets touched by variantSetupB(). Called only by command60(). */
+ void variantSetupA();
+
+ /** Matches sub_123FF: same 8 offsets as variantSetupA(), with different "variant B" byte values. Called only by command33Or47(). */
+ void variantSetupB();
+
+ /**
+ * Shared tail of command60()/command33Or47() (matches loc_12450) -
+ * the two commands are otherwise identical (same gate, same
+ * counter=98/period=84 timer) and differ only in which variant setup
+ * helper runs first.
+ */
+ void command33_47_60Load();
+ int command60();
+
+ /** Dispatch table entries 33 AND 47 both point to this single function (confirmed identical symbol at both table slots). */
+ int command33Or47();
+
+ /** Dispatch table entries 34 AND 54 both point to this single function (confirmed identical symbol at both table slots). */
+ int command34Or54();
+ void loadCommand34Or54();
+
+ int command35();
+ void loadCommand35();
+ int command36();
+ void loadCommand36();
+ int command37();
+ void loadCommand37();
+ int command38();
+ void loadCommand38();
+ int command39();
+ void loadCommand39();
+ int command40();
+ void loadCommand40();
+ int command41();
+ void loadCommand41();
+
+ /**
+ * Matches an unlabeled function immediately following command41() in
+ * the disassembly - see class comment re: its index being inferred
+ * by elimination.
+ */
+ int command53();
+ void loadCommand53();
+
+ int command42();
+ void loadCommand42();
+
+ int command43();
+
+ int command45();
+ int command46();
+
+ int command48();
+ int command49();
+ int command50();
+
+ int command51();
+ void loadCommand51();
+
+ /**
+ * Matches rsound_command52: the deferred-schedule branch loads bx
+ * with the callback target and immediately calls isSoundActive, but
+ * cx (isSoundActive's data-offset parameter) is never set beforehand
+ * on this path, and its result isn't tested by any branch either -
+ * confirmed dead/vestigial code in the original, intentionally
+ * omitted here.
+ */
+ int command52();
+ void loadCommand52();
+
+ int command55();
+ void loadCommand55();
+ int command57();
+ void loadCommand57();
+
+ /** Calls the full command0() reset (not command1(), unlike every other command in this batch) before loading. */
+ int command58();
+ void loadCommand58();
+
+ int command59();
+
+ int command61();
+ int command62();
+ int command63();
+
+ typedef int (RSound9:: *CommandPtr)();
+ static const CommandPtr _commandList[96];
+
+public:
+ RSound9(Audio::Mixer *mixer);
+
+ int command(int commandId, int param) override;
+};
+
} // namespace Dragonsphere
} // namespace MADS
Commit: a7cf2666406878b2c3a75e7ba504e0c8a93617c2
https://github.com/scummvm/scummvm/commit/a7cf2666406878b2c3a75e7ba504e0c8a93617c2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-28T17:16:19+10:00
Commit Message:
MADS: Create sound/ subfolders for each game and move sound files there
Changed paths:
A engines/mads/dragonsphere/sound/asound.cpp
A engines/mads/dragonsphere/sound/asound.h
A engines/mads/dragonsphere/sound/asound_dragonsphere.cpp
A engines/mads/dragonsphere/sound/asound_dragonsphere.h
A engines/mads/dragonsphere/sound/rsound.cpp
A engines/mads/dragonsphere/sound/rsound.h
A engines/mads/dragonsphere/sound/rsound_dragonsphere.cpp
A engines/mads/dragonsphere/sound/rsound_dragonsphere.h
A engines/mads/dragonsphere/sound/sound.cpp
A engines/mads/dragonsphere/sound/sound.h
A engines/mads/forest/sound/digi.cpp
A engines/mads/forest/sound/digi.h
A engines/mads/forest/sound/midi.cpp
A engines/mads/forest/sound/midi.h
A engines/mads/nebular/sound/asound.cpp
A engines/mads/nebular/sound/asound.h
A engines/mads/nebular/sound/asound_nebular.cpp
A engines/mads/nebular/sound/asound_nebular.h
A engines/mads/nebular/sound/isound.cpp
A engines/mads/nebular/sound/isound.h
A engines/mads/nebular/sound/isound_nebular.cpp
A engines/mads/nebular/sound/isound_nebular.h
A engines/mads/nebular/sound/rsound.cpp
A engines/mads/nebular/sound/rsound.h
A engines/mads/nebular/sound/rsound_nebular.cpp
A engines/mads/nebular/sound/rsound_nebular.h
A engines/mads/nebular/sound/sound.cpp
A engines/mads/nebular/sound/sound.h
A engines/mads/phantom/sound/asound.cpp
A engines/mads/phantom/sound/asound.h
A engines/mads/phantom/sound/asound_phantom.cpp
A engines/mads/phantom/sound/asound_phantom.h
A engines/mads/phantom/sound/rsound.cpp
A engines/mads/phantom/sound/rsound.h
A engines/mads/phantom/sound/rsound_phantom.cpp
A engines/mads/phantom/sound/rsound_phantom.h
A engines/mads/phantom/sound/sound.cpp
A engines/mads/phantom/sound/sound.h
R engines/mads/dragonsphere/asound.cpp
R engines/mads/dragonsphere/asound.h
R engines/mads/dragonsphere/asound_dragonsphere.cpp
R engines/mads/dragonsphere/asound_dragonsphere.h
R engines/mads/dragonsphere/rsound.cpp
R engines/mads/dragonsphere/rsound.h
R engines/mads/dragonsphere/rsound_dragonsphere.cpp
R engines/mads/dragonsphere/rsound_dragonsphere.h
R engines/mads/dragonsphere/sound.cpp
R engines/mads/dragonsphere/sound.h
R engines/mads/forest/digi.cpp
R engines/mads/forest/digi.h
R engines/mads/forest/midi.cpp
R engines/mads/forest/midi.h
R engines/mads/nebular/asound.cpp
R engines/mads/nebular/asound.h
R engines/mads/nebular/asound_nebular.cpp
R engines/mads/nebular/asound_nebular.h
R engines/mads/nebular/isound.cpp
R engines/mads/nebular/isound.h
R engines/mads/nebular/isound_nebular.cpp
R engines/mads/nebular/isound_nebular.h
R engines/mads/nebular/rsound.cpp
R engines/mads/nebular/rsound.h
R engines/mads/nebular/rsound_nebular.cpp
R engines/mads/nebular/rsound_nebular.h
R engines/mads/nebular/sound.cpp
R engines/mads/nebular/sound.h
R engines/mads/phantom/asound.cpp
R engines/mads/phantom/asound.h
R engines/mads/phantom/asound_phantom.cpp
R engines/mads/phantom/asound_phantom.h
R engines/mads/phantom/rsound.cpp
R engines/mads/phantom/rsound.h
R engines/mads/phantom/rsound_phantom.cpp
R engines/mads/phantom/rsound_phantom.h
R engines/mads/phantom/sound.cpp
R engines/mads/phantom/sound.h
engines/mads/core/game.cpp
engines/mads/core/kernel.cpp
engines/mads/dragonsphere/dragonsphere.cpp
engines/mads/forest/extra.cpp
engines/mads/forest/forest.h
engines/mads/forest/global.cpp
engines/mads/forest/inventory.cpp
engines/mads/forest/journal.cpp
engines/mads/forest/menus.cpp
engines/mads/forest/rooms/room101.cpp
engines/mads/forest/rooms/room103.cpp
engines/mads/forest/rooms/room104.cpp
engines/mads/forest/rooms/room106.cpp
engines/mads/forest/rooms/room107.cpp
engines/mads/forest/rooms/room199.cpp
engines/mads/forest/rooms/room201.cpp
engines/mads/forest/rooms/room203.cpp
engines/mads/forest/rooms/room204.cpp
engines/mads/forest/rooms/room205.cpp
engines/mads/forest/rooms/room210.cpp
engines/mads/forest/rooms/room211.cpp
engines/mads/forest/rooms/room220.cpp
engines/mads/forest/rooms/room221.cpp
engines/mads/forest/rooms/room301.cpp
engines/mads/forest/rooms/room302.cpp
engines/mads/forest/rooms/room303.cpp
engines/mads/forest/rooms/room304.cpp
engines/mads/forest/rooms/room305.cpp
engines/mads/forest/rooms/room306.cpp
engines/mads/forest/rooms/room307.cpp
engines/mads/forest/rooms/room308.cpp
engines/mads/forest/rooms/room321.cpp
engines/mads/forest/rooms/room322.cpp
engines/mads/forest/rooms/room401.cpp
engines/mads/forest/rooms/room402.cpp
engines/mads/forest/rooms/room403.cpp
engines/mads/forest/rooms/room404.cpp
engines/mads/forest/rooms/room405.cpp
engines/mads/forest/rooms/room420.cpp
engines/mads/forest/rooms/room501.cpp
engines/mads/forest/rooms/room503.cpp
engines/mads/forest/rooms/room509.cpp
engines/mads/forest/rooms/room510.cpp
engines/mads/forest/rooms/room520.cpp
engines/mads/forest/rooms/room904.cpp
engines/mads/module.mk
engines/mads/nebular/nebular.cpp
engines/mads/phantom/phantom.cpp
diff --git a/engines/mads/core/game.cpp b/engines/mads/core/game.cpp
index 18b5a280436..45d185ebac3 100644
--- a/engines/mads/core/game.cpp
+++ b/engines/mads/core/game.cpp
@@ -62,7 +62,7 @@
#include "mads/core/text.h"
#include "mads/core/imath.h"
#include "mads/core/screen.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
diff --git a/engines/mads/core/kernel.cpp b/engines/mads/core/kernel.cpp
index 517c7d1b6a7..2c46bc7cbc6 100644
--- a/engines/mads/core/kernel.cpp
+++ b/engines/mads/core/kernel.cpp
@@ -57,7 +57,7 @@
#include "mads/core/quote.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/nebular/extra.h"
namespace MADS {
diff --git a/engines/mads/dragonsphere/dragonsphere.cpp b/engines/mads/dragonsphere/dragonsphere.cpp
index db50fe32c12..fe126226323 100644
--- a/engines/mads/dragonsphere/dragonsphere.cpp
+++ b/engines/mads/dragonsphere/dragonsphere.cpp
@@ -39,7 +39,7 @@
#include "mads/dragonsphere/dragonsphere.h"
#include "mads/dragonsphere/global.h"
#include "mads/dragonsphere/main.h"
-#include "mads/dragonsphere/sound.h"
+#include "mads/dragonsphere/sound/sound.h"
#include "mads/dragonsphere/rooms/section1.h"
#include "mads/dragonsphere/rooms/section2.h"
#include "mads/dragonsphere/rooms/section3.h"
@@ -71,7 +71,7 @@ Common::Error DragonsphereEngine::run() {
}
// Set up sound manager
- _soundManager = new DragonSoundManager(_mixer, _soundFlag, isDemo());
+ _soundManager = new Sound::DragonSoundManager(_mixer, _soundFlag, isDemo());
_soundManager->validate();
// Run the game
diff --git a/engines/mads/dragonsphere/asound.cpp b/engines/mads/dragonsphere/sound/asound.cpp
similarity index 99%
rename from engines/mads/dragonsphere/asound.cpp
rename to engines/mads/dragonsphere/sound/asound.cpp
index 1f456ffd42a..d3e34c25402 100644
--- a/engines/mads/dragonsphere/asound.cpp
+++ b/engines/mads/dragonsphere/sound/asound.cpp
@@ -22,10 +22,11 @@
#include "audio/fmopl.h"
#include "common/file.h"
#include "common/md5.h"
-#include "mads/dragonsphere/asound.h"
+#include "mads/dragonsphere/sound/asound.h"
namespace MADS {
namespace Dragonsphere {
+namespace Sound {
bool AdlibChannel::_isDisabled;
@@ -1838,5 +1839,6 @@ void ASound::playSound(int offset) {
findFreeChannelFull(loadData(offset));
}
+} // namespace Sound
} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/dragonsphere/asound.h b/engines/mads/dragonsphere/sound/asound.h
similarity index 99%
rename from engines/mads/dragonsphere/asound.h
rename to engines/mads/dragonsphere/sound/asound.h
index 8d7aedc72c6..3ce7bf3f5de 100644
--- a/engines/mads/dragonsphere/asound.h
+++ b/engines/mads/dragonsphere/sound/asound.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef MADS_DRAGONSPHERE_ASOUND_H
-#define MADS_DRAGONSPHERE_ASOUND_H
+#ifndef MADS_DRAGONSPHERE_SOUND_ASOUND_H
+#define MADS_DRAGONSPHERE_SOUND_ASOUND_H
#include "audio/fmopl.h"
#include "common/mutex.h"
@@ -30,6 +30,7 @@
namespace MADS {
namespace Dragonsphere {
+namespace Sound {
#define ADLIB_CHANNEL_COUNT 9
@@ -650,6 +651,7 @@ public:
}
};
+} // namespace Sound
} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/dragonsphere/asound_dragonsphere.cpp b/engines/mads/dragonsphere/sound/asound_dragonsphere.cpp
similarity index 99%
rename from engines/mads/dragonsphere/asound_dragonsphere.cpp
rename to engines/mads/dragonsphere/sound/asound_dragonsphere.cpp
index 9d91a3889fe..1d97b7105f6 100644
--- a/engines/mads/dragonsphere/asound_dragonsphere.cpp
+++ b/engines/mads/dragonsphere/sound/asound_dragonsphere.cpp
@@ -19,10 +19,11 @@
*
*/
-#include "mads/dragonsphere/asound_dragonsphere.h"
+#include "mads/dragonsphere/sound/asound_dragonsphere.h"
namespace MADS {
namespace Dragonsphere {
+namespace Sound {
/*-----------------------------------------------------------------------*/
/* ASound1 (asound.dr1) *
@@ -3862,5 +3863,6 @@ int ASoundDemo9::command48() { findFreeChannel(loadData(0x5E84)); return 0; }
int ASoundDemo9::command49() { findFreeChannel(loadData(0x5E8E)); return 0; }
int ASoundDemo9::command50() { findFreeChannel(loadData(0x5E98)); return 0; }
+} // namespace Sound
} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/dragonsphere/asound_dragonsphere.h b/engines/mads/dragonsphere/sound/asound_dragonsphere.h
similarity index 99%
rename from engines/mads/dragonsphere/asound_dragonsphere.h
rename to engines/mads/dragonsphere/sound/asound_dragonsphere.h
index f6c397a1c36..8797779ef40 100644
--- a/engines/mads/dragonsphere/asound_dragonsphere.h
+++ b/engines/mads/dragonsphere/sound/asound_dragonsphere.h
@@ -19,13 +19,14 @@
*
*/
-#ifndef MADS_DRAGONSPHERE_ASOUND_DRAGONSPHERE_H
-#define MADS_DRAGONSPHERE_ASOUND_DRAGONSPHERE_H
+#ifndef MADS_DRAGONSPHERE_SOUND_ASOUND_DRAGONSPHERE_H
+#define MADS_DRAGONSPHERE_SOUND_ASOUND_DRAGONSPHERE_H
-#include "mads/dragonsphere/asound.h"
+#include "mads/dragonsphere/sound/asound.h"
namespace MADS {
namespace Dragonsphere {
+namespace Sound {
/**
* ASound1 (asound.dr1, _dataOffset = 0x2520, _dataSize = 0x49e0)
@@ -605,6 +606,7 @@ public:
int command(int commandId, int param) override;
};
+} // namespace Sound
} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/dragonsphere/rsound.cpp b/engines/mads/dragonsphere/sound/rsound.cpp
similarity index 99%
rename from engines/mads/dragonsphere/rsound.cpp
rename to engines/mads/dragonsphere/sound/rsound.cpp
index a24382cd9fa..82f06acb713 100644
--- a/engines/mads/dragonsphere/rsound.cpp
+++ b/engines/mads/dragonsphere/sound/rsound.cpp
@@ -20,10 +20,11 @@
*/
#include "common/util.h"
-#include "mads/dragonsphere/rsound.h"
+#include "mads/dragonsphere/sound/rsound.h"
namespace MADS {
namespace Dragonsphere {
+namespace Sound {
/*-----------------------------------------------------------------------*/
@@ -1086,5 +1087,6 @@ post_keyon:
}
}
+} // namespace Sound
} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/dragonsphere/rsound.h b/engines/mads/dragonsphere/sound/rsound.h
similarity index 99%
rename from engines/mads/dragonsphere/rsound.h
rename to engines/mads/dragonsphere/sound/rsound.h
index a9f97cc2a59..126ecca7a29 100644
--- a/engines/mads/dragonsphere/rsound.h
+++ b/engines/mads/dragonsphere/sound/rsound.h
@@ -19,13 +19,14 @@
*
*/
-#ifndef MADS_DRAGONSPHERE_RSOUND_H
-#define MADS_DRAGONSPHERE_RSOUND_H
+#ifndef MADS_DRAGONSPHERE_SOUND_RSOUND_H
+#define MADS_DRAGONSPHERE_SOUND_RSOUND_H
#include "mads/core/sound_manager.h"
namespace MADS {
namespace Dragonsphere {
+namespace Sound {
class RSound;
@@ -530,6 +531,7 @@ public:
}
};
+} // namespace Sound
} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/dragonsphere/rsound_dragonsphere.cpp b/engines/mads/dragonsphere/sound/rsound_dragonsphere.cpp
similarity index 99%
rename from engines/mads/dragonsphere/rsound_dragonsphere.cpp
rename to engines/mads/dragonsphere/sound/rsound_dragonsphere.cpp
index 9d6f643a6ec..c82a5b2ecbb 100644
--- a/engines/mads/dragonsphere/rsound_dragonsphere.cpp
+++ b/engines/mads/dragonsphere/sound/rsound_dragonsphere.cpp
@@ -20,10 +20,11 @@
*/
#include "common/util.h"
-#include "mads/dragonsphere/rsound_dragonsphere.h"
+#include "mads/dragonsphere/sound/rsound_dragonsphere.h"
namespace MADS {
namespace Dragonsphere {
+namespace Sound {
#define MAKE_CALLBACK(cls, fn) reinterpret_cast<RSound::CallbackFunction>(&cls::fn)
@@ -3261,5 +3262,6 @@ int RSound9::command(int commandId, int param) {
return (this->*_commandList[commandId])();
}
+} // namespace Sound
} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/dragonsphere/rsound_dragonsphere.h b/engines/mads/dragonsphere/sound/rsound_dragonsphere.h
similarity index 99%
rename from engines/mads/dragonsphere/rsound_dragonsphere.h
rename to engines/mads/dragonsphere/sound/rsound_dragonsphere.h
index 4e07cd2ef38..e234c1a2e08 100644
--- a/engines/mads/dragonsphere/rsound_dragonsphere.h
+++ b/engines/mads/dragonsphere/sound/rsound_dragonsphere.h
@@ -19,13 +19,14 @@
*
*/
-#ifndef MADS_DRAGONSPHERE_RSOUND_DRAGONSPHERE_H
-#define MADS_DRAGONSPHERE_RSOUND_DRAGONSPHERE_H
+#ifndef MADS_DRAGONSPHERE_SOUND_RSOUND_DRAGONSPHERE_H
+#define MADS_DRAGONSPHERE_SOUND_RSOUND_DRAGONSPHERE_H
-#include "mads/dragonsphere/rsound.h"
+#include "mads/dragonsphere/sound/rsound.h"
namespace MADS {
namespace Dragonsphere {
+namespace Sound {
/**
* RSound1 (rsound.dr1)
@@ -826,6 +827,7 @@ public:
int command(int commandId, int param) override;
};
+} // namespace Sound
} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/dragonsphere/sound.cpp b/engines/mads/dragonsphere/sound/sound.cpp
similarity index 90%
rename from engines/mads/dragonsphere/sound.cpp
rename to engines/mads/dragonsphere/sound/sound.cpp
index 0f23fff6069..954505f4b87 100644
--- a/engines/mads/dragonsphere/sound.cpp
+++ b/engines/mads/dragonsphere/sound/sound.cpp
@@ -19,12 +19,13 @@
*
*/
-#include "mads/dragonsphere/sound.h"
-#include "mads/dragonsphere/asound_dragonsphere.h"
-#include "mads/dragonsphere/rsound_dragonsphere.h"
+#include "mads/dragonsphere/sound/sound.h"
+#include "mads/dragonsphere/sound/asound_dragonsphere.h"
+#include "mads/dragonsphere/sound/rsound_dragonsphere.h"
namespace MADS {
namespace Dragonsphere {
+namespace Sound {
void DragonSoundManager::validate() {
switch (_driverType) {
@@ -99,5 +100,6 @@ void DragonSoundManager::loadDriver(int sectionNumber) {
}
}
-} // namespace RexNebular
+} // namespace Sound
+} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/dragonsphere/sound.h b/engines/mads/dragonsphere/sound/sound.h
similarity index 92%
rename from engines/mads/dragonsphere/sound.h
rename to engines/mads/dragonsphere/sound/sound.h
index 0c5a6ba0b3d..82332cdf570 100644
--- a/engines/mads/dragonsphere/sound.h
+++ b/engines/mads/dragonsphere/sound/sound.h
@@ -19,13 +19,14 @@
*
*/
-#ifndef MADS_DRAGONSPHERE_SOUND_H
-#define MADS_DRAGONSPHERE_SOUND_H
+#ifndef MADS_DRAGONSPHERE_SOUND_SOUND_H
+#define MADS_DRAGONSPHERE_SOUND_SOUND_H
#include "mads/core/sound_manager.h"
namespace MADS {
namespace Dragonsphere {
+namespace Sound {
class DragonSoundManager : public SoundManager {
private:
@@ -49,6 +50,7 @@ public:
void validate() override;
};
+} // namespace Sound
} // namespace Dragonsphere
} // namespace MADS
diff --git a/engines/mads/forest/extra.cpp b/engines/mads/forest/extra.cpp
index 1b1a5fec5d7..5f46db4c4bc 100644
--- a/engines/mads/forest/extra.cpp
+++ b/engines/mads/forest/extra.cpp
@@ -30,11 +30,11 @@
#include "mads/core/player.h"
#include "mads/core/screen.h"
#include "mads/core/timer.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/forest/journal.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
namespace MADS {
namespace Forest {
diff --git a/engines/mads/forest/forest.h b/engines/mads/forest/forest.h
index 622af4b3f08..39c2be9b076 100644
--- a/engines/mads/forest/forest.h
+++ b/engines/mads/forest/forest.h
@@ -23,8 +23,8 @@
#define MADS_FOREST_H
#include "mads/mads.h"
-#include "mads/forest/digi.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/digi.h"
+#include "mads/forest/sound/midi.h"
namespace MADS {
namespace Forest {
diff --git a/engines/mads/forest/global.cpp b/engines/mads/forest/global.cpp
index a4e64c242dd..2e4de9d1a1f 100644
--- a/engines/mads/forest/global.cpp
+++ b/engines/mads/forest/global.cpp
@@ -29,8 +29,8 @@
#include "mads/core/pal.h"
#include "mads/core/player.h"
#include "mads/core/text.h"
-#include "mads/forest/digi.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/digi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/forest/mads/words.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
diff --git a/engines/mads/forest/inventory.cpp b/engines/mads/forest/inventory.cpp
index 88493cc7c08..a97bf7dabda 100644
--- a/engines/mads/forest/inventory.cpp
+++ b/engines/mads/forest/inventory.cpp
@@ -34,12 +34,12 @@
#include "mads/core/screen.h"
#include "mads/core/sprite.h"
#include "mads/core/timer.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/forest/inventory.h"
#include "mads/forest/journal.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
namespace MADS {
namespace Forest {
diff --git a/engines/mads/forest/journal.cpp b/engines/mads/forest/journal.cpp
index ab5a282f638..0352de566b4 100644
--- a/engines/mads/forest/journal.cpp
+++ b/engines/mads/forest/journal.cpp
@@ -22,7 +22,7 @@
#include "mads/forest/journal.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/global.h"
#include "mads/core/kernel.h"
#include "mads/core/player.h"
diff --git a/engines/mads/forest/menus.cpp b/engines/mads/forest/menus.cpp
index b674f977b2a..6c4481c5d07 100644
--- a/engines/mads/forest/menus.cpp
+++ b/engines/mads/forest/menus.cpp
@@ -33,7 +33,7 @@
#include "mads/forest/global.h"
#include "mads/forest/mads/quotes.h"
#include "mads/forest/menus.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
namespace MADS {
namespace Forest {
diff --git a/engines/mads/forest/rooms/room101.cpp b/engines/mads/forest/rooms/room101.cpp
index b429184ae25..f7b0e59284d 100644
--- a/engines/mads/forest/rooms/room101.cpp
+++ b/engines/mads/forest/rooms/room101.cpp
@@ -23,10 +23,10 @@
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
#include "mads/forest/rooms/section1.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
#include "mads/core/inter.h"
diff --git a/engines/mads/forest/rooms/room103.cpp b/engines/mads/forest/rooms/room103.cpp
index 75d1f8913d1..a19fd76336c 100644
--- a/engines/mads/forest/rooms/room103.cpp
+++ b/engines/mads/forest/rooms/room103.cpp
@@ -23,9 +23,9 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
#include "mads/core/inter.h"
diff --git a/engines/mads/forest/rooms/room104.cpp b/engines/mads/forest/rooms/room104.cpp
index c630695b84b..cdca02ec3c5 100644
--- a/engines/mads/forest/rooms/room104.cpp
+++ b/engines/mads/forest/rooms/room104.cpp
@@ -23,10 +23,10 @@
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
#include "mads/forest/rooms/section1.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
#include "mads/core/inter.h"
diff --git a/engines/mads/forest/rooms/room106.cpp b/engines/mads/forest/rooms/room106.cpp
index b246d9909b1..01baea3980c 100644
--- a/engines/mads/forest/rooms/room106.cpp
+++ b/engines/mads/forest/rooms/room106.cpp
@@ -23,10 +23,10 @@
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
#include "mads/forest/rooms/section1.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/config.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
diff --git a/engines/mads/forest/rooms/room107.cpp b/engines/mads/forest/rooms/room107.cpp
index bed3367644a..b3fdfddb7bb 100644
--- a/engines/mads/forest/rooms/room107.cpp
+++ b/engines/mads/forest/rooms/room107.cpp
@@ -20,7 +20,7 @@
*/
#include "mads/forest/rooms/section1.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/global.h"
#include "mads/core/game.h"
#include "mads/core/kernel.h"
diff --git a/engines/mads/forest/rooms/room199.cpp b/engines/mads/forest/rooms/room199.cpp
index 2da241a1cbb..332f86ff92d 100644
--- a/engines/mads/forest/rooms/room199.cpp
+++ b/engines/mads/forest/rooms/room199.cpp
@@ -22,7 +22,7 @@
#include "mads/forest/rooms/section1.h"
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/global.h"
#include "mads/forest/journal.h"
#include "mads/core/game.h"
diff --git a/engines/mads/forest/rooms/room201.cpp b/engines/mads/forest/rooms/room201.cpp
index 1755a2ebc45..74f1ddfebd4 100644
--- a/engines/mads/forest/rooms/room201.cpp
+++ b/engines/mads/forest/rooms/room201.cpp
@@ -22,7 +22,7 @@
#include "mads/forest/rooms/section2.h"
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/core/game.h"
diff --git a/engines/mads/forest/rooms/room203.cpp b/engines/mads/forest/rooms/room203.cpp
index 104abbc1e6a..cf2c46b17ef 100644
--- a/engines/mads/forest/rooms/room203.cpp
+++ b/engines/mads/forest/rooms/room203.cpp
@@ -22,11 +22,11 @@
#include "mads/forest/rooms/section2.h"
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/forest/journal.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
#include "mads/core/inter.h"
diff --git a/engines/mads/forest/rooms/room204.cpp b/engines/mads/forest/rooms/room204.cpp
index 52d5313ab50..d1db9970ce6 100644
--- a/engines/mads/forest/rooms/room204.cpp
+++ b/engines/mads/forest/rooms/room204.cpp
@@ -22,10 +22,10 @@
#include "mads/forest/rooms/section2.h"
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/global.h"
#include "mads/core/inter.h"
diff --git a/engines/mads/forest/rooms/room205.cpp b/engines/mads/forest/rooms/room205.cpp
index 89c9bdca270..1e2142e43a0 100644
--- a/engines/mads/forest/rooms/room205.cpp
+++ b/engines/mads/forest/rooms/room205.cpp
@@ -21,10 +21,10 @@
#include "mads/forest/rooms/section2.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/global.h"
#include "mads/core/imath.h"
diff --git a/engines/mads/forest/rooms/room210.cpp b/engines/mads/forest/rooms/room210.cpp
index 4f1b25a114e..4795650617b 100644
--- a/engines/mads/forest/rooms/room210.cpp
+++ b/engines/mads/forest/rooms/room210.cpp
@@ -23,10 +23,10 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/config.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
diff --git a/engines/mads/forest/rooms/room211.cpp b/engines/mads/forest/rooms/room211.cpp
index 34dac219a68..79562288fef 100644
--- a/engines/mads/forest/rooms/room211.cpp
+++ b/engines/mads/forest/rooms/room211.cpp
@@ -21,9 +21,9 @@
#include "mads/forest/rooms/section1.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/kernel.h"
#include "mads/core/matte.h"
diff --git a/engines/mads/forest/rooms/room220.cpp b/engines/mads/forest/rooms/room220.cpp
index 98161536488..2266ab1c60c 100644
--- a/engines/mads/forest/rooms/room220.cpp
+++ b/engines/mads/forest/rooms/room220.cpp
@@ -21,9 +21,9 @@
#include "mads/forest/rooms/section1.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/kernel.h"
#include "mads/core/matte.h"
diff --git a/engines/mads/forest/rooms/room221.cpp b/engines/mads/forest/rooms/room221.cpp
index 6efa8fb6ad1..6b9266b78f9 100644
--- a/engines/mads/forest/rooms/room221.cpp
+++ b/engines/mads/forest/rooms/room221.cpp
@@ -23,10 +23,10 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
#include "mads/core/inter.h"
diff --git a/engines/mads/forest/rooms/room301.cpp b/engines/mads/forest/rooms/room301.cpp
index cf0cb00c6e8..128f17c2f65 100644
--- a/engines/mads/forest/rooms/room301.cpp
+++ b/engines/mads/forest/rooms/room301.cpp
@@ -19,10 +19,10 @@
*
*/
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/words.h"
#include "mads/core/game.h"
diff --git a/engines/mads/forest/rooms/room302.cpp b/engines/mads/forest/rooms/room302.cpp
index 0244b40157b..f644ee949d6 100644
--- a/engines/mads/forest/rooms/room302.cpp
+++ b/engines/mads/forest/rooms/room302.cpp
@@ -23,10 +23,10 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
#include "mads/core/inter.h"
diff --git a/engines/mads/forest/rooms/room303.cpp b/engines/mads/forest/rooms/room303.cpp
index 9bb532ae0aa..755272f37e7 100644
--- a/engines/mads/forest/rooms/room303.cpp
+++ b/engines/mads/forest/rooms/room303.cpp
@@ -23,7 +23,7 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/core/game.h"
diff --git a/engines/mads/forest/rooms/room304.cpp b/engines/mads/forest/rooms/room304.cpp
index 4089080b22e..1665fd105f3 100644
--- a/engines/mads/forest/rooms/room304.cpp
+++ b/engines/mads/forest/rooms/room304.cpp
@@ -23,11 +23,11 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/forest/journal.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/config.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
diff --git a/engines/mads/forest/rooms/room305.cpp b/engines/mads/forest/rooms/room305.cpp
index c7b619c06c4..df038f198c2 100644
--- a/engines/mads/forest/rooms/room305.cpp
+++ b/engines/mads/forest/rooms/room305.cpp
@@ -22,7 +22,7 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/core/config.h"
diff --git a/engines/mads/forest/rooms/room306.cpp b/engines/mads/forest/rooms/room306.cpp
index d61da85138a..c0ac6a46d03 100644
--- a/engines/mads/forest/rooms/room306.cpp
+++ b/engines/mads/forest/rooms/room306.cpp
@@ -22,10 +22,10 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/config.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
diff --git a/engines/mads/forest/rooms/room307.cpp b/engines/mads/forest/rooms/room307.cpp
index d7e5a639cd3..fa5df9ee9ef 100644
--- a/engines/mads/forest/rooms/room307.cpp
+++ b/engines/mads/forest/rooms/room307.cpp
@@ -23,10 +23,10 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/config.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
diff --git a/engines/mads/forest/rooms/room308.cpp b/engines/mads/forest/rooms/room308.cpp
index 7c8d37dc325..89922b167c3 100644
--- a/engines/mads/forest/rooms/room308.cpp
+++ b/engines/mads/forest/rooms/room308.cpp
@@ -22,7 +22,7 @@
#include "mads/forest/rooms/section3.h"
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/forest/journal.h"
diff --git a/engines/mads/forest/rooms/room321.cpp b/engines/mads/forest/rooms/room321.cpp
index d300610f7c0..6de9b9bf6e3 100644
--- a/engines/mads/forest/rooms/room321.cpp
+++ b/engines/mads/forest/rooms/room321.cpp
@@ -23,7 +23,7 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/core/game.h"
diff --git a/engines/mads/forest/rooms/room322.cpp b/engines/mads/forest/rooms/room322.cpp
index 910d2006faf..9dcb038d95c 100644
--- a/engines/mads/forest/rooms/room322.cpp
+++ b/engines/mads/forest/rooms/room322.cpp
@@ -23,10 +23,10 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
#include "mads/core/inter.h"
diff --git a/engines/mads/forest/rooms/room401.cpp b/engines/mads/forest/rooms/room401.cpp
index f7630c4e601..be1fdea23d5 100644
--- a/engines/mads/forest/rooms/room401.cpp
+++ b/engines/mads/forest/rooms/room401.cpp
@@ -23,10 +23,10 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/config.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
diff --git a/engines/mads/forest/rooms/room402.cpp b/engines/mads/forest/rooms/room402.cpp
index 28e541457c4..facfc0ad752 100644
--- a/engines/mads/forest/rooms/room402.cpp
+++ b/engines/mads/forest/rooms/room402.cpp
@@ -23,11 +23,11 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/forest/journal.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
#include "mads/core/inter.h"
diff --git a/engines/mads/forest/rooms/room403.cpp b/engines/mads/forest/rooms/room403.cpp
index 7d69a1bd266..766d60891d2 100644
--- a/engines/mads/forest/rooms/room403.cpp
+++ b/engines/mads/forest/rooms/room403.cpp
@@ -22,11 +22,11 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/forest/journal.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/config.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
diff --git a/engines/mads/forest/rooms/room404.cpp b/engines/mads/forest/rooms/room404.cpp
index b20b477be55..2dae79b3169 100644
--- a/engines/mads/forest/rooms/room404.cpp
+++ b/engines/mads/forest/rooms/room404.cpp
@@ -22,7 +22,7 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/forest/journal.h"
diff --git a/engines/mads/forest/rooms/room405.cpp b/engines/mads/forest/rooms/room405.cpp
index 3f0c426a814..c301a565c7e 100644
--- a/engines/mads/forest/rooms/room405.cpp
+++ b/engines/mads/forest/rooms/room405.cpp
@@ -22,7 +22,7 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
#include "mads/forest/journal.h"
diff --git a/engines/mads/forest/rooms/room420.cpp b/engines/mads/forest/rooms/room420.cpp
index 4e475ec61db..2de0a35ca73 100644
--- a/engines/mads/forest/rooms/room420.cpp
+++ b/engines/mads/forest/rooms/room420.cpp
@@ -20,9 +20,9 @@
*/
#include "mads/forest/rooms/section1.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/kernel.h"
#include "mads/core/player.h"
diff --git a/engines/mads/forest/rooms/room501.cpp b/engines/mads/forest/rooms/room501.cpp
index 55b0f3e36fc..6f4bda7466b 100644
--- a/engines/mads/forest/rooms/room501.cpp
+++ b/engines/mads/forest/rooms/room501.cpp
@@ -23,10 +23,10 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/extra.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
#include "mads/core/inter.h"
diff --git a/engines/mads/forest/rooms/room503.cpp b/engines/mads/forest/rooms/room503.cpp
index 62cacfc7e5e..6e831fb402c 100644
--- a/engines/mads/forest/rooms/room503.cpp
+++ b/engines/mads/forest/rooms/room503.cpp
@@ -23,10 +23,10 @@
#include "mads/forest/mads/inventory.h"
#include "mads/forest/mads/sounds.h"
#include "mads/forest/mads/words.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/global.h"
#include "mads/forest/journal.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/imath.h"
#include "mads/core/inter.h"
diff --git a/engines/mads/forest/rooms/room509.cpp b/engines/mads/forest/rooms/room509.cpp
index 57faf8eefaf..5c4708464f9 100644
--- a/engines/mads/forest/rooms/room509.cpp
+++ b/engines/mads/forest/rooms/room509.cpp
@@ -19,7 +19,7 @@
*
*/
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/global.h"
#include "mads/core/game.h"
#include "mads/core/kernel.h"
diff --git a/engines/mads/forest/rooms/room510.cpp b/engines/mads/forest/rooms/room510.cpp
index cd1032f4513..2e4fc47d1b3 100644
--- a/engines/mads/forest/rooms/room510.cpp
+++ b/engines/mads/forest/rooms/room510.cpp
@@ -19,9 +19,9 @@
*
*/
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/config.h"
#include "mads/core/font.h"
#include "mads/core/game.h"
diff --git a/engines/mads/forest/rooms/room520.cpp b/engines/mads/forest/rooms/room520.cpp
index aa62391318d..21fd6ab3976 100644
--- a/engines/mads/forest/rooms/room520.cpp
+++ b/engines/mads/forest/rooms/room520.cpp
@@ -19,7 +19,7 @@
*
*/
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/global.h"
#include "mads/core/game.h"
#include "mads/core/kernel.h"
diff --git a/engines/mads/forest/rooms/room904.cpp b/engines/mads/forest/rooms/room904.cpp
index 18023e5cd31..ad384008570 100644
--- a/engines/mads/forest/rooms/room904.cpp
+++ b/engines/mads/forest/rooms/room904.cpp
@@ -22,7 +22,7 @@
#include "common/config-manager.h"
#include "mads/forest/rooms/section9.h"
#include "mads/forest/global.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/game.h"
#include "mads/core/global.h"
#include "mads/core/kernel.h"
diff --git a/engines/mads/forest/digi.cpp b/engines/mads/forest/sound/digi.cpp
similarity index 99%
rename from engines/mads/forest/digi.cpp
rename to engines/mads/forest/sound/digi.cpp
index 09641cf5c18..9488a97b60e 100644
--- a/engines/mads/forest/digi.cpp
+++ b/engines/mads/forest/sound/digi.cpp
@@ -21,7 +21,7 @@
#include "audio/decoders/adpcm.h"
#include "audio/decoders/raw.h"
-#include "mads/forest/digi.h"
+#include "mads/forest/sound/digi.h"
#include "mads/forest/forest.h"
#include "mads/core/env.h"
#include "mads/core/kernel.h"
diff --git a/engines/mads/forest/digi.h b/engines/mads/forest/sound/digi.h
similarity index 100%
rename from engines/mads/forest/digi.h
rename to engines/mads/forest/sound/digi.h
diff --git a/engines/mads/forest/midi.cpp b/engines/mads/forest/sound/midi.cpp
similarity index 99%
rename from engines/mads/forest/midi.cpp
rename to engines/mads/forest/sound/midi.cpp
index 31c9049892c..89ecbd0da52 100644
--- a/engines/mads/forest/midi.cpp
+++ b/engines/mads/forest/sound/midi.cpp
@@ -24,7 +24,7 @@
#include "audio/adlib_hmisos.h"
#include "audio/midiparser_hmp.h"
#include "audio/mt32gm.h"
-#include "mads/forest/midi.h"
+#include "mads/forest/sound/midi.h"
#include "mads/core/env.h"
#include "mads/forest/forest.h"
diff --git a/engines/mads/forest/midi.h b/engines/mads/forest/sound/midi.h
similarity index 100%
rename from engines/mads/forest/midi.h
rename to engines/mads/forest/sound/midi.h
diff --git a/engines/mads/module.mk b/engines/mads/module.mk
index 492431cad0d..9872184e5b3 100644
--- a/engines/mads/module.mk
+++ b/engines/mads/module.mk
@@ -66,12 +66,6 @@ MODULE_OBJS := \
core/window.o \
core/xms.o \
nebular/nebular.o \
- nebular/asound.o \
- nebular/asound_nebular.o \
- nebular/isound.o \
- nebular/isound_nebular.o \
- nebular/rsound.o \
- nebular/rsound_nebular.o \
nebular/console.o \
nebular/copy.o \
nebular/extra.o \
@@ -79,7 +73,6 @@ MODULE_OBJS := \
nebular/main.o \
nebular/main_menu.o \
nebular/menus.o \
- nebular/sound.o \
nebular/popup.o \
nebular/mads/mads.o \
nebular/rooms/room101.o \
@@ -205,6 +198,19 @@ MODULE_OBJS := \
nebular/rooms/dialog.o \
nebular/rooms/forcefield.o \
nebular/rooms/teleporter.o \
+ nebular/sound/asound.o \
+ nebular/sound/asound_nebular.o \
+ nebular/sound/isound.o \
+ nebular/sound/isound_nebular.o \
+ nebular/sound/rsound.o \
+ nebular/sound/rsound_nebular.o \
+ nebular/sound/sound.o \
+ phantom/phantom.o \
+ phantom/catacombs.o \
+ phantom/global.o \
+ phantom/main_menu.o \
+ phantom/menus.o \
+ phantom/main.o \
phantom/mads/mads.o \
phantom/rooms/section1.o \
phantom/rooms/room101.o \
@@ -260,17 +266,16 @@ MODULE_OBJS := \
phantom/rooms/room504.o \
phantom/rooms/room505.o \
phantom/rooms/room506.o \
- phantom/phantom.o \
- phantom/asound.o \
- phantom/asound_phantom.o \
- phantom/rsound.o \
- phantom/rsound_phantom.o \
- phantom/catacombs.o \
- phantom/global.o \
- phantom/main_menu.o \
- phantom/menus.o \
- phantom/main.o \
- phantom/sound.o \
+ phantom/sound/asound.o \
+ phantom/sound/asound_phantom.o \
+ phantom/sound/rsound.o \
+ phantom/sound/rsound_phantom.o \
+ phantom/sound/sound.o \
+ dragonsphere/dragonsphere.o \
+ dragonsphere/global.o \
+ dragonsphere/main.o \
+ dragonsphere/main_menu.o \
+ dragonsphere/menus.o \
dragonsphere/mads/mads.o \
dragonsphere/rooms/section1.o \
dragonsphere/rooms/room101.o \
@@ -344,25 +349,18 @@ MODULE_OBJS := \
dragonsphere/rooms/room613.o \
dragonsphere/rooms/room614.o \
dragonsphere/rooms/room909.o \
- dragonsphere/dragonsphere.o \
- dragonsphere/asound.o \
- dragonsphere/asound_dragonsphere.o \
- dragonsphere/rsound.o \
- dragonsphere/rsound_dragonsphere.o \
- dragonsphere/global.o \
- dragonsphere/main.o \
- dragonsphere/main_menu.o \
- dragonsphere/menus.o \
- dragonsphere/sound.o \
+ dragonsphere/sound/asound.o \
+ dragonsphere/sound/asound_dragonsphere.o \
+ dragonsphere/sound/rsound.o \
+ dragonsphere/sound/rsound_dragonsphere.o \
+ dragonsphere/sound/sound.o \
forest/forest.o \
- forest/digi.o \
forest/extra.o \
forest/global.o \
forest/inventory.o \
forest/journal.o \
forest/main.o \
forest/menus.o \
- forest/midi.o \
forest/mads/mads.o \
forest/rooms/room101.o \
forest/rooms/room103.o \
@@ -407,7 +405,9 @@ MODULE_OBJS := \
forest/rooms/section3.o \
forest/rooms/section4.o \
forest/rooms/section5.o \
- forest/rooms/section9.o
+ forest/rooms/section9.o \
+ forest/sound/digi.o \
+ forest/sound/midi.o
# This module can be built as a plugin
ifeq ($(ENABLE_MADS), DYNAMIC_PLUGIN)
diff --git a/engines/mads/nebular/nebular.cpp b/engines/mads/nebular/nebular.cpp
index 63ad35d5e84..b23a4595cd9 100644
--- a/engines/mads/nebular/nebular.cpp
+++ b/engines/mads/nebular/nebular.cpp
@@ -44,7 +44,7 @@
#include "mads/nebular/popup.h"
#include "mads/nebular/mads/inventory.h"
#include "mads/nebular/mads/words.h"
-#include "mads/nebular/sound.h"
+#include "mads/nebular/sound/sound.h"
#include "mads/nebular/rooms/section1.h"
#include "mads/nebular/rooms/section2.h"
#include "mads/nebular/rooms/section3.h"
@@ -79,7 +79,7 @@ Common::Error RexNebularEngine::run() {
}
// Set up sound manager
- _soundManager = new RexSoundManager(_mixer, _soundFlag);
+ _soundManager = new Sound::RexSoundManager(_mixer, _soundFlag);
_soundManager->validate();
// Run the game
diff --git a/engines/mads/nebular/asound.cpp b/engines/mads/nebular/sound/asound.cpp
similarity index 99%
rename from engines/mads/nebular/asound.cpp
rename to engines/mads/nebular/sound/asound.cpp
index 76f6ad466ad..3905a87d72b 100644
--- a/engines/mads/nebular/asound.cpp
+++ b/engines/mads/nebular/sound/asound.cpp
@@ -23,10 +23,11 @@
#include "common/file.h"
#include "common/md5.h"
#include "common/memstream.h"
-#include "mads/nebular/asound.h"
+#include "mads/nebular/sound/asound.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
bool AdlibChannel::_channelsEnabled;
@@ -870,5 +871,6 @@ void RexASound::channelCommand(byte *&pSrc, bool &updateFlag) {
}
}
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/asound.h b/engines/mads/nebular/sound/asound.h
similarity index 98%
rename from engines/mads/nebular/asound.h
rename to engines/mads/nebular/sound/asound.h
index 8ab06465d11..3763593cb78 100644
--- a/engines/mads/nebular/asound.h
+++ b/engines/mads/nebular/sound/asound.h
@@ -19,14 +19,15 @@
*
*/
-#ifndef MADS_NEBULAR_ASOUND_H
-#define MADS_NEBULAR_ASOUND_H
+#ifndef MADS_NEBULAR_SOUND_ASOUND_H
+#define MADS_NEBULAR_SOUND_ASOUND_H
#include "audio/fmopl.h"
#include "mads/core/sound_manager.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
class ASound;
@@ -388,6 +389,7 @@ public:
RexASound(Audio::Mixer *mixer, const Common::Path &filename, int dataOffset, int dataSize);
};
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/asound_nebular.cpp b/engines/mads/nebular/sound/asound_nebular.cpp
similarity index 99%
rename from engines/mads/nebular/asound_nebular.cpp
rename to engines/mads/nebular/sound/asound_nebular.cpp
index a3961d0446a..e33895705b8 100644
--- a/engines/mads/nebular/asound_nebular.cpp
+++ b/engines/mads/nebular/sound/asound_nebular.cpp
@@ -19,10 +19,11 @@
*
*/
-#include "mads/nebular/asound_nebular.h"
+#include "mads/nebular/sound/asound_nebular.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
/*-----------------------------------------------------------------------*/
@@ -2633,5 +2634,6 @@ int ASound9::command51() {
}
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/asound_nebular.h b/engines/mads/nebular/sound/asound_nebular.h
similarity index 99%
rename from engines/mads/nebular/asound_nebular.h
rename to engines/mads/nebular/sound/asound_nebular.h
index 420ceb98dd4..5d31e8dd480 100644
--- a/engines/mads/nebular/asound_nebular.h
+++ b/engines/mads/nebular/sound/asound_nebular.h
@@ -22,10 +22,11 @@
#ifndef MADS_NEBULAR_SOUND_NEBULAR_H
#define MADS_NEBULAR_SOUND_NEBULAR_H
-#include "mads/nebular/asound.h"
+#include "mads/nebular/sound/asound.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
class ASound1 : public RexASound {
private:
@@ -454,6 +455,7 @@ public:
int command(int commandId, int param) override;
};
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/isound.cpp b/engines/mads/nebular/sound/isound.cpp
similarity index 99%
rename from engines/mads/nebular/isound.cpp
rename to engines/mads/nebular/sound/isound.cpp
index 8c148cb3a60..f5be73f389a 100644
--- a/engines/mads/nebular/isound.cpp
+++ b/engines/mads/nebular/sound/isound.cpp
@@ -23,10 +23,11 @@
#include "common/file.h"
#include "common/textconsole.h"
#include "common/util.h"
-#include "mads/nebular/isound.h"
+#include "mads/nebular/sound/isound.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
namespace {
@@ -698,5 +699,6 @@ int ISound::readBuffer(int16 *buffer, int numSamples) {
return numSamples;
}
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/isound.h b/engines/mads/nebular/sound/isound.h
similarity index 97%
rename from engines/mads/nebular/isound.h
rename to engines/mads/nebular/sound/isound.h
index 0d4508f43b3..439453dc5d8 100644
--- a/engines/mads/nebular/isound.h
+++ b/engines/mads/nebular/sound/isound.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef MADS_NEBULAR_ISOUND_H
-#define MADS_NEBULAR_ISOUND_H
+#ifndef MADS_NEBULAR_SOUND_ISOUND_H
+#define MADS_NEBULAR_SOUND_ISOUND_H
#include "audio/audiostream.h"
#include "audio/mixer.h"
@@ -28,6 +28,7 @@
namespace MADS {
namespace RexNebular {
+namespace Sound {
/**
* Shared native implementation of the Rex Nebular IBM PC Speaker runtime.
@@ -176,6 +177,7 @@ public:
}
};
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/isound_nebular.cpp b/engines/mads/nebular/sound/isound_nebular.cpp
similarity index 99%
rename from engines/mads/nebular/isound_nebular.cpp
rename to engines/mads/nebular/sound/isound_nebular.cpp
index d5def52a8c5..8668e684d47 100644
--- a/engines/mads/nebular/isound_nebular.cpp
+++ b/engines/mads/nebular/sound/isound_nebular.cpp
@@ -19,10 +19,11 @@
*
*/
-#include "mads/nebular/isound_nebular.h"
+#include "mads/nebular/sound/isound_nebular.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
namespace {
@@ -472,5 +473,6 @@ ISound9::ISound9(Audio::Mixer *mixer) :
ARRAYSIZE(kSection9Commands)) {
}
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/isound_nebular.h b/engines/mads/nebular/sound/isound_nebular.h
similarity index 94%
rename from engines/mads/nebular/isound_nebular.h
rename to engines/mads/nebular/sound/isound_nebular.h
index c768b436ca3..37551849a18 100644
--- a/engines/mads/nebular/isound_nebular.h
+++ b/engines/mads/nebular/sound/isound_nebular.h
@@ -19,13 +19,14 @@
*
*/
-#ifndef MADS_NEBULAR_ISOUND_NEBULAR_H
-#define MADS_NEBULAR_ISOUND_NEBULAR_H
+#ifndef MADS_NEBULAR_SOUND_ISOUND_NEBULAR_H
+#define MADS_NEBULAR_SOUND_ISOUND_NEBULAR_H
-#include "mads/nebular/isound.h"
+#include "mads/nebular/sound/isound.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
struct ISoundCommandSequence {
uint16 sequenceOffset;
@@ -103,6 +104,7 @@ public:
ISound9(Audio::Mixer *mixer);
};
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/rsound.cpp b/engines/mads/nebular/sound/rsound.cpp
similarity index 99%
rename from engines/mads/nebular/rsound.cpp
rename to engines/mads/nebular/sound/rsound.cpp
index 6a92010d579..edc226a6eae 100644
--- a/engines/mads/nebular/rsound.cpp
+++ b/engines/mads/nebular/sound/rsound.cpp
@@ -23,10 +23,11 @@
#include "common/md5.h"
#include "common/memstream.h"
#include "common/util.h"
-#include "mads/nebular/rsound.h"
+#include "mads/nebular/sound/rsound.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
void Channel::reset(byte *startPtr) {
_pitchBendFadeStep = 0;
@@ -747,5 +748,6 @@ int RSound::command8() {
return result;
}
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/rsound.h b/engines/mads/nebular/sound/rsound.h
similarity index 99%
rename from engines/mads/nebular/rsound.h
rename to engines/mads/nebular/sound/rsound.h
index b41e3cc50a7..dfda2782a6e 100644
--- a/engines/mads/nebular/rsound.h
+++ b/engines/mads/nebular/sound/rsound.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef MADS_NEBULAR_RSOUND_H
-#define MADS_NEBULAR_RSOUND_H
+#ifndef MADS_NEBULAR_SOUND_RSOUND_H
+#define MADS_NEBULAR_SOUND_RSOUND_H
#include "mads/core/sound_manager.h"
@@ -28,6 +28,7 @@
namespace MADS {
namespace RexNebular {
+namespace Sound {
class RSound;
@@ -327,6 +328,7 @@ public:
static void timerCallback(void *data);
};
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/rsound_nebular.cpp b/engines/mads/nebular/sound/rsound_nebular.cpp
similarity index 99%
rename from engines/mads/nebular/rsound_nebular.cpp
rename to engines/mads/nebular/sound/rsound_nebular.cpp
index 27d2317dbd1..e51b2f0da87 100644
--- a/engines/mads/nebular/rsound_nebular.cpp
+++ b/engines/mads/nebular/sound/rsound_nebular.cpp
@@ -19,10 +19,11 @@
*
*/
-#include "mads/nebular/rsound_nebular.h"
+#include "mads/nebular/sound/rsound_nebular.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
const RSound1::CommandPtr RSound1::_commandList[42] = {
&RSound1::command0, &RSound1::command1, &RSound1::command2, &RSound1::command3,
@@ -2406,5 +2407,6 @@ int RSound9::command51() {
return 0;
}
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/rsound_nebular.h b/engines/mads/nebular/sound/rsound_nebular.h
similarity index 98%
rename from engines/mads/nebular/rsound_nebular.h
rename to engines/mads/nebular/sound/rsound_nebular.h
index 094ba7bb26e..745dcc536de 100644
--- a/engines/mads/nebular/rsound_nebular.h
+++ b/engines/mads/nebular/sound/rsound_nebular.h
@@ -19,13 +19,14 @@
*
*/
-#ifndef MADS_NEBULAR_RSOUND_NEBULAR_H
-#define MADS_NEBULAR_RSOUND_NEBULAR_H
+#ifndef MADS_NEBULAR_SOUND_RSOUND_NEBULAR_H
+#define MADS_NEBULAR_SOUND_RSOUND_NEBULAR_H
-#include "mads/nebular/rsound.h"
+#include "mads/nebular/sound/rsound.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
class RSound1 : public RSound {
private:
@@ -628,6 +629,7 @@ public:
int command(int commandId, int param) override;
};
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/sound.cpp b/engines/mads/nebular/sound/sound.cpp
similarity index 60%
rename from engines/mads/nebular/sound.cpp
rename to engines/mads/nebular/sound/sound.cpp
index 2a84ef94bd7..d30cad11815 100644
--- a/engines/mads/nebular/sound.cpp
+++ b/engines/mads/nebular/sound/sound.cpp
@@ -19,13 +19,14 @@
*
*/
-#include "mads/nebular/sound.h"
-#include "mads/nebular/asound_nebular.h"
-#include "mads/nebular/isound_nebular.h"
-#include "mads/nebular/rsound_nebular.h"
+#include "mads/nebular/sound/sound.h"
+#include "mads/nebular/sound/asound_nebular.h"
+#include "mads/nebular/sound/isound_nebular.h"
+#include "mads/nebular/sound/rsound_nebular.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
void RexSoundManager::validate() {
switch (_driverType) {
@@ -51,31 +52,31 @@ void RexSoundManager::loadDriver(int sectionNumber) {
// Roland MT32 drivers
switch (sectionNumber) {
case 1:
- _driver = new RexNebular::RSound1(_mixer);
+ _driver = new RSound1(_mixer);
break;
case 2:
- _driver = new RexNebular::RSound2(_mixer);
+ _driver = new RSound2(_mixer);
break;
case 3:
- _driver = new RexNebular::RSound3(_mixer);
+ _driver = new RSound3(_mixer);
break;
case 4:
- _driver = new RexNebular::RSound4(_mixer);
+ _driver = new RSound4(_mixer);
break;
case 5:
- _driver = new RexNebular::RSound5(_mixer);
+ _driver = new RSound5(_mixer);
break;
case 6:
- _driver = new RexNebular::RSound6(_mixer);
+ _driver = new RSound6(_mixer);
break;
case 7:
- _driver = new RexNebular::RSound7(_mixer);
+ _driver = new RSound7(_mixer);
break;
case 8:
- _driver = new RexNebular::RSound8(_mixer);
+ _driver = new RSound8(_mixer);
break;
case 9:
- _driver = new RexNebular::RSound9(_mixer);
+ _driver = new RSound9(_mixer);
break;
default:
return;
@@ -85,31 +86,31 @@ void RexSoundManager::loadDriver(int sectionNumber) {
case SOUND_PCSPEAKER:
switch (sectionNumber) {
case 1:
- _driver = new RexNebular::ISound1(_mixer);
+ _driver = new ISound1(_mixer);
break;
case 2:
- _driver = new RexNebular::ISound2(_mixer);
+ _driver = new ISound2(_mixer);
break;
case 3:
- _driver = new RexNebular::ISound3(_mixer);
+ _driver = new ISound3(_mixer);
break;
case 4:
- _driver = new RexNebular::ISound4(_mixer);
+ _driver = new ISound4(_mixer);
break;
case 5:
- _driver = new RexNebular::ISound5(_mixer);
+ _driver = new ISound5(_mixer);
break;
case 6:
- _driver = new RexNebular::ISound6(_mixer);
+ _driver = new ISound6(_mixer);
break;
case 7:
- _driver = new RexNebular::ISound7(_mixer);
+ _driver = new ISound7(_mixer);
break;
case 8:
- _driver = new RexNebular::ISound8(_mixer);
+ _driver = new ISound8(_mixer);
break;
case 9:
- _driver = new RexNebular::ISound9(_mixer);
+ _driver = new ISound9(_mixer);
break;
default:
return;
@@ -120,31 +121,31 @@ void RexSoundManager::loadDriver(int sectionNumber) {
// Adlib drivers
switch (sectionNumber) {
case 1:
- _driver = new RexNebular::ASound1(_mixer);
+ _driver = new ASound1(_mixer);
break;
case 2:
- _driver = new RexNebular::ASound2(_mixer);
+ _driver = new ASound2(_mixer);
break;
case 3:
- _driver = new RexNebular::ASound3(_mixer);
+ _driver = new ASound3(_mixer);
break;
case 4:
- _driver = new RexNebular::ASound4(_mixer);
+ _driver = new ASound4(_mixer);
break;
case 5:
- _driver = new RexNebular::ASound5(_mixer);
+ _driver = new ASound5(_mixer);
break;
case 6:
- _driver = new RexNebular::ASound6(_mixer);
+ _driver = new ASound6(_mixer);
break;
case 7:
- _driver = new RexNebular::ASound7(_mixer);
+ _driver = new ASound7(_mixer);
break;
case 8:
- _driver = new RexNebular::ASound8(_mixer);
+ _driver = new ASound8(_mixer);
break;
case 9:
- _driver = new RexNebular::ASound9(_mixer);
+ _driver = new ASound9(_mixer);
break;
default:
return;
@@ -152,5 +153,6 @@ void RexSoundManager::loadDriver(int sectionNumber) {
}
}
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/nebular/sound.h b/engines/mads/nebular/sound/sound.h
similarity index 92%
rename from engines/mads/nebular/sound.h
rename to engines/mads/nebular/sound/sound.h
index 90131696a1f..5678bab403d 100644
--- a/engines/mads/nebular/sound.h
+++ b/engines/mads/nebular/sound/sound.h
@@ -19,13 +19,14 @@
*
*/
-#ifndef MADS_NEBULAR_SOUND_H
-#define MADS_NEBULAR_SOUND_H
+#ifndef MADS_NEBULAR_SOUND_SOUND_H
+#define MADS_NEBULAR_SOUND_SOUND_H
#include "mads/core/sound_manager.h"
namespace MADS {
namespace RexNebular {
+namespace Sound {
class RexSoundManager : public SoundManager {
protected:
@@ -47,6 +48,7 @@ public:
void validate() override;
};
+} // namespace Sound
} // namespace RexNebular
} // namespace MADS
diff --git a/engines/mads/phantom/phantom.cpp b/engines/mads/phantom/phantom.cpp
index d4f6cd53a60..431dc90b672 100644
--- a/engines/mads/phantom/phantom.cpp
+++ b/engines/mads/phantom/phantom.cpp
@@ -35,7 +35,7 @@
#include "mads/core/text.h"
#include "mads/phantom/phantom.h"
#include "mads/phantom/main.h"
-#include "mads/phantom/sound.h"
+#include "mads/phantom/sound/sound.h"
#include "mads/phantom/catacombs.h"
#include "mads/phantom/global.h"
#include "mads/phantom/rooms/section1.h"
@@ -63,7 +63,7 @@ Common::Error PhantomEngine::run() {
}
// Set up sound manager
- _soundManager = new PhantomSoundManager(_mixer, _soundFlag, isDemo());
+ _soundManager = new Sound::PhantomSoundManager(_mixer, _soundFlag, isDemo());
_soundManager->validate();
// Run the game
diff --git a/engines/mads/phantom/asound.cpp b/engines/mads/phantom/sound/asound.cpp
similarity index 99%
rename from engines/mads/phantom/asound.cpp
rename to engines/mads/phantom/sound/asound.cpp
index 9858a9317d1..c8b060558b9 100644
--- a/engines/mads/phantom/asound.cpp
+++ b/engines/mads/phantom/sound/asound.cpp
@@ -22,10 +22,11 @@
#include "audio/fmopl.h"
#include "common/file.h"
#include "common/md5.h"
-#include "mads/phantom/asound.h"
+#include "mads/phantom/sound/asound.h"
namespace MADS {
namespace Phantom {
+namespace Sound {
bool AdlibChannel::_isDisabled;
@@ -1930,5 +1931,6 @@ uint16 ASound::readWord_impl() {
return lo | (hi << 8);
}
+} // namespace Sound
} // namespace Phantom
} // namespace MADS
diff --git a/engines/mads/phantom/asound.h b/engines/mads/phantom/sound/asound.h
similarity index 99%
rename from engines/mads/phantom/asound.h
rename to engines/mads/phantom/sound/asound.h
index 93b7c86961f..d723d96275d 100644
--- a/engines/mads/phantom/asound.h
+++ b/engines/mads/phantom/sound/asound.h
@@ -19,8 +19,8 @@
*
*/
-#ifndef MADS_PHANTOM_ASOUND_H
-#define MADS_PHANTOM_ASOUND_H
+#ifndef MADS_PHANTOM_SOUND_ASOUND_H
+#define MADS_PHANTOM_SOUND_ASOUND_H
#include "audio/fmopl.h"
#include "common/mutex.h"
@@ -30,6 +30,7 @@
namespace MADS {
namespace Phantom {
+namespace Sound {
#define ADLIB_CHANNEL_COUNT 9
@@ -477,6 +478,7 @@ public:
}
};
+} // namespace Sound
} // namespace Phantom
} // namespace MADS
diff --git a/engines/mads/phantom/asound_phantom.cpp b/engines/mads/phantom/sound/asound_phantom.cpp
similarity index 99%
rename from engines/mads/phantom/asound_phantom.cpp
rename to engines/mads/phantom/sound/asound_phantom.cpp
index 270129ca06d..c421d7d112f 100644
--- a/engines/mads/phantom/asound_phantom.cpp
+++ b/engines/mads/phantom/sound/asound_phantom.cpp
@@ -19,10 +19,11 @@
*
*/
-#include "mads/phantom/asound_phantom.h"
+#include "mads/phantom/sound/asound_phantom.h"
namespace MADS {
namespace Phantom {
+namespace Sound {
/*-----------------------------------------------------------------------*/
/* ASound1 (asound.ph1) *
@@ -1773,5 +1774,6 @@ int ASoundDemo::command29() {
return 0;
}
+} // namespace Sound
} // namespace Phantom
} // namespace MADS
diff --git a/engines/mads/phantom/asound_phantom.h b/engines/mads/phantom/sound/asound_phantom.h
similarity index 98%
rename from engines/mads/phantom/asound_phantom.h
rename to engines/mads/phantom/sound/asound_phantom.h
index a2afb3bd590..5647dc39a32 100644
--- a/engines/mads/phantom/asound_phantom.h
+++ b/engines/mads/phantom/sound/asound_phantom.h
@@ -19,13 +19,14 @@
*
*/
-#ifndef MADS_PHANTOM_ASOUND_PHANTOM_H
-#define MADS_PHANTOM_ASOUND_PHANTOM_H
+#ifndef MADS_PHANTOM_SOUND_ASOUND_PHANTOM_H
+#define MADS_PHANTOM_SOUND_ASOUND_PHANTOM_H
-#include "mads/phantom/asound.h"
+#include "mads/phantom/sound/asound.h"
namespace MADS {
namespace Phantom {
+namespace Sound {
/**
* ASound1 (asound.ph1, _dataOffset = 0x21e0)
@@ -414,6 +415,7 @@ public:
int command(int commandId, int param) override;
};
+} // namespace Sound
} // namespace Phantom
} // namespace MADS
diff --git a/engines/mads/phantom/rsound.cpp b/engines/mads/phantom/sound/rsound.cpp
similarity index 99%
rename from engines/mads/phantom/rsound.cpp
rename to engines/mads/phantom/sound/rsound.cpp
index c2702c6f129..51ff7427c10 100644
--- a/engines/mads/phantom/rsound.cpp
+++ b/engines/mads/phantom/sound/rsound.cpp
@@ -20,10 +20,11 @@
*/
#include "common/util.h"
-#include "mads/phantom/rsound.h"
+#include "mads/phantom/sound/rsound.h"
namespace MADS {
namespace Phantom {
+namespace Sound {
/*-----------------------------------------------------------------------*/
@@ -1109,5 +1110,6 @@ post_keyon:
}
}
+} // namespace Sound
} // namespace Phantom
} // namespace MADS
diff --git a/engines/mads/phantom/rsound.h b/engines/mads/phantom/sound/rsound.h
similarity index 99%
rename from engines/mads/phantom/rsound.h
rename to engines/mads/phantom/sound/rsound.h
index f069c1c9ab1..1fd8363b2b1 100644
--- a/engines/mads/phantom/rsound.h
+++ b/engines/mads/phantom/sound/rsound.h
@@ -19,13 +19,14 @@
*
*/
-#ifndef MADS_PHANTOM_RSOUND_H
-#define MADS_PHANTOM_RSOUND_H
+#ifndef MADS_PHANTOM_SOUND_RSOUND_H
+#define MADS_PHANTOM_SOUND_RSOUND_H
#include "mads/core/sound_manager.h"
namespace MADS {
namespace Phantom {
+namespace Sound {
class RSound;
@@ -490,6 +491,7 @@ public:
}
};
+} // namespace Sound
} // namespace Phantom
} // namespace MADS
diff --git a/engines/mads/phantom/rsound_phantom.cpp b/engines/mads/phantom/sound/rsound_phantom.cpp
similarity index 99%
rename from engines/mads/phantom/rsound_phantom.cpp
rename to engines/mads/phantom/sound/rsound_phantom.cpp
index 877b8c8bb00..693420d80fb 100644
--- a/engines/mads/phantom/rsound_phantom.cpp
+++ b/engines/mads/phantom/sound/rsound_phantom.cpp
@@ -20,10 +20,11 @@
*/
#include "common/util.h"
-#include "mads/phantom/rsound_phantom.h"
+#include "mads/phantom/sound/rsound_phantom.h"
namespace MADS {
namespace Phantom {
+namespace Sound {
RSound1::RSound1(Audio::Mixer *mixer) : RSound(mixer, "rsound.ph1", 0x2D20, 0x4B30, 0xDC) {
}
@@ -1468,5 +1469,6 @@ int RSound9::command71() {
return 0;
}
+} // namespace Sound
} // namespace Phantom
} // namespace MADS
diff --git a/engines/mads/phantom/rsound_phantom.h b/engines/mads/phantom/sound/rsound_phantom.h
similarity index 98%
rename from engines/mads/phantom/rsound_phantom.h
rename to engines/mads/phantom/sound/rsound_phantom.h
index f73a4869a82..321c71deaeb 100644
--- a/engines/mads/phantom/rsound_phantom.h
+++ b/engines/mads/phantom/sound/rsound_phantom.h
@@ -19,13 +19,14 @@
*
*/
-#ifndef MADS_PHANTOM_RSOUND_PHANTOM_H
-#define MADS_PHANTOM_RSOUND_PHANTOM_H
+#ifndef MADS_PHANTOM_SOUND_RSOUND_PHANTOM_H
+#define MADS_PHANTOM_SOUND_RSOUND_PHANTOM_H
-#include "mads/phantom/rsound.h"
+#include "mads/phantom/sound/rsound.h"
namespace MADS {
namespace Phantom {
+namespace Sound {
/**
* RSound1 (rsound.ph1)
@@ -449,6 +450,7 @@ public:
int command(int commandId, int param) override;
};
+} // namespace Sound
} // namespace Phantom
} // namespace MADS
diff --git a/engines/mads/phantom/sound.cpp b/engines/mads/phantom/sound/sound.cpp
similarity index 91%
rename from engines/mads/phantom/sound.cpp
rename to engines/mads/phantom/sound/sound.cpp
index beb5d94ff46..738d109b6d5 100644
--- a/engines/mads/phantom/sound.cpp
+++ b/engines/mads/phantom/sound/sound.cpp
@@ -19,12 +19,13 @@
*
*/
-#include "mads/phantom/sound.h"
-#include "mads/phantom/asound_phantom.h"
-#include "mads/phantom/rsound_phantom.h"
+#include "mads/phantom/sound/sound.h"
+#include "mads/phantom/sound/asound_phantom.h"
+#include "mads/phantom/sound/rsound_phantom.h"
namespace MADS {
namespace Phantom {
+namespace Sound {
void PhantomSoundManager::validate() {
switch (_driverType) {
@@ -83,5 +84,6 @@ void PhantomSoundManager::loadDriver(int sectionNumber) {
}
}
+} // namespace Sound
} // namespace Phantom
} // namespace MADS
diff --git a/engines/mads/phantom/sound.h b/engines/mads/phantom/sound/sound.h
similarity index 93%
rename from engines/mads/phantom/sound.h
rename to engines/mads/phantom/sound/sound.h
index 33f6cfa544f..b811a589e8a 100644
--- a/engines/mads/phantom/sound.h
+++ b/engines/mads/phantom/sound/sound.h
@@ -19,13 +19,14 @@
*
*/
-#ifndef MADS_PHANTOM_SOUND_H
-#define MADS_PHANTOM_SOUND_H
+#ifndef MADS_PHANTOM_SOUND_SOUND_H
+#define MADS_PHANTOM_SOUND_SOUND_H
#include "mads/core/sound_manager.h"
namespace MADS {
namespace Phantom {
+namespace Sound {
class PhantomSoundManager : public SoundManager {
private:
@@ -49,6 +50,7 @@ public:
void validate() override;
};
+} // namespace Sound
} // namespace Phantom
} // namespace MADS
Commit: 19e96502a27f8f67b322124e6d18d8a95f133bd6
https://github.com/scummvm/scummvm/commit/19e96502a27f8f67b322124e6d18d8a95f133bd6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-28T17:16:50+10:00
Commit Message:
MADS: DRAGONSPHERE: Hooking up RSound, ASound init fix
Changed paths:
engines/mads/dragonsphere/sound/asound.cpp
engines/mads/dragonsphere/sound/asound.h
engines/mads/dragonsphere/sound/rsound.cpp
engines/mads/dragonsphere/sound/rsound.h
engines/mads/dragonsphere/sound/sound.cpp
diff --git a/engines/mads/dragonsphere/sound/asound.cpp b/engines/mads/dragonsphere/sound/asound.cpp
index d3e34c25402..cf9631892e8 100644
--- a/engines/mads/dragonsphere/sound/asound.cpp
+++ b/engines/mads/dragonsphere/sound/asound.cpp
@@ -243,6 +243,12 @@ ASound::ASound(Audio::Mixer *mixer, const Common::Path &filename,
: SoundDriver(mixer, filename, dataOffset, dataSize) {
AdlibChannel::_isDisabled = false;
+ // Initialize OPL
+ _opl = OPL::Config::create();
+ _opl->init();
+ _opl->start(new Common::Functor0Mem<void, ASound>(this, &ASound::onTimer),
+ CALLBACKS_PER_SECOND);
+
/* Standard OPL timer-reset sequence. */
write(4, 0x60);
write(4, 0x80);
@@ -253,9 +259,11 @@ ASound::ASound(Audio::Mixer *mixer, const Common::Path &filename,
Common::fill(_adlibPorts, _adlibPorts + 256, 0);
command0();
+}
- _opl->start(new Common::Functor0Mem<void, ASound>(this, &ASound::onTimer),
- CALLBACKS_PER_SECOND);
+ASound::~ASound() {
+ _opl->stop();
+ delete _opl;
}
void ASound::validate(bool isDemo) {
diff --git a/engines/mads/dragonsphere/sound/asound.h b/engines/mads/dragonsphere/sound/asound.h
index 3ce7bf3f5de..3f679c3a1d9 100644
--- a/engines/mads/dragonsphere/sound/asound.h
+++ b/engines/mads/dragonsphere/sound/asound.h
@@ -195,7 +195,7 @@ protected:
typedef void (ASound::*CallbackFunction)();
private:
- OPL::OPL *_opl = OPL::Config::create();
+ OPL::OPL *_opl;
// ---- callback / tick state ------------------------------------------
uint16 _callbackCounter = 0; // per-tick countdown
@@ -624,9 +624,7 @@ public:
ASound(Audio::Mixer *mixer, const Common::Path &filename,
int dataOffset, int dataSize);
- ~ASound() override {
- delete _opl;
- }
+ ~ASound() override;
/** Stop all currently playing sounds (wraps command0). */
virtual int stop() override;
diff --git a/engines/mads/dragonsphere/sound/rsound.cpp b/engines/mads/dragonsphere/sound/rsound.cpp
index 82f06acb713..8c693cb90aa 100644
--- a/engines/mads/dragonsphere/sound/rsound.cpp
+++ b/engines/mads/dragonsphere/sound/rsound.cpp
@@ -19,7 +19,8 @@
*
*/
-#include "common/util.h"
+#include "common/file.h"
+#include "common/md5.h"
#include "mads/dragonsphere/sound/rsound.h"
namespace MADS {
@@ -121,6 +122,35 @@ RSound::RSound(Audio::Mixer *mixer, const Common::Path &filename,
command0();
}
+void RSound::validate() {
+ Common::File f;
+ static const char *const MD5[] = {
+ "a34a4c5ee91d1ad0b007e3f6d791725e",
+ "af04277f9b6d7206a683383ee8fa4a13",
+ "9b5ff2c3ec2265771e440cbc0f60b3ff",
+ "2ae7ec33e79d326653925ff8ddc7550c",
+ "504d445acd33487aa1653c3f476b1199",
+ "e342cfa5c8e968d132e525f1ed9c975c",
+ nullptr,
+ nullptr,
+ "94a28abdbb536f87f5d470c72734d8e3"
+ };
+
+ for (int i = 1; i <= 9; ++i) {
+ if (i == 7 || i == 8)
+ continue;
+
+ Common::Path filename(Common::String::format("rsound.dr%d", i));
+ if (!f.open(filename))
+ error("Could not process - %s", filename.toString().c_str());
+ Common::String md5str = Common::computeStreamMD5AsString(f, 8192);
+ f.close();
+
+ if (md5str != MD5[i - 1])
+ error("Invalid sound file - %s", filename.toString().c_str());
+ }
+}
+
int RSound::stop() {
command0();
int result = _pollResult;
diff --git a/engines/mads/dragonsphere/sound/rsound.h b/engines/mads/dragonsphere/sound/rsound.h
index 126ecca7a29..92203fd9b03 100644
--- a/engines/mads/dragonsphere/sound/rsound.h
+++ b/engines/mads/dragonsphere/sound/rsound.h
@@ -504,6 +504,12 @@ public:
bool _isDisabled;
int _pollResult;
+public:
+ /**
+ * Validate the sound driver files needed for data
+ */
+ static void validate();
+
public:
/**
* Constructor
diff --git a/engines/mads/dragonsphere/sound/sound.cpp b/engines/mads/dragonsphere/sound/sound.cpp
index 954505f4b87..64242e1fa9a 100644
--- a/engines/mads/dragonsphere/sound/sound.cpp
+++ b/engines/mads/dragonsphere/sound/sound.cpp
@@ -28,21 +28,17 @@ namespace Dragonsphere {
namespace Sound {
void DragonSoundManager::validate() {
- switch (_driverType) {
- case SOUND_MT32:
- error("MT32 is not yet supported");
- break;
- default:
+ if (_driverType == SOUND_MT32 && !_isDemo) {
+ RSound::validate();
+ } else {
ASound::validate(_isDemo);
- break;
}
}
void DragonSoundManager::loadDriver(int sectionNumber) {
removeDriver();
- switch (_driverType) {
- case SOUND_MT32:
+ if (_driverType == SOUND_MT32 && !_isDemo) {
// Roland MT32 drivers
switch (sectionNumber) {
case 1:
@@ -57,13 +53,20 @@ void DragonSoundManager::loadDriver(int sectionNumber) {
case 4:
_driver = new RSound4(_mixer);
break;
+ case 5:
+ _driver = new RSound5(_mixer);
+ break;
+ case 6:
+ _driver = new RSound6(_mixer);
+ break;
+ case 9:
+ _driver = new RSound9(_mixer);
+ break;
default:
- // TODO
+ _driver = nullptr;
break;
}
- break;
-
- default:
+ } else {
// Adlib drivers
switch (sectionNumber) {
case 1:
@@ -95,7 +98,7 @@ void DragonSoundManager::loadDriver(int sectionNumber) {
break;
default:
_driver = nullptr;
- return;
+ break;
}
}
}
Commit: 4d71bfa71b90bbf614afa456673496d5c303b77c
https://github.com/scummvm/scummvm/commit/4d71bfa71b90bbf614afa456673496d5c303b77c
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-28T17:43:28+10:00
Commit Message:
MADS: PHANTOM: Hooking up RSound, ASound init fix
Changed paths:
engines/mads/phantom/sound/asound.cpp
engines/mads/phantom/sound/asound.h
engines/mads/phantom/sound/rsound.cpp
engines/mads/phantom/sound/rsound.h
engines/mads/phantom/sound/sound.cpp
diff --git a/engines/mads/phantom/sound/asound.cpp b/engines/mads/phantom/sound/asound.cpp
index c8b060558b9..4b4d0c5c755 100644
--- a/engines/mads/phantom/sound/asound.cpp
+++ b/engines/mads/phantom/sound/asound.cpp
@@ -203,6 +203,11 @@ ASound::ASound(Audio::Mixer *mixer, const Common::Path &filename, int dataOffset
SoundDriver(mixer, filename, dataOffset, dataSize) {
AdlibChannel::_isDisabled = false;
+ // Initialize the OPL
+ _opl = OPL::Config::create();
+ _opl->init();
+ _opl->start(new Common::Functor0Mem<void, ASound>(this, &ASound::onTimer), CALLBACKS_PER_SECOND);
+
write(4, 0x60); // Mask off both adlib timers
write(4, 0x80); // IRQ reset timer flags
write(2, 0xff); // Timer 1 rate 80us
@@ -212,8 +217,11 @@ ASound::ASound(Audio::Mixer *mixer, const Common::Path &filename, int dataOffset
Common::fill(_adlibPorts, _adlibPorts + 256, 0);
command0();
+}
- _opl->start(new Common::Functor0Mem<void, ASound>(this, &ASound::onTimer), CALLBACKS_PER_SECOND);
+ASound::~ASound() {
+ _opl->stop();
+ delete _opl;
}
void ASound::validate(bool isDemo) {
diff --git a/engines/mads/phantom/sound/asound.h b/engines/mads/phantom/sound/asound.h
index d723d96275d..86d8deec233 100644
--- a/engines/mads/phantom/sound/asound.h
+++ b/engines/mads/phantom/sound/asound.h
@@ -131,7 +131,7 @@ struct AdlibSample {
class ASound : public SoundDriver {
private:
- OPL::OPL *_opl = OPL::Config::create();
+ OPL::OPL *_opl;
uint16 _callbackCounter = 0; // Period counter
uint16 _callbackPeriod = 0; // Period reload
AdlibChannel *_activeChannelPtr = NULL;
@@ -453,9 +453,7 @@ public:
/**
* Destructor
*/
- ~ASound() override {
- delete _opl;
- }
+ ~ASound() override;
/**
* Stop all currently playing sounds
diff --git a/engines/mads/phantom/sound/rsound.cpp b/engines/mads/phantom/sound/rsound.cpp
index 51ff7427c10..8bfcf22f065 100644
--- a/engines/mads/phantom/sound/rsound.cpp
+++ b/engines/mads/phantom/sound/rsound.cpp
@@ -19,7 +19,8 @@
*
*/
-#include "common/util.h"
+#include "common/file.h"
+#include "common/md5.h"
#include "mads/phantom/sound/rsound.h"
namespace MADS {
@@ -122,6 +123,34 @@ RSound::RSound(Audio::Mixer *mixer, const Common::Path &filename,
command0();
}
+void RSound::validate() {
+ Common::File f;
+ static const char *const MD5[] = {
+ "8edcb79a8c3514eac0835496326a72ae",
+ "4b81a46440f8404d9eda1ce5ae2c5579",
+ "11d8d441e47ad1ccd8faafd6572a17d0",
+ "4cd5c4d45126e60ca701690489ab8afa",
+ "588357d711bbcdabdf7d7e5d96013ce5",
+ nullptr,
+ nullptr,
+ nullptr,
+ "3d4843074c1dcbfd7919179c58aec9bc"
+ };
+
+ for (int i = 1; i <= 9; ++i) {
+ if (i >= 6 && i <= 8)
+ continue;
+ Common::Path filename(Common::String::format("asound.ph%d", i));
+ if (!f.open(filename))
+ error("Could not process - %s", filename.toString().c_str());
+ Common::String md5str = Common::computeStreamMD5AsString(f, 8192);
+ f.close();
+
+ if (md5str != MD5[i - 1])
+ error("Invalid sound file - %s", filename.toString().c_str());
+ }
+}
+
int RSound::stop() {
command0();
int result = _pollResult;
diff --git a/engines/mads/phantom/sound/rsound.h b/engines/mads/phantom/sound/rsound.h
index 1fd8363b2b1..a781927492e 100644
--- a/engines/mads/phantom/sound/rsound.h
+++ b/engines/mads/phantom/sound/rsound.h
@@ -464,6 +464,12 @@ public:
bool _isDisabled;
int _pollResult;
+public:
+ /**
+ * Validates the presence of the sound driver files.
+ */
+ static void validate();
+
public:
/**
* Constructor
diff --git a/engines/mads/phantom/sound/sound.cpp b/engines/mads/phantom/sound/sound.cpp
index 738d109b6d5..0f77f2b4c6e 100644
--- a/engines/mads/phantom/sound/sound.cpp
+++ b/engines/mads/phantom/sound/sound.cpp
@@ -28,36 +28,48 @@ namespace Phantom {
namespace Sound {
void PhantomSoundManager::validate() {
- switch (_driverType) {
- case SOUND_MT32:
- // TODO
- assert(0 == 1);
- break;
-
- default:
+ if (_driverType == SOUND_MT32 && !_isDemo) {
+ // MT32
+ RSound::validate();
+ } else {
// Adlib
ASound::validate(_isDemo);
- break;
}
}
void PhantomSoundManager::loadDriver(int sectionNumber) {
removeDriver();
- switch (_driverType) {
- case SOUND_MT32:
- // Roland MT32 drivers
- assert(sectionNumber == 1);
- _driver = new RSound1(_mixer);
- break;
+ if (_isDemo) {
+ _driver = new ASoundDemo(_mixer);
- default:
- // Adlib drivers
- if (_isDemo) {
- _driver = new ASoundDemo(_mixer);
- return;
+ } else if (_driverType == SOUND_MT32) {
+ // MT32
+ switch (sectionNumber) {
+ case 1:
+ _driver = new RSound1(_mixer);
+ break;
+ case 2:
+ _driver = new RSound2(_mixer);
+ break;
+ case 3:
+ _driver = new RSound3(_mixer);
+ break;
+ case 4:
+ _driver = new RSound4(_mixer);
+ break;
+ case 5:
+ _driver = new RSound5(_mixer);
+ break;
+ case 9:
+ _driver = new RSound9(_mixer);
+ break;
+ default:
+ _driver = nullptr;
+ break;
}
-
+ } else {
+ // Adlib
switch (sectionNumber) {
case 1:
_driver = new ASound1(_mixer);
@@ -79,7 +91,7 @@ void PhantomSoundManager::loadDriver(int sectionNumber) {
break;
default:
_driver = nullptr;
- return;
+ break;
}
}
}
More information about the Scummvm-git-logs
mailing list