From 7f9f4de22827cb952b007a6d8fa0094585f43ed5 Mon Sep 17 00:00:00 2001 From: Lucas Scharenbroich Date: Mon, 21 Feb 2022 10:29:57 -0600 Subject: [PATCH] Add sprite back into initialization --- demos/zelda/App.Main.s | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/demos/zelda/App.Main.s b/demos/zelda/App.Main.s index 2829a8c..d6a9e33 100644 --- a/demos/zelda/App.Main.s +++ b/demos/zelda/App.Main.s @@ -36,7 +36,7 @@ DOWN_ARROW equ $0A ldy #0 jsl SetPalette - ldx #256 + ldx #256 ; 32 x 22 playfield (704 tiles, $580 tiles) ldy #176 jsl SetScreenMode @@ -44,23 +44,24 @@ DOWN_ARROW equ $0A jsr BG0SetUp ; Initialize the sprite's global position (this is tracked outside of the tile engine) - stz PlayerX - stz PlayerY + lda #64 + sta PlayerX + sta PlayerY stz MapScreenX stz MapScreenY -; Add a sprite to the engine and save it's sprite ID +; Add a sprite to the engine and save its sprite SPRITE_ID equ {SPRITE_16X16+1} OKTOROK equ {SPRITE_16X16+79} -; lda #SPRITE_ID ; 16x16 sprite -; ldx PlayerX -; ldy PlayerY -; jsl AddSprite -; bcc :sprite_ok -; brl Exit ; If we could not allocate a sprite, exit -;:sprite_ok -; sta PlayerID + lda #SPRITE_ID ; 16x16 sprite + ldx PlayerX + ldy PlayerY + jsl AddSprite + bcc :sprite_ok + brl Exit ; If we could not allocate a sprite, exit +:sprite_ok + sta PlayerID ; Add 4 octoroks ; lda #OKTOROK @@ -123,7 +124,7 @@ EvtLoop brl Exit :not_q brl EvtLoop - + cmp #'d' bne :not_d inc PlayerX