Jump to content
IGNORED

Player1colors question


Recommended Posts

Posted (edited)

I'm working on a game that uses player1colors. Sometimes I want a sprite to be multi-color, but sometimes i want to make a very large sprite a single color, and sometimes change that single color too.  Redefining player1color for every single color would take up a lot of ROM like this.  I came up with this idea where I store all the color data in RAM and use a loop.  I was wondering if anyone has a better way of doing the same thing.

 

 

 asm

 ldx #<r000

 stx player1color

 lda #>r000

 sta player1color+1

end

 w000=$42

 for temp5 = 0 to 27 : w001[temp5] = r000 : next

Edited by Krunkcleanup
Link to comment
Share on other sites

I'm using bB with a few snippets of asm here and there (my asm skills aren't that good yet).

Normally with player1colors you need to set a color value for every line.

 player1color:

 $42

 $42

 $42

 $42

 $42

 $42

 $42

 $42

 $42

 $42

end

 

If I want a different color, i need a whole new table of repeated values like the last one, and when they're all the same color it seems pretty wasteful for ROM.

Without the player1colors kernel option, you just set COLUP1 = $42, which takes up very little ROM in comparison.

So I could make a sub for redefining all the colors, but I still would need a table of repeated values for color I want the sprite to be.

When I want a sprite to be one color, what I need is to change one value, and have them all be that value without manually doing each line.

I'm not sure how the kernel works, but I'm guessing that it advances the location of the color data every scanline by 1.

  • Like 1
Link to comment
Share on other sites

Sorry, I mistakenly thought you meant that you'd have a separate variable for each line and not just one for the whole thing.   I don't see why you couldn't use a single variable and define each one line as that variable... and then just change that variable as needed.  I'm hoping to do something similar with my very early attempt at a first game with different colored enemies (with different stat blocks).   Have you tried doing that in a quick build?  I might try it later tonight myself.

Link to comment
Share on other sites

17 hours ago, Krunkcleanup said:

If I want a different color, i need a whole new table of repeated values like the last one, and when they're all the same color it seems pretty wasteful for ROM.

Without the player1colors kernel option, you just set COLUP1 = $42, which takes up very little ROM in comparison.

So I could make a sub for redefining all the colors, but I still would need a table of repeated values for color I want the sprite to be.

When I want a sprite to be one color, what I need is to change one value, and have them all be that value without manually doing each line.

I'm not sure how the kernel works, but I'm guessing that it advances the location of the color data every scanline by 1.

 

Are you trying to make a multicolored sprite mixed with a single colored sprite?  I use player1colors in my first just started WIP project and I tried it with the single color player0 sprite and it worked fine using COLUP0.   Are you trying to mix multicolor and single within the same coding color sprite?   Or do you just want a variety of sprite colors with the same shape like in old NES games?  If it's the latter then you can just instead use the monochrome player0 sprite for color swaps and leave the player1 sprite for characters you want to have multiple colors at the same time.

Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...