mirror of
https://github.com/RetroDECK/Supermodel.git
synced 2024-11-26 15:45:41 +00:00
- getbass now uses MPC106.
- Fixed some error messages in 53C810.cpp. - Fixed stereo (was swapped) and added a flip stereo option.
This commit is contained in:
parent
b25cbb2391
commit
bda9efebac
|
@ -1,3 +1,4 @@
|
||||||
|
//TODO: clean up game titles (for example: Star Wars is incorrectly labeled rev.A)
|
||||||
/**
|
/**
|
||||||
** Supermodel
|
** Supermodel
|
||||||
** A Sega Model 3 Arcade Emulator.
|
** A Sega Model 3 Arcade Emulator.
|
||||||
|
|
|
@ -228,7 +228,7 @@ void C53C810::WriteRegister(unsigned reg, UINT8 data)
|
||||||
{
|
{
|
||||||
if (reg >= 0x60)
|
if (reg >= 0x60)
|
||||||
{
|
{
|
||||||
ErrorLog("%s:%d: Invalid 53C810 register (%02X).", __FILE__, __LINE__, reg);
|
ErrorLog("Write to invalid 53C810 register (%02X).", reg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -343,7 +343,7 @@ UINT8 C53C810::ReadRegister(unsigned reg)
|
||||||
|
|
||||||
if (reg >= 0x60)
|
if (reg >= 0x60)
|
||||||
{
|
{
|
||||||
ErrorLog("%s:%d: Invalid 53C810 register (%02X).", __FILE__, __LINE__, reg);
|
ErrorLog("Read from invalid 53C810 register (%02X).", reg);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -454,7 +454,6 @@ void CDSB1::RunFrame(INT16 *audioL, INT16 *audioR)
|
||||||
INT16 *mpegFill[2] = { &mpegL[retainedSamples], &mpegR[retainedSamples] };
|
INT16 *mpegFill[2] = { &mpegL[retainedSamples], &mpegR[retainedSamples] };
|
||||||
MPEG_Decode(mpegFill, 32000/60-retainedSamples+2);
|
MPEG_Decode(mpegFill, 32000/60-retainedSamples+2);
|
||||||
retainedSamples = Resampler.UpSampleAndMix(audioL, audioR, mpegL, mpegR, v, v, 44100/60, 32000/60+2, 44100, 32000);
|
retainedSamples = Resampler.UpSampleAndMix(audioL, audioR, mpegL, mpegR, v, v, 44100/60, 32000/60+2, 44100, 32000);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1004,7 +1003,6 @@ void CDSB2::RunFrame(INT16 *audioL, INT16 *audioR)
|
||||||
INT16 *mpegFill[2] = { &mpegL[retainedSamples], &mpegR[retainedSamples] };
|
INT16 *mpegFill[2] = { &mpegL[retainedSamples], &mpegR[retainedSamples] };
|
||||||
MPEG_Decode(mpegFill, 32000/60-retainedSamples+2);
|
MPEG_Decode(mpegFill, 32000/60-retainedSamples+2);
|
||||||
retainedSamples = Resampler.UpSampleAndMix(audioL, audioR, mpegL, mpegR, volume[0], volume[1], 44100/60, 32000/60+2, 44100, 32000);
|
retainedSamples = Resampler.UpSampleAndMix(audioL, audioR, mpegL, mpegR, volume[0], volume[1], 44100/60, 32000/60+2, 44100, 32000);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2575,7 +2575,7 @@ BOOL CModel3::LoadROMSet(const struct GameInfo *GameList, const char *zipFile)
|
||||||
PPCConfig.pvr = PPC_MODEL_603R; // 66 MHz
|
PPCConfig.pvr = PPC_MODEL_603R; // 66 MHz
|
||||||
PPCConfig.bus_frequency = BUS_FREQUENCY_66MHZ;
|
PPCConfig.bus_frequency = BUS_FREQUENCY_66MHZ;
|
||||||
PPCConfig.bus_frequency_multiplier = 0x10; // 1X multiplier
|
PPCConfig.bus_frequency_multiplier = 0x10; // 1X multiplier
|
||||||
if (!strcmp(Game->id, "bass")) // some Step 1.0 games use MPC106
|
if (!strcmp(Game->id, "bass") || !strcmp(Game->id, "getbass")) // some Step 1.0 games use MPC106
|
||||||
PCIBridge.SetModel(0x106);
|
PCIBridge.SetModel(0x106);
|
||||||
else
|
else
|
||||||
PCIBridge.SetModel(0x105); // MPC105
|
PCIBridge.SetModel(0x105); // MPC105
|
||||||
|
|
|
@ -137,16 +137,38 @@ static void PlayCallback(void *data, Uint8 *stream, int len)
|
||||||
static void MixChannels(unsigned numSamples, INT16 *leftBuffer, INT16 *rightBuffer, void *dest)
|
static void MixChannels(unsigned numSamples, INT16 *leftBuffer, INT16 *rightBuffer, void *dest)
|
||||||
{
|
{
|
||||||
INT16 *p = (INT16*)dest;
|
INT16 *p = (INT16*)dest;
|
||||||
|
|
||||||
|
#if (NUM_CHANNELS == 1)
|
||||||
|
for (unsigned i = 0; i < numSamples; i++)
|
||||||
|
*p++ = leftBuffer[i] + rightBuffer[i]; // TODO: these should probably be clipped!
|
||||||
|
#else
|
||||||
|
if (g_Config.flipStereo) // swap left and right channels
|
||||||
|
{
|
||||||
for (unsigned i = 0; i < numSamples; i++)
|
for (unsigned i = 0; i < numSamples; i++)
|
||||||
{
|
{
|
||||||
#if (NUM_CHANNELS == 1)
|
|
||||||
*p++ = leftBuffer[i] + rightBuffer[i];
|
|
||||||
#else
|
|
||||||
*p++ = rightBuffer[i];
|
*p++ = rightBuffer[i];
|
||||||
*p++ = leftBuffer[i];
|
*p++ = leftBuffer[i];
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else // stereo as God intended!
|
||||||
|
{
|
||||||
|
for (unsigned i = 0; i < numSamples; i++)
|
||||||
|
{
|
||||||
|
*p++ = leftBuffer[i];
|
||||||
|
*p++ = rightBuffer[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif // NUM_CHANNELS
|
||||||
|
}
|
||||||
|
|
||||||
|
static void LogAudioInfo(SDL_AudioSpec *fmt)
|
||||||
|
{
|
||||||
|
InfoLog("Audio device information:");
|
||||||
|
InfoLog(" Frequency: %d", fmt->freq);
|
||||||
|
InfoLog(" Channels: %d", fmt->channels);
|
||||||
|
InfoLog("Sample Format: %d", fmt->format);
|
||||||
|
InfoLog("");
|
||||||
|
}
|
||||||
|
|
||||||
BOOL OpenAudio()
|
BOOL OpenAudio()
|
||||||
{
|
{
|
||||||
|
@ -167,6 +189,11 @@ BOOL OpenAudio()
|
||||||
SDL_AudioSpec obtained;
|
SDL_AudioSpec obtained;
|
||||||
if (SDL_OpenAudio(&fmt, &obtained) < 0)
|
if (SDL_OpenAudio(&fmt, &obtained) < 0)
|
||||||
return ErrorLog("Unable to open 44.1KHz 2-channel audio with SDL: %s\n", SDL_GetError());
|
return ErrorLog("Unable to open 44.1KHz 2-channel audio with SDL: %s\n", SDL_GetError());
|
||||||
|
LogAudioInfo(&obtained);
|
||||||
|
|
||||||
|
// Check if obtained format is what we really requested
|
||||||
|
if ((obtained.freq!=fmt.freq) || (obtained.channels!=fmt.channels) || (obtained.format!=fmt.format))
|
||||||
|
ErrorLog("Incompatible audio settings (44.1KHz, 16-bit required). Check drivers!\n");
|
||||||
|
|
||||||
// Check what buffer sample size was actually obtained, and use that
|
// Check what buffer sample size was actually obtained, and use that
|
||||||
playSamples = obtained.samples;
|
playSamples = obtained.samples;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
//TODO before release:
|
//TODO before release:
|
||||||
// - Controls for Dirt Devils, and other recent games (is bass working?)
|
// - Controls for Dirt Devils, and other recent games (is bass working?)
|
||||||
// - Crosshairs
|
// - Stereo reverse option (see Srally2 sound test menu)
|
||||||
// - Comment source code, clean up
|
// - Comment source code, clean up
|
||||||
// - BOOL -> bool, TRUE/FALSE -> true/false
|
// - BOOL -> bool, TRUE/FALSE -> true/false
|
||||||
// - Add option for building with /MD in MSVC Makefile
|
// - Add option for building with /MD in MSVC Makefile
|
||||||
|
@ -392,6 +392,8 @@ static void ApplySettings(CINIFile *INI, const char *section)
|
||||||
g_Config.throttle = x ? true : false;
|
g_Config.throttle = x ? true : false;
|
||||||
if (OKAY == INI->Get(section, "ShowFrameRate", x))
|
if (OKAY == INI->Get(section, "ShowFrameRate", x))
|
||||||
g_Config.showFPS = x ? true : false;
|
g_Config.showFPS = x ? true : false;
|
||||||
|
if (OKAY == INI->Get(section, "FlipStereo", x))
|
||||||
|
g_Config.flipStereo = x ? true : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read settings (from a specific section) from the config file
|
// Read settings (from a specific section) from the config file
|
||||||
|
@ -421,6 +423,7 @@ static void LogConfig(void)
|
||||||
InfoLog("\tDisableDebugger = %d", g_Config.disableDebugger);
|
InfoLog("\tDisableDebugger = %d", g_Config.disableDebugger);
|
||||||
#endif
|
#endif
|
||||||
InfoLog("\tInputSystem = %s", g_Config.GetInputSystem());
|
InfoLog("\tInputSystem = %s", g_Config.GetInputSystem());
|
||||||
|
InfoLog("\tFlipStereo = %d", g_Config.flipStereo);
|
||||||
|
|
||||||
// CModel3Config
|
// CModel3Config
|
||||||
InfoLog("\tMultiThreaded = %d", g_Config.multiThreaded);
|
InfoLog("\tMultiThreaded = %d", g_Config.multiThreaded);
|
||||||
|
@ -1031,10 +1034,10 @@ static void Help(void)
|
||||||
puts(" -print-games List supported games and quit");
|
puts(" -print-games List supported games and quit");
|
||||||
puts("");
|
puts("");
|
||||||
puts("Emulation Options:");
|
puts("Emulation Options:");
|
||||||
puts(" -ppc-frequency=<f> Set PowerPC frequency in MHz [Default: 40]");
|
printf(" -ppc-frequency=<f> Set PowerPC frequency in MHz [Default: %d]\n", g_Config.GetPowerPCFrequency());
|
||||||
puts(" -no-scsp Disable Sega Custom Sound Processor (sound effects)");
|
puts(" -no-scsp Disable Sega Custom Sound Processor (sound effects)");
|
||||||
puts(" -no-dsb Disable Digital Sound Board (MPEG music)");
|
puts(" -no-dsb Disable Digital Sound Board (MPEG music)");
|
||||||
puts(" -multi-threaded Enable multi-threading");
|
puts(" -multi-threaded Enable multi-threading for enhanced performance");
|
||||||
#ifdef SUPERMODEL_DEBUGGER
|
#ifdef SUPERMODEL_DEBUGGER
|
||||||
puts(" -disable-debugger Completely disable debugger functionality");
|
puts(" -disable-debugger Completely disable debugger functionality");
|
||||||
puts(" -enter-debugger Enter debugger at start of emulation");
|
puts(" -enter-debugger Enter debugger at start of emulation");
|
||||||
|
@ -1051,6 +1054,7 @@ static void Help(void)
|
||||||
puts("Audio Options:");
|
puts("Audio Options:");
|
||||||
puts(" -sound-volume=<v> Set volume of sound effects in % [Default: 100]");
|
puts(" -sound-volume=<v> Set volume of sound effects in % [Default: 100]");
|
||||||
puts(" -music-volume=<v> Set volume of MPEG music in % [Default: 100]");
|
puts(" -music-volume=<v> Set volume of MPEG music in % [Default: 100]");
|
||||||
|
puts(" -flip-stereo Swap left and right audio channels");
|
||||||
puts("");
|
puts("");
|
||||||
puts("Input Options:");
|
puts("Input Options:");
|
||||||
#ifdef SUPERMODEL_WIN32
|
#ifdef SUPERMODEL_WIN32
|
||||||
|
@ -1183,6 +1187,11 @@ int main(int argc, char **argv)
|
||||||
else
|
else
|
||||||
CmdLine.Set("Global", "MusicVolume", n);
|
CmdLine.Set("Global", "MusicVolume", n);
|
||||||
}
|
}
|
||||||
|
else if (!strcmp(argv[i], "-flip-stereo"))
|
||||||
|
{
|
||||||
|
n = 1;
|
||||||
|
CmdLine.Set("Global", "FlipStereo", n);
|
||||||
|
}
|
||||||
else if (!strcmp(argv[i], "-no-scsp"))
|
else if (!strcmp(argv[i], "-no-scsp"))
|
||||||
{
|
{
|
||||||
n = 0;
|
n = 0;
|
||||||
|
@ -1236,7 +1245,7 @@ int main(int argc, char **argv)
|
||||||
CmdLine.Set("Global", "FragmentShader", &argv[i][13]);
|
CmdLine.Set("Global", "FragmentShader", &argv[i][13]);
|
||||||
}
|
}
|
||||||
#ifdef SUPERMODEL_WIN32
|
#ifdef SUPERMODEL_WIN32
|
||||||
else if (!strncmp(argv[i],"-input-system=", 14))
|
else if (!strncmp(argv[i],"-input-system=", 14)) // this setting is not written to the config file!
|
||||||
{
|
{
|
||||||
if (argv[i][14] == '\0')
|
if (argv[i][14] == '\0')
|
||||||
ErrorLog("-input-system requires an input system name.");
|
ErrorLog("-input-system requires an input system name.");
|
||||||
|
|
|
@ -47,6 +47,7 @@ public:
|
||||||
bool fullScreen; // Full screen mode (if TRUE)
|
bool fullScreen; // Full screen mode (if TRUE)
|
||||||
bool throttle; // 60 Hz frame limiting
|
bool throttle; // 60 Hz frame limiting
|
||||||
bool showFPS; // Show frame rate
|
bool showFPS; // Show frame rate
|
||||||
|
bool flipStereo; // Flip stereo channels
|
||||||
|
|
||||||
#ifdef SUPERMODEL_DEBUGGER
|
#ifdef SUPERMODEL_DEBUGGER
|
||||||
bool disableDebugger; // disables the debugger (not stored in the config. file)
|
bool disableDebugger; // disables the debugger (not stored in the config. file)
|
||||||
|
@ -88,6 +89,7 @@ public:
|
||||||
fullScreen = false;
|
fullScreen = false;
|
||||||
throttle = true;
|
throttle = true;
|
||||||
showFPS = false;
|
showFPS = false;
|
||||||
|
flipStereo = false;
|
||||||
#ifdef SUPERMODEL_DEBUGGER
|
#ifdef SUPERMODEL_DEBUGGER
|
||||||
disableDebugger = false;
|
disableDebugger = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue