Jump to content

Photo

List of Variables Freed by kernel Options?


2 replies to this topic

#1 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,205 posts

Posted Mon Jul 16, 2018 2:55 PM

After not having success with the search function I thought to ask:

 

Is there a list of confirmed safe variables freed when using certain kernel options?

 

For instance: when using

 

 set kernel_options player1colors no_blank_lines

 

Does that mean it frees up

missile0x, missile0y, missile1x, missile1y, missile0height, missile1height



#2 RevEng OFFLINE  

RevEng

    River Patroller

  • 4,992 posts
  • Bitnik
  • Location:bottom of the stack

Posted Mon Jul 16, 2018 4:12 PM

For instance: when using
 
 set kernel_options player1colors no_blank_lines
 
Does that mean it frees up
missile0x, missile0y, missile1x, missile1y, missile0height, missile1height


No. One rule of thumb you can keep in mind is that usually the X variables stick around. Otherwise the trick of turning on ENAM0 and positioning the missile wouldn't work. The other variables are (almost?) always consumed.

If I open up 2600basic.h, I can see that "player1color = $87", and "missile1height = $87". That means when player1color is being used, it consumes that missile1height memory location.

I know from experience that player1color is actually 2 bytes, so it also consumes "$88". 2600basic.h says "missile1y = $88", so that variable is gone too.

Similar comparisons can be made to show player0color eats up missile0y and missile0height. I leave those as an exercise to the reader. ;)

#3 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • Topic Starter
  • 9,205 posts

Posted Mon Jul 16, 2018 5:22 PM

Thank you for the info RevEng.  Back to reducing playfield rows and re-writing code to use boolean flags instead of whole vars. :)






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users