Legal
@@ -129,7 +129,7 @@ everything together.
All in all, you just need to place
-#include <geos.h>
+#include <geos.h>
on top of your source.
@@ -806,7 +806,7 @@ hang on disk access. Use safe, large numbers. Note that safe IEC range is 8-31.
Disk Initialization
-GEOS has two functions for initialization ('logging' as they say on CP\M) the disk.
+GEOS has two functions for initialization ('logging in' as they say on CP\M) the disk.
OpenDisk
where
System is halted after call to
Note that it is not the same as window
@@ -1446,10 +1449,10 @@ just in the content.
Here is how single descriptor looks like:
void myMenu = {
- (char)top, (char)botom, // this is the size of the menubox
- (unsigned)left, (unsigned)right, // counting all items in current descriptor
- (char)number_of_items | type_of_menu, // number of following items ORed with
- // type of this menu, it can be either
+ (char)top, (char)bottom, // this is the size of the menubox
+ (unsigned)left, (unsigned)right, // counting all items in current descriptor
+ (char)number_of_items | type_of_menu, // number of following items ORed with
+ // type of this menu, it can be either
// HORIZONTAL or VERTICAL if you will have also bit 6 set then menu won't be closed
// after moving mouse pointer outside the menubox. You can have at most 31 items.
@@ -1583,9 +1586,47 @@ void example = {
(unsigned)address_to_store_values_at,
(char)number_of_bytes_that_follow,
(char)data,(char)data (...)
- (...) - more such definitions
- (unsigned)NULL - address of 0 ends the table
+ // more such definitions
+ (unsigned)NULL // address of 0 ends the table
};
+Intercepting system vectors
+
+It is possible to intercept and hook in the GEOS Kernal using vectors. Here is a little example:
+
+void (*oldVector)(void);
+
+void NewVectorHandler(void) {
+ // do something and at the end call the old vector routine
+ oldVector();
+}
+
+void hook_into_system(void) {
+ oldVector = mouseVector;
+ mouseVector = NewVectorHandler;
+}
+
+void remove_hook(void) {
+ mouseVector = oldVector;
+}
+
+
+In your
+That little example above intercepts
+ -
+
diff --git a/include/geos/gstruct.h b/include/geos/gstruct.h
index 5535b9abe..85e03d317 100644
--- a/include/geos/gstruct.h
+++ b/include/geos/gstruct.h
@@ -17,6 +17,8 @@
#ifndef _GSTRUCT_H
#define _GSTRUCT_H
+typedef void (*void_func) (void);
+
struct f_date { /* date in filedesctiptor */
char f_year;
char f_month;
diff --git a/include/geos/gsym.h b/include/geos/gsym.h
index da32bda93..dd1bcad4c 100644
--- a/include/geos/gsym.h
+++ b/include/geos/gsym.h
@@ -15,7 +15,7 @@
#define nameBuf char[17]
#define blockBuf char[256]
-#define zpage (char*)0x0000
+#define zpage ((blockBuf)0x0000)
#define CPU_DDR *(char*)0x00
#define CPU_DATA *(char*)0x01
@@ -85,9 +85,9 @@
#define STATUS *(char*)0x90
#define curDevice *(char*)0xba
-#define irqvec *(unsigned int*)0x0314
-#define bkvec *(unsigned int*)0x0316
-#define nmivec *(unsigned int*)0x0318
+#define irqvec (*(void_func*)0x0314)
+#define bkvec (*(void_func*)0x0316)
+#define nmivec (*(void_func*)0x0318)
#define APP_RAM (char*)0x0400
#define BACK_SCR_BASE (char*)0x6000
@@ -118,18 +118,19 @@
#define VLIRInfo (*(struct VLIR_info*)0x8496)
-#define appMain *(unsigned int*)0x849b
-#define intTopVector *(unsigned int*)0x849d
-#define intBotVector *(unsigned int*)0x849f
-#define mouseVector *(unsigned int*)0x84a1
-#define keyVector *(unsigned int*)0x84a3
-#define inputVector *(unsigned int*)0x84a5
-#define mouseFaultVec *(unsigned int*)0x84a7
-#define otherPressVec *(unsigned int*)0x84a9
-#define StringFaultVec *(unsigned int*)0x84ab
-#define alarmTmtVector *(unsigned int*)0x84ad
-#define BRKVector *(unsigned int*)0x84af
-#define RecoverVector *(unsigned int*)0x84b1
+#define appMain (*(void_func*)0x849b)
+#define intTopVector (*(void_func*)0x849d)
+#define intBotVector (*(void_func*)0x849f)
+#define mouseVector (*(void_func*)0x84a1)
+#define keyVector (*(void_func*)0x84a3)
+#define inputVector (*(void_func*)0x84a5)
+#define mouseFaultVec (*(void_func*)0x84a7)
+#define otherPressVec (*(void_func*)0x84a9)
+#define StringFaultVec (*(void_func*)0x84ab)
+#define alarmTmtVector (*(void_func*)0x84ad)
+#define BRKVector (*(void_func*)0x84af)
+#define RecoverVector (*(void_func*)0x84b1)
+
#define selectionFlash *(char*)0x84b3
#define alphaFlag *(char*)0x84b4
#define iconSelFlg *(char*)0x84b5
@@ -188,9 +189,10 @@
#define config *(char*)0xff00
#define END_MOUSE (char*)0xfffa
-#define NMI_VECTOR *(unsigned int*)0xfffa
-#define RESET_VECTOR *(unsigned int*)0xfffc
-#define IRQ_VECTOR *(unsigned int*)0xfffe
+
+#define NMI_VECTOR (*(void_func*)0xfffa)
+#define RESET_VECTOR (*(void_func*)0xfffc)
+#define IRQ_VECTOR (*(void_func*)0xfffe)
#define vicbase (char*)0xd000
#define sidbase (char*)0xd400