From: cuz Date: Thu, 12 Dec 2002 21:01:34 +0000 (+0000) Subject: Fixed escape and stop key definitions for the commodore machines X-Git-Tag: V2.12.0~1917 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0dc85c727b4d2bbe1a9fa1d0218424602f7ba655;p=cc65 Fixed escape and stop key definitions for the commodore machines git-svn-id: svn://svn.cc65.org/cc65/trunk@1741 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/include/c128.h b/include/c128.h index 85782aef3..ebb367e3b 100644 --- a/include/c128.h +++ b/include/c128.h @@ -46,6 +46,7 @@ /* Additional key defines */ +#define CH_ESC 27 #define CH_F1 133 #define CH_F2 137 #define CH_F3 134 diff --git a/include/cbm.h b/include/cbm.h index ba831dd54..12753deb1 100644 --- a/include/cbm.h +++ b/include/cbm.h @@ -104,8 +104,8 @@ extern unsigned char _filetype; /* Default 'u' */ #define CH_PI 126 #define CH_DEL 20 #define CH_INS 148 -#define CH_ESC 95 #define CH_ENTER '\n' +#define CH_STOP 3 diff --git a/include/cbm264.h b/include/cbm264.h index 25d8e84da..a9125d5d5 100644 --- a/include/cbm264.h +++ b/include/cbm264.h @@ -46,6 +46,7 @@ /* Additional key defines */ +#define CH_ESC 27 #define CH_F1 133 #define CH_F2 137 #define CH_F3 134 @@ -113,4 +114,4 @@ - + diff --git a/include/cbm510.h b/include/cbm510.h index 9f03f1217..078557f94 100644 --- a/include/cbm510.h +++ b/include/cbm510.h @@ -46,6 +46,7 @@ /* Additional key defines */ +#define CH_ESC 27 #define CH_F1 224 #define CH_F2 225 #define CH_F3 226 diff --git a/include/cbm610.h b/include/cbm610.h index 723d87699..8f9e78c6a 100644 --- a/include/cbm610.h +++ b/include/cbm610.h @@ -46,6 +46,7 @@ /* Additional key defines */ +#define CH_ESC 27 #define CH_F1 224 #define CH_F2 225 #define CH_F3 226 diff --git a/include/pet.h b/include/pet.h index 684d20f81..ccc31432f 100644 --- a/include/pet.h +++ b/include/pet.h @@ -6,7 +6,7 @@ /* */ /* */ /* */ -/* (C) 1998-2001 Ullrich von Bassewitz */ +/* (C) 1998-2002 Ullrich von Bassewitz */ /* Wacholderweg 14 */ /* D-70597 Stuttgart */ /* EMail: uz@musoftware.de */ @@ -45,6 +45,9 @@ +/* Additional key defines */ +#define CH_ESC 27 + /* Color defines */ #define COLOR_BLACK 0x00 #define COLOR_WHITE 0x01 diff --git a/libsrc/dbg/dbg.c b/libsrc/dbg/dbg.c index c285027d4..a929bddcf 100644 --- a/libsrc/dbg/dbg.c +++ b/libsrc/dbg/dbg.c @@ -465,6 +465,24 @@ static void AnyKeyPrompt (void) +static char IsAbortKey (char C) +/* Return true if C is an abort key */ +{ +#if defined(CH_ESC) + if (C == CH_ESC) { + return 1; + } +#endif +#if defined(CH_STOP) + if (C == CH_STOP) { + return 1; + } +#endif + return 0; +} + + + static char Input (char* Prompt, char* Buf, unsigned char Count) /* Read input from the user, return 1 on success, 0 if aborted */ { @@ -503,8 +521,8 @@ static char Input (char* Prompt, char* Buf, unsigned char Count) } else if (c == '\n') { Buf [i] = '\0'; done = 1; - } else if (c == CH_ESC) { - /* Abort */ + } else if (IsAbortKey (c)) { + /* Abort */ done = 2; } } while (!done); @@ -1500,4 +1518,4 @@ void DbgEntry (void) } - +