+Random Terrain Posted March 19, 2008 Share Posted March 19, 2008 (edited) 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 March 19, 2008 by Random Terrain Quote Link to comment Share on other sites More sharing options...
+batari Posted March 19, 2008 Share Posted March 19, 2008 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. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 19, 2008 Author Share Posted March 19, 2008 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. Quote Link to comment Share on other sites More sharing options...
+batari Posted March 19, 2008 Share Posted March 19, 2008 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. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 19, 2008 Author Share Posted March 19, 2008 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. Quote Link to comment Share on other sites More sharing options...
+batari Posted March 19, 2008 Share Posted March 19, 2008 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. Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 19, 2008 Author Share Posted March 19, 2008 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. Quote Link to comment Share on other sites More sharing options...
+batari Posted March 20, 2008 Share Posted March 20, 2008 (edited) 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 March 20, 2008 by batari Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted March 20, 2008 Author Share Posted March 20, 2008 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.