Ein eigenes Projekt wäre übertrieben,
ich möchte einfach ein paar Sachen ausprobieren zum üben.
Bitte verrate noch wie ich die ganzen Form3 Sachen übersetzen kann.
zcc +cpm -subtype=pcw80 -lndos -create-app forms3tst.c -o forms3tst.com
hat nicht funktioniert
forms3tst.c:83:15: fatal error: Too few arguments to call to function 'initForms'
Compilation aborted
Davon abgesehen hatte ich das CLS schon versucht. Dazu fand ich ein funktionierendes Beispiel:
Code: Alles auswählen
/*
* Test the Native Console of the Amstrad PCW
*
* 23/3/2021 RobertK (based on ansivt52.c by Stefano)
*
Manual Index:
https://www.manualslib.com/manual/1002846/Amstrad-Pcw8256.html?page=170#manual
Character Set:
https://www.manualslib.com/manual/1002846/Amstrad-Pcw8256.html?page=283#manual
Terminal codes:
https://www.manualslib.com/manual/1002846/Amstrad-Pcw8256.html?page=308#manual
*/
#include <stdio.h>
void main()
{
int x;
printf("Before CLS\n");
printf("\x1b\x45"); // ESC E -> Clear screen
printf("\x1b\x48"); // ESC H -> Home
printf("If this is the first thing you can read, CLS is OK.\n");
/* Draw an X */
for (x = 0; x < 11; x++) {
// ESC Y r c -> gotoxy
printf("\x1b\x59%c%c*",32 + 10 + x, 32 + 20 + x);
printf("\x1b\x59%c%c*",32 + 20 - x, 32 + 20 + x);
}
}
Übersetzt mit zcc +cpm -subtype=pcw80 -lndos -create-app screen.c -o screen.com
Ich habe dann versucht das selber umzusetzen:
Code: Alles auswählen
#include <stdio.h>
void gotoXY(unsigned int x, unsigned int y) {
putchar(27); // ESC
putchar('Y'); // cursor to position
putchar(y + 32); // row + 32
putchar(x + 32); // column + 32
}
void cLS() {
printf("Before CLS\n");
printf("\x1b\x45"); // ESC E -> Clear screen
printf("\x1b\x48"); // ESC H -> Home
printf("Test\n");
/* putchar(27); // ESC
putchar(69); // cls
putchar(27); // ESC
putchar(72); // home
*/
}
int main(void) {
cLS;
putchar('A'); // oder printf("%s", "O");
gotoXY(1,1);
putchar('B'); // oder printf("%s", "O");
gotoXY(2, 2);
putchar('C'); // oder printf("%s", "O");
gotoXY(14, 14);
putchar('O'); // oder printf("%s", "O");
gotoXY(80, 26);
putchar('Z'); // oder printf("%s", "O");
}
Übersetzt mit zcc +cpm -subtype=pcw80 -lndos -create-app PrintAT.c -o PrintAT.com
Das funktioniert nicht.
es macht zwar HOME, aber der Bildschirm ist nicht leer.
Ich habe dann versucht die Printf vorher und hinterher hinzuzufügen.
Die werden aber auch nicht ausgegeben
