Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,544,439
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 05-06-24 05:16 AM
Guest: Register | Login

0 users currently in Computing | 1 guest

Main - Computing - Nintendo 64 Saving New thread | New reply


Zeld
Posted on 03-19-07 06:22 PM (rev. 2 of 03-21-07 09:34 PM) Link | Quote | ID: 16966


Paragoomba
Level: 21

Posts: 4/73
EXP: 49442
Next: 501

Since: 02-21-07

Last post: 6108 days
Last view: 6020 days
I need to know how to program a save/load routine for Nintendo 64 saves, specifically of the Flash RAM type. I'm working on a complete Co-operation mode for the single player of Jet Force Gemini, with allowance of up to 4 players and none of that crap about only getting to play as Floyd (i.e. you'll be able to use any character you like in co op as long as they've been unlocked in multi player).

I have the single player menu working in multi player, so co op mode is accessed by entering a regular multi player battle, pausing the game, and accessing the map from the pause menu and selecting the level to play on. For some reason the game lets you start on Goldwood or the Spawnship (the Spawnship seems to be the better and safer choice). Much of the game freezes with more than one player being in single player mode. I'm not sure what causes these bugs, and I'll work those out later if necessary.

Ultimately, the problem with these freezes is that it causes you to have to start co op mode all over, because you can't save your progress. The game saves your one player mode progress, and since the addresses for co op mode are different, it ends up saving the wrong thing, often overwriting one of your good files (it saves to the last save slot selected in single player I believe). I need to write a new save routine that saves to none of those slots, but rather, some unused Flash RAM space, in order to use a custom load routine once multi player is started to resume co op play from before any fatal crashes.

I'm not sure if there's a trick to writing a save or load routine, but I don't know what the hell the address is for Flash RAM whether there's a trick to it or not. Is the address generated? I thought there was a possibility that the DMA registers contained a varying address for the Flash RAM. If the address is static, then what is it? I did as much research as I could and found next to nothing. From what I could gather, including reading some emulator source, the address is 0x88000000 or 0xA8000000, favoring the latter.

I've written several test programs to read from these addresses and dump the contents into the RDRAM for my viewing pleasure, but when I disassemble the actual emulator itself, the x86 recompile says it loads an immediate zero value and stores to my RDRAM address rather than actually loading from read/write memory. Where the hell is the Flash RAM? Where is HyperHacker when you need him?

Before I submit, I thought of something else:

If I write my own save/load routine, would the emulator be smart enough to recognize it? I debugged the saving process and it seems the space the emulator allocates for SRAM loads the data that is being saved in small blocks, stores it to the save file, and then clears the block. So, the area the emulator allocates for SRAM isn't a full SRAM attachment, and it seems like the emulator only uses it when it recognizes a real save routine. I suppose I phrased that badly, but the point is I'm worried the emulator will assemble a write to a save file as a write to some useless temporary address.

EDIT:

I'd still like to know where the Flash RAM is, if anyone can tell me, but I don't really need it anymore. The hack is complete and I can save/load one player mode and/or co op mode files into co op mode and/or one player mode. In other words, the files are all nice and compatible now, thanks to a 296 line gameshark code. Yes, that's "too long", but it's also "worth it".

HyperHacker
Posted on 03-25-07 07:46 AM Link | Quote | ID: 19007

...
Level: 73

Posts: 33/1220
EXP: 3369418
Next: 116450

Since: 03-25-07
From: no

Last post: 6101 days
Last view: 6085 days
Hacking something into a game, you'd be much better off just finding what areas get loaded to/from the flash memory and modifying those, then if necessary calling the routines that do the loading/saving.

Main - Computing - Nintendo 64 Saving New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.024 seconds. (329KB of memory used)
MySQL - queries: 37, rows: 47/48, time: 0.020 seconds.