0 Members and 1 Guest are viewing this topic.
...On a separate note, what is the Omnimaga lib?
I think what you are referring to chaining of hooks, like how Omnicalc and Axe can both have hooks running at the same time. Im not quite sure how to do it though ...On a separate note, what is the Omnimaga lib?
Restoring hooks is easy when you know how they work. For each hook, there is a 3 byte area of ram and a flag. The ram is 2 bytes of the address followed by the page byte. And the flag is as simple as on/off. Here's the wikiti page on the parser hook. As you can see, its ram is at $9BAC and its flag is 1, (iy + $36).As far as backing up goes, that's pretty easy. Save the three bytes as $9BAC and that flag. Then when you are done, just restore them.But chaining is a little more difficult. First, you are going to have to get the information from those areas, but save them somewhere where you can find them later (this can be difficult sometimes.) Then install your hook. Now when your hook is called you do your thing, but when you are done, you need to put the calculator right back in the state you found it and jump to the address you just saved. If you have any differences in calculator state, the other hook won't know what to do and you'll run into problems. And of course, if you need to return a value to the OS, you won't be jumping to the other hook.
Get on wabbitemu, clear your ram. Then install an app and check the memory around $9BAC. You should see mostly 00's, but there should be a few 3 byte strings. Depending on which app page those strings give, you can tell which app sent out the hook. (You can use omnicalc to figure out which app is on which page.) Then use brandonW's ti83plus.inc to figure out which hook it is.
Use smallEditRam, it will persist through most Asm programs. It's only 117 bytes, but that's enough to find code in the archive and stream it to appBackUpScreen.
Quote from: thepenguin77 on November 11, 2010, 03:35:40 pmRestoring hooks is easy when you know how they work. For each hook, there is a 3 byte area of ram and a flag. The ram is 2 bytes of the address followed by the page byte. And the flag is as simple as on/off. Here's the wikiti page on the parser hook. As you can see, its ram is at $9BAC and its flag is 1, (iy + $36).As far as backing up goes, that's pretty easy. Save the three bytes as $9BAC and that flag. Then when you are done, just restore them.But chaining is a little more difficult. First, you are going to have to get the information from those areas, but save them somewhere where you can find them later (this can be difficult sometimes.) Then install your hook. Now when your hook is called you do your thing, but when you are done, you need to put the calculator right back in the state you found it and jump to the address you just saved. If you have any differences in calculator state, the other hook won't know what to do and you'll run into problems. And of course, if you need to return a value to the OS, you won't be jumping to the other hook.Thanks, thepenquin! I had no idea of the $9BAC area.So, does anyone know which areas of RAM the hook code for Xlib, Celtic III and Omnicalc are? I want to make sure I find a safe spot for my hook code
SmallEditRam is my favorite ram location because nothing uses it. You can put a hook there and a week later, it will still be there. Appbackupscreen gets killed by almost every single asm program. Not to mention omnicalc uses it quite a bit for hook activities.I am saying put your hook code in smallEditRam because you don't have to worry about it getting overwritten.