There is a patch for SMB3 by `infidelity` that adds savestate feature:
https://www.romhacking.net/hacks/2886/
Looks like this patch was also used in some other SMB3 hacks, for example:
* Super Mario Bros. 3 (Definitive Edition v1.3)
* New Super Mario Bros 3 (Save)
* Super Mario Bros. 3 MIX REV 2B (USA)
Forementioned patch is 10 years old, with revision number 7, but it contains a serious bug that I am amazed nobody pointed out before.
This game crashes instantly, when burned into real cartridge. This does not only affect this particular hack but all other SMB3 hacks (with battery save feature added), based on this patch.
I was trying to figure out what is going on and reproduce this behavior on emulator, and when WRAM at $6000-$7fff is initialized to all zeros, all FFs or some semi-random values, the game also hangs on emu.
The direct cause of hang is this loopthat is never exit because neither NMI nor IRQ changes RAM[$010] to anything.
On emu (and probably flashcarts), when the game is first RUN, there is no savestate file, so the WRAM at $6000-$7fff is probably initialized to:
$6000-$60ff = $60
$6100-$61ff = $61
...
$7f00-$7fff = $$7f
to mimic the open-bus bevaviour, which satisfies the game to start normally.
Though on physical cart with battery, initial WRAM content is unpredictable. Even if you first initialize the RAM to the above values with some external cartridge-programmer (like kazzo), when user decides to remove the battery, we still have problem.
I did not analyze the logic of this patch, so I don't know how yet how to fix it.
Maybe some CRC of the WRAM should be stored to determine if contains good data and if not - clear it before starting, though looking at the patch notes, main problem was to find unused WRAM locations.
![Image]()
Does anyone have any contact to infidelity?
Looks like this forum:
http://acmlm.kafuka.org/board/thread.php?id=7810&page=4
where he announced all his hacks is already dead.
https://www.romhacking.net/hacks/2886/
Looks like this patch was also used in some other SMB3 hacks, for example:
* Super Mario Bros. 3 (Definitive Edition v1.3)
* New Super Mario Bros 3 (Save)
* Super Mario Bros. 3 MIX REV 2B (USA)
Forementioned patch is 10 years old, with revision number 7, but it contains a serious bug that I am amazed nobody pointed out before.
This game crashes instantly, when burned into real cartridge. This does not only affect this particular hack but all other SMB3 hacks (with battery save feature added), based on this patch.
I was trying to figure out what is going on and reproduce this behavior on emulator, and when WRAM at $6000-$7fff is initialized to all zeros, all FFs or some semi-random values, the game also hangs on emu.
The direct cause of hang is this loop
Code:
0C:A818: A9 00 LDA #$00 0C:A81A: 85 10 STA $0010 = #$00>0C:A81C: A5 10 LDA $0010 = #$00 0C:A81E: 10 FC BPL $A81C
On emu (and probably flashcarts), when the game is first RUN, there is no savestate file, so the WRAM at $6000-$7fff is probably initialized to:
$6000-$60ff = $60
$6100-$61ff = $61
...
$7f00-$7fff = $$7f
to mimic the open-bus bevaviour, which satisfies the game to start normally.
Though on physical cart with battery, initial WRAM content is unpredictable. Even if you first initialize the RAM to the above values with some external cartridge-programmer (like kazzo), when user decides to remove the battery, we still have problem.
I did not analyze the logic of this patch, so I don't know how yet how to fix it.
Maybe some CRC of the WRAM should be stored to determine if contains good data and if not - clear it before starting, though looking at the patch notes, main problem was to find unused WRAM locations.

Does anyone have any contact to infidelity?
Looks like this forum:
http://acmlm.kafuka.org/board/thread.php?id=7810&page=4
where he announced all his hacks is already dead.
Statistics: Posted by krzysiobal — Mon Jan 15, 2024 12:49 pm — Replies 0 — Views 29