🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

A C64 Game - Step 62

posted in New Old Things
Published August 04, 2012
Advertisement

Time to get rid of the old ugly Get Ready display. And put up a new ugly one.



The changes are pretty easy, we modify our DisplayGetReady routine to display the sprites now (and store the old sprite settings):

;------------------------------------------------------------
;displays get ready
;------------------------------------------------------------
!zone DisplayGetReady
DisplayGetReady
          lda #40
          sta LEVEL_START_DELAY
          lda #0
          sta SPRITE_JUMP_POS
          lda VIC_SPRITE_ENABLE
          sta SPRITE_ENABLED
          lda VIC_SPRITE_MULTICOLOR
          sta SPRITE_MULTICOLOR

          ldx #0
          ldy #0

-
          lda GETREADY_SPRITE_X_POS,x
          sta VIC_SPRITE_X_POS,y
          lda VIC_SPRITE_COLOR,x
          sta SPRITE_COLOR,x
          lda GETREADY_SPRITE_COLOR,x
          sta VIC_SPRITE_COLOR,x
          iny
          iny
          inx
          cpx #8
          bne -

          lda #110
          sta VIC_SPRITE_Y_POS
          sta VIC_SPRITE_Y_POS + 2
          sta VIC_SPRITE_Y_POS + 4
          sta VIC_SPRITE_Y_POS + 6
          sta VIC_SPRITE_Y_POS + 8
          sta VIC_SPRITE_Y_POS + 10
          sta VIC_SPRITE_Y_POS + 12
          sta VIC_SPRITE_Y_POS + 14

          lda #SPRITE_G
          sta SPRITE_POINTER_BASE
          lda #SPRITE_E
          sta SPRITE_POINTER_BASE + 1
          sta SPRITE_POINTER_BASE + 4
          lda #SPRITE_T
          sta SPRITE_POINTER_BASE + 2
          lda #SPRITE_R
          sta SPRITE_POINTER_BASE + 3
          lda #SPRITE_A
          sta SPRITE_POINTER_BASE + 5
          lda #SPRITE_D
          sta SPRITE_POINTER_BASE + 6
          lda #SPRITE_Y
          sta SPRITE_POINTER_BASE + 7

          lda #0
          sta VIC_SPRITE_MULTICOLOR
          lda #$80
          sta VIC_SPRITE_X_EXTEND
          lda #$ff
          sta VIC_SPRITE_ENABLE
          sta VIC_SPRITE_EXPAND_X
          sta VIC_SPRITE_EXPAND_Y
          rts

...and then the remove routine to restore the previous sprite setup:


          lda SPRITE_ENABLED
          sta VIC_SPRITE_ENABLE
          lda SPRITE_MULTICOLOR
          sta VIC_SPRITE_MULTICOLOR
          lda SPRITE_POS_X_EXTEND
          sta VIC_SPRITE_X_EXTEND
          lda SPRITE_POS_X
          sta VIC_SPRITE_X_POS
          lda SPRITE_POS_X + 1
          sta VIC_SPRITE_X_POS + 2
          lda SPRITE_POS_Y
          sta VIC_SPRITE_Y_POS
          lda SPRITE_POS_Y + 1
          sta VIC_SPRITE_Y_POS + 2


          ldx #0
          stx VIC_SPRITE_EXPAND_X
          stx VIC_SPRITE_EXPAND_Y
-
          ldy SPRITE_ACTIVE,x
          cpy #0
          bne +

--
          lda SPRITE_COLOR,x
          sta VIC_SPRITE_COLOR,x
          inx
          cpx #2
          bne -
          jmp GameLoop

+
          lda TYPE_START_SPRITE,y
          sta SPRITE_POINTER_BASE,x
          jmp --

Also, remember, tables, tables, tables?

One more for the sprite setup:

GETREADY_SPRITE_X_POS
          !byte 32,67,102,147,182,217,252,48 - 16

GETREADY_SPRITE_COLOR
          !byte 2,3,4,5,6,7,8,9


step62.zip

Previous Step Next Step

Previous Entry A C64 Game - Step 61
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement