From 788d4a884b4f1d0465e925d0686dc4374eb449b5 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Sat, 23 May 2015 18:00:49 -0400 Subject: [PATCH] Add an airplane tile. --- pewpew.asm | 23 +++++++++++++++-------- tiles.asm | 20 ++++++++++++-------- tiles.pcx | Bin 1057 -> 1231 bytes 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/pewpew.asm b/pewpew.asm index c045f86..dadd886 100644 --- a/pewpew.asm +++ b/pewpew.asm @@ -70,12 +70,18 @@ Start: ; Write something recognizable into our scratch space. jsr FillScratch - ; Start the background color as a lime green. - lda #31 - sta $23 + ; Start the background color as a sky blue. lda #16 + sta $23 + lda #31 sta $24 + ; Player's initial starting location. + lda #(256 / 4) + sta $20 + lda #((224 - 8) / 2) + sta $21 + MainLoop: @@ -110,19 +116,20 @@ LoadPaletteAndTileData: lda #32 ; Palette entries for BG2 start at 32. sta CGADDR - - lda.l PaletteData, x + lda.l UntitledPalette, x sta CGDATA inx cpx #8 ; 8 bytes of palette data. bne - ; DMA 0 source address & bank. - ldx #TileData + ldx #UntitledData stx DMA0SRC - lda #:TileData + lda #:UntitledData sta DMA0SRCBANK ; DMA 0 transfer size. - ldy #320 ; See the helpful comment in face.asm. + ; See the helpful comment in tiles.asm to find the size of the tile data. + ldy #384 sty DMA0SIZE ; DMA 0 control register. ; Transfer type 001 = 2 addresses, LH. @@ -144,7 +151,7 @@ LoadPaletteAndTileData: ; Set word address for accessing VRAM to $6000. ldx #$6000 ; BG 2 starts here. stx VMADDR - ldx #$0002 ; Stick one tile into BG2. + ldx #$0004 ; Stick one tile into BG2. stx VMDATA ; Set up the screen. 16x16 tiles for BG2, 8x8 tiles elsewhere, mode 0. diff --git a/tiles.asm b/tiles.asm index a6cb685..8b6c29e 100644 --- a/tiles.asm +++ b/tiles.asm @@ -1,13 +1,13 @@ ; Created with eKid's pcx2snes converter ; -TileData: +UntitledData: .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 .db $07, $00, $18, $07, $20, $1F, $4C, $33, $50, $2F, $86, $79, $86, $79, $80, $7F .db $E0, $00, $18, $E0, $04, $F8, $32, $CC, $0A, $F4, $61, $9E, $61, $9E, $01, $FE - .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 - .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 - .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 + .db $10, $00, $28, $10, $A8, $90, $64, $58, $E3, $DC, $30, $0F, $AC, $93, $60, $5F + .db $00, $00, $00, $00, $00, $00, $F8, $00, $80, $00, $70, $80, $0E, $F0, $01, $FE + .db $80, $00, $80, $00, $80, $00, $80, $00, $80, $00, $80, $00, $80, $00, $80, $00 .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 @@ -21,9 +21,13 @@ TileData: .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 .db $80, $7F, $9F, $60, $9F, $6F, $4F, $37, $47, $38, $20, $1F, $18, $07, $07, $00 .db $01, $FE, $F9, $06, $F9, $F6, $F2, $EC, $E2, $1C, $04, $F8, $18, $E0, $E0, $00 + .db $60, $5F, $AC, $93, $30, $0F, $E3, $DC, $64, $58, $A8, $90, $28, $10, $10, $00 + .db $01, $FE, $0E, $F0, $70, $80, $80, $00, $F8, $00, $00, $00, $00, $00, $00, $00 + .db $80, $00, $80, $00, $80, $00, $80, $00, $80, $00, $80, $00, $80, $00, $80, $00 + .db $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 -PaletteData: - .db $1F, $7C, $00, $00, $FF, $7F, $1F, $00 +UntitledPalette: + .db $1F, $7C, $00, $00, $FF, $7F, $1F, $02 -; 20 tiles (12 spaces) -; 320 bytes +; 24 tiles (8 spaces) +; 384 bytes diff --git a/tiles.pcx b/tiles.pcx index 61013f9526e08a7f429aa71e4726117a4f161763..37e2b8dd3ceb767686e4cb5a0a58aac8d6d7c6e8 100644 GIT binary patch literal 1231 zcmeHDTMmLS5S-b@#26DV!X5Nzo~?ySkob(}!QDax>=(brO$+TzcV~AtE3Toj#|{Mx z+Idm%faOV}!V8f#*n(F);TgrV0)=No9$+K%a3ACjdVNyr_KE3#6@$H3R#=OE;2nbm zo(#TWNU%gLrxHq)Ib}N5L*T$&w31`1V5;(U_0pJpmZezj`o<97ixh3 literal 1057 zcmeHDTMEN443j(tr3`k2?Et<10o*o}evCcXc~UtY%g4U@y&5cJCANjzBO53#IHP07 z;G2S1Y;UR?-bftrf-{-3#}k~5jtA%x2BjOLG)^YK9UnDb`BUABwxZh{-TEV(4uNGZ fQ{geSx1{8EZ*{UdJ7r|K%?e@ly|euSe{q2Y2D3Pd