chore: clear leftover sprite VRAM data on sprite change

This commit is contained in:
Rekai Nyangadzayi Musuka 2022-05-13 11:59:33 -03:00
parent bf59ac0d92
commit 594a5ad74a
1 changed files with 2 additions and 0 deletions

View File

@ -730,6 +730,8 @@ fn initVertSpriteTuple() VertSpriteTuple {
} }
fn loadSprite(comptime kind: usize, comptime i: usize, sprite: *OAM.Attribute) void { fn loadSprite(comptime kind: usize, comptime i: usize, sprite: *OAM.Attribute) void {
GBA.memset32(GBA.SPRITE_VRAM, 0, 0x8000); // Clear Sprite VRAM
sprites[kind][i].load(); sprites[kind][i].load();
sprite.setSize(sprites[kind][i].size()); sprite.setSize(sprites[kind][i].size());
} }