Publish VCC Plus OSS source distribution for 3.6.2 build 60
This commit is contained in:
commit
c652a5276d
1192 files changed
+272368
No files matched your search
@@ -0,0 +1,33 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
// Send a text report through the CoCo printer port. No disk file is needed.
|
||||
#include <coco.h>
|
||||
#include <vcc/printer.h>
|
||||
|
||||
static int printLanding(unsigned visit, const char *planet, const char *observation)
|
||||
{
|
||||
/* Two digits for the visit, a five-character field for the planet. */
|
||||
return vcc_printer_printf("%02u %-5s %s\n", visit, planet, observation);
|
||||
}
|
||||
|
||||
int main(void)
|
||||
{
|
||||
cls(1);
|
||||
printf("FLIGHT CONTROL\n");
|
||||
printf("START CAPTURE IN PRINTER OUTPUT\n");
|
||||
printf("PRESS SPACE TO SEND REPORT\n");
|
||||
while (waitkey(0) != ' ') {}
|
||||
|
||||
/* Ordinary printf still goes to the screen. These four lines go to the port. */
|
||||
if (vcc_printer_printf("TP-10 FLIGHT REPORT\n") < 0 ||
|
||||
printLanding(1, "EARTH", "BLUE SEA") < 0 ||
|
||||
printLanding(2, "MARS", "RED RIDGE") < 0 ||
|
||||
vcc_printer_printf("END OF REPORT\n") < 0)
|
||||
{
|
||||
printf("REPORT FORMAT ERROR\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* The guest cannot tell whether the Mac is capturing the port. */
|
||||
printf("REPORT SENT TO PRINTER PORT\n");
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user