mirror of https://github.com/PCSX2/pcsx2.git
Null pointer protection and warning in LilyPad and SPU2-X savestates and a small init fix in SPU2-X.
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5112 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
be4b7b1768
commit
52a54fda62
|
@ -1428,7 +1428,13 @@ struct PadPluginFreezeData {
|
||||||
};
|
};
|
||||||
|
|
||||||
s32 CALLBACK PADfreeze(int mode, freezeData *data) {
|
s32 CALLBACK PADfreeze(int mode, freezeData *data) {
|
||||||
if (mode == FREEZE_SIZE) {
|
if (!data)
|
||||||
|
{
|
||||||
|
printf("LilyPad savestate null pointer!\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mode == FREEZE_SIZE) {
|
||||||
data->size = sizeof(PadPluginFreezeData);
|
data->size = sizeof(PadPluginFreezeData);
|
||||||
}
|
}
|
||||||
else if (mode == FREEZE_LOAD) {
|
else if (mode == FREEZE_LOAD) {
|
||||||
|
|
|
@ -656,6 +656,13 @@ EXPORT_C_(int) SPU2setupRecording(int start, void* pData)
|
||||||
|
|
||||||
EXPORT_C_(s32) SPU2freeze(int mode, freezeData *data)
|
EXPORT_C_(s32) SPU2freeze(int mode, freezeData *data)
|
||||||
{
|
{
|
||||||
|
jASSUME( data != NULL );
|
||||||
|
if ( !data )
|
||||||
|
{
|
||||||
|
printf("SPU2-X savestate null pointer!\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
if( mode == FREEZE_SIZE )
|
if( mode == FREEZE_SIZE )
|
||||||
{
|
{
|
||||||
data->size = Savestate::SizeIt();
|
data->size = Savestate::SizeIt();
|
||||||
|
@ -663,9 +670,13 @@ EXPORT_C_(s32) SPU2freeze(int mode, freezeData *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
jASSUME( mode == FREEZE_LOAD || mode == FREEZE_SAVE );
|
jASSUME( mode == FREEZE_LOAD || mode == FREEZE_SAVE );
|
||||||
jASSUME( data != NULL );
|
|
||||||
|
|
||||||
if( data->data == NULL ) return -1;
|
if( data->data == NULL )
|
||||||
|
{
|
||||||
|
printf("SPU2-X savestate null pointer!\n");
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
Savestate::DataBlock& spud = (Savestate::DataBlock&)*(data->data);
|
Savestate::DataBlock& spud = (Savestate::DataBlock&)*(data->data);
|
||||||
|
|
||||||
switch( mode )
|
switch( mode )
|
||||||
|
|
|
@ -134,7 +134,7 @@ void V_Core::Init( int index )
|
||||||
if (!c)
|
if (!c)
|
||||||
{
|
{
|
||||||
WetGate.ExtL = 0;
|
WetGate.ExtL = 0;
|
||||||
WetGate.ExtL = 0;
|
WetGate.ExtR = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
Regs.MMIX = c ? 0xFFC : 0xFF0; // PS2 confirmed (f3c and f30 after BIOS ran, ffc and ff0 after sdinit)
|
Regs.MMIX = c ? 0xFFC : 0xFF0; // PS2 confirmed (f3c and f30 after BIOS ran, ffc and ff0 after sdinit)
|
||||||
|
|
Loading…
Reference in New Issue