- Fixed format strings for messages involving __LINE__.

- Fixed an MPEG related crash when loading save states. If usingLoopStart is 0, it is important not to call MPEG_SetLoop()!
- -input-system is working again.
- Changed the format of some messages here and there.
This commit is contained in:
Bart Trzynadlowski 2011-08-28 04:37:41 +00:00
parent 8be2966ecb
commit 87dc5b4181
10 changed files with 53 additions and 39 deletions

View file

@ -109,7 +109,7 @@ const struct GameInfo g_Model3GameList[] =
1998, 1998,
0x21, 0x21,
0x800000, // 8 MB of fixed CROM 0x800000, // 8 MB of fixed CROM
FALSE, // 96 MB of banked CROM (Do not Mirror) FALSE, // 96 MB of banked CROM (do not mirror)
0x4000000, // 64 MB of VROM 0x4000000, // 64 MB of VROM
0x1000000, // 16 MB of sample ROMs 0x1000000, // 16 MB of sample ROMs
GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_VR|GAME_INPUT_SHIFT4, GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_VR|GAME_INPUT_SHIFT4,
@ -188,7 +188,7 @@ const struct GameInfo g_Model3GameList[] =
1998, 1998,
0x21, 0x21,
0x800000, // 8 MB of fixed CROM 0x800000, // 8 MB of fixed CROM
FALSE, // 64 MB of banked CROM (Do not Mirror) FALSE, // 64 MB of banked CROM (do not mirror)
0x4000000, // 64 MB of VROM 0x4000000, // 64 MB of VROM
0x1000000, // 16 MB of sample ROMs 0x1000000, // 16 MB of sample ROMs
GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_VR|GAME_INPUT_SHIFT4, GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_VR|GAME_INPUT_SHIFT4,
@ -1063,7 +1063,7 @@ const struct GameInfo g_Model3GameList[] =
1998, 1998,
0x21, 0x21,
0x800000, // 8 MB of fixed CROM 0x800000, // 8 MB of fixed CROM
FALSE, // 96 MB of banked CROM (Do not Mirror) FALSE, // 96 MB of banked CROM (do not mirror)
0x4000000, // 64 MB of VROM 0x4000000, // 64 MB of VROM
0x1000000, // 16 MB of sample ROMs 0x1000000, // 16 MB of sample ROMs
GAME_INPUT_COMMON|GAME_INPUT_ANALOG_JOYSTICK, GAME_INPUT_COMMON|GAME_INPUT_ANALOG_JOYSTICK,
@ -1485,7 +1485,6 @@ const struct GameInfo g_Model3GameList[] =
} }
}, },
/*
// Spikeout Final Edition (disabled because this is a bad dump according to MAME) // Spikeout Final Edition (disabled because this is a bad dump according to MAME)
{ {
"spikeofe", "spikeofe",
@ -1494,7 +1493,7 @@ const struct GameInfo g_Model3GameList[] =
1998, 1998,
0x21, 0x21,
0x800000, // 8 MB of fixed CROM 0x800000, // 8 MB of fixed CROM
FALSE, // 96 MB of banked CROM (Do not Mirror) FALSE, // 96 MB of banked CROM (do not mirror)
0x4000000, // 64 MB of VROM 0x4000000, // 64 MB of VROM
0x1000000, // 16 MB of sample ROMs 0x1000000, // 16 MB of sample ROMs
GAME_INPUT_COMMON|GAME_INPUT_JOYSTICK1|GAME_INPUT_SPIKEOUT, GAME_INPUT_COMMON|GAME_INPUT_JOYSTICK1|GAME_INPUT_SPIKEOUT,
@ -1508,16 +1507,16 @@ const struct GameInfo g_Model3GameList[] =
{ "CROM", "epr21653.17", 0xF4BD9C3C, 0x200000, 2, 0x0000006, 8, TRUE }, { "CROM", "epr21653.17", 0xF4BD9C3C, 0x200000, 2, 0x0000006, 8, TRUE },
// Banked CROM0 // Banked CROM0
{ "CROMxx", "mpr21616.4", 0xD5980569, 0x400000, 2, 0x0000000, 8, TRUE }, { "CROMxx", "mpr21616.4", 0x5240FC3A, 0x800000, 2, 0x0000000, 8, TRUE },
{ "CROMxx", "mpr21615.3", 0x50341C34, 0x400000, 2, 0x0000002, 8, TRUE }, { "CROMxx", "mpr21615.3", 0x58293076, 0x800000, 2, 0x0000002, 8, TRUE },
{ "CROMxx", "mpr21614.2", 0x789A96E9, 0x400000, 2, 0x0000004, 8, TRUE }, { "CROMxx", "mpr21614.2", 0x9EC89AE6, 0x800000, 2, 0x0000004, 8, TRUE },
{ "CROMxx", "mpr21613.1", 0x39F181C0, 0x400000, 2, 0x0000006, 8, TRUE }, { "CROMxx", "mpr21613.1", 0x1738C350, 0x800000, 2, 0x0000006, 8, TRUE },
// Banked CROM1 // Banked CROM1
{ "CROMxx", "mpr21620.8", 0x3A1ECEC4, 0x400000, 2, 0x2000000, 8, TRUE }, { "CROMxx", "mpr21620.8", 0x1CFE931A, 0x800000, 2, 0x2000000, 8, TRUE },
{ "CROMxx", "mpr21619.7", 0xD2380847, 0x400000, 2, 0x2000002, 8, TRUE }, { "CROMxx", "mpr21619.7", 0xE6D69E72, 0x800000, 2, 0x2000002, 8, TRUE },
{ "CROMxx", "mpr21618.6", 0xA9C0E6C4, 0x400000, 2, 0x2000004, 8, TRUE }, { "CROMxx", "mpr21618.6", 0x222F1829, 0x800000, 2, 0x2000004, 8, TRUE },
{ "CROMxx", "mpr21617.5", 0x8306B52C, 0x400000, 2, 0x2000006, 8, TRUE }, { "CROMxx", "mpr21617.5", 0x6C874B78, 0x800000, 2, 0x2000006, 8, TRUE },
// Banked CROM2 // Banked CROM2
{ "CROMxx", "mpr21624.12", 0x56994CC6, 0x400000, 2, 0x4000000, 8, TRUE }, { "CROMxx", "mpr21624.12", 0x56994CC6, 0x400000, 2, 0x4000000, 8, TRUE },
@ -1536,7 +1535,7 @@ const struct GameInfo g_Model3GameList[] =
{ "VROM", "mpr21634.27", 0x876E6788, 0x400000, 2, 2, 32, FALSE }, { "VROM", "mpr21634.27", 0x876E6788, 0x400000, 2, 2, 32, FALSE },
{ "VROM", "mpr21635.28", 0x093534A8, 0x400000, 2, 4, 32, FALSE }, { "VROM", "mpr21635.28", 0x093534A8, 0x400000, 2, 4, 32, FALSE },
{ "VROM", "mpr21636.29", 0x2433F21C, 0x400000, 2, 6, 32, FALSE }, { "VROM", "mpr21636.29", 0x2433F21C, 0x400000, 2, 6, 32, FALSE },
{ "VROM", "mpr21637.30", 0x093534A8, 0x400000, 2, 8, 32, FALSE }, /*{ "VROM", "mpr21637.30", 0x093534A8, 0x400000, 2, 8, 32, FALSE },*/
{ "VROM", "mpr21638.31", 0x3773A215, 0x400000, 2, 10, 32, FALSE }, { "VROM", "mpr21638.31", 0x3773A215, 0x400000, 2, 10, 32, FALSE },
{ "VROM", "mpr21639.32", 0x313D1872, 0x400000, 2, 12, 32, FALSE }, { "VROM", "mpr21639.32", 0x313D1872, 0x400000, 2, 12, 32, FALSE },
{ "VROM", "mpr21640.33", 0x271366BE, 0x400000, 2, 14, 32, FALSE }, { "VROM", "mpr21640.33", 0x271366BE, 0x400000, 2, 14, 32, FALSE },
@ -1564,7 +1563,6 @@ const struct GameInfo g_Model3GameList[] =
{ NULL, NULL, 0, 0, 0, 0, 0, FALSE } { NULL, NULL, 0, 0, 0, 0, 0, FALSE }
} }
}, },
*/
// Spikeout (Revision C) // Spikeout (Revision C)
{ {
@ -1574,7 +1572,7 @@ const struct GameInfo g_Model3GameList[] =
1998, 1998,
0x21, 0x21,
0x800000, // 8 MB of fixed CROM 0x800000, // 8 MB of fixed CROM
FALSE, // 96 MB of banked CROM (Do not Mirror) FALSE, // 96 MB of banked CROM (do not mirror)
0x4000000, // 64 MB of VROM 0x4000000, // 64 MB of VROM
0x1000000, // 16 MB of sample ROMs 0x1000000, // 16 MB of sample ROMs
GAME_INPUT_COMMON|GAME_INPUT_JOYSTICK1|GAME_INPUT_SPIKEOUT, GAME_INPUT_COMMON|GAME_INPUT_JOYSTICK1|GAME_INPUT_SPIKEOUT,

View file

@ -228,7 +228,7 @@ void C53C810::WriteRegister(unsigned reg, UINT8 data)
{ {
if (reg >= 0x60) if (reg >= 0x60)
{ {
ErrorLog("%s:%s: Invalid 53C810 register (%02X).", __FILE__, __LINE__, reg); ErrorLog("%s:%d: Invalid 53C810 register (%02X).", __FILE__, __LINE__, reg);
return; return;
} }
@ -343,7 +343,7 @@ UINT8 C53C810::ReadRegister(unsigned reg)
if (reg >= 0x60) if (reg >= 0x60)
{ {
ErrorLog("%s:%s: Invalid 53C810 register (%02X).", __FILE__, __LINE__, reg); ErrorLog("%s:%d: Invalid 53C810 register (%02X).", __FILE__, __LINE__, reg);
return 0; return 0;
} }

View file

@ -29,6 +29,8 @@
* *
* TODO List * TODO List
* --------- * ---------
* - Should MPEG_SetLoop() check for loopEnd==0? This causes crashes. Usually
* only occurs when loopStart is also 0, and that can only be checked here.
* - Volume fade out in Daytona 2 is much too slow. Probably caused by 68K * - Volume fade out in Daytona 2 is much too slow. Probably caused by 68K
* timing or interrupts. * timing or interrupts.
* - Check actual MPEG sample rate. So far, all games seem to use 32 KHz, which * - Check actual MPEG sample rate. So far, all games seem to use 32 KHz, which
@ -547,6 +549,7 @@ void CDSB1::LoadState(CBlockFile *StateFile)
if (isPlaying) if (isPlaying)
{ {
MPEG_PlayMemory((const char *) &mpegROM[usingMPEGStart], usingMPEGEnd-usingMPEGStart); MPEG_PlayMemory((const char *) &mpegROM[usingMPEGStart], usingMPEGEnd-usingMPEGStart);
if ((usingLoopStart != 0) && (usingLoopEnd != 0))
MPEG_SetLoop((const char *) &mpegROM[usingLoopStart], usingLoopEnd); MPEG_SetLoop((const char *) &mpegROM[usingLoopStart], usingLoopEnd);
MPEG_SetOffset(mpegPos); MPEG_SetOffset(mpegPos);
} }
@ -677,7 +680,7 @@ static const char *stateName[] =
void CDSB2::WriteMPEGFIFO(UINT8 byte) void CDSB2::WriteMPEGFIFO(UINT8 byte)
{ {
//printf("fifo: %x (state %s)\n", byte, stateName[mpegState]); printf("fifo: %x (state %s)\n", byte, stateName[mpegState]);
switch (mpegState) switch (mpegState)
{ {
case ST_IDLE: case ST_IDLE:
@ -693,7 +696,7 @@ void CDSB2::WriteMPEGFIFO(UINT8 byte)
usingMPEGStart = mpegStart; usingMPEGStart = mpegStart;
usingMPEGEnd = mpegEnd; usingMPEGEnd = mpegEnd;
MPEG_PlayMemory((const char *) &mpegROM[mpegStart], mpegEnd-mpegStart); MPEG_PlayMemory((const char *) &mpegROM[mpegStart], mpegEnd-mpegStart);
//printf("playing %X\n", mpegStart); printf("playing %X\n", mpegStart);
mpegState = ST_IDLE; mpegState = ST_IDLE;
playing = 1; playing = 1;
} }
@ -737,7 +740,7 @@ void CDSB2::WriteMPEGFIFO(UINT8 byte)
if (playing) if (playing)
{ {
//printf("Setting loop point to %x\n", mpegStart); printf("Setting loop point to %x\n", mpegStart);
usingLoopStart = mpegStart; usingLoopStart = mpegStart;
usingLoopEnd = mpegEnd-mpegStart; usingLoopEnd = mpegEnd-mpegStart;
MPEG_SetLoop((const char *) &mpegROM[usingLoopStart], usingLoopEnd); MPEG_SetLoop((const char *) &mpegROM[usingLoopStart], usingLoopEnd);
@ -781,7 +784,7 @@ void CDSB2::WriteMPEGFIFO(UINT8 byte)
usingMPEGStart = mpegStart; usingMPEGStart = mpegStart;
usingMPEGEnd = mpegEnd; usingMPEGEnd = mpegEnd;
MPEG_PlayMemory((const char *) &mpegROM[mpegStart], mpegEnd-mpegStart); MPEG_PlayMemory((const char *) &mpegROM[mpegStart], mpegEnd-mpegStart);
//printf("playing %X (from st_gota4)\n", mpegStart); printf("playing %X (from st_gota4)\n", mpegStart);
playing = 1; playing = 1;
} }
break; break;
@ -1100,11 +1103,18 @@ void CDSB2::LoadState(CBlockFile *StateFile)
if (isPlaying) if (isPlaying)
{ {
MPEG_PlayMemory((const char *) &mpegROM[usingMPEGStart], usingMPEGEnd-usingMPEGStart); MPEG_PlayMemory((const char *) &mpegROM[usingMPEGStart], usingMPEGEnd-usingMPEGStart);
if ((usingLoopStart != 0) && (usingLoopEnd != 0))
MPEG_SetLoop((const char *) &mpegROM[usingLoopStart], usingLoopEnd); MPEG_SetLoop((const char *) &mpegROM[usingLoopStart], usingLoopEnd);
MPEG_SetOffset(mpegPos); MPEG_SetOffset(mpegPos);
} }
else else
MPEG_StopPlaying(); MPEG_StopPlaying();
//DEBUG
printf("mpegStart=%X, mpegEnd=%X\n", mpegStart, mpegEnd);
printf("usingMPEGStart=%X, usingMPEGEnd=%X\n", usingMPEGStart, usingMPEGEnd);
printf("usingLoopStart=%X, usingLoopEnd=%X\n", usingLoopStart, usingLoopEnd);
} }
// Offsets of memory regions within DSB2's pool // Offsets of memory regions within DSB2's pool

View file

@ -312,7 +312,7 @@ void CMPC10x::SetModel(int modelNum)
if ((modelNum!=0x105) && (modelNum!=0x106)) if ((modelNum!=0x105) && (modelNum!=0x106))
{ {
ErrorLog("%s:%s: Invalid MPC10x model number (%X).", __FILE__, __LINE__, modelNum); ErrorLog("%s:%d: Invalid MPC10x model number (%X).", __FILE__, __LINE__, modelNum);
model = 0x105; model = 0x105;
} }

View file

@ -729,7 +729,7 @@ void CModel3::SetCROMBank(unsigned idx)
idx = (~idx) & 0xF; idx = (~idx) & 0xF;
cromBank = &crom[0x800000 + (idx*0x800000)]; cromBank = &crom[0x800000 + (idx*0x800000)];
DebugLog("CROM bank setting: %d (%02X), PC=%08X, LR=%08X\n", idx, cromBankReg, ppc_get_pc(), ppc_get_lr()); DebugLog("CROM bank setting: %d (%02X), PC=%08X, LR=%08X\n", idx, cromBankReg, ppc_get_pc(), ppc_get_lr());
// printf("CROM bank setting: %d (%02X), PC=%08X, LR=%08X\n", idx, cromBankReg, ppc_get_pc(), ppc_get_lr()); //printf("CROM bank setting: %d (%02X), PC=%08X, LR=%08X\n", idx, cromBankReg, ppc_get_pc(), ppc_get_lr());
} }
UINT8 CModel3::ReadSystemRegister(unsigned reg) UINT8 CModel3::ReadSystemRegister(unsigned reg)

View file

@ -1098,6 +1098,9 @@ int main(int argc, char **argv)
#ifdef SUPERMODEL_DEBUGGER #ifdef SUPERMODEL_DEBUGGER
int cmdEnterDebugger=false; int cmdEnterDebugger=false;
#endif // SUPERMODEL_DEBUGGER #endif // SUPERMODEL_DEBUGGER
#ifdef SUPERMODEL_WIN32
char *inputSystem = NULL;
#endif // SUPERMODEL_WIN32
unsigned n; unsigned n;
UINT32 addr; UINT32 addr;
@ -1164,19 +1167,19 @@ int main(int argc, char **argv)
else if (!strcmp(argv[i],"-enter-debugger")) else if (!strcmp(argv[i],"-enter-debugger"))
cmdEnterDebugger = true; cmdEnterDebugger = true;
#endif // SUPERMODEL_DEBUGGER #endif // SUPERMODEL_DEBUGGER
else if (!strncmp(argv[i],"-sound-vol",10)) else if (!strncmp(argv[i],"-sound-volume",13))
{ {
ret = sscanf(&argv[i][10],"=%d",&n); ret = sscanf(&argv[i][13],"=%d",&n);
if (ret != 1) if (ret != 1)
ErrorLog("-sound-vol requires a volume setting."); ErrorLog("-sound-volume requires a volume setting.");
else else
CmdLine.Set("Global", "SoundVolume", n); CmdLine.Set("Global", "SoundVolume", n);
} }
else if (!strncmp(argv[i],"-music-vol",10)) else if (!strncmp(argv[i],"-music-volume",13))
{ {
ret = sscanf(&argv[i][10],"=%d",&n); ret = sscanf(&argv[i][13],"=%d",&n);
if (ret != 1) if (ret != 1)
ErrorLog("-music-vol requires a volume setting."); ErrorLog("-music-volume requires a volume setting.");
else else
CmdLine.Set("Global", "MusicVolume", n); CmdLine.Set("Global", "MusicVolume", n);
} }
@ -1238,9 +1241,9 @@ int main(int argc, char **argv)
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.");
else else
CmdLine.Set("Global", "InputSystem", &argv[i][14]); inputSystem = &argv[i][14];
} }
#endif #endif // SUPERMODEL_WIN32
else if (!strcmp(argv[i],"-print-inputs")) else if (!strcmp(argv[i],"-print-inputs"))
cmdPrintInputs = true; cmdPrintInputs = true;
else if (!strcmp(argv[i],"-config-inputs")) else if (!strcmp(argv[i],"-config-inputs"))
@ -1290,6 +1293,7 @@ int main(int argc, char **argv)
Debugger::CSupermodelDebugger *Debugger = NULL; Debugger::CSupermodelDebugger *Debugger = NULL;
#endif // SUPERMODEL_DEBUGGER #endif // SUPERMODEL_DEBUGGER
g_Config.SetInputSystem(inputSystem);
if (stricmp(g_Config.GetInputSystem(), "sdl") == 0) if (stricmp(g_Config.GetInputSystem(), "sdl") == 0)
InputSystem = new CSDLInputSystem(); InputSystem = new CSDLInputSystem();
#ifdef SUPERMODEL_WIN32 #ifdef SUPERMODEL_WIN32

View file

@ -67,7 +67,7 @@ public:
#endif #endif
) )
{ {
ErrorLog("Unknown input system (%s), defaulting to SDL.", inpSysName); ErrorLog("Unknown input system '%s', defaulting to SDL.", inpSysName);
inputSystem = "sdl"; inputSystem = "sdl";
return; return;
} }

View file

@ -177,7 +177,7 @@ static BOOL LoadROM(UINT8 *buf, unsigned bufSize, const struct ROMMap *Map, cons
} }
if (loadAll) // need to load all ROMs, so there should be no unmapped regions if (loadAll) // need to load all ROMs, so there should be no unmapped regions
return ErrorLog("%s:%d: No mapping for \"%s\".", __FILE__, __LINE__, ROM->region); return ErrorLog("%s:%d: No mapping for '%s'.", __FILE__, __LINE__, ROM->region);
else else
return OKAY; return OKAY;
} }
@ -256,7 +256,7 @@ const struct GameInfo * LoadROMSetFromZIPFile(const struct ROMMap *Map, const st
DebugLog("%s also contains: %s (%s)\n", zipFile, CurGame->id, CurGame->title); DebugLog("%s also contains: %s (%s)\n", zipFile, CurGame->id, CurGame->title);
if (multipleGameError == FALSE) // only warn about this once if (multipleGameError == FALSE) // only warn about this once
{ {
ErrorLog("Multiple games were found in %s; loading \"%s\".", zipFile, Game->title); ErrorLog("Multiple games were found in %s; loading '%s'.", zipFile, Game->title);
multipleGameError = TRUE; multipleGameError = TRUE;
} }
} }

View file

@ -73,7 +73,7 @@ extern void MPEG_SetOffset(int pos);
* *
* Parameters: * Parameters:
* loop Start address. * loop Start address.
* loopend End offset. * loopend End offset. Must NOT be 0!
*/ */
extern void MPEG_SetLoop(const char *loop, int loopend); extern void MPEG_SetLoop(const char *loop, int loopend);

View file

@ -53,6 +53,8 @@ int m1fread(unsigned char *buf, int size1, int size2, void *f)
if (in_file) return fread(buf, size1, size2, (FILE *) f); if (in_file) return fread(buf, size1, size2, (FILE *) f);
//printf("total=%X, offset=%X, end=%X\n", total, offset, end);
// if past EOF // if past EOF
if ((total + offset) >= end) if ((total + offset) >= end)
{ {