DaveTCode / GBADotnet

A C#/net core GBA emulator
MIT License
20 stars 1 forks source link

Index out of bounds exception during Konami Kart Racers #63

Closed DaveTCode closed 2 years ago

DaveTCode commented 2 years ago

Was running in release mode so only got the bare bones of exception info saying it was in DrawTextModeScanline

DaveTCode commented 2 years ago

Tested this now, the failure is accessing vram for tile 769 just as a race starts. The base block is 3 and tileY is 7 and it's a large palette.

So calculation is 3 0x4000 + 769 64 + tileX (0) + 7 * 8 which is C000 + C040 + 0 + 0x38 which is 0x1_8078 and VRAM is 0x18000.

What's supposed to wrap here?

DaveTCode commented 2 years ago

Fix this by assuming that out of bounds reads caused by tiles get ignored rather than wrapped. Played a full race and everything looked fine