diff --git a/Src/Games.cpp b/Src/Games.cpp index 6d162d6..6fe7ffb 100644 --- a/Src/Games.cpp +++ b/Src/Games.cpp @@ -1,3 +1,4 @@ +//TODO: clean up game titles (for example: Star Wars is incorrectly labeled rev.A) /** ** Supermodel ** A Sega Model 3 Arcade Emulator. diff --git a/Src/Model3/53C810.cpp b/Src/Model3/53C810.cpp index 684df6f..58e1890 100644 --- a/Src/Model3/53C810.cpp +++ b/Src/Model3/53C810.cpp @@ -228,7 +228,7 @@ void C53C810::WriteRegister(unsigned reg, UINT8 data) { if (reg >= 0x60) { - ErrorLog("%s:%d: Invalid 53C810 register (%02X).", __FILE__, __LINE__, reg); + ErrorLog("Write to invalid 53C810 register (%02X).", reg); return; } @@ -343,7 +343,7 @@ UINT8 C53C810::ReadRegister(unsigned reg) if (reg >= 0x60) { - ErrorLog("%s:%d: Invalid 53C810 register (%02X).", __FILE__, __LINE__, reg); + ErrorLog("Read from invalid 53C810 register (%02X).", reg); return 0; } diff --git a/Src/Model3/DSB.cpp b/Src/Model3/DSB.cpp index 0e8bcc0..4a47278 100644 --- a/Src/Model3/DSB.cpp +++ b/Src/Model3/DSB.cpp @@ -454,7 +454,6 @@ void CDSB1::RunFrame(INT16 *audioL, INT16 *audioR) INT16 *mpegFill[2] = { &mpegL[retainedSamples], &mpegR[retainedSamples] }; MPEG_Decode(mpegFill, 32000/60-retainedSamples+2); retainedSamples = Resampler.UpSampleAndMix(audioL, audioR, mpegL, mpegR, v, v, 44100/60, 32000/60+2, 44100, 32000); - #endif } @@ -1004,7 +1003,6 @@ void CDSB2::RunFrame(INT16 *audioL, INT16 *audioR) INT16 *mpegFill[2] = { &mpegL[retainedSamples], &mpegR[retainedSamples] }; 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); - #endif } diff --git a/Src/Model3/Model3.cpp b/Src/Model3/Model3.cpp index 7dac922..9a3ec93 100644 --- a/Src/Model3/Model3.cpp +++ b/Src/Model3/Model3.cpp @@ -2575,7 +2575,7 @@ BOOL CModel3::LoadROMSet(const struct GameInfo *GameList, const char *zipFile) PPCConfig.pvr = PPC_MODEL_603R; // 66 MHz PPCConfig.bus_frequency = BUS_FREQUENCY_66MHZ; 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); else PCIBridge.SetModel(0x105); // MPC105 diff --git a/Src/OSD/SDL/Audio.cpp b/Src/OSD/SDL/Audio.cpp index 7280c7f..7643ce6 100755 --- a/Src/OSD/SDL/Audio.cpp +++ b/Src/OSD/SDL/Audio.cpp @@ -137,15 +137,37 @@ static void PlayCallback(void *data, Uint8 *stream, int len) static void MixChannels(unsigned numSamples, INT16 *leftBuffer, INT16 *rightBuffer, void *dest) { INT16 *p = (INT16*)dest; - for (unsigned i = 0; i < numSamples; i++) - { + #if (NUM_CHANNELS == 1) - *p++ = leftBuffer[i] + rightBuffer[i]; + for (unsigned i = 0; i < numSamples; i++) + *p++ = leftBuffer[i] + rightBuffer[i]; // TODO: these should probably be clipped! #else - *p++ = rightBuffer[i]; - *p++ = leftBuffer[i]; -#endif + if (g_Config.flipStereo) // swap left and right channels + { + for (unsigned i = 0; i < numSamples; i++) + { + *p++ = rightBuffer[i]; + *p++ = leftBuffer[i]; + } } + 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() @@ -167,7 +189,12 @@ BOOL OpenAudio() SDL_AudioSpec obtained; if (SDL_OpenAudio(&fmt, &obtained) < 0) 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 playSamples = obtained.samples; diff --git a/Src/OSD/SDL/Main.cpp b/Src/OSD/SDL/Main.cpp index cb7e973..1f5f554 100644 --- a/Src/OSD/SDL/Main.cpp +++ b/Src/OSD/SDL/Main.cpp @@ -1,6 +1,6 @@ //TODO before release: // - 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 // - BOOL -> bool, TRUE/FALSE -> true/false // - 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; if (OKAY == INI->Get(section, "ShowFrameRate", x)) 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 @@ -421,6 +423,7 @@ static void LogConfig(void) InfoLog("\tDisableDebugger = %d", g_Config.disableDebugger); #endif InfoLog("\tInputSystem = %s", g_Config.GetInputSystem()); + InfoLog("\tFlipStereo = %d", g_Config.flipStereo); // CModel3Config InfoLog("\tMultiThreaded = %d", g_Config.multiThreaded); @@ -1031,10 +1034,10 @@ static void Help(void) puts(" -print-games List supported games and quit"); puts(""); puts("Emulation Options:"); - puts(" -ppc-frequency= Set PowerPC frequency in MHz [Default: 40]"); + printf(" -ppc-frequency= Set PowerPC frequency in MHz [Default: %d]\n", g_Config.GetPowerPCFrequency()); puts(" -no-scsp Disable Sega Custom Sound Processor (sound effects)"); 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 puts(" -disable-debugger Completely disable debugger functionality"); puts(" -enter-debugger Enter debugger at start of emulation"); @@ -1051,6 +1054,7 @@ static void Help(void) puts("Audio Options:"); puts(" -sound-volume= Set volume of sound effects in % [Default: 100]"); puts(" -music-volume= Set volume of MPEG music in % [Default: 100]"); + puts(" -flip-stereo Swap left and right audio channels"); puts(""); puts("Input Options:"); #ifdef SUPERMODEL_WIN32 @@ -1183,6 +1187,11 @@ int main(int argc, char **argv) else 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")) { n = 0; @@ -1236,7 +1245,7 @@ int main(int argc, char **argv) CmdLine.Set("Global", "FragmentShader", &argv[i][13]); } #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') ErrorLog("-input-system requires an input system name."); diff --git a/Src/OSD/SDL/OSDConfig.h b/Src/OSD/SDL/OSDConfig.h index 3fc6e39..fe02ca3 100644 --- a/Src/OSD/SDL/OSDConfig.h +++ b/Src/OSD/SDL/OSDConfig.h @@ -47,6 +47,7 @@ public: bool fullScreen; // Full screen mode (if TRUE) bool throttle; // 60 Hz frame limiting bool showFPS; // Show frame rate + bool flipStereo; // Flip stereo channels #ifdef SUPERMODEL_DEBUGGER bool disableDebugger; // disables the debugger (not stored in the config. file) @@ -88,6 +89,7 @@ public: fullScreen = false; throttle = true; showFPS = false; + flipStereo = false; #ifdef SUPERMODEL_DEBUGGER disableDebugger = false; #endif