1
0
mirror of https://github.com/cc65/cc65.git synced 2025-08-15 06:27:36 +00:00

more info about kernal functions that silently restore vectors

git-svn-id: svn://svn.cc65.org/cc65/trunk@2864 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
izydorst
2004-01-02 23:16:01 +00:00
parent 77e667c14d
commit 83342c6ee9

View File

@@ -1648,6 +1648,13 @@ void remove_hook(void) {
<p> <p>
In your <tt/main/ function you should call <tt/hook_into_system()/ but <em/after/ all calls to GEOS In your <tt/main/ function you should call <tt/hook_into_system()/ but <em/after/ all calls to GEOS
kernal (like <tt/DoMenu/, <tt/DoIcons/, etc.) - right before passing control to the <tt/MainLoop()/. kernal (like <tt/DoMenu/, <tt/DoIcons/, etc.) - right before passing control to the <tt/MainLoop()/.
Be warned that vectors are most likely to be changed by GEOS kernal also by other functions (like
<tt/GotoFirstMenu/, <tt/DoDlgBox/ and its derivatives etc.). It depends on what kernal functions
you use and which vectors you altered. Unfortunately there is no exact list for GEOS 2.0, a complete
list for GEOS 1.x can be found in A. Boyce's Programmers' Referenece Guide mentioned before. Most of
information contained there should be still valid for GEOS 2.0. When calling a function that restores
the vector you should add a <tt/hook_into_system()/ call right after it.
<p>
It is critical to restore old vector values before exiting the program. If you have more than one It is critical to restore old vector values before exiting the program. If you have more than one
place where you call <tt/exit()/ then it might be worth to register <tt/remove_hook/ function to place where you call <tt/exit()/ then it might be worth to register <tt/remove_hook/ function to
be called upon exiting with <tt/atexit(&amp;remove_hook);/ call. This way you will ensure that be called upon exiting with <tt/atexit(&amp;remove_hook);/ call. This way you will ensure that