open_agb_firm icon indicating copy to clipboard operation
open_agb_firm copied to clipboard

Super Mario Advance 4 crashes

Open StariaRose opened this issue 1 year ago • 15 comments

Apologies if this was already reported or is a known issue, I didn't find anything about it online.

Specs: Nintendo 3DS XL (old, not new). Latest CFW and open_agb_firm release.

Steps to reproduce:

  1. Download SMA4 and put it on the SD card.
  2. Load firmware, run game.
  3. Play for a good bit.

Expected Result: Game should work normally.

Actual result: Game screen goes entirely black after a bit. I've noticed it within 1-2 minutes. The game seems to be working in the background, the audio continues, I tried pausing and moving around and heard appropriate sounds etc..

Other Notes: This happened with SMA4's original release and VC/Switch Online releases with the E-Reader levels in them.

StariaRose avatar Oct 14 '24 02:10 StariaRose

Verify the hash against this database and make sure the save file is not corrupted. If it matches you may be one of the unlucky people to have defective hardware. @Dartz150 had 2 of them and was able to fix them by reflowing his FCRAM chips.

profi200 avatar Oct 14 '24 13:10 profi200

Ah yeah, it matched all right. Guess I'm one of the unlucky ones. No clue how to reflow an FCRAM chip lol. Thanks anyways!

StariaRose avatar Oct 16 '24 22:10 StariaRose

It's not clear to us how this problem even happens because affected consoles show no signs of RAM failure in 3DS mode. Maybe it just can't keep up with the timings however then a reflow should not make a difference. ¯_(ツ)_/¯

profi200 avatar Oct 17 '24 00:10 profi200

Yeah... most GBA games run just fine, so this felt weird to me.

StariaRose avatar Oct 18 '24 03:10 StariaRose

Is it reproducable and is there a specific place in the game where this happens often? I could try this myself on a known good 3DS later.

profi200 avatar Oct 18 '24 10:10 profi200

Lurker here, with another idea: there seem to exist several [removed link] either intended to test actual hardware (original GBAs, not DS/3DS backward compatibility) or to test emulator compatibility. Maybe one can be used as a memtest ?

...or maybe a memtest can be somehow implemented ?

vpelletier avatar Oct 18 '24 11:10 vpelletier

Is it reproducable and is there a specific place in the game where this happens often? I could try this myself on a known good 3DS later.

It's reproducible across the original release, the Virtual Console release and the Switch release. It happens not in a specific place, but at a specific time, about a few minutes in. At one point, this was in the E-Reader's first level. Another case, it was in the E-Reader castle thingie where I was idling for a bit. Another, in level 1-1 while I was going slow. Finally, in level 1-4 when I was going fast. I noticed around the same time ish for each, though I didn't measure.

Lurker here, with another idea: there seem to exist several [removed link] either intended to test actual hardware (original GBAs, not DS/3DS backward compatibility) or to test emulator compatibility. Maybe one can be used as a memtest ?

...or maybe a memtest can be somehow implemented ?

Actually, that's interesting. I have no idea why/how this is a memory issue at all XD (I'm not super knowledgeable about low level stuffs). No 3DS game has had this issue, I'm trying to remember if I had the issue with Sonic Rush for DS or if I'm misremembering. I'll try it and lyk!

StariaRose avatar Oct 18 '24 14:10 StariaRose

Hey, so I did go ahead and test it across a few games:

  • Sonic Advance 2
  • Mario vs. Donkey Kong
  • Final Fantasy IV Advance
  • And, of course, SMB4 Advance, this time the Wii/Wii U VC version. I had all three ROMs (original, VC and Switch) present on the system.

I also played some DS and 3DS games:

  • Sonic Rush
  • Kingdom Hearts 358/2 Days
  • Kingdom Hearts DDD
  • Fire Emblem Fates

No sign of failure, with similar playtimes for each (though MvDK was a bit shorter). The E-Reader levels were there and I played a few successfully.

I hesitate to close this issue on my own yet, because I'm not sure if it'll show its face again and I just got lucky. I'll continue to test though, and with other games too.

StariaRose avatar Oct 29 '24 18:10 StariaRose

Ah, i forgot about this issue because i had too many other things in my head the last few weeks. I will test that game probably this evening. If it does crash however i can't promise a fix because this is extremely hard to debug. But at least there are only few things that could make it crash.

profi200 avatar Oct 30 '24 11:10 profi200

I played through the entire first world with a fresh savegame and no hangs, glitches or blackscreens. So yeah, i can't reproduce this. However i used the european version with language set to german. Sometimes the language setting can influence unstable games.

profi200 avatar Oct 31 '24 12:10 profi200

wow, this caught my attention. I had no idea about 3DS VC behaving like that on certain units.

If SMA4 behaves correctly on DS mode through GBARunner2/3 on said O3DS XL, then it's probably got to do with GBA Slot access timing issue interfering between both the DMA engines as well the FCRAM (as GBA's EWRAM). It's almost as if a DMA (3) device takes ownership and interlocks with FCRAM.

Maybe Nintendo knew about this and did patches by adjusting the FCRAM timings on GBA on the fly to overcome the GBA timing issues across different FCRAM vendors.

This is pure conjeture, but maybe intercepting GBA Slot2-EWRAM timing patches on SMA4, & replacing them with the above ones, will fix said game for all 3DS models.

Also the reasoning of the interlocks between FCRAM & DMA, is because the FCRAM itself can't keep up with DMA, and will incorrectly interlock with VRAM's /RD , /WR lines, inducing the DMA (3) bug. Thus, as a workaround, increasing the FCRAM timings will likely fix the issues.

cotodevel avatar Nov 02 '24 15:11 cotodevel

FCRAM is only used for the hardware cart emulator. That means every time the GBA hardware wants to read ROM it will actually read from FCRAM. That RAM is a little wonky in general with people starting to report actual defects like bit flips and the much more common one being broken lines (cracked solder balls ect.).

And there is this mystery of GBA mode breaking in random games at random places. For example i mentioned how Dartz150 had 2 broken units. They both passed RAM testing in 3DS mode but they both had weird bugs in GBA mode. Some Pacman game he had to test for GBARunner3 development had the sound setting stuck at off every time the game is booted. The other one was a background animation being frozen in a Mega Man game. Other than that the games behaved normally. All of these weird bugs did go away after he reflowed the FCRAM chips.

profi200 avatar Nov 03 '24 11:11 profi200

And? FCRAM has different timings for a reason, to provide 3DS/DS/GBA backwards compatibility across different brands.

So my point stands. Adjusting FCRAM timings will fix issues in certain units where the FCRAM hardware may be wearing out or where a game may freeze due to GBA Slot2 timings.

cotodevel avatar Nov 03 '24 16:11 cotodevel

If it's ok to ask, I wasn't able to find much about reflowing the FCRAM online. Would one of you know how to do it?

Either way, open_agb_firm is incredible work thus far. Thanks so much!

StariaRose avatar Nov 03 '24 17:11 StariaRose

I'm not going down the rabbit hole of patching games Supercard style when this will cause issues with games and it's not clear if this will fix the issue. Nintendo intended it to work without any modification to games.


If it's ok to ask, I wasn't able to find much about reflowing the FCRAM online. Would one of you know how to do it?

The short version is you heat up the chip and board until the solder balls melt which is usually used to solve defects like cracked solder balls. If you want a full guide maybe @Dartz150 can help. Keep in mind it's not a beginners job. It's easy to damage your 3DS.

profi200 avatar Nov 04 '24 11:11 profi200