mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
libretro: empty srm prevention hack
This commit is contained in:
parent
74e770b1ec
commit
0fd6751db8
1 changed files with 12 additions and 1 deletions
|
@ -741,14 +741,25 @@ void *retro_get_memory_data(unsigned id)
|
||||||
|
|
||||||
size_t retro_get_memory_size(unsigned id)
|
size_t retro_get_memory_size(unsigned id)
|
||||||
{
|
{
|
||||||
|
unsigned int i;
|
||||||
|
int sum;
|
||||||
|
|
||||||
if (id != RETRO_MEMORY_SAVE_RAM)
|
if (id != RETRO_MEMORY_SAVE_RAM)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (PicoAHW & PAHW_MCD)
|
if (PicoAHW & PAHW_MCD)
|
||||||
// bram
|
// bram
|
||||||
return 0x2000;
|
return 0x2000;
|
||||||
else
|
|
||||||
|
if (Pico.m.frame_count == 0)
|
||||||
return SRam.size;
|
return SRam.size;
|
||||||
|
|
||||||
|
// if game doesn't write to sram, don't report it to
|
||||||
|
// libretro so that RA doesn't write out zeroed .srm
|
||||||
|
for (i = 0, sum = 0; i < SRam.size; i++)
|
||||||
|
sum |= SRam.data[i];
|
||||||
|
|
||||||
|
return (sum != 0) ? SRam.size : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void retro_reset(void)
|
void retro_reset(void)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue