Cult-of-GBA / BIOS

A Game Boy Advance replacement BIOS.
MIT License
90 stars 7 forks source link

Oversight in reset_modes routine #2

Closed ladystarbreeze closed 3 years ago

ladystarbreeze commented 3 years ago

The reset_modes routine in entrypoint.s unconditionally switches to System mode before branching to the address in the link register. However, the routine is reused to reset registers on cold boot; since the CPU has never been in System mode by the time this function is called, the value of the System mode link register is undefined and the BIOS will crash.

fleroviux commented 3 years ago

Fixed in https://github.com/Cult-of-GBA/BIOS/commit/32bf0990f6de1807a875f81538f4fe49f20465cf