ekeeke / Genesis-Plus-GX

An enhanced port of Genesis Plus - accurate & portable Sega 8/16 bit emulator
Other
676 stars 194 forks source link

Any MSU-MD patched games seem to be not able to use save states\rewind? #460

Closed xzyxzy closed 1 year ago

xzyxzy commented 1 year ago

*** Running: /opt/galauncher/galauncher.sh retroarch megadrive "/home/arcade/shared/roms/megadrive/Road Rash II MSU-MD.bin" Prelaunching Retroarch

error: XDG_RUNTIME_DIR is invalid or not set in the environment.

retroarch: malloc.c:2617: sysmalloc: Assertion ``(old_top == initial_top (av) && old_size == 0) || ((unsigned long) (old_size) >= MINSIZE && prev_inuse (old_top) && ((unsigned long) old_end & (pagesize - 1)) == 0)' failed.

/opt/galauncher/emulators/retroarch.sh: line 7: 215796 Aborted (core dumped) retroarch --verbose --log-file "$LOG_DIR"/retroarch.log -L "$core_file" "$rom" ${@:3}

Postlaunching Retroarch

retroarch.log

ekeeke commented 1 year ago

It seems some of the MSU-MD patches have an additional patch to change the "SEGA MEGADRIVE" or "SEGA GENESIS" string in the ROM header into "SEGA MEGASD", presumably to fix some incorrect detection when using MSU-MD games on MegaSD flashcarts. Unfortunately, this makes this emulator thinks that the game supports MegaSD hardware features (which are also emulated by this emulator) instead of normal "CD mode 1" as with MSU-MD games, which results in both Sega CD hardware and MegaSD hardware being emulated and, for savestate, with both hardware states being saved, which overrides the fixed state buffer size.

I will need to fix the way emulated hardware is detected when this specific string is found, as it seems (from MegaSD dev manual at least) that CD hardware should be fully emulated when this string is found, and MegaSD hardware features are limited to some enhanced mapper that allo for ROM writes (which no existing hacks or games use for now).

xzyxzy commented 1 year ago

Should I just replace said strings back to their original counterparts as workaround?

EDIT: Yep, changing header back seems like helping with this.

ekeeke commented 1 year ago

Yes you can as a temporary workaround.

I would have preferred MegaSD dev would have reserved the "SEGA MEGASD" string to identify games that support MegaSD flashcart specific CD overlay features (i.e MD+ games) and not the opposite (i.e games that use CD mode 1 and can work with real Mega CD hardware or emulators) but that's the way it is now :-/

ekeeke commented 1 year ago

Fixed by https://github.com/ekeeke/Genesis-Plus-GX/commit/eef172acf3067044aba35ac3d9e9fc9c6281314b