nba-emu / NanoBoyAdvance

A cycle-accurate Nintendo Game Boy Advance emulator.
GNU General Public License v3.0
955 stars 53 forks source link

Prefetcher is disabled on 0x20000 boundary #347

Open alyosha-tas opened 5 months ago

alyosha-tas commented 5 months ago

When the prefetcher encounters a 0x20000 boundary, it stops fetching and behaves as though it is full (it will use up whatever it has in the buffer and does not fetch anymore until the cpu fetches the next instruction after the buffer has emptied.)

Here is a test demonstrating this:

https://github.com/alyosha-tas/gba-tests/blob/master/prefetcher/bounday_test_1.gba

It seems as though an extra cycle delay happens on the cpu fetch if the buffer is not empty. This is the only way I can pass the test, otherwise I get 40 instead of the required 41. I haven't completely worked out the details yet.