From ec652367d0857217b270b59f7e9d225756c91edc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= Date: Sun, 20 Nov 2022 13:28:45 +0100 Subject: [PATCH 1/3] Support targets without cursor keys Not all targets to have cursor keys on their keyboard. Add corresponding #ifdefs to the conio test program. --- targettest/conio.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/targettest/conio.c b/targettest/conio.c index 49434595b..efe82d7c6 100644 --- a/targettest/conio.c +++ b/targettest/conio.c @@ -130,9 +130,11 @@ void main(void) case CH_ENTER: clrscr(); return; +#ifdef CH_CURS_LEFT case CH_CURS_LEFT: inpos = (inpos - 1) % 8; break; +#endif case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': (void)textcolor(i - '0'); @@ -164,7 +166,9 @@ void main(void) default: cputc(i); /* fallthrough */ +#ifdef CH_CURS_RIGHT case CH_CURS_RIGHT: +#endif inpos = (inpos + 1) % 8; } #endif From 484e1dc9fde4c8407f05ab7f5f6374a4b9c33cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= Date: Sun, 20 Nov 2022 13:30:57 +0100 Subject: [PATCH 2/3] Character defines for osic1p target Added character definitions for line graphics and enter character for osic1p target. --- include/osic1p.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/osic1p.h b/include/osic1p.h index d6ab5fee1..3a5b4723e 100644 --- a/include/osic1p.h +++ b/include/osic1p.h @@ -44,4 +44,22 @@ #define _bgcolor(color) COLOR_BLACK #define _bordercolor(color) COLOR_BLACK +/* Colors are not functional, display is black and white only. */ +#define COLOR_BLACK 0x00 +#define COLOR_WHITE 0x01 + +#define CH_ULCORNER 0xCC +#define CH_URCORNER 0xCD +#define CH_LLCORNER 0xCB +#define CH_LRCORNER 0xCE +#define CH_TTEE 0xD9 +#define CH_BTEE 0xD7 +#define CH_LTEE 0xD8 +#define CH_RTEE 0xDA +#define CH_CROSS 0xDB +#define CH_HLINE 0x94 +#define CH_VLINE 0x95 + +#define CH_ENTER 0x0D + #endif From a46de2f6d447409878f6cb560e28cf6cec6e33df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20M=C3=BChlstrasser?= Date: Sun, 20 Nov 2022 15:22:37 +0100 Subject: [PATCH 3/3] Fix macro order --- include/osic1p.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/include/osic1p.h b/include/osic1p.h index 3a5b4723e..479d9fd52 100644 --- a/include/osic1p.h +++ b/include/osic1p.h @@ -36,14 +36,6 @@ # error "This module may only be used when compiling for the Challenger 1P!" #endif -/* The following #defines will cause the matching functions calls in conio.h -** to be overlaid by macros with the same names, saving the function call -** overhead. -*/ -#define _textcolor(color) COLOR_WHITE -#define _bgcolor(color) COLOR_BLACK -#define _bordercolor(color) COLOR_BLACK - /* Colors are not functional, display is black and white only. */ #define COLOR_BLACK 0x00 #define COLOR_WHITE 0x01 @@ -62,4 +54,13 @@ #define CH_ENTER 0x0D +/* The following #defines will cause the matching functions calls in conio.h +** to be overlaid by macros with the same names, saving the function call +** overhead. +*/ +#define _textcolor(color) COLOR_WHITE +#define _bgcolor(color) COLOR_BLACK +#define _bordercolor(color) COLOR_BLACK +#define _cpeekcolor(color) COLOR_WHITE + #endif