Page 1 of 1

[TI ASM] chaining hooks

Posted: Thu 07 Dec, 2006 8:11 pm
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

Posted: Sat 09 Dec, 2006 8:17 am
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.

Posted: Sat 09 Dec, 2006 8:43 am
by King Harold
That's cool, but, how do you chain them?

Posted: Sat 09 Dec, 2006 11:05 pm
by elfprince13
install them on top of the others, check if you want to handle it, otherwise pass it to the next program...

Posted: Sat 09 Dec, 2006 11:46 pm
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.

Posted: Sun 10 Dec, 2006 9:04 am
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?