libretro / fmsx-libretro

Port of fMSX to the libretro API.
Other
32 stars 39 forks source link

Feature request: SRAM-style saves #40

Closed ofry closed 2 years ago

ofry commented 6 years ago

My feature request: in-game saves.

Without it, for example, it's TOTALLY impossible to finish "Knightmare 3: Shalom" game. That's because in middle of this game I must save, turn off MSX, turn on again, and load this save to move forward...

Information about this game: https://gamefaqs.gamespot.com/msx/918191-knightmare-3-shalom

gingerbeardman commented 5 years ago

@ofry can you explain what you have tried and how it is not working?

As far as I know the emulator core already supports disk operations.

You can confirm this by trying using the standalone version of fMSX: https://fms.komkon.org/fMSX/#Downloads

ofry commented 5 years ago

I mean "SRAM saves" in libretro terminology.

gingerbeardman commented 5 years ago

OK, I think you should look into how the MSX works a little more as there is some misunderstanding on your part.

The MSX is a disk home computer with keyboard that stores its software to removable media, similar to Spectrum/C64/Amiga/Atari/IBM-PC/Apple. The user saved information/gamedata onto floppy disks or cassette tapes, not battery backup flash memory like most game consoles do. So you would need to dedicate a floppy disc image to use for your save games.

Learn more about MSX here: https://www.youtube.com/watch?v=Tr7HAXCqTxc

It's also worthwhile installing standalone fMSX that may help you figure out if your issue is specific to reotroarch (or not as in this case)

ofry commented 5 years ago

Yes, I know MSX is home computer...

But in libretro terminology, for example, PSOne memory card image is "SRAM save" too.

So core should create and format new floppy disk image for every new game.

gingerbeardman commented 5 years ago

So core should create and format new floppy disk image for every new game.

Yes, this is the easiest way. Keep a blank formatted disk image, and copy&rename it for each game you need to save game data.

Aside: the approach to saving game data varies from game to game, which is why SRAM-style saving in fMSX is not really feasible, regardless of which port/version of fMSX you are using.

gingerbeardman commented 5 years ago

Not possible, please close.

ofry commented 5 years ago

I give more precise explanation there:

https://github.com/libretro/fmsx-libretro/issues/43#issuecomment-431342687

cayce-msx commented 2 years ago

A PR is now active for #43; it will enable actually saving disk image changes to the host, if you configure that (the default will be to retain current behaviour, which is to simply 'forget' (throw away) disk updates when exiting RetroArch. (Internally, all content images - CAS,ROM,DSK,M3U alike) are read into memory and all processing thereafter happens in memory.)

As for SRAM: @gingerbeardman is not 100% correct - the MSX actually did have SRAM: some game ROM cartridges brought their own SRAM. And the FM-PAC had 4kB of SRAM, which many MSX2/2+ games used for savegames.

fMSX and fmsx-libretro support these SRAMs. Saves to it will be stored as Game.sav files, and loaded upon restart. This will (of course) only work for games that actually write to SRAM. That is not something an emulator can add.

The best news is: RetroArch provides state saving (default hotkeys: F2 to save, F4 to load), and fmsx-libretro supports that fully. So there is no need at all to use SRAM.

cayce-msx commented 2 years ago

@ofry At https://www.generation-msx.nl/software/konami/knightmare-iii---shalom/946/ I see that this is a ROM game that can save to SRAM: "save support depends on the Konami Game Master 2 cartridge". fMSX supports that, but relies on GMASTER2.ROM to be present in the RA system dir (same location as MSX2P.ROM etc). SHA1 for that is 5c00f9e3a48411e08fac89b1dfdd2a6e95853919. Without it, fMSX wil not save to SRAM.

I know it's three years back, but could you retest, using this new info, and see if this issue still occurs for you?

If not, or if you can't retest, please close the issue. Thanks!

ofry commented 2 years ago

@cayce-msx This game can search saves on disk and cassette tape. So I think, for example, can create blank formatted tape and save it via fMSX core. Then it goes to SRAM interface of Retroarch https://github.com/libretro/fmsx-libretro/issues/91 if I open this game again, it should be possible to load this save.

cayce-msx commented 2 years ago

I'm busy with coding #90 for disk I/O, although I do think it's stretching things - the SRAM functionality in RetroArch is really meant for, well, SRAM, exactly the way an MSX used it. But anyway, I'm building it; let's see what autechre thinks of it.

As for tape, I'll leave that for someone else to build.

Have you attempted to retest my suggestion above with GMASTER2.ROM? Mind you, SRAM will be saved by fMSX to .sram files, and can be read back. So that functionality is already there.

ofry commented 2 years ago

Sorry, I haven't GMASTER2.ROM :( and can't find it in MSX BIOS collections and game collections which provided by piracy :(

Example of such sets: MSX TOSEC (2009-09-27)