196
TI Z80 / Screenshot Hook
« on: August 19, 2011, 07:23:48 pm »
I saw this post and decided to write a keyhook that puts the current LCD contents into a pic variable.
You install it by running prgmASAVEPIC and take a screenshot by holding [ON] and pressing a key from 0 to 9.
Currently it has basic functionality and is useful, but be aware of the following limitations (some of which I can fix and will probably get around to fixing):
Although you can start it, there is currently no specific way to get rid of the hook. If you have CalcSys, you can manually reset bit 0 of (iy+$34), but other than that the only way to get rid of it is a RAM reset. (Though it works fine and there's no reason to remove it )
It doesn't chain the current keyhook. It can probably be successfully chained, though, so for apps that have keyhooks and do chain them, you just have to install my hook first.
It overwrites picvars in RAM, and will not take a screenshot if the picvar is in flash. These are both intended.
It will create picture variables as necessary, but will not if there is no free RAM. This is only a problem when free RAM could be gotten, i.e. when the edit buffer is open (e.g. on the home screen). I'll look into making it work when the edit buffer is open.
It saves 768 bytes. If the picvar chosen already exists, but is only 767 bytes (as viewed from the memory menu), it will overwrite 12 bytes of RAM. Make sure they are 779 bytes.
It only works within bcall(_GetKey). This is a result of using the GetCSC hook. You probably won't be able to use it in most of your favorite ASM programs.
In the ASM programs in which it does work, it carries the potential to break them if they expect OP1 to remain intact across a bcall(_GetKey)
Other than that, have fun! (The .8xp is a binary, .8xv is Mimas-format source (yay!), and .z80 is said .8xv converted)
(Note that you can use it on the homescreen or in the program editor, you just need to have a 779-byte picvar in RAM first.)
You install it by running prgmASAVEPIC and take a screenshot by holding [ON] and pressing a key from 0 to 9.
Currently it has basic functionality and is useful, but be aware of the following limitations (some of which I can fix and will probably get around to fixing):
Although you can start it, there is currently no specific way to get rid of the hook. If you have CalcSys, you can manually reset bit 0 of (iy+$34), but other than that the only way to get rid of it is a RAM reset. (Though it works fine and there's no reason to remove it )
It doesn't chain the current keyhook. It can probably be successfully chained, though, so for apps that have keyhooks and do chain them, you just have to install my hook first.
It overwrites picvars in RAM, and will not take a screenshot if the picvar is in flash. These are both intended.
It will create picture variables as necessary, but will not if there is no free RAM. This is only a problem when free RAM could be gotten, i.e. when the edit buffer is open (e.g. on the home screen). I'll look into making it work when the edit buffer is open.
It saves 768 bytes. If the picvar chosen already exists, but is only 767 bytes (as viewed from the memory menu), it will overwrite 12 bytes of RAM. Make sure they are 779 bytes.
It only works within bcall(_GetKey). This is a result of using the GetCSC hook. You probably won't be able to use it in most of your favorite ASM programs.
In the ASM programs in which it does work, it carries the potential to break them if they expect OP1 to remain intact across a bcall(_GetKey)
Other than that, have fun! (The .8xp is a binary, .8xv is Mimas-format source (yay!), and .z80 is said .8xv converted)
(Note that you can use it on the homescreen or in the program editor, you just need to have a 779-byte picvar in RAM first.)