Page 1 of 1

[TI ASM] interrupt disapearing after BASIC prog

Posted: Sat 03 Feb, 2007 10:06 am
by King Harold
I made a little program that displays my name at the bottom of the screen whilst in the homescreen, and ONLY there, well - cool, but sometimes during a BASIC program that does:

Code: Select all

0->X
Repeat 0
Disp X
X+1->X
End
It disappeared. Well actually it was still there, but the calc switched to IM 1.
Why does it do that?!

Edit: in fact every BASIC prog seems to do this

Posted: Sat 03 Feb, 2007 1:41 pm
by LolBbq
I think TI-BASIC requires the calc's interrupts and only the calc's interrupts to run correctly. Many menus and functions of the TI-OS are inaccessible when you run IM 2, for example, when I run my own TSR, and then try to graph something, it gives me an ERR:SYNTAX or something and then destroys the TSR and switches back to IM 1.

Posted: Sat 03 Feb, 2007 2:03 pm
by King Harold
That is strange though isn't it.. Not to mention annoying

Posted: Sat 03 Feb, 2007 3:00 pm
by LolBbq
It sort of makes TSRs not worth programming... :(

Posted: Sat 03 Feb, 2007 3:25 pm
by King Harold
There has got to be a way to make them stay though
(What about a call to your program at $0038?)

Edit: oh, no, ROM page 0 is always mapped to $0000..

Posted: Sat 03 Feb, 2007 3:37 pm
by LolBbq
You mean rewrite the code at $0038 so that when it runs in IM 1 it calls whatever you want to? It's a bit impractical, since TI as pretty much stuffed that area full of code and there's no saferam there.

Posted: Sat 03 Feb, 2007 4:19 pm
by Dwedit
Maybe use a key hook instead of interrupts. If you hook into the part where it scans the keyboard (I think it's getKeyHookPtr), you can get effects like an interrupt, but no TIOS interrupting it.

Posted: Sat 03 Feb, 2007 4:23 pm
by King Harold
It doesn't run at a constant time, but I could use that to re-install the interrupt ;)

@LolBbq: one could replace jr $006A \ in a,(4) by call Label \ nop, then have the code at $006A in your interrupt, end with in a,(4) and then jp to $003C
BUT it's ROM so we can't do that.. And you can't even map an other page to it..