Moved the lightpen names from <mouse.h> to a new <pen.h>.

Renamed the adjuster pointer.
This commit is contained in:
Greg King
2013-07-25 13:32:40 -04:00
parent 078a1df2f6
commit 3b544613d2
8 changed files with 97 additions and 40 deletions

View File

@@ -1,10 +1,10 @@
;
; Pointer for library references by device drivers.
;
; 2013-06-23, Greg King
; 2013-07-25, Greg King
;
.export mouse_libref, _mouse_adjuster
.export mouse_libref, _pen_adjuster
.data
@@ -17,7 +17,7 @@ mouse_libref: ; generic label for mouse-kernel
; The function might read a value from a file; or, it might ask the user
; to help calibrate the driver.
;
; void __fastcall__ (*mouse_adjuster)(unsigned char *) = NULL;
; void __fastcall__ (*pen_adjuster)(unsigned char *) = NULL;
;
_mouse_adjuster:
_pen_adjuster:
.addr $0000

View File

@@ -1,13 +1,14 @@
/*
** Calibrate lightpen drivers to the current video hardware.
**
** 2013-06-17, Greg King
** 2013-07-25, Greg King
**
*/
#include <conio.h>
#include <mouse.h>
#include <pen.h>
#define COMMAND1 "Adjust by clicking on line."

View File

@@ -1,10 +1,10 @@
;
; Pointer for library references by device drivers.
;
; 2013-06-23, Greg King
; 2013-07-25, Greg King
;
.export mouse_libref, _mouse_adjuster
.export mouse_libref, _pen_adjuster
.data
@@ -17,7 +17,7 @@ mouse_libref: ; generic label for mouse-kernel
; The function might read a value from a file; or, it might ask the user
; to help calibrate the driver.
;
; void __fastcall__ (*mouse_adjuster)(unsigned char *) = NULL;
; void __fastcall__ (*pen_adjuster)(unsigned char *) = NULL;
;
_mouse_adjuster:
_pen_adjuster:
.addr $0000

View File

@@ -1,13 +1,14 @@
/*
** Calibrate lightpen drivers to the current video hardware.
**
** 2013-06-17, Greg King
** 2013-07-25, Greg King
**
*/
#include <conio.h>
#include <mouse.h>
#include <pen.h>
#define COMMAND1 "Adjust by clicking on line."

10
libsrc/cbm/penadjust.c Executable file → Normal file
View File

@@ -1,14 +1,14 @@
/*
** Main lightpen driver calibration functions.
**
** 2013-06-23, Greg King
** 2013-07-25, Greg King
*/
#include <stddef.h>
#include <fcntl.h>
#include <unistd.h>
#include <mouse.h>
#include <pen.h>
static const char *name;
@@ -40,15 +40,15 @@ static void __fastcall__ adjuster (unsigned char *XOffset)
/* pen_adjust() is optional; if you want to use its feature,
** then it must be called before a driver is installed.
** Note: This function merely saves the file-name pointer, and sets
** the mouse_adjuster pointer. The file will be read only when a driver
** the pen_adjuster pointer. The file will be read only when a driver
** is installed, and only if that driver wants to be calibrated.
*/
void __fastcall__ pen_adjust (const char *filename)
{
if (filename != NULL && filename[0] != '\0') {
name = filename;
mouse_adjuster = adjuster;
pen_adjuster = adjuster;
} else {
mouse_adjuster = pen_calibrate;
pen_adjuster = pen_calibrate;
}
}