diff --git a/libsrc/osic1p/cpeekc.s b/libsrc/osic1p/cpeekc.s new file mode 100644 index 000000000..55a170501 --- /dev/null +++ b/libsrc/osic1p/cpeekc.s @@ -0,0 +1,17 @@ +; +; 2017-06-21, Greg King +; +; char cpeekc (void); +; +; Get a character from OSI C1P screen RAM. +; + .export _cpeekc + + .include "extzp.inc" + + +_cpeekc: + ldy CURS_X + lda (SCREEN_PTR),y + ldx #>$0000 + rts diff --git a/libsrc/osic1p/cpeekcolor.s b/libsrc/osic1p/cpeekcolor.s new file mode 100644 index 000000000..ed275ec95 --- /dev/null +++ b/libsrc/osic1p/cpeekcolor.s @@ -0,0 +1,8 @@ +; +; 2017-06-03, Greg King +; +; unsigned char cpeekcolor (void); +; + + .import return1 + .export _cpeekcolor := return1 ; always COLOR_WHITE diff --git a/libsrc/osic1p/cpeekrevers.s b/libsrc/osic1p/cpeekrevers.s new file mode 100644 index 000000000..ab7c68b35 --- /dev/null +++ b/libsrc/osic1p/cpeekrevers.s @@ -0,0 +1,9 @@ +; +; 2017-06-15, Greg King +; +; unsigned char cpeekrevers (void); +; +; Get a reverse attribute from screen RAM +; + .import return0 + .export _cpeekrevers := return0 ; No attribute diff --git a/targettest/Makefile b/targettest/Makefile index 35b767727..f78e22461 100644 --- a/targettest/Makefile +++ b/targettest/Makefile @@ -624,6 +624,7 @@ EXELIST_pce = \ # stroserror-test strqtok-test uname-test EXELIST_osic1p = \ minimal \ + conio \ cursor \ mul-test diff --git a/targettest/conio.c b/targettest/conio.c index 56fc5dcda..8ebb15bd5 100644 --- a/targettest/conio.c +++ b/targettest/conio.c @@ -15,12 +15,16 @@ #include #include -#if defined(__GAMATE__) +#if defined(__GAMATE__) || defined(__OSIC1P__) /* there is not enough screen space to show all 256 characters at the bottom */ #define NUMCHARS 128 -#define NUMCOLS 4 #else #define NUMCHARS 256 +#endif + +#if defined(__GAMATE__) +#define NUMCOLS 4 +#else #define NUMCOLS 16 #endif @@ -79,6 +83,7 @@ void peektest(void) revers(rbuf[j]); cputc(buf[j]); } +#if !defined (__OSIC1P__) gotoxy(0, LINE_PEEKTEST); cpeeks(buf, NUMCOLS); (void)textcolor(1); @@ -87,6 +92,7 @@ void peektest(void) for (j = 0; j < NUMCOLS; ++j) { cputc(buf[j]); } +#endif } void main(void) @@ -134,7 +140,8 @@ void main(void) } } - gotoxy(0, ysize - 2 - ((NUMCHARS + xsize) / xsize)); + gotoxy(0, ysize - 3 - ((NUMCHARS + xsize) / xsize)); + // one line with 0123..pattern revers(1); for (i = 0; i < xsize; ++i) { cputc('0' + i % 10); @@ -147,9 +154,11 @@ void main(void) cputc(' '); } } + // fill last line of the block with '#' while(wherex() > 0) { cputc('#'); } + // one more line with 0123..pattern revers(1); for (i = 0; i < xsize; ++i) { cputc('0' + i % 10);