Jump to content

Recommended Posts

I saw a thread that mentioned skipdraw with color. I can't find a listing of it. What does the multi-color skipdraw routine look like?

Share this post


Link to post
Share on other sites

You just have to add the color data read/write before reading the graphics data. And in the skip branch waste the similar amount of cycles.

Share this post


Link to post
Share on other sites

This is what I have, but I end up with each line of the sprite being different colors, but the colors shift as he moves up and down.

 

I'm setting up a pointer at the top like this

LDA #HeroGraphicsColor
sec
sbc Hero_YPosFromBot
clc
adc #C_P0_HEIGHT - #1
STA HeroGraphicsColorPtr

 

This is how I'm doing skipdraw in the kernal

 

;skipDraw
; draw Hero sprite:
lda	 #C_P0_HEIGHT-1	 ; 2
dcp	 Hero_Y			; 5 (DEC and CMP)																																																																			  
bcs	 .doDrawHero_E1_e	   ; 2/3 ; should be bcs
lda	 #0			  ; 2
.byte   $2c			 ;-1 (BIT ABS to skip next 2 bytes)(kinda like a jump)
.doDrawHero_E1_e:
lda	 (Hero_Ptr),y	  ; 5
sta	 GRP0
lda	 (HeroGraphicsColorPtr),y	  ; 5
sta	 COLUP0

Share this post


Link to post
Share on other sites

I see what I was doing wrong. I wasn't setting up the pointers properly. Below is the code I used that worked.

 

LDA #<HeroGraphicsColor
sta HeroGraphicsColorPtr
LDA #>HeroGraphicsColor
sta HeroGraphicsColorPtr+1

lda HeroGraphicsColorPtr
sec
sbc Hero_YPosFromBot
clc
adc #C_P0_HEIGHT - #1
STA HeroGraphicsColorPtr

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...