From 3ef2eee4b0b13e872b9d07f96a57b370260735f9 Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 14 Dec 2016 03:42:46 -0800 Subject: [PATCH] Draw grid of faces --- test_gfx.asm | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/test_gfx.asm b/test_gfx.asm index 8938fdb..43624f8 100644 --- a/test_gfx.asm +++ b/test_gfx.asm @@ -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