Lewis2907 Posted April 26, 2021 Share Posted April 26, 2021 Below is from the page that RT maintains. Since there are only 26 variables. Some can be reused depending on what they are for. Is there a way to correctly use Def, Const or Bit Operations as variables? That would possibly increase the number of variables past 26 like DPC+ has 35 variables and Standard Kernel has 94 variables. I know we can use temp1-6, but that is obliterated once you use drawscreen. Probably a way with ASM, but I'm not familiar with ASM to even attempt it. Hopefully what I posted makes sense, basically have more variables for the multisprite kernel ""Since the Atari 2600 only has 128 bytes of RAM, and batari Basic only has 26 bytes available for variables (depending on the kernel you are using), it is very likely that you will need to use individual bits for game state information. For example, a common use of a bit is to determine whether a game is over or still in progress. The 8 bits of a byte are numbered 0 through 7, starting from right to left, with 0 being the least significant bit (LSB) or smallest."" Quote Link to comment Share on other sites More sharing options...
+Random Terrain Posted April 26, 2021 Share Posted April 26, 2021 Speaking of bits, have you seen this part: https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#bitop_bit_of_a_reminder Quote Link to comment Share on other sites More sharing options...
Lewis2907 Posted April 26, 2021 Author Share Posted April 26, 2021 RT, Thanks. I gonna try that out and see what happens. Probably do a small example program as proof of concept. Then try to implement into larger programs. Quote Link to comment Share on other sites More sharing options...
+Karl G Posted April 27, 2021 Share Posted April 27, 2021 I'm not sure I entirely follow what you are asking. Bit operations let you use 8 individual bits of a single variable to track 8 different true/false types of conditions. Const lets you define any number of unchanging constant values in your code, which is handy for readability and maintainability of the code. Def effectively lets you hide the bit operations by giving a specific bit its own name that can be used in operations. If you give a better idea of what you are trying to do, then perhaps we could give you better information. 1 Quote Link to comment Share on other sites More sharing options...
Lewis2907 Posted April 27, 2021 Author Share Posted April 27, 2021 I attached a small program of what I'm trying to do. basically I'm trying to reuse "a" over or use as bit for random numbers or another operation I may need. I may be over thinking this. I put some notes inside the .bas program to better explain where my thought process is going with this if it works. 20210427_Mulisrptie_Bit_Ops.bas Quote Link to comment Share on other sites More sharing options...
+Gemintronic Posted April 28, 2021 Share Posted April 28, 2021 it looks like you set the cart type to 32k ROM with SuperChip RAM. That means you have a lot more variables to work with. Just, they have a weird way of accessing them. https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#superchipram 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.