24 const int width = 800;
25 const int height = 600;
26 const int bytes_per_pixel = 4;
29 extern void *prom_screen;
31 #define MAKE_16(r, g, b) (((r & 0x1f) << 11) | ((g & 0x1f) << 6) | (b & 0x1f)) 34 char c,
int x,
int y,
unsigned short f,
unsigned short b,
40 prom_getprop(prom_screen,
"address", (
void *) &addr, 4);
45 prom_map(addr, 0xb0000000, 0x01000000);
46 unsigned short *p = (
unsigned short *) 0xb0000000;
47 for (
int i = 0; i < width * height; i++)
49 p[i] = MAKE_16(0, 0, 0);
51 for (
int i = 0; i < 0x7f; i++)
54 (
char) i, (i * 8) % width, 16 * ((i * 8) / width),
55 MAKE_16(i, 0xff, 0x7f - i), MAKE_16(0x00, 0x00, 0x00), p);
59 #define FONT_HEIGHT 16 61 char c,
int x,
int y,
unsigned short f,
unsigned short b,
64 int idx = ((int) c) * 16;
65 for (
int i = 0; i < 16; i++)
67 unsigned char row = ppc_font[idx + i];
68 for (
int j = 0; j < 8; j++)
71 if ((row & (0x80 >> j)) != 0)
79 buf[y * width + i * width + x + j] = col;