jsmolka / gba-tests

A collection of Game Boy Advance tests.
MIT License
101 stars 9 forks source link

BIOS test 2 fail #5

Closed DenSinH closed 4 years ago

DenSinH commented 4 years ago

I was running the test against my own emulator, and couldn't figure out why it would go wrong. I checked the registers, and the value in R1 was not the value it was supposed to read, but it was 1 instead. First I thought the m_word macro might not have worked, but it did.

When checking out what happens in the SQRT SWI I found that it jumped to 0x404 in the BIOS, and ran these instructions right after the handler: image the SWI changes the value in R1!

It fails on some other emulators as well, and probably passes on mGBA because it HLEs the BIOS. You can probably simply fix the test by using R0 instead of R1, or some other register that is not changed.

fleroviux commented 4 years ago

+1 the test fails with the real BIOS. verified in mGBA and NBA using a real BIOS.

jsmolka commented 4 years ago

Thanks for this. I am kinda mad because I read the GBATEK documentation and it never mentioned r1. Now the only things left which don't work on real hardware are the 32k memory mirrors.