[Scummvm-git-logs] scummvm master -> 3e51e97444cfeabb0fafde5532bd64d9aeadf5ce
dreammaster
noreply at scummvm.org
Wed Jul 29 07:08:26 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
3e51e97444 MADS: NEBULAR: Merge RexASound into ASound
Commit: 3e51e97444cfeabb0fafde5532bd64d9aeadf5ce
https://github.com/scummvm/scummvm/commit/3e51e97444cfeabb0fafde5532bd64d9aeadf5ce
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2026-07-29T17:06:02+10:00
Commit Message:
MADS: NEBULAR: Merge RexASound into ASound
RexASound as a separate class was initially done back when I
thought that the one ASound class could be used for all three
games, with each having it's own channelCommand function for
handling differing sets of opcodes. However, as it turned out,
each ASound had a multitude of differences. So they each needed
their own implementation. So there was no point separating
RexASound from ASound
Changed paths:
engines/mads/nebular/sound/asound.cpp
engines/mads/nebular/sound/asound.h
engines/mads/nebular/sound/asound_nebular.cpp
engines/mads/nebular/sound/asound_nebular.h
diff --git a/engines/mads/nebular/sound/asound.cpp b/engines/mads/nebular/sound/asound.cpp
index 3cc01ab520f..db19c02ec0c 100644
--- a/engines/mads/nebular/sound/asound.cpp
+++ b/engines/mads/nebular/sound/asound.cpp
@@ -29,6 +29,8 @@ namespace MADS {
namespace RexNebular {
namespace Sound {
+constexpr int CHAN_COMMAND_COUNT = 15;
+
bool AdlibChannel::_channelsEnabled;
void AdlibChannel::reset() {
@@ -124,7 +126,6 @@ ASound::ASound(Audio::Mixer *mixer, const Common::Path &filename, int dataOffset
_activeChannelPtr = nullptr;
_samplePtr = nullptr;
_frameCounter = 0;
- _chanCommandCount = 15;
_isDisabled = false;
_masterVolume = 255;
_noiseTicks1 = 0;
@@ -378,7 +379,7 @@ void ASound::pollActiveChannel() {
break;
}
- if (!(*pSrc & 0x80) || (*pSrc <= (0xff - _chanCommandCount))) {
+ if (!(*pSrc & 0x80) || (*pSrc <= (0xff - CHAN_COMMAND_COUNT))) {
if (updateFlag)
updateActiveChannel();
@@ -694,14 +695,7 @@ int ASound::command8() {
return result;
}
-/*-----------------------------------------------------------------------*/
-
-RexASound::RexASound(Audio::Mixer *mixer, const Common::Path &filename, int dataOffset, int dataSize) :
- ASound(mixer, filename, dataOffset, dataSize) {
- _chanCommandCount = 15;
-}
-
-void RexASound::channelCommand(byte *&pSrc, bool &updateFlag) {
+void ASound::channelCommand(byte *&pSrc, bool &updateFlag) {
AdlibChannel *chan = _activeChannelPtr;
int cmdNum = 255 - *pSrc;
diff --git a/engines/mads/nebular/sound/asound.h b/engines/mads/nebular/sound/asound.h
index ffd5ca24e2a..3af918b13b9 100644
--- a/engines/mads/nebular/sound/asound.h
+++ b/engines/mads/nebular/sound/asound.h
@@ -184,12 +184,11 @@ private:
*/
void onTimer();
+ void channelCommand(byte *&pSrc, bool &updateFlag);
+
protected:
- int _chanCommandCount;
int _commandParam;
- virtual void channelCommand(byte *&pSrc, bool &updateFlag) = 0;
-
/**
* Hook called once per update() frame, immediately after the disabled
* check and before the frame counter/channel polling. Only ASound9's
@@ -374,15 +373,6 @@ public:
void setVolume(int volume) override;
};
-// TODO: Merge RexASound into ASound
-class RexASound : public ASound {
-protected:
- void channelCommand(byte *&pSrc, bool &updateFlag) override;
-
-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/sound/asound_nebular.cpp b/engines/mads/nebular/sound/asound_nebular.cpp
index e33895705b8..e107f4ccc4c 100644
--- a/engines/mads/nebular/sound/asound_nebular.cpp
+++ b/engines/mads/nebular/sound/asound_nebular.cpp
@@ -41,7 +41,7 @@ const ASound1::CommandPtr ASound1::_commandList[42] = {
&ASound1::command40, &ASound1::command41
};
-ASound1::ASound1(Audio::Mixer *mixer) : RexASound(mixer, "asound.001", 0x1520, 0x17b0) {
+ASound1::ASound1(Audio::Mixer *mixer) : ASound(mixer, "asound.001", 0x1520, 0x17b0) {
_cmd23Toggle = false;
// Load sound samples
@@ -342,7 +342,7 @@ const ASound2::CommandPtr ASound2::_commandList[44] = {
&ASound2::command40, &ASound2::command41, &ASound2::command42, &ASound2::command43
};
-ASound2::ASound2(Audio::Mixer *mixer) : RexASound(mixer, "asound.002", 0x15E0, 0x4b70) {
+ASound2::ASound2(Audio::Mixer *mixer) : ASound(mixer, "asound.002", 0x15E0, 0x4b70) {
_command12Param = 0xFD;
// Load sound samples
@@ -713,7 +713,7 @@ const ASound3::CommandPtr ASound3::_commandList[61] = {
&ASound3::command60
};
-ASound3::ASound3(Audio::Mixer *mixer) : RexASound(mixer, "asound.003", 0x15B0, 0x5020) {
+ASound3::ASound3(Audio::Mixer *mixer) : ASound(mixer, "asound.003", 0x15B0, 0x5020) {
_command39Flag = false;
// Load sound samples
@@ -1117,7 +1117,7 @@ const ASound4::CommandPtr ASound4::_commandList[61] = {
&ASound4::command60
};
-ASound4::ASound4(Audio::Mixer *mixer) : RexASound(mixer, "asound.004", 0x14F0, 0x2930) {
+ASound4::ASound4(Audio::Mixer *mixer) : ASound(mixer, "asound.004", 0x14F0, 0x2930) {
// Load sound samples
auto samplesStream = getDataStream(0x122);
for (int i = 0; i < 210; ++i)
@@ -1373,7 +1373,7 @@ const ASound5::CommandPtr ASound5::_commandList[42] = {
&ASound5::command40, &ASound5::command41
};
-ASound5::ASound5(Audio::Mixer *mixer) : RexASound(mixer, "asound.005", 0x15E0, 0x2200) {
+ASound5::ASound5(Audio::Mixer *mixer) : ASound(mixer, "asound.005", 0x15E0, 0x2200) {
// Load sound samples
auto samplesStream = getDataStream(0x144);
for (int i = 0; i < 164; ++i)
@@ -1614,7 +1614,7 @@ const ASound6::CommandPtr ASound6::_commandList[30] = {
&ASound6::nullCommand, &ASound6::command29
};
-ASound6::ASound6(Audio::Mixer *mixer) : RexASound(mixer, "asound.006", 0x1390, 0x22d0) {
+ASound6::ASound6(Audio::Mixer *mixer) : ASound(mixer, "asound.006", 0x1390, 0x22d0) {
// Load sound samples
auto samplesStream = getDataStream(0x122);
for (int i = 0; i < 200; ++i)
@@ -1770,7 +1770,7 @@ const ASound7::CommandPtr ASound7::_commandList[38] = {
&ASound7::command36, &ASound7::command37
};
-ASound7::ASound7(Audio::Mixer *mixer) : RexASound(mixer, "asound.007", 0x1460, 0x2cf0) {
+ASound7::ASound7(Audio::Mixer *mixer) : ASound(mixer, "asound.007", 0x1460, 0x2cf0) {
// Load sound samples
auto samplesStream = getDataStream(0x122);
for (int i = 0; i < 214; ++i)
@@ -1978,7 +1978,7 @@ const ASound8::CommandPtr ASound8::_commandList[38] = {
&ASound8::command36, &ASound8::command37
};
-ASound8::ASound8(Audio::Mixer *mixer) : RexASound(mixer, "asound.008", 0x1490, 0x1810) {
+ASound8::ASound8(Audio::Mixer *mixer) : ASound(mixer, "asound.008", 0x1490, 0x1810) {
// Load sound samples
auto samplesStream = getDataStream(0x122);
for (int i = 0; i < 174; ++i)
@@ -2233,7 +2233,7 @@ const ASound9::CommandPtr ASound9::_commandList[52] = {
&ASound9::command48, &ASound9::command49, &ASound9::command50, &ASound9::command51
};
-ASound9::ASound9(Audio::Mixer *mixer) : RexASound(mixer, "asound.009", 0x16F0, 0x85a0) {
+ASound9::ASound9(Audio::Mixer *mixer) : ASound(mixer, "asound.009", 0x16F0, 0x85a0) {
_callbackCounter = _callbackPeriod = 0;
_callbackFnPtr = nullptr;
diff --git a/engines/mads/nebular/sound/asound_nebular.h b/engines/mads/nebular/sound/asound_nebular.h
index 5d31e8dd480..99d54d09ace 100644
--- a/engines/mads/nebular/sound/asound_nebular.h
+++ b/engines/mads/nebular/sound/asound_nebular.h
@@ -28,7 +28,7 @@ namespace MADS {
namespace RexNebular {
namespace Sound {
-class ASound1 : public RexASound {
+class ASound1 : public ASound {
private:
typedef int (ASound1:: *CommandPtr)();
static const CommandPtr _commandList[42];
@@ -76,7 +76,7 @@ public:
int command(int commandId, int param) override;
};
-class ASound2 : public RexASound {
+class ASound2 : public ASound {
private:
byte _command12Param;
private:
@@ -128,7 +128,7 @@ public:
int command(int commandId, int param) override;
};
-class ASound3 : public RexASound {
+class ASound3 : public ASound {
private:
bool _command39Flag;
@@ -188,7 +188,7 @@ public:
int command(int commandId, int param) override;
};
-class ASound4 : public RexASound {
+class ASound4 : public ASound {
private:
typedef int (ASound4:: *CommandPtr)();
static const CommandPtr _commandList[61];
@@ -226,7 +226,7 @@ public:
int command(int commandId, int param) override;
};
-class ASound5 : public RexASound {
+class ASound5 : public ASound {
private:
typedef int (ASound5:: *CommandPtr)();
static const CommandPtr _commandList[42];
@@ -272,7 +272,7 @@ public:
int command(int commandId, int param) override;
};
-class ASound6 : public RexASound {
+class ASound6 : public ASound {
private:
typedef int (ASound6:: *CommandPtr)();
static const CommandPtr _commandList[30];
@@ -301,7 +301,7 @@ public:
int command(int commandId, int param) override;
};
-class ASound7 : public RexASound {
+class ASound7 : public ASound {
private:
typedef int (ASound7:: *CommandPtr)();
static const CommandPtr _commandList[38];
@@ -333,7 +333,7 @@ public:
int command(int commandId, int param) override;
};
-class ASound8 : public RexASound {
+class ASound8 : public ASound {
private:
typedef int (ASound8:: *CommandPtr)();
static const CommandPtr _commandList[38];
@@ -376,7 +376,7 @@ public:
int command(int commandId, int param) override;
};
-class ASound9 : public RexASound {
+class ASound9 : public ASound {
private:
/**
* Deferred sound-loader callback state (word_1949E/word_194A0/_soundPtr
More information about the Scummvm-git-logs
mailing list