Draw grid of faces

This commit is contained in:
greg 2016-12-14 03:42:46 -08:00
parent 861a99e494
commit 3ef2eee4b0

View File

@ -64,7 +64,7 @@ Start:
; size (last argument) depends on color mode
; location is beginning of VRAM
Load_Block_to_VRAM Face, $0000, (8*2*2),
Load_Block_to_VRAM Tiles, $0000, (8*2*2),
; put character data at VRAM $0000, tile data at $0400
lda #$04
@ -76,11 +76,24 @@ Start:
lda #%00000001
sta $212c ; enable bkg 1,
ldx #$04f0 ; load $0400 (VRAM address of tile data)
stx $2116 ; and store it to VRAM address word-sized register
ldx #$0400 ; load $0400 (VRAM address of tile data)
TileLoadLoop:
ldx #$0001
stx $2118 ;store tile map entry to the address specified in $2116 - this increments or not based on 2115
stx $2116 ; store VRAM address of tile data to VRAM address word-sized register
lda #$01 ; smile tile
sta $2118 ;store tile map entry to the address specified in $2116 - this increments or not based on 2115
inx
stx $2116
lda #$00 ; blank tile
sta $2118
inx
cpx #$0780 ; $400 - $780 seems to be limit of snes screen tile memory
bne TileLoadLoop
lda #%10000001 ; enable NMI and joypads
@ -112,11 +125,13 @@ mainloop:
.org 0
.section "TileData"
Face:
Tiles:
;blank tile
.db $00, $00, $00, $00, $00, $00, $00, $00
.db $00, $00, $00, $00, $00, $00, $00, $00
;face
.db %00000000
.db %00000000