#include <conio.h>
#include <ctype.h>
#include <errno.h>
+#include <cc65.h>
#include <dio.h>
clrscr ();
screensize (&ScreenX, &ScreenY);
+ /* Allow user to read exit messages */
+ if (doesclrscrafterexit ()) {
+ atexit ((void (*)) cgetc);
+ }
+
cputs ("Floppy Disk Copy\r\n");
chline (16);
cputs ("\r\n");
#include <string.h>
#include <zlib.h>
+#ifdef __CC65__
+#include <stdlib.h>
+#include <cc65.h>
+#endif
+
#ifndef __CC65__
/*
** Emulate inflatemem() if using original zlib.
FILE* fp;
unsigned length;
+#ifdef __CC65__
+ /* allow user to read exit messages */
+ if (doesclrscrafterexit()) {
+ atexit((void (*)) getchar);
+ }
+#endif /* __CC65__ */
+
/* read GZIP file */
puts("GZIP file name:");
fp = fopen(get_fname(), "rb");
#include <time.h>
#include <conio.h>
#include <tgi.h>
+#include <cc65.h>
register signed short xs, ys, xx, yy;
register signed short x, y;
- /* calc stepwidth */
+ /* Calc stepwidth */
xs = ((x2 - x1) / (SCREEN_X));
ys = ((y2 - y1) / (SCREEN_Y));
xx = x1;
for (x = 0; x < (SCREEN_X); x++) {
xx += xs;
- /* do iterations */
+ /* Do iterations */
r = 0;
i = 0;
for (count = 0; (count < maxiterations) &&
if (count == maxiterations) {
tgi_setcolor (0);
} else {
- if (MAXCOL == 2)
+ if (MAXCOL == 2) {
tgi_setcolor (1);
- else
+ } else {
tgi_setcolor (count % MAXCOL);
+ }
}
- /* set pixel */
+ /* Set pixel */
tgi_setpixel (x, y);
}
}
if (err != TGI_ERR_OK) {
cprintf ("Error #%d initializing graphics.\r\n%s\r\n",
err, tgi_geterrormsg (err));
+ if (doesclrscrafterexit ()) {
+ cgetc ();
+ }
exit (EXIT_FAILURE);
};
cprintf ("ok.\n\r");
t = clock ();
- /* calc mandelbrot set */
+ /* Calc mandelbrot set */
mandelbrot (tofp (-2), tofp (-2), tofp (2), tofp (2));
t = clock () - t;
/* Fetch the character from the keyboard buffer and discard it */
- (void) cgetc ();
+ cgetc ();
- /* shut down gfx mode and return to textmode */
+ /* Shut down gfx mode and return to textmode */
tgi_done ();
/* Calculate stats */
/* Output stats */
cprintf ("time : %lu.%us\n\r", sec, sec10);
- /* Wait for a key, then end */
- cputs ("Press any key when done...\n\r");
- (void) cgetc ();
+ if (doesclrscrafterexit ()) {
+ /* Wait for a key, then end */
+ cputs ("Press any key when done...\n\r");
+ cgetc ();
+ }
/* Done */
return EXIT_SUCCESS;
#include <conio.h>
#include <ctype.h>
#include <dbg.h>
+#include <cc65.h>
#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) (((a) < (b)) ? (a) : (b))
/* Wait for a key-press, so that some platforms can show the error
** message before they remove the current screen.
*/
- cgetc();
+ if (doesclrscrafterexit ()) {
+ cgetc ();
+ }
exit (EXIT_FAILURE);
}
}
#include <string.h>
-#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <dirent.h>
#include <em.h>
+#include <cc65.h>
#ifndef __CBM__
#include <fcntl.h>
#include <unistd.h>
}
log ("Press any key...");
- cgetc ();
+ getchar ();
if (loadoverlay (1)) {
log ("Calling overlay 1 from main");
foobar ();
}
- log ("Press any key...");
- cgetc ();
+ if (doesclrscrafterexit ()) {
+ log ("Press any key...");
+ getchar ();
+ }
}