jsmolka/gba-tests

NES test 002 causes bios write operation

7FM opened this issue · 3 comments

7FM commented

First of all, thank you a lot! Your test suite helped a lot of finding bugs in our emulator.
During searching for more bugs we have encountered that test t002 causes a bios write(instead of DMA registers) which is caused by the address calculated here: https://github.com/jsmolka/gba-suite/blob/3c6b5c5680b01ddc28b5a4853db9a43ea7889c63/nes/nes.asm#L63

this calcualtion results in the address: 0x2 E000 0000 -> 0xE000 0000 -> 0x000 0000 (ignoring 4 MSBits)
I would suspect that replacing the multiplication by an addition or OR would resolve the issue.
Also some code for checking if the DMA transfer worked would be nice and might look something like that:

        adr     r0, .dma_pass
        ldr     r1, [r0]
        cmp     r1, 0xFF
        bne     f002

I haven't tried compiling it yet. Feedback is highly appreciated.

Thanks in advance!

7FM commented

Just tried it: compiling works fine & execution as well, now a DMA transfer gets triggered. I will submit a PR, hope it works for you as well.

Thanks for that! It was supposed to be that way (just a small typo on the German keyboard).

7FM commented

can reläte :D