*NEW* DOWNLOAD ~ Version 2.2: http://www.mediafire.com/?b7lrwb19s64ybod *NEW*
*NEW* Checksum Algorithm in C++: Lufia SRAM Checksum Algorithm C++ Code Program *NEW*
*UPDATED* README FILE (for how to use this program properly): readme.txt *UPDATED*
Changelog:
- added support for modifying 32 spell slots instead of 24 (run over the lists at your own risk!)
- added the readme file to the .rar package and updated the readme as well
ABOUT:
Wanting to edit your SRAM values for Lufia & The Fortress of Doom, but getting errors? Well, that is due to the checksum value for each of the 3 save slots. This program will tell you what the given value is (two bytes found after the "FILE0?" for each of the slots), and it will calculate the checksum for your save slot and give you a decimal value (remember, it is little endian 16-bit) that needs to be entered into the offset 0x06 & 0x07 for said slot. Hopefully I will update this to actually calculate and automatically replace the value for you if it does not match (ie. if you updated some stuff). But I am currently working on finding where all the data is stored (and how) in the SRAM.
Above: Checksum program in action, v.1.1!
Above: Version 2.0
Above: Version 2.1
Version 1.0: Original version would only checksum save slot 1 (File00) and would give you a message about success or failure.
Version 1.1: Update to version 1.0 that will checksum all 3 save slots, but took away the message saying success or failure.
Version 2.0: Massive update to version 1.1 that adds controls to display all items, spells, as well as the party's items, spells, and other info - as well as gold. The controls for modifying items, spells, and gold are there but have not been implemented yet.
Version 2.1: Redid the interface to use tabs instead of those horrid checkboxes. Currently intended to be the final iteration of the program.
Current Issues: Adding functionality for value modification.
Proposed Features: As mentioned before, I hope to update this so that you will be able to modify anything saved into your SRAM (at this point, it looks like HP, MP, GOLD, Spells and Items), and let it calculate the checksum for you, and then it will automagically replace the checksum value.
Special Thanks to KingMike from RHDN (http://www.romhacking.net) for using ASM to trace the algorithm for the checksum for me (which was awesome because he knew exactly where to look) and giving me the $6502 checksum "base starting value" as well as the algorithm for computing the checksum beyond that. Here's the code from his disassembly that was crucial to this program:
$00/9429 A0 FC 03 LDY #$03FC A:0070 X:616E Y:0000
$00/942C A6 1F LDX $1F [$00:001F] A:0070 X:616E Y:03FC
$00/942E A9 02 65 LDA #$6502 A:0070 X:0000 Y:03FC
$00/9431 18 CLC A:6502 X:0000 Y:03FC
$00/9432 7D 08 00 ADC $0008,x[$70:0008] A:6502 X:0000 Y:03FC
$00/9435 E8 INX A:4AE7 X:0000 Y:03FC
$00/9436 E8 INX A:4AE7 X:0001 Y:03FC
$00/9437 88 DEY A:4AE7 X:0002 Y:03FC
$00/9438 D0 F7 BNE $F7 [$9431] A:4AE7 X:0002 Y:03FB
$00/943A AA TAX A:592C X:07F8 Y:0000
$00/943B 7A PLY A:592C X:592C Y:0000
$00/943C AB PLB A:592C X:592C Y:0000
$00/943D 28 PLP A:592C X:592C Y:0000
$00/943E 60 RTS A:592C X:592C Y:0000
UPDATE: Version 2.2 is available for download here: http://www.mediafire.com/?b7lrwb19s64ybod , but it has only been tested on a Windows Vista platform (x64) and was built with Visual Studio 2008 using either .NET Framework 2.0 or 3.5, I can never remember... And there are some serious bugs that will make it crash when buttons are hit without a file being loaded. I haven't touched the program in 9 months, so hopefully I can start working on it a little bit again in my free time. I hope to do some minor updates and fixes and release the entire source code/project file in the near future. Stay tuned!
Also, a point of note about magic...
You are given 32 bytes to work with for magic for each character, except that your list must end with the 0x00 or "END OF LIST" byte. Otherwise, you will spill over into the next character's list. So if you fill up all 32 bytes of the Hero's spell list, he will also pick up all of Lufia's spells. And if you fill up all 32 bytes of Lufia's spell list, both Hero and Lufia will pick up all of Jerin's spells! And if you fill up Jerin's spell list, all three characters will pick up what look like proper spells (0x01 - 0x37) in SRAM, until it runs across a 0x00 END OF LIST character/byte. I managed to get the Hero up to 9 pages of spells with this method!
ALSO! If you give your character "Elf" magic (to warp to Elfrea) before you have Jerin in your party -- do not talk to Artea! The game will freeze when he tries to give Jerin his old bow...
Have a suggestion? Drop me a line at: vegetaman@gmail.com