Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: macweirdo on November 20, 2011, 04:39:34 pm
-
So let's say I wanted to have a way to store two bits per pixel on the screen (768 bytes of data, * 2.) into RAM so I could manipulate it. How would I go about doing this, and which safeRam areas should I use (if I use L6, I'll just end up drawing directly to the screen, but I want 4scale as well, and I know it's possible.)
The first one, I'm guessing might be L3, and everytime I want to access data, I'll just do
for bit one:
{L3}+(number of pixel)
and bit two:
{other safeRam}+(number of pixel)
so to draw the screen, I just have to do a
DispGraph(L3,other safeRam)^r
So tl;dr, which safeRam besides L3 should I use for holding the entire screen?
Thanks in advance!
-
You could wither use L6, which is the main buffer, or use L1 after Reallocating the variables elsewhere. To reallocate the variables, use something like #Realloc(L4).
Good luck. :)
-
use L6, which is the main buffer
You're serious? Waht? Doesn't that corrupt buffer drawing or something? (btw, I don't understand that statement)
Good luck. :)
Looks like I'll need it. Thanks :D
-
use L6, which is the main buffer
You're serious? Waht? Doesn't that corrupt buffer drawing or something? (btw, I don't understand that statement)
The main buffer is what gets displayed with a DispGraph. If there's something else there, that will be drawn instead.
For instance, try this code and see if you can figure out what is happening:
:ClrDraw
:255->{L6}
:rand->{L6+766}r // This is the superscript r
:DispGraph
:Repeat getKey(15)
:End
-
use L6, which is the main buffer
You're serious? Waht? Doesn't that corrupt buffer drawing or something? (btw, I don't understand that statement)
The main buffer is what gets displayed with a DispGraph. If there's something else there, that will be drawn instead.
For instance, try this code and see if you can figure out what is happening:
:ClrDraw
:255->{L6}
:rand->{L6+766}r // This is the superscript r
:DispGraph
:Repeat getKey(15)
:End
So storing data there is just like doing a Pxl-On( to that buffer?
-
Kind of, yes. Pxl-On( places the sprite data in a specific arrangement on the buffer.
-
use L6, which is the main buffer
You're serious? Waht? Doesn't that corrupt buffer drawing or something? (btw, I don't understand that statement)
The main buffer is what gets displayed with a DispGraph. If there's something else there, that will be drawn instead.
For instance, try this code and see if you can figure out what is happening:
:ClrDraw
:255->{L6}
:rand->{L6+766}r // This is the superscript r
:DispGraph
:Repeat getKey(15)
:End
So storing data there is just like doing a Pxl-On( to that buffer?
Kind of. It's just another way of drawing stuff.
Remember that the data on the buffer is stored in binary, and because of this 255 = FFh = 11111111b makes 8 pixels in a row black.
-
use L6, which is the main buffer
You're serious? Waht? Doesn't that corrupt buffer drawing or something? (btw, I don't understand that statement)
The main buffer is what gets displayed with a DispGraph. If there's something else there, that will be drawn instead.
For instance, try this code and see if you can figure out what is happening:
:ClrDraw
:255->{L6}
:rand->{L6+766}r // This is the superscript r
:DispGraph
:Repeat getKey(15)
:End
So storing data there is just like doing a Pxl-On( to that buffer?
Kind of. It's just another way of drawing stuff.
Remember that the data on the buffer is stored in binary, and because of this 255 = FFh = 11111111b makes 8 pixels in a row black.
Yeah, don't worry, I have prior programming experience.
EDIT: why do I have -3 karma?
-
track your posts. You'll see which posts got derated.
-
Just an FYI, if you absolutely needed more free ram and all the buffers are taken, you could create an appvar and use that:
getCalc("appvMYAPPV", 766)->A
3->{A+766}
DispGraph(L3,A)^^r
You could also do something like
Buff(766,0)->A
3->{A+766}
DispGraph(L3,A)^^r
...although you'd be adding the buffer directly to the program itself (inflating its size by 766 bytes) + I don't think you can modify buffers you have inside the program if you turn your program into an app.
-
Two things I must mention. First, buffers are 768 bytes. Second, creating a variable of size 766 in A and storing a value to A+766 will corrupt whatever is next in memory. Why is 3 being stored there, anyway?
-
EDIT: why do I have -3 karma?
Because three people disliked this post (http://ourl.ca/7063/187581) and downvoted it.
-
EDIT: why do I have -3 karma?
Because three people disliked this post (http://ourl.ca/7063/187581) and downvoted it.
Deleted it because I recently lost respect even though that post is ancient. Thanks for taking the time to find that post :D
EDIT To prevent a double post:
Just an FYI, if you absolutely needed more free ram and all the buffers are taken, you could create an appvar and use that:
getCalc("appvMYAPPV", 766)->A
3->{A+766}
DispGraph(L3,A)^^r
You could also do something like
Buff(766,0)->A
3->{A+766}
DispGraph(L3,A)^^r
...although you'd be adding the buffer directly to the program itself (inflating its size by 766 bytes) + I don't think you can modify buffers you have inside the program if you turn your program into an app.
I'm trying to keep it as fast as I can, but I'm never making it an App, this program might be less than 1500 bytes.
Can't wait to release my first Axe game :D
-
Two things I must mention. First, buffers are 768 bytes. Second, creating a variable of size 766 in A and storing a value to A+766 will corrupt whatever is next in memory.
Ah, you're right. I was just copying down the numbers/examples that were used before. Whoops.
Why is 3 being stored there, anyway?
No reason. Prime numbers are cool, I guess.