diff --git a/Config/Music.xml b/Config/Music.xml
new file mode 100644
index 0000000..d67bb58
--- /dev/null
+++ b/Config/Music.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Src/Model3/DSB.cpp b/Src/Model3/DSB.cpp
index 9154383..24e4d11 100644
--- a/Src/Model3/DSB.cpp
+++ b/Src/Model3/DSB.cpp
@@ -221,7 +221,7 @@ void CDSB1::IOWrite8(UINT32 addr, UINT8 data)
usingMPEGStart = mpegStart;
usingMPEGEnd = mpegEnd;
- MpegDec::SetMemory(&mpegROM[mpegStart], mpegEnd - mpegStart, false);
+ MpegDec::SetMemory(mpegROM, mpegStart, mpegEnd - mpegStart, false);
return;
}
@@ -233,7 +233,7 @@ void CDSB1::IOWrite8(UINT32 addr, UINT8 data)
usingMPEGStart = mpegStart;
usingMPEGEnd = mpegEnd;
- MpegDec::SetMemory(&mpegROM[mpegStart], mpegEnd - mpegStart, false); // assume not looped for now
+ MpegDec::SetMemory(mpegROM, mpegStart, mpegEnd - mpegStart, false); // assume not looped for now
return;
}
break;
@@ -266,13 +266,13 @@ void CDSB1::IOWrite8(UINT32 addr, UINT8 data)
{
usingLoopStart = loopStart;
usingLoopEnd = mpegEnd-loopStart;
- MpegDec::UpdateMemory(&mpegROM[usingLoopStart], usingLoopEnd, true);
+ MpegDec::UpdateMemory(mpegROM, usingLoopStart, usingLoopEnd, true);
}
else
{
usingLoopStart = loopStart;
usingLoopEnd = loopEnd-loopStart;
- MpegDec::UpdateMemory(&mpegROM[usingLoopStart], usingLoopEnd, true);
+ MpegDec::UpdateMemory(mpegROM, usingLoopStart, usingLoopEnd, true);
}
}
@@ -302,7 +302,7 @@ void CDSB1::IOWrite8(UINT32 addr, UINT8 data)
loopEnd = endLatch;
usingLoopStart = loopStart;
usingLoopEnd = loopEnd-loopStart;
- MpegDec::UpdateMemory(&mpegROM[usingLoopStart], usingLoopEnd, true);
+ MpegDec::UpdateMemory(mpegROM, usingLoopStart, usingLoopEnd, true);
//printf("loopEnd = %08X\n", loopEnd);
}
break;
@@ -529,10 +529,10 @@ void CDSB1::LoadState(CBlockFile *StateFile)
// Restart MPEG audio at the appropriate position
if (isPlaying)
{
- MpegDec::SetMemory(&mpegROM[usingMPEGStart], usingMPEGEnd - usingMPEGStart, false);
+ MpegDec::SetMemory(mpegROM, usingMPEGStart, usingMPEGEnd - usingMPEGStart, false);
if (usingLoopEnd != 0) { // only if looping was actually enabled
- MpegDec::UpdateMemory(&mpegROM[usingLoopStart], usingLoopEnd, true);
+ MpegDec::UpdateMemory(mpegROM, usingLoopStart, usingLoopEnd, true);
}
MpegDec::SetPosition(playOffset);
@@ -691,7 +691,7 @@ void CDSB2::WriteMPEGFIFO(UINT8 byte)
usingMPEGEnd = mpegEnd;
playing = 1;
- MpegDec::SetMemory(&mpegROM[mpegStart], mpegEnd - mpegStart, false);
+ MpegDec::SetMemory(mpegROM, mpegStart, mpegEnd - mpegStart, false);
mpegState = ST_IDLE;
}
@@ -737,7 +737,7 @@ void CDSB2::WriteMPEGFIFO(UINT8 byte)
{
usingLoopStart = mpegStart;
usingLoopEnd = mpegEnd - mpegStart;
- MpegDec::UpdateMemory(&mpegROM[usingLoopStart], usingLoopEnd, true);
+ MpegDec::UpdateMemory(mpegROM, usingLoopStart, usingLoopEnd, true);
}
break;
@@ -773,7 +773,7 @@ void CDSB2::WriteMPEGFIFO(UINT8 byte)
usingMPEGStart = mpegStart;
usingMPEGEnd = mpegEnd;
playing = 1;
- MpegDec::SetMemory(&mpegROM[mpegStart], mpegEnd - mpegStart, false);
+ MpegDec::SetMemory(mpegROM, mpegStart, mpegEnd - mpegStart, false);
}
break;
case ST_GOTA5:
@@ -1165,10 +1165,10 @@ void CDSB2::LoadState(CBlockFile *StateFile)
// Restart MPEG audio at the appropriate position
if (isPlaying)
{
- MpegDec::SetMemory(&mpegROM[usingMPEGStart], usingMPEGEnd - usingMPEGStart, false);
+ MpegDec::SetMemory(mpegROM, usingMPEGStart, usingMPEGEnd - usingMPEGStart, false);
if (usingLoopEnd != 0) { // only if looping was actually enabled
- MpegDec::UpdateMemory(&mpegROM[usingLoopStart], usingLoopEnd, true);
+ MpegDec::UpdateMemory(mpegROM, usingLoopStart, usingLoopEnd, true);
}
MpegDec::SetPosition(playOffset);
diff --git a/Src/OSD/SDL/Main.cpp b/Src/OSD/SDL/Main.cpp
index dc37b66..7108536 100644
--- a/Src/OSD/SDL/Main.cpp
+++ b/Src/OSD/SDL/Main.cpp
@@ -1,7 +1,7 @@
/**
** Supermodel
** A Sega Model 3 Arcade Emulator.
- ** Copyright 2003-2023 The Supermodel Team
+ ** Copyright 2003-2024 The Supermodel Team
**
** This file is part of Supermodel.
**
@@ -95,6 +95,7 @@
#include "OSD/Audio.h"
#include "Graphics/New3D/VBO.h"
#include "Graphics/SuperAA.h"
+#include "Sound/MPEG/MpegAudio.h"
#include
#include "Util/BMPFile.h"
@@ -105,6 +106,12 @@
Global Run-time Config
******************************************************************************/
+static const std::string s_analysisPath = Util::Format() << FileSystemPath::GetPath(FileSystemPath::Analysis);
+static const std::string s_configFilePath = Util::Format() << FileSystemPath::GetPath(FileSystemPath::Config) << "Supermodel.ini";
+static const std::string s_gameXMLFilePath = Util::Format() << FileSystemPath::GetPath(FileSystemPath::Config) << "Games.xml";
+static const std::string s_musicXMLFilePath = Util::Format() << FileSystemPath::GetPath(FileSystemPath::Config) << "Music.xml";
+static const std::string s_logFilePath = Util::Format() << FileSystemPath::GetPath(FileSystemPath::Log) << "Supermodel.log";
+
static Util::Config::Node s_runtime_config("Global");
@@ -914,6 +921,9 @@ int Supermodel(const Game &game, ROMSet *rom_set, IEmulator *Model3, CInputs *In
return 1;
*rom_set = ROMSet(); // free up this memory we won't need anymore
+ // Customized music for games with MPEG boards
+ MpegDec::LoadCustomTracks(s_musicXMLFilePath, game);
+
// Load NVRAM
LoadNVRAM(Model3);
@@ -982,7 +992,7 @@ int Supermodel(const Game &game, ROMSet *rom_set, IEmulator *Model3, CInputs *In
goto QuitError;
if (OKAY != Render3D->Init(xOffset*aaValue, yOffset*aaValue, xRes*aaValue, yRes*aaValue, totalXRes*aaValue, totalYRes*aaValue, superAA->GetTargetID()))
goto QuitError;
-
+
Model3->AttachRenderers(Render2D,Render3D, superAA);
// Reset emulator
@@ -1356,12 +1366,6 @@ QuitError:
/******************************************************************************
Entry Point and Command Line Procesing
******************************************************************************/
-
-static const std::string s_analysisPath = Util::Format() << FileSystemPath::GetPath(FileSystemPath::Analysis);
-static const std::string s_configFilePath = Util::Format() << FileSystemPath::GetPath(FileSystemPath::Config) << "Supermodel.ini";
-static const std::string s_gameXMLFilePath = Util::Format() << FileSystemPath::GetPath(FileSystemPath::Config) << "Games.xml";
-static const std::string s_logFilePath = Util::Format() << FileSystemPath::GetPath(FileSystemPath::Log) << "Supermodel.log";
-
// Create and configure inputs
static bool ConfigureInputs(CInputs *Inputs, Util::Config::Node *fileConfig, Util::Config::Node *runtimeConfig, const Game &game, bool configure)
{
@@ -1543,7 +1547,7 @@ static Util::Config::Node DefaultConfig()
static void Title(void)
{
puts("Supermodel: A Sega Model 3 Arcade Emulator (Version " SUPERMODEL_VERSION ")");
- puts("Copyright 2003-2023 by The Supermodel Team");
+ puts("Copyright 2003-2024 by The Supermodel Team");
}
static void Help(void)
diff --git a/Src/Sound/MPEG/MpegAudio.cpp b/Src/Sound/MPEG/MpegAudio.cpp
index 45e8c68..66f8fad 100644
--- a/Src/Sound/MPEG/MpegAudio.cpp
+++ b/Src/Sound/MPEG/MpegAudio.cpp
@@ -1,6 +1,205 @@
+/**
+ ** Supermodel
+ ** A Sega Model 3 Arcade Emulator.
+ ** Copyright 2003-2024 The Supermodel Team
+ **
+ ** This file is part of Supermodel.
+ **
+ ** Supermodel is free software: you can redistribute it and/or modify it under
+ ** the terms of the GNU General Public License as published by the Free
+ ** Software Foundation, either version 3 of the License, or (at your option)
+ ** any later version.
+ **
+ ** Supermodel is distributed in the hope that it will be useful, but WITHOUT
+ ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ ** more details.
+ **
+ ** You should have received a copy of the GNU General Public License along
+ ** with Supermodel. If not, see .
+ **/
+
#define MINIMP3_IMPLEMENTATION
#include "Pkgs/minimp3.h"
#include "MpegAudio.h"
+#include "Util/ConfigBuilders.h"
+#include "OSD/Logger.h"
+
+#include
+#include