Calculator Community > ASM

Miscellaneous ASM Questions

<< < (4/5) > >>

Xeda112358:
I'm fairly sure that the parser hook doesn't let you intercept non-function tokens. I could be wrong about that, but I don't think so.

E37:
If you are ok with cheating a bit, there is a somewhat easier way to accomplish it. At a glance, the statistics variables all have their own dedicated ram area. A wild guess, but they are probably in statVars. If you can find the ram area for one of these stat vars, every time your hook runs, you can set the value of that stat var to the value of tau and instead of replacing the pi with a tau, replace it with that stat var. You could install a token hook to change whatever that stat var was to the tau character. It would look just like the tau token and work like it in all cases too. The only problem is that it would mess with the value stored in that variable unless you can find a way to save and restore it.

Xeda112358:
Holy heck that is clever! So all you'd need a token hook, RawKeyHook, and parser hook.

E37:

--- Quote from: Xeda112358 on April 23, 2019, 02:10:19 pm ---Holy heck that is clever! So all you'd need a token hook, RawKeyHook, and parser hook.

--- End quote ---
I can't tell if you are being sarcastic. Given how much trouble I always have when trying to use more than one hook at a time, I suspect you are laughing at me.

Why a parser hook? Isn't that for modifying functions? I don't see why you would need one unless you are trying to disable all functions that would modify the hacked stat var's value. Since Sue Doenim has found a way using some hook or other to insert the token, it should be simple to change the stat var to tau's value then to be sure it is the correct value when it runs.

Xeda112358:
Oh, good point, I was still stuck on translating the tau tokens at parse time.

I wasn't intending to come off as sarcastic, I just went from point A to C without sharing point B, so to speak. I was thinking context hooks and whatnot, but the hooks I listed are easier to work with. "Only" those hooks seemed like a way easier task to me :P

Your idea(s) are legitimately really clever and I just got really excited when I read it (how I feel whenever I see a really clever implementation or optimization).

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version