const char chargen_4x8_glyphs[][4] = {
/* 00 */
- { 0x10, 0x10, 0xf0, 0x00 },
+ { 0x00, 0xf0, 0x10, 0x10 },
/* 01 */
- { 0x10, 0x10, 0xf0, 0x10 },
+ { 0x10, 0xf0, 0x10, 0x10 },
/* 02 */
- { 0x10, 0x10, 0x1f, 0x10 },
+ { 0x10, 0x1f, 0x10, 0x10 },
/* 03 */
- { 0x10, 0x10, 0xff, 0x10 },
+ { 0x00, 0xff, 0x10, 0x10 },
/* 04 */
{ 0x10, 0x10, 0x10, 0x10 },
/* 05 */
/* 22 '"' "*/
{ 0xb0, 0x00, 0xb0, 0x00 },
/* 23 '#' */
- { 0x7b, 0x28, 0x7b, 0x00 },
+ { 0x7c, 0x28, 0x7c, 0x00 },
/* 24 '$' */
- { 0x64, 0xd6, 0x4b, 0x00 },
+ { 0x64, 0xd6, 0x4c, 0x00 },
/* 25 '%' */
- { 0x86, 0x38, 0xb2, 0x00 },
+ { 0x86, 0x38, 0xc2, 0x00 },
/* 26 '&' */
- { 0x6b, 0x94, 0x6e, 0x0a },
+ { 0x6c, 0x94, 0x6e, 0x0a },
/* 27 ''' */
{ 0x00, 0x40, 0x80, 0x00 },
/* 28 '(' */
/* 4d 'M' */
{ 0xfe, 0x60, 0xfe, 0x00 },
/* 4e 'N' */
- { 0xfe, 0x80, 0x8e, 0x00 },
+ { 0xfe, 0x80, 0x7e, 0x00 },
/* 4f 'O' */
{ 0x7c, 0x82, 0x7c, 0x00 },
/* 50 'P' */
/* 54 'T' */
{ 0x80, 0xfe, 0x80, 0x00 },
/* 55 'U' */
- { 0xfe, 0x02, 0xfe, 0x02 },
+ { 0xfe, 0x02, 0xfe, 0x00 },
/* 56 'V' */
{ 0xf8, 0x06, 0xf8, 0x00 },
/* 57 'W' */
/* 65 'e' */
{ 0x1c, 0x2a, 0x1a, 0x00 },
/* 66 'f' */
- { 0x10, 0x77, 0x90, 0x00 },
+ { 0x10, 0x7e, 0x90, 0x00 },
/* 67 'g' */
- { 0x12, 0x2a, 0x3a, 0x00 },
+ { 0x12, 0x2a, 0x3c, 0x00 },
/* 68 'h' */
{ 0xfe, 0x20, 0x1e, 0x00 },
/* 69 'i' */
/* 74 't' */
{ 0x20, 0x7c, 0x22, 0x00 },
/* 75 'u' */
- { 0x3c, 0x02, 0x37, 0x00 },
+ { 0x3c, 0x02, 0x3e, 0x00 },
/* 76 'v' */
{ 0x38, 0x06, 0x38, 0x00 },
/* 77 'w' */
void display_draw_cell(DPIX *pixbuf, DCPU16_WORD *cell_map, DCPU16_WORD index, int cell_x, int cell_y, DPIX fg, DPIX bg) {
DPIX *cellstart = pixbuf; /* start of display */
unsigned int pix_x, pix_y;
- unsigned char *cell_bitmap = (unsigned char *)(cell_map + index);
+ unsigned char *cell_bitmap = (unsigned char *)(cell_map + (index * sizeof index));
assert(cell_x < CELL_X);
assert(cell_y < CELL_Y);
cellstart += (PIX_X * PIX_BORDER); /* skip top border */
- cellstart += (CELL_Y_SZ) * cell_y; /* skip down to row */
+ cellstart += (CELL_Y_SZ * PIX_X) * cell_y; /* skip down to row */
cellstart += PIX_BORDER; /* skip side border */
for (pix_x = 0; pix_x < CELL_X_SZ; pix_x++) {
for (pix_y = 0; pix_y < CELL_Y_SZ; pix_y++) {
if ((cell_bitmap[pix_x] >> pix_y) & 0x01)
- cellstart[(pix_y * PIX_X) + pix_x] = fg;
+ cellstart[((CELL_Y_SZ - pix_y - 1) * PIX_X) + pix_x] = fg;
else
- cellstart[(pix_y * PIX_X) + pix_x] = bg;
+ cellstart[((CELL_Y_SZ - pix_y - 1) * PIX_X) + pix_x] = bg;
}
}
}