jsmolka / eggvance

A Game Boy Advance emulator.
https://smolka.dev/tags/eggvance
GNU General Public License v3.0
65 stars 1 forks source link

Pokemon Sapphire hangs at the end of the intro. #4

Closed fleroviux closed 3 years ago

fleroviux commented 4 years ago

image

Tested with a japanese ROM and a 1.1 USA ROM. In both cases the game will hang at the end of the intro scene.

jsmolka commented 4 years ago

This is caused by the bundled replacement BIOS. Everything is fine with the real one.

fleroviux commented 4 years ago

Doesn't happen in NBA or mGBA with the same BIOS.

jsmolka commented 4 years ago

Weird. The only thing I could think of is a wrongly initialized register.

jsmolka commented 3 years ago

This turns out to be a pretty interesting issue. I was able to find the infinite loop thanks to the pokemon disassembly project. Turns out that there is a null pointer dereference in this function which results in a bios read (it's described really well in the comment). The bug has been fixed in Emerald, that's why I never noticed it.

Now I just have to find out why the cached BIOS value is garbage ¯\_(ツ)_/¯

jsmolka commented 3 years ago

Fixed improving bad reads https://github.com/jsmolka/eggvance/commit/213c7ab0a18502125b725536c433da3bf90d0b84.

fleroviux commented 3 years ago

Neat. Your DMA open bus isn't quite right yet, though. Successful 16-bit reads should mirror the value in the MSW of the bus register. If I recall correctly the game Lufia relies on this in the intro.

jsmolka commented 3 years ago

I will look into it, thank you.