From 0700f3d642c05713012e5f073df5884bc008d35c Mon Sep 17 00:00:00 2001 From: Ian C Date: Tue, 18 Sep 2018 14:42:07 +0000 Subject: Centered BG3. --- main.asm | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'main.asm') diff --git a/main.asm b/main.asm index 7ec67d4..e9e36d2 100644 --- a/main.asm +++ b/main.asm @@ -56,6 +56,21 @@ stz VMADDH DMA 9,zero,$18,0 + ; Clear OAM + ; +ClearOAM: + stz OAMADDL + stz OAMADDH + INDEX16 + ldx #0 +.loop + stz OAMDATA + stz OAMDATA + inx + cpx #544/2 + bne loop + INDEX8 + ; Copy 4-colour tiles ; stz VMADDL @@ -80,6 +95,9 @@ ; stz CGADD DMA 0,PaletteData,$22,PaletteDataLen + lda #$80 + sta CGADD + DMA 0,PaletteData,$22,PaletteDataLen ; Copy BG3 ; @@ -118,9 +136,19 @@ copybg3: lda #$40 sta BG3SC + lda #-52 + sta BG3HOFS + stz BG3HOFS + lda #-32 + sta BG3VOFS + stz BG3VOFS + lda #$0f sta INIDISP + lda #$81 + sta NMITIMEN + ; Loop forever. Forever: jmp Forever -- cgit v1.2.3