From bf92ca0be9c1142492b99c5917df33173d200a74 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Sun, 7 Jun 2015 09:39:23 -0400 Subject: [PATCH] Add a font for digits and a fake player score. --- pewpew.asm | 36 +++++++++++++++++++++++++++++++++--- sprites32.pcx | Bin 2306 -> 2857 bytes 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/pewpew.asm b/pewpew.asm index 3ebfce7..3ab34a6 100644 --- a/pewpew.asm +++ b/pewpew.asm @@ -139,7 +139,7 @@ LoadPaletteAndTileData: lda #:SpriteData sta DMA0SRCBANK ; DMA 0 transfer size. Equal to the size of sprites32.pic. - ldx #2048 + ldx #4096 stx DMA0SIZE ; DMA 0 control register. ; Transfer type 001 = 2 addresses, LH. @@ -227,7 +227,7 @@ InitWorld: sta playerX lda #((224 - 32) / 2) sta playerY - lda #20 + lda #16 sta playerHealth ; (x-velocity, y-velocity) of 4 different player shot patterns. @@ -539,7 +539,7 @@ SpawnEnemyShips: - GetRandomByte - cmp #(224 - 32) + cmp #(224 - 32 - 8) bcs - ; Keep trying. sta enemyShipArray + 2, Y ; y. @@ -1065,6 +1065,36 @@ UpdateSprites: ; TODO: refactor into smaller pieces. bra - + + ; Sprites to show player score. + clc + lda #252 + sta $00 ; Current x. + stz $01 ; Fake score. +- + lda #64 + adc $01 + sta spriteTableStart + 2, X ; sprite number + lda $00 + sbc #7 + sta $00 + sta spriteTableStart, X ; x + lda #212 + sta spriteTableStart + 1, X ; y + ; Set priority bits so that the sprite is drawn in front. + lda #%00110000 + sta spriteTableStart + 3, X + lda #%01000000 ; Enable small sprite. + sta spriteTableScratchStart, Y + .rept 4 + inx + .endr + iny + + inc $01 + lda $01 + cmp #10 + bne - + ; Now clear out the unused entries in the sprite table. - cpx #spriteTable1Size diff --git a/sprites32.pcx b/sprites32.pcx index baf29501977e4e553c90ee0dcc272d9ba0007c24..300faa1db424d37e86b528f178a6eaf3db6ae292 100644 GIT binary patch delta 583 zcma)2!41MN40MHxD!&j9Cg9l*6Cfsw#0pHo6R`ktl7d)*8OoCn_+nbpN=R**IOm-0 zv-iv6YQbeuk$#T0R2Ow|*vvPl-KBIwfg=eAitN)C7R5qM!e)cM2Yym=dIe1)7}3Ze z=DVeo1&@JmdT)Ac6@c$<