Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Feature Request) .sav file support #81

Open
spagootie opened this issue Aug 8, 2024 · 10 comments
Open

(Feature Request) .sav file support #81

spagootie opened this issue Aug 8, 2024 · 10 comments

Comments

@spagootie
Copy link

spagootie commented Aug 8, 2024

I know the original DraStic supports saving with .sav files instead of .dsv files, it'd be very useful for syncing saves between devices.

@steward-fu
Copy link
Owner

Both .sav and .dsv are kept in my porting, please check in your microsd.

@spagootie
Copy link
Author

How can I switch between saving as .sav and .dsv?

@vickyorlo
Copy link

While I can confirm that the port loads .sav files, it re-saves them as .dsv afterwards... It would be nice to have the option to use .sav files for comaptibility with flashcarts and other emulators.

@steward-fu
Copy link
Owner

steward-fu commented Dec 12, 2024

In my understanding, the .sav file is used in game and the .dsv is used for quick save-state or load-state. You can copy the save file from the flash card and then overwritten the drastic's .sav file. After load in game, you can do 'quick save-state' in drastic emulator. Then, you can get the new .dsv file.

So, my question is: what is the meaning of ".sav file support" ?

@vickyorlo
Copy link

vickyorlo commented Dec 12, 2024

Not quite. The savestate format for DraStic is .dss. The savestate format for DeSmuME is .dsx where x is the slot number.

.dsv is the DeSmuME battery save format. It is almost identical to the .sav raw battery save file format used by almost everything else, but it has a bunch of data appended at the end.

For example, here's a save file from a flash cart and a save file from DraStic:

-rwxrwxrwx    1 root     root         65658 Dec 11 01:36 Castlevania - Portrait of Ruin (USA).dsv
-rwxrwxrwx    1 root     root         65536 Dec 11 02:15 Castlevania - Portrait of Ruin (USA).sav

You might notice that the .dsv file is 22 bytes larger. Those 22 bytes are the extra data added by DeSmuME and they're pretty much garbage. Here's the contents of those 22 bytes:

00010000  7c 3c 2d 2d 53 6e 69 70  20 61 62 6f 76 65 20 68  ||<--Snip above h|
00010010  65 72 65 20 74 6f 20 63  72 65 61 74 65 20 61 20  |ere to create a |
00010020  72 61 77 20 73 61 76 20  62 79 20 65 78 63 6c 75  |raw sav by exclu|
00010030  64 69 6e 67 20 74 68 69  73 20 44 65 53 6d 75 4d  |ding this DeSmuM|
00010040  45 20 73 61 76 65 64 61  74 61 20 66 6f 6f 74 65  |E savedata foote|
00010050  72 3a 00 00 01 00 00 00  01 00 00 00 00 00 02 00  |r:..............|
00010060  00 00 00 00 01 00 00 00  00 00 7c 2d 44 45 53 4d  |..........|-DESM|
00010070  55 4d 45 20 53 41 56 45  2d 7c                    |UME SAVE-||

@steward-fu
Copy link
Owner

Thanks for your information. If so, I think you can use .sav file (from flashcard) directly on the DraStic emulator. Is my understanding correct ? If correct, then nothing needed to do for this issue, right ?

@vickyorlo
Copy link

Yes, you can, it is possible to load .sav files with DraStic. However what I and (I think) the original poster wants is a setting to make DraStic save its files in the .sav format so they can be then directly moved to a flashcard or another emulator.
For example, I want to start playing a game on DraStic on a handheld and be able to directly move the battery save file to my computer and use it with for example MelonDS without converting, and then be able to move the save file back to my handheld and use it in DraStic without converting. This is very easy to do nowadays with programs like syncthing and I do it quite a lot. Currently only the second half is possible.

@steward-fu
Copy link
Owner

Thanks for your explanation. Both .sav and .dsv are in drastic folder. I mean user can copy it directly without any conversion. So, I am a little confusing why we need convert to .sav file ?

@SlyAceZeta
Copy link

They're saying that currently DraStic can load .sav files, but it cannot save .sav files.

@steward-fu
Copy link
Owner

The .sav file is for in-game state when playing NDS game. I mean if you do save the state in game, the .save file can be updated properly. So, my question is: do you need to update the .sav file automatically when exit NDS emulator ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants