Omnimaga
Calculator Community => TI Calculators => Axe => Topic started by: Builderboy on February 25, 2011, 04:16:49 pm
-
So since I am already using L1,L3,L4,L5 and L6 in PortalX, and yet I am looking into adding greyscale to certain parts. The best way would be to move the variables from L1 into L2 with the Realloc() function, but doesn't use large portions of L2? What areas are safe? If I turn off interrupts, will that make L2 safer, or still dangerous?
-
I believe this is what you would have to do:
di
Backup all the contents that you will override in L2 somewhere.
<stuff using L2>
Restore the backup
ei
-
Yeah if you absolutely need these areas, you'll have to store their content elsewhere prior using them, such as an arbitrary buffer inside your program or in a temporary appvar.
-
Oh yeah, if you use a program you can just put a Zeros(768) at the end of your program for another buffer. ;D
-
You can use LnReg to transfer interrupt control from Mirage to the OS. That would be the best idea since you can still use OS routines that require interrupts.
-
Oh yeah, if you use a program you can just put a Zeros(768) at the end of your program for another buffer. ;D
O.O
/me hugs ztrumpet
-
You can use LnReg to transfer interrupt control from Mirage to the OS. That would be the best idea since you can still use OS routines that require interrupts.
O.O
* ZTrumpet hugs Quigibo
How does that work?
-
You can use LnReg to transfer interrupt control from Mirage to the OS. That would be the best idea since you can still use OS routines that require interrupts.
O.O
* ZTrumpet hugs Quigibo
How does that work?
LnReg sets interrupt mode 1 (normal), which doesn't use any extra data. Mirage uses a custom interrupt (mode 2) whose data needs to be stored in RAM. Mirage uses L2 for this data.
So I don't have to start another topic, is L2 completely safe to use if I do FnOff or LnReg? I use L2 for an array in Contra, and for some reason when I mess with it enough, Return returns straight to the homescreen instead of back to the Mirage shell.
And in other cases, Return returns back to Mirage, but the GUI is messed up (none of the program names appear, though I can still run them).
-
There is one byte in statVars (I assume L2) that mirage uses. That is $8A4A. If it is 1, mirage quits to the homescreen. If it is anything else, it doesn't.
-
Ah, that must be it. Mirage uses it regardless of whether interrupts are enabled?
EDIT: StatVars is $8A3A... Is that it?
EDIT2: Lol, just realized I can type "statvars" with one hand :D
-
Yep, $8A4A is the spot. This is the shortest possible (clean) program demonstrating my point.
xor a
jr nc, $+2
nop
inc a
ld ($8A4A), a
ret
When you run it, you essentially quit mirage.
Edit:
Ok, now it's the smallest.
-
Is that byte the only byte Mirage uses? I got the impression that it also used a lot more bytes for local variables and stuff, which is why the gui gets messed up
-
*bump*
Anybody know the answer? The mirdevinfo (http://www.detachedsolutions.com/mirageos/develop/mirdevinfo.zip) package doesn't mention this at all.
-
FolderBytes = StatVars+5 ;(10) Holds one data byte for each folder, which
; contains the number of progs in the folder,
; (99 Max), and then Bit 7 is used to notate
; if the folder is either Open or Closed.
That's probably what's causing your problems. I don't know why that couldn't have been stored somewhere else (e.g., in cmdShadow, and use statVars for the cached appvar settings instead) but there you have it.
-
Thanks! I didn't see that.
Guess I could save that into the program somewhere and restore it before exiting. What does the (10) mean?
-
It means there are 10 bytes there that you might have to back up and restore. I'm pretty sure Mirage has a limit of 10 folders.
-
Hmm... I read that as having 99 folders... What does the 99 mean?
EDIT:Never mind, 99 programs per folder :D
-
Hmm... I read that as having 99 folders... What does the 99 mean?
EDIT:Never mind, 99 programs per folder :D
Oh, that's what I thought too. That makes sense then :)
But according to BrandonW (according to _player1537 (on Cemetech (http://www.cemetech.net/forum/viewtopic.php?p=141526#141526))), Mirage might use more of it in future versions.