mirror of
https://github.com/FunKey-Project/picodrive-irixxxx.git
synced 2026-02-05 06:25:31 +01:00
Merge pull request #133 from jdgleaver/sega-cd-ram-cart
Fix MegaCD RAM cart saving
This commit is contained in:
commit
d1313fc553
1
.gitignore
vendored
1
.gitignore
vendored
@ -11,6 +11,7 @@
|
||||
tags
|
||||
cscope.out
|
||||
PicoDrive.map
|
||||
*.map
|
||||
config.mak
|
||||
config.log
|
||||
cpu/musashi/m68kmake
|
||||
|
||||
@ -428,13 +428,13 @@ else ifeq ($(platform), emscripten)
|
||||
# GCW0
|
||||
else ifeq ($(platform), gcw0)
|
||||
TARGET := $(TARGET_NAME)_libretro.so
|
||||
CC = mipsel-linux-gcc
|
||||
AR = mipsel-linux-ar
|
||||
CC = /opt/gcw0-toolchain/usr/bin/mipsel-linux-gcc
|
||||
AR = /opt/gcw0-toolchain/usr/bin/mipsel-linux-ar
|
||||
SHARED := -shared -nostdlib
|
||||
fpic := -fPIC
|
||||
LIBM :=
|
||||
DONT_COMPILE_IN_ZLIB = 1
|
||||
CFLAGS += -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float
|
||||
CFLAGS += -fomit-frame-pointer -ffast-math -march=mips32 -mtune=mips32r2 -mhard-float
|
||||
|
||||
# Windows MSVC 2017 all architectures
|
||||
else ifneq (,$(findstring windows_msvc2017,$(platform)))
|
||||
|
||||
@ -78,9 +78,11 @@ static int get_ext(const char *fname, char ext[4],
|
||||
strcpy(ext, fname + pos);
|
||||
|
||||
if (base != NULL) {
|
||||
len = pos;
|
||||
if (len + 1 < base_size)
|
||||
len = base_size - 1;
|
||||
if (pos + 1 < base_size)
|
||||
pos = base_size - 1;
|
||||
|
||||
len = (pos < len) ? pos : len;
|
||||
|
||||
memcpy(base, fname, len);
|
||||
base[len] = 0;
|
||||
}
|
||||
|
||||
@ -1203,7 +1203,9 @@ void *retro_get_memory_data(unsigned type)
|
||||
switch(type)
|
||||
{
|
||||
case RETRO_MEMORY_SAVE_RAM:
|
||||
if (PicoIn.AHW & PAHW_MCD)
|
||||
/* Note: MCD RAM cart uses Pico.sv.data */
|
||||
if ((PicoIn.AHW & PAHW_MCD) &&
|
||||
!(PicoIn.opt & POPT_EN_MCD_RAMCART))
|
||||
data = Pico_mcd->bram;
|
||||
else
|
||||
data = Pico.sv.data;
|
||||
@ -1231,8 +1233,12 @@ size_t retro_get_memory_size(unsigned type)
|
||||
{
|
||||
case RETRO_MEMORY_SAVE_RAM:
|
||||
if (PicoIn.AHW & PAHW_MCD)
|
||||
// bram
|
||||
return 0x2000;
|
||||
{
|
||||
if (PicoIn.opt & POPT_EN_MCD_RAMCART)
|
||||
return 0x12000;
|
||||
else /* bram */
|
||||
return 0x2000;
|
||||
}
|
||||
|
||||
if (Pico.m.frame_count == 0)
|
||||
return Pico.sv.size;
|
||||
|
||||
@ -87,7 +87,7 @@ struct retro_core_option_definition option_defs_us[] = {
|
||||
{
|
||||
"picodrive_ramcart",
|
||||
"MegaCD RAM cart",
|
||||
"Emulate a MegaCD RAM cart, used for save game data.",
|
||||
"Emulate a MegaCD RAM cart, used for save game data. WARNING: When enabled, internal save data (BRAM) will be discarded.",
|
||||
{
|
||||
{ "disabled", NULL },
|
||||
{ "enabled", NULL },
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user