Responds to NMI

This commit is contained in:
greg 2016-12-07 10:52:25 -08:00
parent d8ddf3bba6
commit 67ccdc3052

View File

@ -2,11 +2,28 @@
.include "snes_init.asm" .include "snes_init.asm"
.include "my_custom.asm" .include "my_custom.asm"
.EQU PalNum $0000
.BANK 0 SLOT 0 .BANK 0 SLOT 0
.org 0 .org 0
.section "Vblank" .section "Vblank"
VBlank: VBlank:
Set_A_8_XY_16
stz $2115
ldx #$0400 ;setup VRAM
ldx #$0400
stx $2116 ; VRAM address
lda PalNum
sta $2119
lda $4210 ; clear NMI flag
rti rti
.ENDS .ENDS
@ -52,6 +69,8 @@ Start:
Set_A_8_XY_16 Set_A_8_XY_16
stz PalNum
Load_Palette_Color $00, $00 Load_Palette_Color $00, $00
Load_Palette_Color $00, $00 Load_Palette_Color $00, $00
Load_Palette_Color $00, $00 Load_Palette_Color $00, $00
@ -84,21 +103,25 @@ Start:
Enable_NMI_And_Joypad Enable_NMI_And_Joypad
mainloop: mainloop:
Spin_Loop $02
Reset_Palette_Offset wai
Load_Palette_Color $00, $00 wai
Load_Palette_Color $00, $00 wai
Load_Palette_Color $00, $00 wai
Load_Palette_Color $ff, $0a wai
wai
wai
wai
wai
wai
wai
wai
Spin_Loop $02 lda PalNum
clc
Reset_Palette_Offset adc #$04
Load_Palette_Color $ff, $a0 and #$1c
Load_Palette_Color $00, $00 sta PalNum
Load_Palette_Color $00, $00
Load_Palette_Color $ff, $0a
jmp mainloop jmp mainloop