Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: pimathbrainiac on February 25, 2013, 12:26:17 pm
-
So... I got an appvar read from the archive (using files) in my VVVVVV port! The appvar is a 768 byte list and uses the following code:
!If (GetCalc("vVVVSAV",Y0)->V)
Output(0,0,"CREATING SAVE")
Pause 1000
GetCalc("vVVVSAV",768)
GetCalc("vVVVSAV",Y0)->V
2->{L+3}->{L+7}
0->{L+0}->{L+1}->{L+2}->{L+8}->{L+9}->{L+18}->{L+19}
8->{L+5}->{L+14}
48->{L+6}->{L+15}
0->{L+10}->{L+12}
0->{L+11}->{L+13}
Copy(L,V,768)
End
Copy(V,L,768)
{L+0}->A
{L+1}->B
{L+2}->C
{L+3}->D
{L+5}->F
{L+6}->G
{L+7}->H
{L+8}->I
{L+9}->J
{L+10}->K
{L+11}->L
{L+12}->M
{L+13}->N
{L+18}->S
{L+19}->T
{L+14}->X
{L+15}->Y
It works completely and totally!
My problem: I have a 9600 byte appvar (made by another program I made) for the maps. It works in the normal way (without files)
GetCalc("vPIMAP")->U
But when I use it with files:
GetCalc("vPIMAP",Y1)->U
It goofs up the graphics routine and everything that calls that appvar.
Any help?
-
I haven't really looked through the problem, but here's a little trick you can use to optimize your code a whole lot -
{L+0}->A
{L+1}->B
{L+2}->C
{L+3}->D
{L+5}->F
{L+6}->G
{L+7}->H
{L+8}->I
{L+9}->J
{L+10}->K
{L+11}->L
{L+12}->M
{L+13}->N
{L+18}->S
{L+19}->T
{L+14}->X
{L+15}->Y
can be replaced with
Copy(L,{E}9CFB,16)
where {E} is the EE key where your comma is on the keypad.
In addition,
Copy(L,V,768)
can generally be replaced with
Copy(L,V)
becuase 768 is the default size argument.
-
I haven't really looked through the problem, but here's a little trick you can use to optimize your code a whole lot -
{L+0}->A
{L+1}->B
{L+2}->C
{L+3}->D
{L+5}->F
{L+6}->G
{L+7}->H
{L+8}->I
{L+9}->J
{L+10}->K
{L+11}->L
{L+12}->M
{L+13}->N
{L+18}->S
{L+19}->T
{L+14}->X
{L+15}->Y
can be replaced with
Copy(L,{E}9CFB,16)
where {E} is the EE key where your comma is on the keypad.
False. First of all, there are alphabetical gaps in those variable names. Secondly, variables are two bytes large and a Copy() won't skip every other byte. Lastly, it's very bad practice to use raw hex values as variable pointers, the ° operator exists for a reason.
-
Whoops, my bad! Ignore my post, please.
-
GetCalc("vPIMAP",Y1)->U
It goofs up the graphics routine and everything that calls that appvar.
Any help?
Remove the useless "->U" and replace all your "U" after this line by "Y1". And don't forget to archive your appvar.
-
GetCalc("vPIMAP",Y1)->U
It goofs up the graphics routine and everything that calls that appvar.
Any help?
Remove the useless "->U" and replace all your "U" after this line by "Y1". And don't forget to archive your appvar.
I've tried that and I get a parenthesis error in my graphics routine (the one Pt-On that uses that) and only there (and ALL I did was replace all the Us with Y1s, I didn't even touch the parenthesis!)
-
Ah i guess ypu put a Y1 in your pt-on, which is forbidden.
Then, try this instead (sorry, i am on android so i'll post a weird syntax)
Getcalc appvpimap,Y1
Copy Y1,L3,768
Then replace all the Us (the ones i said shoumd become y1s) by L3
-
But the appvar is 9600 bytes, not 768!
-
Lol, then you have two solutions: either create a temporary appvar with the right size (pointed by U) and copy the archived one in it, or copy 8 bytes of data to a temporary buffer like L3 before each pt-on. For example, if your Pt-On is like Pt-On(X,Y,f(Y1)), you can replace it by Copy(f(Y1),L3,8):Pt-On(X,Y,L3)
-
It's crazy slow to make a TMP copy every time you draw. Also, files work form RAM. :P
-
Well, I gots this working with Hayleia over IRC! Thanks y'all!
-
Nice to hear !
-
It's crazy slow to make a TMP copy every time you draw. Also, files work form RAM. :P
They work from RAM but there is no point using them from RAM :P
And it may be too slow for moving tilemaps but he only draws the map once (I guess) and then only the player moves, so the loss of speed isn't a big problem here.
Well, I gots this working with Hayleia over IRC! Thanks y'all!
Great :D