fixed uninitialized per-tile hscroll table
authorJohn Tsiombikas <nuclear@member.fsf.org>
Sun, 5 Jul 2020 09:49:07 +0000 (12:49 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Sun, 5 Jul 2020 09:49:07 +0000 (12:49 +0300)
test.asm

index eff673c..4c51874 100644 (file)
--- a/test.asm
+++ b/test.asm
        sep #$20
        .a8
        .endmacro
+       .macro I16
+       rep #$10
+       .i16
+       .endmacro
+       .macro I8
+       sep #$10
+       .i8
+       .endmacro
 
        ; VMEM map
        ; 0000: tilemap for BG1 (32x32 4bpp: 512b)
@@ -256,6 +264,16 @@ snes_init:
        stz REG_MDMAEN
        stz REG_HDMAEN
        stz REG_MEMSEL
+
+       ; clear vmem
+       I16
+       setreg REG_VMAINC, $80
+       ldx $4000
+@clear:        stz REG_VMDATAL
+       stz REG_VMDATAH
+       dex
+       bne @clear
+       I8
        rts
 
        ; cartridge header