michelhe / rustboyadvance-ng

RustBoyAdvance-NG is a Nintendo™ Game Boy Advance emulator and debugger, written in the rust programming language.
MIT License
596 stars 23 forks source link

Not passing mgba memory tests #94

Open michelhe opened 4 years ago

michelhe commented 4 years ago

image

xTibor commented 4 years ago

The failing S8 (U16 load) tests may be the most visible one among these, I have a feeling those ones are causing the striped graphics corruptions in Doom 2 and in the demoscene stuff from SFC.

michelhe commented 4 years ago

I think doom 2 specifically has something to do with the fact that I'm allowing u8 stores to VRAM.

michelhe commented 4 years ago

From GBATek

Writing 8bit Data to Video Memory
Video Memory (BG, OBJ, OAM, Palette) can be written to in 16bit and 32bit units only. Attempts to write 8bit data (by STRB opcode) won't work:
Writes to OBJ (6010000h-6017FFFh) (or 6014000h-6017FFFh in Bitmap mode) and to OAM (7000000h-70003FFh) are ignored, the memory content remains unchanged.
Writes to BG (6000000h-600FFFFh) (or 6000000h-6013FFFh in Bitmap mode) and to Palette (5000000h-50003FFh) are writing the new 8bit value to BOTH upper and lower 8bits of the addressed halfword, ie. "[addr AND NOT 1]=data*101h".