From: Greg King Date: Thu, 25 Jul 2013 17:32:40 +0000 (-0400) Subject: Moved the lightpen names from to a new . X-Git-Tag: V2.15~248^2~1 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3b544613d27fe80844e6ab8fc66e7cdb630fcdae;p=cc65 Moved the lightpen names from to a new . Renamed the adjuster pointer. --- diff --git a/include/mouse.h b/include/mouse.h index bc93f8b8c..5e69c7ff6 100644 --- a/include/mouse.h +++ b/include/mouse.h @@ -118,13 +118,6 @@ extern const char mouse_stddrv[]; /* The address of the static standard mouse driver for a platform */ extern const void mouse_static_stddrv[]; -/* A program optionally can set this pointer to a function that gives -** a calibration value to a driver. If this pointer isn't NULL, -** then a driver that wants a value can call that function. -** mouse_adjuster must be set before the driver is installed. -*/ -extern void __fastcall__ (*mouse_adjuster) (unsigned char *pValue); - /*****************************************************************************/ @@ -201,23 +194,6 @@ unsigned char __fastcall__ mouse_ioctl (unsigned char code, void* data); * NON-PORTABLE! */ -void __fastcall__ pen_calibrate (unsigned char *XOffset); -/* Ask the user to help to calibrate a lightpen. Changes the screen! - * A pointer to this function can be put into mouse_adjuster. - */ - -void __fastcall__ pen_adjust (const char *filename); -/* Get a lightpen calibration value from a file if it exists. Otherwise, call - * pen_calibrate() to create a value; then, write it into a file, so that it - * will be available at the next time that the lightpen is used. - * Might change the screen. - * 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 - * is installed, and only if that driver wants to be calibrated. - */ - /* End of mouse.h */ diff --git a/include/pen.h b/include/pen.h new file mode 100644 index 000000000..bab6997df --- /dev/null +++ b/include/pen.h @@ -0,0 +1,78 @@ +/*****************************************************************************/ +/* */ +/* pen.h */ +/* */ +/* Lightpen API */ +/* */ +/* */ +/* This software is provided "as-is", without any expressed or implied */ +/* warranty. In no event will the authors be held liable for any damages */ +/* arising from the use of this software. */ +/* */ +/* Permission is granted to anyone to use this software for any purpose, */ +/* including commercial applications, and to alter it and redistribute it */ +/* freely, subject to the following restrictions: */ +/* */ +/* 1. The origin of this software must not be misrepresented; you must not */ +/* claim that you wrote the original software. If you use this software */ +/* in a product, an acknowledgment in the product documentation would be */ +/* appreciated, but is not required. */ +/* 2. Altered source versions must be marked plainly as such; and, must not */ +/* be misrepresented as being the original software. */ +/* 3. This notice may not be removed or altered from any source */ +/* distribution. */ +/* */ +/*****************************************************************************/ + + + +#ifndef _PEN_H +#define _PEN_H + + + +/*****************************************************************************/ +/* Declarations */ +/*****************************************************************************/ + + + +/* A program optionally can set this pointer to a function that gives +** a calibration value to a driver. If this pointer isn't NULL, +** then a driver that wants a value can call that function. +** pen_adjuster must be set before the driver is installed. +*/ +extern void __fastcall__ (*pen_adjuster) (unsigned char *pValue); + + + +/*****************************************************************************/ +/* Functions */ +/*****************************************************************************/ + + + +void __fastcall__ pen_calibrate (unsigned char *XOffset); +/* Ask the user to help to calibrate a lightpen. Changes the screen! + * A pointer to this function can be put into pen_adjuster. + */ + +void __fastcall__ pen_adjust (const char *filename); +/* Get a lightpen calibration value from a file if it exists. Otherwise, call + * pen_calibrate() to create a value; then, write it into a file, so that it + * will be available at the next time that the lightpen is used. + * Might change the screen. + * 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 pen_adjuster pointer. The file will be read only when a driver + * is installed, and only if that driver wants to be calibrated. + */ + + + +/* End of pen.h */ +#endif + + + diff --git a/libsrc/c128/mouseref.s b/libsrc/c128/mouseref.s index fb83c439f..9b18a1f08 100644 --- a/libsrc/c128/mouseref.s +++ b/libsrc/c128/mouseref.s @@ -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 diff --git a/libsrc/c128/pencalib.c b/libsrc/c128/pencalib.c index cf9a3f92b..7fb342f4d 100644 --- a/libsrc/c128/pencalib.c +++ b/libsrc/c128/pencalib.c @@ -1,13 +1,14 @@ /* ** Calibrate lightpen drivers to the current video hardware. ** -** 2013-06-17, Greg King +** 2013-07-25, Greg King ** */ #include #include +#include #define COMMAND1 "Adjust by clicking on line." diff --git a/libsrc/c64/mouseref.s b/libsrc/c64/mouseref.s index fb83c439f..9b18a1f08 100644 --- a/libsrc/c64/mouseref.s +++ b/libsrc/c64/mouseref.s @@ -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 diff --git a/libsrc/c64/pencalib.c b/libsrc/c64/pencalib.c index d0e6b0ff2..587c5627e 100644 --- a/libsrc/c64/pencalib.c +++ b/libsrc/c64/pencalib.c @@ -1,13 +1,14 @@ /* ** Calibrate lightpen drivers to the current video hardware. ** -** 2013-06-17, Greg King +** 2013-07-25, Greg King ** */ #include #include +#include #define COMMAND1 "Adjust by clicking on line." diff --git a/libsrc/cbm/penadjust.c b/libsrc/cbm/penadjust.c old mode 100755 new mode 100644 index f33b3a275..dc1ffe129 --- a/libsrc/cbm/penadjust.c +++ b/libsrc/cbm/penadjust.c @@ -1,14 +1,14 @@ /* ** Main lightpen driver calibration functions. ** -** 2013-06-23, Greg King +** 2013-07-25, Greg King */ #include #include #include -#include +#include 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; } } diff --git a/samples/mousetest.c b/samples/mousetest.c index b2d49b072..dd90e0990 100644 --- a/samples/mousetest.c +++ b/samples/mousetest.c @@ -3,7 +3,7 @@ ** Will work for the C64/C128/CBM510/Atari/Apple2. ** ** 2001-09-13, Ullrich von Bassewitz -** 2013-06-26, Greg King +** 2013-07-25, Greg King ** */ @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include