24 enum { BLACK, BLUE, GREEN, CYAN, RED, MAGENTA, YELLOW, WHITE };
26 /* dimensions of the whole screen */
30 /* dimensions of the playfield */
33 /* offset of the playfield from the left side of the screen */
36 #define CHAR(c, fg, bg) \
37 ((uint16_t)(c) | ((uint16_t)(fg) << 12) | ((uint16_t)(bg) << 8))
39 uint16_t scr[SCR_COLS * SCR_ROWS];
41 static void wrchar(uint16_t c);
51 /* fill the screen buffer, and draw */
52 for(i=0; i<SCR_ROWS; i++) {
55 for(j=0; j<SCR_COLS; j++) {
56 if(i > PF_ROWS || j < PF_XOFFS - 1 || j > PF_XOFFS + PF_COLS) {
57 row[j] = CHAR(' ', WHITE, BLACK);
58 } else if((i == PF_ROWS && j >= PF_XOFFS && j < PF_XOFFS + PF_COLS) ||
59 j == PF_XOFFS - 1 || j == PF_XOFFS + PF_COLS) {
60 row[j] = CHAR(G_CHECKER, WHITE, BLACK);
62 row[j] = CHAR(' ', BLACK, WHITE);
75 void cleanup_game(void)
94 static void wrchar(uint16_t c)
96 unsigned char cc = c & 0xff;
97 unsigned char ca = c >> 8;
100 ansi_ibmchar(cc, ca);