profi200 / open_agb_firm

open_agb_firm is a bare metal app for running GBA homebrew/games using the 3DS builtin GBA hardware.
GNU General Public License v3.0
860 stars 42 forks source link

Implement ROM mirroring #16

Closed Powerlated closed 3 years ago

Powerlated commented 3 years ago

![Uploading 09172BDB-F2EA-4AF2-95D4-DB6F36043370.jpeg…]() Currently, ROM out of bounds is padded with 0xFF, instead of mirroring the existing ROM space. For a test, see mgba’s Game Boy Advance test suite.

profi200 commented 3 years ago

That picture is a redirect to this issue.

If you are referring to mirrors of the ROM area (0x08000000, 0x0A000000, 0x0C000000) this is unfixable and how the hardware is implemented. Otherwise i'm not sure what you mean.

profi200 commented 3 years ago

I asked endrift about this and the only games which actually do mirror the ROM are the Classic NES series which do use this as AP (but strangely they work fine even with 0xFF padding). Every other game doesn't respond to out of bounds reads resulting in getting "open bus" data back. This is something i can't fix because the hardware gamecart emulation uses fixed size 16 and 32 MiB and there is no way i can reduce that to mimic open bus behavior.

The failing SRAM tests i can't fix either. Seems like a hardware bug for unaligned reads/writes. The H-Blank test failing is also failing on a GBA SP with the exact same result (one off) so i think that test should actually be a pass.