Jump to content
IGNORED

Can we change the color of one row using pfcolors?


Random Terrain

Recommended Posts

I see that we can change the color of 11 rows all at once like this:

 

 pfcolors:
$f5
$f5
$f5
$43
$f5
$f5
$f5
$f5
$f5
$f5
$f5
end

 

But is there a way to change the color of just one row while a game is running without needing to download special files and using Superchip RAM?

 

 

 

Thanks.

Edited by Random Terrain
Link to comment
Share on other sites

I see that we can change the color of 11 rows all at once like this:

 

 pfcolors:
$f5
$f5
$f5
$43
$f5
$f5
$f5
$f5
$f5
$f5
$f5
end

 

But is there a way to change the color of just one row while a game is running without needing to download special files and using Superchip RAM?

 

 

 

Thanks.

Define a new list with one color changed. It won't waste any more space to use one more, or even three more, as pfcolor tables are always stored in ROM in groups of four.

Link to comment
Share on other sites

Define a new list with one color changed. It won't waste any more space to use one more, or even three more, as pfcolor tables are always stored in ROM in groups of four.

Thanks. I should have been more clear. I wanted the player to be able to change the color of any row.

Link to comment
Share on other sites

Define a new list with one color changed. It won't waste any more space to use one more, or even three more, as pfcolor tables are always stored in ROM in groups of four.

Thanks. I should have been more clear. I wanted the player to be able to change the color of any row.

That depends. Do you need to be able to change any/all row colors arbitrarily, or will any single row on the whole screen be changeable to a fixed color? Either can be done without Superchip RAM or additional files, but the former will require 12 of your variables.

Link to comment
Share on other sites

That depends. Do you need to be able to change any/all row colors arbitrarily, or will any single row on the whole screen be changeable to a fixed color? Either can be done without Superchip RAM or additional files, but the former will require 12 of your variables.

Yes, any row arbitrarily. The player would move to any row, double-click the fire button and the color of that row would cycle to the next color in the list according to the color chart. Players could have 11 lines of different colors that they could change any time they want.

 

Would that also work with no_blank_lines?

 

 

Thanks.

Link to comment
Share on other sites

That depends. Do you need to be able to change any/all row colors arbitrarily, or will any single row on the whole screen be changeable to a fixed color? Either can be done without Superchip RAM or additional files, but the former will require 12 of your variables.

Yes, any row arbitrarily. The player would move to any row, double-click the fire button and the color of that row would cycle to the next color in the list according to the color chart. Players could have 11 lines of different colors that they could change any time they want.

 

Would that also work with no_blank_lines?

 

 

Thanks.

Yes, you can use pfcolors with no_blank_lines.

 

Setting up the table will take a little time, however, as the variables in 2600basic.h need to be reorganized for it to work (I forgot that the pfcolor tables need values stepping by 4 in ROM, or in this case, RAM.) So I guess I lied, you do need this one file, but it can be done.

Link to comment
Share on other sites

Setting up the table will take a little time, however, as the variables in 2600basic.h need to be reorganized for it to work (I forgot that the pfcolor tables need values stepping by 4 in ROM, or in this case, RAM.) So I guess I lied, you do need this one file, but it can be done.

If you get a chance, I'd like to be able to try it even if I have to download a file. If other people want to play with the code, they can always download the special file too.

 

 

Thanks.

Link to comment
Share on other sites

OK, here is the 2600basic.h file, with some sample code.

 

You only get variables a-o. Variables p-z do not exist in this file. The row colors 1-11 may be set by row1, row2, row3, up to row11. "Row 0" is the topmost row, and it must be set using COLUPF every frame. Note that these variables are stored in RAM stepping by 4 bytes at a time, so if you instead want to assign mycolor to row "a", where a=1-11, you can do the following:

 

temp1=(a-1)*4:row1[temp1]=mycolor

 

The sample program (included) shows one way to set row colors based on a cursor position.

colorchange.zip

Edited by batari
Link to comment
Share on other sites

OK, here is the 2600basic.h file, with some sample code.

 

You only get variables a-o. Variables p-z do not exist in this file. The row colors 1-11 may be set by row1, row2, row3, up to row11. "Row 0" is the topmost row, and it must be set using COLUPF every frame. Note that these variables are stored in RAM stepping by 4 bytes at a time, so if you instead want to assign mycolor to row "a", where a=1-11, you can do the following:

 

temp1=(a-1)*4:row1[temp1]=mycolor

 

The sample program (included) shows one way to set row colors based on a cursor position.

Thanks! I tried it and it works great. Now I'll insert it into the program I'm working on and see what happens.

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