[TI ASM] Interrupt problems.. (Ti-84)

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

CoBB
MCF Legend
Posts: 1601
Joined: Mon 20 Dec, 2004 8:45 am
Location: Budapest, Absurdistan
Contact:

Post by CoBB »

The keyboard is read by polling, so you’ve no chance to ‘invalidate’ keypresses. If the system interrupt is run, it will inevitably process them.
cjgone
Regular Member
Posts: 83
Joined: Tue 18 Apr, 2006 5:33 am
Location: Washington->UC Berkeley '15

Other

Post by cjgone »

What method programs such as "OmniCalc" use to keep the [on] log, double-click the prgm button, so that they do not trigger the key and run after the calculator is turned off? (I guess you could do the [on] key one using port 4, and checking the bit that tells if the onkey is being depressed)

My ISR is using $9A9A... Not sure if it is deleted\modified or not.
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Is appbackupscreen safe for tsr's?

Post by driesguldolf »

I dont understand the first question, but the second one, about your tsr located at $9A9A i do understand:

It is perfectly safe as long as you dont play asm games or run apps, as they will most likely use that area without checking if an interrupt is installed there. there's no way (i can think of) to get around that =(, aside using apps and hooks (wich I believe to be horribly complicated)...

If your using it as an isr it is perfectly safe (because ti-os doesn't us it)

btw to avoid misunderstandings:
-tsr= terminate and stay resident programs
-isr= interrupt service routine
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

What method programs such as "OmniCalc" use to keep the [on] log, double-click the prgm button, so that they do not trigger the key and run after the calculator is turned off? (I guess you could do the [on] key one using port 4, and checking the bit that tells if the onkey is being depressed)
keyhook, you can check the ON key with some port (3 or something)
User avatar
calc84maniac
Regular Member
Posts: 112
Joined: Wed 18 Oct, 2006 7:34 pm
Location: The ex-planet Pluto
Contact:

Post by calc84maniac »

The guy said
using port 4, and checking the bit that tells if the onkey is being depressed
It happens to be bit 3 of port 4.
~calc84maniac has spoken.

Projects:
F-Zero 83+
Project M (Super Mario for 83+)
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

It wouldn't work very well with a keyhook though, but there is a flag that allows the ON key to be processed by the keyhook
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

wikiTI wrote:Port Number: 04h

Function: Interrupting Device Identification and Memory Map Control

This port serves two purposes. When read it indicates the device that triggered an interrupt. When written it sets the memory map mode and hardware timer speed. When an interrupt is triggered, it should be cleared by reseting the corresponding bit in port 3. Otherwise, it will continously call the interrupt code once interrupts are reenabled with ei.
[edit]
Read Values

* Bits 0~2 and 4~7 are set according to which device triggered the running interrupt.
o Bit 0: Set if pressing the ON Key triggered the interrupt.
o Bit 1: Set if the first hardware timer triggered the interrupt.
o Bit 2: Set if the second hardware timer triggered the interrupt.
o Bit 4: Link activity generated an interrupt.
o 83+SE / 84+ only: Bit 5: First crystal timer has expired.
o 83+SE / 84+ only: Bit 6: Second crystal timer has expired.
o 83+SE / 84+ only: Bit 7: Third crystal timer has expired.
* Bit 3 is reset if the ON key is being pressed, set otherwise.
*points at last line of quote*
User avatar
Jim e
Calc King
Posts: 2457
Joined: Sun 26 Dec, 2004 5:27 am
Location: SXIOPO = Infinite lives for both players
Contact:

Post by Jim e »

It sucks when two people arguing are in complete agreement, it's hard to see who's winning.

cjone's post is ancient. However what king harold mentioned was the key hook. Prior to any key being processed, the key hooks code gets executed, it can the decide what to do in the situation that key was pressed. It could check what menu you are on, allowing for double taps. Or if on is being pressed like [on]+Log. When the hooks code is done, it can either tell TI-OS that it should continue processing the key or tell it that it doesn't need to anymore.

There's a whole bunch of hooks that can add a plethora of functionality. All documented on the wiki. There's an article with the meaning of life there somewhere, and it's probably AfD.
Image
cjgone
Regular Member
Posts: 83
Joined: Tue 18 Apr, 2006 5:33 am
Location: Washington->UC Berkeley '15

Post by cjgone »

Kk, thanks.. I've figured out about the hooks, now I just need to learn how to implement them.


However, I must ask, if Tsrs are automatically killed via archiving, graphing, etc. what purpose do they serve( on the calculator that is)?
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

well you could re-enable them in a hook.. say, a keyhook, it normally gets executed quite quickly after the TSR is disabled, except when a BASIC program is running - if you really want to run your 'TSR' there you could enable it in a parser hook

so they serve the purpose you give them
Post Reply