Jump to content
  • Advertisement
  • entries
    104
  • comments
    102
  • views
    259546

A C64 Game - Step 62

Sign in to follow this  
Endurion

1675 views

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

step62.png

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

Sign in to follow this  


0 Comments


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!