Code Monkey home page Code Monkey logo

Comments (18)

MaikelChan avatar MaikelChan commented on September 26, 2024

It's weird, because the save format of Banjo-Kazooie should only be EEP. Have you tried simply changing the extension?

from bksaveeditor.

Deozaan avatar Deozaan commented on September 26, 2024

I have tried changing the extension. That didn't work for me.

I'm sorry I wasn't clear. My save file is from the Retroarch emulator.

In the meantime I opened up an issue on an N64 Save Converter repository and the repository owner seems to have determined that BKSaveEditor expects a 512 byte EEP, but the converter creates a 2048 byte EEP file for broad compatibility since most emulators don't have trouble reading a file that is longer than expected, but crash when reading a file that is shorter than expected.

That said, I've tried doing as suggested and trimming my converted EEP file down to 512 bytes and it's still not working for me.

from bksaveeditor.

MaikelChan avatar MaikelChan commented on September 26, 2024

Could you post your save?

from bksaveeditor.

Deozaan avatar Deozaan commented on September 26, 2024

Here it is. It was created with the Steam version of RetroArch using the Mupen64Plus-Next core.

Banjo-Kazooie (USA).zip

from bksaveeditor.

MaikelChan avatar MaikelChan commented on September 26, 2024

Apparently Retroarch saves a bunch of stuff inside SRM files, so it's not a proper save file as the game itself would generate. I have found this: https://github.com/drehren/ra_mp64_srm_convert, but I'm having issues converting your save. It says SRM file size is invalid.

from bksaveeditor.

Deozaan avatar Deozaan commented on September 26, 2024

I'm learning more about this as I go. It seems the "standard" for SRM files is for them to be 290 kB. Yet for some reason mine are almost all between about 200 bytes to 20 kB. I assumed the extra 270-289 kB was all just padding that my emulator was trimming out, but perhaps there's extra data in there that is missing from my SRMs for some reason.

I've been in contact with @Ninjiteu of https://github.com/Ninjiteu/N64SaveConverter/ who says that opening my save with RetroArch converted it to a 290 kB SRM file which was then able to be converted and trimmed to work with BKSaveEditor. I asked which core he used to output the 290 kB file but have not yet heard back.

from bksaveeditor.

Deozaan avatar Deozaan commented on September 26, 2024

Apparently Retroarch saves a bunch of stuff inside SRM files, so it's not a proper save file as the game itself would generate. I have found this: https://github.com/drehren/ra_mp64_srm_convert, but I'm having issues converting your save. It says SRM file size is invalid.

I used the command ./ra_mp64_srm_convert -c "./Banjo-Kazooie (USA).srm" converted.srm and it converted my save to a 290 kB file without complaint.

You can also use ./ra_mp64_srm_convert --overwrite "./Banjo-Kazooie (USA).srm" to convert in place, but I didn't want to overwrite the original file. Either way, both commands output an identical file.

But still, when I convert that 290 kB file to an EEP with N64SaveConverter and try loading the EEP in BKSaveEditor I'm told it's not a valid save. So I'm not sure the initial RA MP64 SRM Convert conversion is outputting a valid file.

EDIT: Come to think of it, the behavior of RA MP64 SRM Convert is strange. It should be "splitting" the SRM into EEP SRA MPK files. But it is taking an SRM file as input and outputting an SRM file.

If I use .\ra_mp64_srm_convert.exe -s ".\Banjo-Kazooie (USA).srm" then it outputs a 2 kB EEP file, which BKSaveEditor still tells me is not a valid save file, even if I trim it down to the first 512 bytes.

from bksaveeditor.

Deozaan avatar Deozaan commented on September 26, 2024

I made a mistake! I actually did overwrite the original file at some point while testing. Using the original 761 byte file and explicitly telling RAMP64Convert to split the file gives me an error saying invalid SRM file size.

This confirms to me that the 290 kB SRM file output was not a valid, properly formatted SRM file.

from bksaveeditor.

MaikelChan avatar MaikelChan commented on September 26, 2024

I just tested on Retroarch. It's generating 290kb files for me. And then I used your save. It was able to open it properly, and when resaving, it generated again a 290kb. More importantly, despite the size of the file, I can see with an hex editor that the file that my retroarch generated when resaving your save, contains a proper Banjo save file, which trimming to 512 bytes should work. But the file you sent, if you open it with an hex editor, you will see something that says RZIP. I don't know what's up with that, but that doesn't belong to a Banjo save. Maybe there's some save compression feature in Retroarch? I'm not too familiar with it.

from bksaveeditor.

MaikelChan avatar MaikelChan commented on September 26, 2024

Apparently yes, there's a save compression system called RZIP for saves and savestates: neil4/RetroArch-Lite@19bc12f

Saving them uncompressed would make manipulating save files easier.

from bksaveeditor.

MaikelChan avatar MaikelChan commented on September 26, 2024

This must be it.

sram

from bksaveeditor.

Ninjiteu avatar Ninjiteu commented on September 26, 2024

from bksaveeditor.

Ninjiteu avatar Ninjiteu commented on September 26, 2024

from bksaveeditor.

Deozaan avatar Deozaan commented on September 26, 2024

This must be it.

sram

Ah, yes! I had that option enabled. Thank you!

The save files I sent you @Deozaan should work with the Banjo Save editor. Did you try it?

Yes, I tried it and it worked, thank you, @Ninjiteu. But I wanted to be able to reproduce converting my saves to proper EEPs and vice versa, which I wasn't able to do because I had enabled SaveRAM compression in RetroArch's setting.

from bksaveeditor.

Deozaan avatar Deozaan commented on September 26, 2024

So I suppose the question now becomes, can BKSaveEditor be modified to support files larger than 512 bytes so I don't have to manually trim my saves each time?

from bksaveeditor.

MaikelChan avatar MaikelChan commented on September 26, 2024

I totally understand that having to convert the file every time is a pain, but I would prefer not to do that for the following reasons:

  • The program makes some checks to make sure the file opened is a proper BK save file. This includes checking if it's 512 bytes and checking for some data patterns inside the file. This is to prevent being able to open saves from other games or any other kind of file that could cause unexpected results like crashes or corrupting said file.
  • I'm not familiar with the SRM file format, but since it can contain other data like memory packs, I can't be sure that the EEPROM data is located always at the beginning of the SRM file, which if it's not always the case, it could also cause corruption issues. And even if it loads the file correctly, resaving the file would lose all the extra data the SRM file contains.
  • I consider it out of the scope of this program. The main function is to be able to open an edit a BK save file. Most emulators save that file as is, and if you extract the save file from a cartridge with a special hardware, you'll also obtain a valid file the save editor should be able to open. In fact, the screenshots I added to the README show the contents of the save in my actual BK cartridge. So I don't think adding support for arbitrary formats that some software might use is the right approach.

from bksaveeditor.

Deozaan avatar Deozaan commented on September 26, 2024

Understood.

Putting aside the request for SRM support, even being able to read 2048 byte EEP files (and simply discarding/ignoring everything after 512 bytes) would make life easier if the SRM -> EEP converter a person used outputs 2 kB files instead of 512 byte files.

But to be fair to you and your time, if I'm assessing the actual use-case, my intention for BKSaveEditor will be to use it once or twice to keep myself from having to start the game over if I miss one of the missable RetroAchievements for the game. So I can put up with the inconvenience of manually trimming the file a couple times if needed. 🙂

Thank you very much for your help!

from bksaveeditor.

MaikelChan avatar MaikelChan commented on September 26, 2024

No problem, hopefully the editor ends up being useful!

from bksaveeditor.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.