Wii related updates for save state fixes/workarounds (#246)
* Wii: Fix uninitialized save state size causing load state problems - Issue origially from Wii and possibly affects similar devices where retroarch and the core are one program. The problem was that the serialize size was not reset when you change game, causing the last serialized size to be carried over to the next game loaded causing save state issues due to change in size. Initializing this variable during retro_init() seems enough for most of the games. - In this same observation, also initialized some variables in a similar way. - also exluded a variable used for sound state that was added for smooth sound after load state which causes similar loading issues as well. - default sample rate has been lowered to 32K as well as to minimize some stuttering for these devices, while maintaining 48K sample rate for others. - Some comments are added to modified section as necessary. * Add workaround for save state issue in Wii with expansion audio - Some mappers are not loading states as well. Seems to affect those that are using expansion audio. some of these mappers(bandai, mmc5, namco106), the state variables has to be expanded so that it will load states fine with big endian while others (vrc6, vrc7 sunsoft), some variables that were added for smoother audio during load state has been removed. - This does not guarantee though that other mappers might not have similar incompatibilities after loading a state but so far, some of the most common roms in each mapper has been tested to load fine. * FDS: Expand state variables for big endian compatibility * FDS: Change OSD label from Disk 0 to Disk 1... when switching disks - Minor osd label change that now shows Disk 1 of (# of disks) instead of just Disk 0 Side nth.
This commit is contained in:
committed by
hizzlekizzle
parent
e3cf3efc69
commit
b09a060ae6
@@ -98,10 +98,10 @@ static uint16_t retro_palette[256];
|
||||
static uint16_t* fceu_video_out;
|
||||
|
||||
/* Some timing-related variables. */
|
||||
unsigned sndsamplerate = 48000;
|
||||
unsigned sndquality = 0;
|
||||
unsigned sndvolume = 150;
|
||||
unsigned swapDuty = 0;
|
||||
static unsigned sndsamplerate;
|
||||
static unsigned sndquality;
|
||||
static unsigned sndvolume;
|
||||
unsigned swapDuty;
|
||||
|
||||
static int32_t *sound = 0;
|
||||
static uint32_t JSReturn = 0;
|
||||
@@ -110,6 +110,8 @@ static uint32_t MouseData[MAX_PORTS][3] = { {0} };
|
||||
static uint32_t fc_MouseData[3] = {0};
|
||||
static uint32_t current_palette = 0;
|
||||
|
||||
static unsigned serialize_size;
|
||||
|
||||
int PPUViewScanline=0;
|
||||
int PPUViewer=0;
|
||||
|
||||
@@ -836,6 +838,20 @@ void retro_init(void)
|
||||
if(environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &rgb565))
|
||||
log_cb.log(RETRO_LOG_INFO, "Frontend supports RGB565 - will use that instead of XRGB1555.\n");
|
||||
#endif
|
||||
|
||||
/* initialize some of the default variables */
|
||||
#ifdef GEKKO
|
||||
sndsamplerate = 32000;
|
||||
#else
|
||||
sndsamplerate = 48000;
|
||||
#endif
|
||||
sndquality = 0;
|
||||
sndvolume = 150;
|
||||
swapDuty = 0;
|
||||
|
||||
/* Wii: initialize this or else last variable is passed through
|
||||
* when loading another rom causing save state size change. */
|
||||
serialize_size = 0;
|
||||
}
|
||||
|
||||
static void retro_set_custom_palette(void)
|
||||
@@ -1550,8 +1566,6 @@ void retro_run(void)
|
||||
retro_run_blit(gfx);
|
||||
}
|
||||
|
||||
static unsigned serialize_size = 0;
|
||||
|
||||
size_t retro_serialize_size(void)
|
||||
{
|
||||
if (serialize_size == 0)
|
||||
|
||||
Reference in New Issue
Block a user