2 ** Fancy hello world program using cc65.
4 ** Ullrich von Bassewitz (ullrich@von-bassewitz.de)
6 ** TEST version for atari5200 conio, using all four colors
18 /*****************************************************************************/
20 /*****************************************************************************/
24 static const char Text [] = "Hello world!";
25 static unsigned char colors[] = { COLOR_WHITE, COLOR_LIGHTGREEN, COLOR_LIGHTRED, COLOR_BLACK };
29 /*****************************************************************************/
31 /*****************************************************************************/
37 unsigned char XSize, YSize;
41 /* Set screen colors */
42 (void) textcolor (COLOR_WHITE);
43 (void) bordercolor (COLOR_BLACK);
44 (void) bgcolor (COLOR_BLACK);
46 /* Clear the screen, put cursor in upper left corner */
49 /* Ask for the screen size */
50 screensize (&XSize, &YSize);
52 /* Install joystick driver */
53 joy_install (joy_static_stddrv);
56 /* Draw a border around the screen */
63 /* Vertical line, left side */
64 cvlinexy (0, 1, YSize - 2);
71 /* Vertical line, right side */
72 cvlinexy (XSize - 1, 1, YSize - 2);
74 /* Write the greeting in the mid of the screen */
75 gotoxy ((XSize - strlen (Text)) / 2, YSize / 2);
79 textcolor (colors[i]); /* switch to color #0 */
80 cputsxy(3, ++PosY, "COLOR 0");
81 textcolor ((colors[i] + 1) & 3); /* switch to color #1 */
82 cputsxy(3, ++PosY, "COLOR 1");
83 textcolor ((colors[i] + 2) & 3); /* switch to color #2 */
84 cputsxy(3, ++PosY, "COLOR 2");
85 textcolor ((colors[i] + 3) & 3); /* switch to color #3 */ /* color #3 is the background color. So written text isn't visible. */
86 cputsxy(3, ++PosY, "COLOR 3");
88 /* Wait for the user to press and release a button */
89 while (!joy_read (JOY_1))
91 while (joy_read (JOY_1))
97 textcolor (colors[i]);
98 bgcolor ((colors[i] + 3) & 3);
100 /* Clear the screen again */