8 void_func oldMouseVector, oldKeyVector;
11 // do something on mouse press/release
15 // call previous routine
20 // do something on key press/release
24 // call previous routine
28 void hook_into_system(void) {
29 // hook into system vectors - preserve old value
30 oldMouseVector = mouseVector;
32 oldKeyVector = keyVector;
36 void remove_hooks(void) {
37 mouseVector = oldMouseVector;
38 keyVector = oldKeyVector;
47 To make cc65 do something for you before exiting you might register
48 a function to be called using atexit call. #include <stdlib.h> then and
51 atexit(&remove_hooks);
54 cputsxy(0,1, CBOLDON "Just" COUTLINEON "a " CITALICON "string." CPLAINTEXT );
58 /* This program will loop forever though */
63 If not using atexit() you have to remember about restoring system vectors
64 right before exiting your application. Otherwise the system will most