From 903788638147bc98b38ef4af39cf01877928f856 Mon Sep 17 00:00:00 2001 From: cuz Date: Sun, 7 Nov 2004 12:41:18 +0000 Subject: [PATCH] New function mouse_geterrormsg() git-svn-id: svn://svn.cc65.org/cc65/trunk@3289 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- include/mouse.h | 3 ++ libsrc/mouse/Makefile | 17 +++++------ libsrc/mouse/mouse_geterrormsg.s | 49 ++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 8 deletions(-) create mode 100644 libsrc/mouse/mouse_geterrormsg.s diff --git a/include/mouse.h b/include/mouse.h index af91cecca..1a8745572 100644 --- a/include/mouse.h +++ b/include/mouse.h @@ -118,6 +118,9 @@ unsigned char __fastcall__ mouse_install (const struct mouse_callbacks* c, unsigned char __fastcall__ mouse_uninstall (void); /* Uninstall the currently loaded driver. Returns an error code. */ +const char* __fastcall__ mouse_geterrormsg (unsigned char code); +/* Get an error message describing the error in code. */ + void __fastcall__ mouse_hide (void); /* Hide the mouse. The function manages a counter and may be called more than * once. For each call to mouse_hide there must be a call to mouse_show to make diff --git a/libsrc/mouse/Makefile b/libsrc/mouse/Makefile index 4c30e0805..dee8f70dd 100644 --- a/libsrc/mouse/Makefile +++ b/libsrc/mouse/Makefile @@ -31,14 +31,15 @@ CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include C_OBJS = mouse_load.o -S_OBJS = mouse-kernel.o \ - mouse_box.o \ - mouse_hide.o \ - mouse_info.o \ - mouse_ioctl.o \ - mouse_move.o \ - mouse_pos.o \ - mouse_show.o \ +S_OBJS = mouse-kernel.o \ + mouse_box.o \ + mouse_geterrormsg.o \ + mouse_hide.o \ + mouse_info.o \ + mouse_ioctl.o \ + mouse_move.o \ + mouse_pos.o \ + mouse_show.o \ mouse_unload.o #-------------------------------------------------------------------------- diff --git a/libsrc/mouse/mouse_geterrormsg.s b/libsrc/mouse/mouse_geterrormsg.s new file mode 100644 index 000000000..f4189afd6 --- /dev/null +++ b/libsrc/mouse/mouse_geterrormsg.s @@ -0,0 +1,49 @@ +; +; Ullrich von Bassewitz, 2004-11-07 +; +; const char* __fastcall__ mouse_geterrormsg (unsigned char code); +; /* Get an error message describing the error in code. */ +; + + .include "mouse-kernel.inc" + + +.proc _mouse_geterrormsg + + cmp #MOUSE_ERR_COUNT + bcc L1 + lda #MOUSE_ERR_COUNT ; "Unknown error" +L1: tay + ldx #>msgtab + lda #