1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 17:29:50 +00:00

Merge pull request #1927 from smuehlst/osi-conio-chardefs

Character defines for osic1p target
This commit is contained in:
Bob Andrews 2022-11-28 04:15:34 +01:00 committed by GitHub
commit 765e7d1efa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -36,6 +36,24 @@
# error "This module may only be used when compiling for the Challenger 1P!" # error "This module may only be used when compiling for the Challenger 1P!"
#endif #endif
/* 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
/* The following #defines will cause the matching functions calls in conio.h /* 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 ** to be overlaid by macros with the same names, saving the function call
** overhead. ** overhead.
@ -43,5 +61,6 @@
#define _textcolor(color) COLOR_WHITE #define _textcolor(color) COLOR_WHITE
#define _bgcolor(color) COLOR_BLACK #define _bgcolor(color) COLOR_BLACK
#define _bordercolor(color) COLOR_BLACK #define _bordercolor(color) COLOR_BLACK
#define _cpeekcolor(color) COLOR_WHITE
#endif #endif

View File

@ -130,9 +130,11 @@ void main(void)
case CH_ENTER: case CH_ENTER:
clrscr(); clrscr();
return; return;
#ifdef CH_CURS_LEFT
case CH_CURS_LEFT: case CH_CURS_LEFT:
inpos = (inpos - 1) % 8; inpos = (inpos - 1) % 8;
break; break;
#endif
case '0': case '1': case '2': case '3': case '4': case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9': case '5': case '6': case '7': case '8': case '9':
(void)textcolor(i - '0'); (void)textcolor(i - '0');
@ -164,7 +166,9 @@ void main(void)
default: default:
cputc(i); cputc(i);
/* fallthrough */ /* fallthrough */
#ifdef CH_CURS_RIGHT
case CH_CURS_RIGHT: case CH_CURS_RIGHT:
#endif
inpos = (inpos + 1) % 8; inpos = (inpos + 1) % 8;
} }
#endif #endif