-\r
-void modexDrawChar(page_t *page, int x/*for planar selection only*/, word t, word col, word bgcol, word addr)\r
-{\r
- /* vertical drawing routine by joncampbell123.\r
- *\r
- * optimize for VGA mode X planar memory to minimize the number of times we do I/O write to map mask register.\r
- * so, we enumerate over columns (not rows!) to draw every 4th pixel. bit masks are used because of the font bitmap.\r
- *\r
- * NTS: addr defines what VGA memory address we use, "x" is redundant except to specify which of the 4 pixels we select in the map mask register. */\r
- word rows = romFonts[t].charSize;\r
- word drawaddr;\r
- word colm, row;\r
- byte fontbyte;\r
- byte plane;\r
- byte m1,m2;\r
-\r
- plane = x & 3;\r
- m1 = 0x80; // left half\r
- m2 = 0x08; // right half\r
- for (colm=0;colm < 4;colm++) {\r
- drawaddr = addr;\r
- modexSelectPlane(PLANE(plane));\r
- for (row=0;row < rows;row++) {\r
- fontbyte = romFontsData.l[row];\r
- vga_state.vga_graphics_ram[drawaddr ] = (fontbyte & m1) ? col : bgcol;\r
- vga_state.vga_graphics_ram[drawaddr+1] = (fontbyte & m2) ? col : bgcol;\r
- drawaddr += page->width >> 2;\r
- }\r
-\r
- m1 >>= 1;\r
- m2 >>= 1;\r
- if ((++plane) == 4) {\r
- addr++;\r
- plane = 0;\r
- }\r
- }\r
-}\r