giibiiadvance icon indicating copy to clipboard operation
giibiiadvance copied to clipboard

Rotating sprite shows garbage

Open GValiente opened this issue 3 years ago • 4 comments

Test ROM

Test ROM code

Test video

When rotating a sprite until its rotation is disabled, the emulator shows garbage.

It happens on v0.3.0 with and without a BIOS file.

GValiente avatar Dec 01 '20 14:12 GValiente

The corruption happens when the angle reaches 0, as far as I can see. However, if you take a look at the VRAM viewers, the corruption pattern is correct for the values stored in VRAM. The tiles are correct, but the attributes of the sprite in OAM are wrong.

I suspect this has something to do with the CPU emulation, not with the video emulation. I remember I had a lot of trouble with the instructions that use the barrel shifter, and the fact that the corruption happens right when angle reaches 0 makes me think it's related to that. And I suspect that https://github.com/AntonioND/giibiiadvance/issues/17 is the same issue.

Maybe the C++ compiler is using instructions that I don't emulate correctly, and I've never hit that case because I never use C++ in my tests.

AntonioND avatar Dec 01 '20 18:12 AntonioND

Actually, all of the demos that can hit angle = 0 crash when that happens...

AntonioND avatar Dec 01 '20 18:12 AntonioND

Do you have the map or elf file of the ROM?

AntonioND avatar Dec 03 '20 01:12 AntonioND

Test MAP.

Test ELF.

GValiente avatar Dec 03 '20 02:12 GValiente