1
0
mirror of https://github.com/cc65/cc65.git synced 2025-08-08 06:25:17 +00:00

some tweaks to testprog

This commit is contained in:
mrdudz
2017-12-12 17:05:52 +01:00
parent 892732f340
commit 2957acd133

View File

@@ -2,6 +2,7 @@
** revers(), and textcolor() for the full range of character codes. ** revers(), and textcolor() for the full range of character codes.
** **
** 2017-07-15, Greg King ** 2017-07-15, Greg King
** 2017-12-12, Groepaz
*/ */
#include <conio.h> #include <conio.h>
@@ -139,7 +140,12 @@ static unsigned char testCPeekC (char ch)
** and, compare it to the first untranslated char. ** and, compare it to the first untranslated char.
*/ */
ch2_c = peekChWithoutTranslation (); ch2_c = peekChWithoutTranslation ();
if (ch2_c != ch2_b) { if ((ch2_c != ch2_b)
#if defined(__C128__)
/* VDC memory is not accessable */
&& (width == 40)
#endif
){
/* The test was NOT succesful. /* The test was NOT succesful.
** Output a diagnostic; and, return FAILURE. ** Output a diagnostic; and, return FAILURE.
*/ */
@@ -190,7 +196,12 @@ static unsigned char testCPeekCol (char ch)
** and, compare it to the first untranslated char. ** and, compare it to the first untranslated char.
*/ */
ch2_c = peekColWithoutTranslation (); ch2_c = peekColWithoutTranslation ();
if (ch2_c != ch2_b) { if ((ch2_c != ch2_b)
#if defined(__C128__)
/* VDC memory is not accessable */
&& (width == 40)
#endif
){
/* The test was NOT succesful. /* The test was NOT succesful.
** Output a diagnostic; and, return FAILURE. ** Output a diagnostic; and, return FAILURE.
*/ */
@@ -221,6 +232,7 @@ int main (void)
clrscr (); clrscr ();
revers (1); revers (1);
textcolor(1); textcolor(1);
bgcolor(0);
screensize (&width, &i); screensize (&width, &i);
#if defined(__VIC20__) #if defined(__VIC20__)
@@ -236,14 +248,29 @@ int main (void)
} }
} while (++i != 0); /* will wrap around when finished */ } while (++i != 0); /* will wrap around when finished */
/* test colors */ #if defined(__VIC20__)
clrscr (); cgetc();
revers (0);
#if defined (__CBM610__) || defined (__PET__)
cprintf("no COLOR_RAM\n\r");
#else
cprintf("COLOR_RAM at $%04x\n\r", COLOR_RAM);
#endif #endif
/* test colors */
#if defined(__VIC20__)
clrscr ();
#endif
revers (0);
textcolor(1);
#if defined (__CBM610__) || defined (__PET__)
cprintf("\n\rno COLOR_RAM\n\r");
#elif defined (__C128__)
if (width == 40) {
cprintf("\n\rCOLOR_RAM at $%04x\n\r", COLOR_RAM);
} else {
cprintf("\n\rno COLOR_RAM\n\r");
}
#else
cprintf("\n\rCOLOR_RAM at $%04x\n\r", COLOR_RAM);
#endif
do { do {
if (!testCPeekCol (i)) { if (!testCPeekCol (i)) {
ret = 1; ret = 1;
@@ -253,11 +280,11 @@ int main (void)
/* test revers */ /* test revers */
textcolor(1); cputc('\n'); cputc('\r'); textcolor(1); cputc('\n'); cputc('\r');
revers(0); cputc('*'); chBack (); c1 = cpeekrevers(); chForth(); revers(0); cputc('x'); chBack (); c1 = cpeekrevers(); chForth();
revers(1); cputc('*'); chBack (); c2 = cpeekrevers(); chForth(); revers(1); cputc('X'); chBack (); c2 = cpeekrevers(); chForth();
cputc('\n'); cputc('\r'); cputc('\n'); cputc('\r');
revers(c1); cputc('*'); revers(c1); cputc('o');
revers(c2); cputc('*'); revers(c2); cputc('O');
/* test cpeeks() */ /* test cpeeks() */
revers(0); revers(0);