** Will work for the C64/C128/CBM510/Atari/Apple2.
**
** 2001-09-13, Ullrich von Bassewitz
-** 2013-08-23, Greg King
+** 2013-09-05, Greg King
**
*/
#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))
-#if defined(__C64__) || defined(__C128__) || defined(__CBM510__)
+#ifdef __CBM__
-/* Addresses of data for sprite 0 */
-#if defined(__C64__)
-# define SPRITE0_DATA ((unsigned char[64])0x0340)
-# define SPRITE0_PTR ((unsigned char *)0x07F8)
-#elif defined(__C128__)
-# define SPRITE0_DATA ((unsigned char[64])0x0E00)
-# define SPRITE0_PTR ((unsigned char *)0x07F8)
-#elif defined(__CBM510__)
-# define SPRITE0_DATA ((unsigned char[64])0xF400)
-# define SPRITE0_PTR ((unsigned char *)0xF3F8)
-#endif
+/* Set dark-on-light colors. */
+const unsigned char mouse_def_pointercolor = COLOR_BLACK;
-/* The mouse sprite (an arrow) */
-static const unsigned char MouseSprite[64] = {
- 0xFE, 0x00, 0x00,
- 0xFC, 0x00, 0x00,
- 0xF8, 0x00, 0x00,
- 0xFC, 0x00, 0x00,
- 0xDE, 0x00, 0x00,
- 0x8F, 0x00, 0x00,
- 0x07, 0x80, 0x00,
- 0x03, 0xC0, 0x00,
- 0x01, 0xE0, 0x00,
- 0x00, 0xF0, 0x00,
- 0x00, 0x78, 0x00,
- 0x00, 0x38, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00
-};
#endif
/* 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);
}
}
cursor (0);
clrscr ();
- /* The pointer should be created before the driver is installed,
- ** in case a lightpen driver needs it during calibration.
- */
-
-#if defined(__C64__) || defined(__C128__) || defined(__CBM510__)
- /* Copy the sprite data */
- memcpy ((void*) SPRITE0_DATA, MouseSprite, sizeof (MouseSprite));
-
- /* Set the VIC-II sprite pointer. */
- *SPRITE0_PTR = ((unsigned) SPRITE0_DATA & 0x3FFF) / sizeof SPRITE0_DATA;
-
- /* Set the color of sprite 0 */
-# ifdef __CBM510__
- pokebsys ((unsigned) &VIC.spr0_color, COLOR_BLACK);
-# else
- VIC.spr0_color = COLOR_BLACK;
-# endif
-#endif
-
/* If a lightpen driver is installed, then it can get a calibration value
** from this file (if it exists). Or, the user can adjust the pen; and,
** the value will be put into this file, for the next time.
** (Other drivers will ignore this.)
*/
-#if defined(__C64__) || defined(__C128__)
+#if defined(__C64__) || defined(__C128__) || defined(__CBM510__)
pen_adjust ("pen.dat");
#endif