[TI ASM] chaining hooks

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

Post Reply
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

[TI ASM] chaining hooks

Post by King Harold »

I know it is possible (*points at omnicalc and other Detached products*) but how do you chain hooks?
You probebly check some bits to see whether they are in use, but what do you do then? You can't just stuff it into your app, thats writeback to archive, and that's evil.
Just guessing here but its that where appvars and saferam are for?

Edit: yay 500th post :D
Patori
Maxcoderz Staff
Posts: 1479
Joined: Sat 18 Dec, 2004 3:51 am
Location: Toledo, Ohio, USA

Post by Patori »

keyhooks?

*shivers* I remember making a keyhook program that changed the value of a key pressed to another value.

I installed it on tons of kids i didnt like's calcs before a test.

They were pissed.

And probably failed.
Currently coming up with a new signature idea... since my forum avatar changer was killed by an upgrade...
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

That's cool, but, how do you chain them?
User avatar
elfprince13
Sir Posts-A-Lot
Posts: 234
Joined: Sun 11 Dec, 2005 2:21 am
Contact:

Post by elfprince13 »

install them on top of the others, check if you want to handle it, otherwise pass it to the next program...
Andy_J
Calc Master
Posts: 1110
Joined: Mon 20 Dec, 2004 10:01 pm
Location: In the state of Roo Fearing
Contact:

Post by Andy_J »

The Detached Solutions apps are specifically written to work with each other. Omnicalc checks for MirageOS and Symbolic, and if either (or both) are installed it passes the appropriate key presses to the appropriate routines in them.

If you want true universal chaing, look at my ShortCut app (which I unfortunately haven't touched in almost two and a half years). Chaining is not 100% reliable; my method borrows 6 bytes of RAM which may be in use for something else at the time (but probably aren't). If I ever do get off my lazy bum and rewrite it, I'll try to find a better method to call the other keyhook.

Essentially, it checks to see if the hook is in use when it installs its own hook. If it is, it stores the old hook page and address into its appvar. Then, when the hook fires, it does its own business and checks the appvar to see if there is a hook to chain. If there is, it checks the $83 validation byte and chains to the hook if the byte checks out.
ImageImage
Image
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Ok, thanks, wouldnt that mean you have to map some memory (the page of the other app) somewhere and then do something funny to get it at $4000?
Post Reply