Spinloop working

This is enough spinlooping for there to be a noticable gap between the
screen colors
This commit is contained in:
greg 2016-12-01 02:23:44 -08:00
parent 7776d8a7ec
commit 8f6343f5f5
1 changed files with 57 additions and 14 deletions

View File

@ -1,28 +1,71 @@
.include "header.inc" .include "header.inc"
.include "snes_init.asm" .include "snes_init.asm"
.BANK 0 SLOT 0
.ORG 0
.SECTION "maincode"
VBlank: VBlank:
RTI rti
Start: Start:
Snes_Init ; Initialize the SNES Snes_Init ; Initialize the SNES
sep #$20 ; set A register to 8-bit ;stz $1337
stz $2121 ;store zero in memory
lda #%10000000 ; force Vblank by turning off screen lda #%11000000 ;3-green, 5-red
sta $2122
lda #%00000111 ;blank, 5-blue, 2-green
sta $2122
lda #$0f
sta $2100 sta $2100
; load 16-bit color into color data register $2122 lda #$3
lda #%11100000 ;low byte of green oye:
sta $2122 dea
lda #%00000000 ;high byte of green cmp #$00
sta $2122 bne oye
lda #%00001111 ; End Vblank set brightness to 0b1111 (=100%)
sta $2100 ; store it to Screen Display Register
; loop forever ldx #$03
Forever: lvl3:
jmp Forever lda #$ff
lvl2:
xba
lda #$ff
lvl1:
dea
cmp #$00
bne lvl1
xba
dea
cmp #$00
bne lvl2
stz $1337
dex
txa
cmp #$00
bne lvl3
stz $2121 ;store zero in memory
lda #%00111111 ;3-green, 5-red
sta $2122
lda #%00000000 ;blank, 5-blue, 2-green
sta $2122
lda #$0f
sta $2100
mainloop:
jmp mainloop
.ENDS
.BANK 1
.ORG 0
.SECTION "TileData"
.ENDS