// * extract hw code from framebuffer code
// * use clear_screen() in scroll code
// * read/write_char should take a position; should not take count
-// * remove vmode_g->class (integrate into vmode_g->memmodel)
// * normalize params (don't use AX/BX/CX/etc.)
// XXX
void
clear_screen(struct vgamode_s *vmode_g)
{
- if (GET_GLOBAL(vmode_g->class) == TEXT) {
+ if (GET_GLOBAL(vmode_g->memmodel) & TEXT) {
memset16_far(GET_GLOBAL(vmode_g->sstart), 0, 0x0720, 32*1024);
return;
}
nblines = 0;
u8 cols = clr - cul + 1;
- if (GET_GLOBAL(vmode_g->class) == TEXT) {
+ if (GET_GLOBAL(vmode_g->memmodel) & TEXT) {
// Compute the address
void *address_far = (void*)(SCREEN_MEM_START(nbcols, nbrows, page));
dprintf(3, "Scroll, address %p (%d %d %02x)\n"
u16 nbrows = GET_BDA(video_rows) + 1;
u16 nbcols = GET_BDA(video_cols);
- if (GET_GLOBAL(vmode_g->class) == TEXT) {
+ if (GET_GLOBAL(vmode_g->memmodel) & TEXT) {
// Compute the address
void *address_far = (void*)(SCREEN_MEM_START(nbcols, nbrows, cp.page)
+ (cp.x + cp.y * nbcols) * 2);
u16 nbrows = GET_BDA(video_rows) + 1;
u16 nbcols = GET_BDA(video_cols);
- if (GET_GLOBAL(vmode_g->class) == TEXT) {
+ if (GET_GLOBAL(vmode_g->memmodel) & TEXT) {
// Compute the address
u16 *address_far = (void*)(SCREEN_MEM_START(nbcols, nbrows, cp.page)
+ (cp.x + cp.y * nbcols) * 2);
struct vgamode_s *vmode_g = find_vga_entry(GET_BDA(video_mode));
if (!vmode_g)
return;
- if (GET_GLOBAL(vmode_g->class) == TEXT)
+ if (GET_GLOBAL(vmode_g->memmodel) & TEXT)
return;
u8 *addr_far, mask, attr, data;
struct vgamode_s *vmode_g = find_vga_entry(GET_BDA(video_mode));
if (!vmode_g)
return;
- if (GET_GLOBAL(vmode_g->class) == TEXT)
+ if (GET_GLOBAL(vmode_g->memmodel) & TEXT)
return;
u8 *addr_far, mask, attr=0, data, i;
#define VPARAM(x) &video_param_table[x]
static struct vgamode_s vga_modes[] VAR16 = {
- //mode vparam class model bits sstart pelm dac
- {0x00, VPARAM(0x17), TEXT, CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
- {0x01, VPARAM(0x17), TEXT, CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
- {0x02, VPARAM(0x18), TEXT, CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
- {0x03, VPARAM(0x18), TEXT, CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
- {0x04, VPARAM(0x04), GRAPH, CGA, 2, SEG_CTEXT, 0xFF, PAL(palette1)},
- {0x05, VPARAM(0x05), GRAPH, CGA, 2, SEG_CTEXT, 0xFF, PAL(palette1)},
- {0x06, VPARAM(0x06), GRAPH, CGA, 1, SEG_CTEXT, 0xFF, PAL(palette1)},
- {0x07, VPARAM(0x07), TEXT, MTEXT, 4, SEG_MTEXT, 0xFF, PAL(palette0)},
- {0x0D, VPARAM(0x0d), GRAPH, PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette1)},
- {0x0E, VPARAM(0x0e), GRAPH, PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette1)},
- {0x0F, VPARAM(0x11), GRAPH, PLANAR1, 1, SEG_GRAPH, 0xFF, PAL(palette0)},
- {0x10, VPARAM(0x12), GRAPH, PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
- {0x11, VPARAM(0x1a), GRAPH, PLANAR1, 1, SEG_GRAPH, 0xFF, PAL(palette2)},
- {0x12, VPARAM(0x1b), GRAPH, PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
- {0x13, VPARAM(0x1c), GRAPH, LINEAR8, 8, SEG_GRAPH, 0xFF, PAL(palette3)},
- {0x6A, VPARAM(0x1d), GRAPH, PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
+ //mode vparam model bits sstart pelm dac
+ {0x00, VPARAM(0x17), CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
+ {0x01, VPARAM(0x17), CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
+ {0x02, VPARAM(0x18), CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
+ {0x03, VPARAM(0x18), CTEXT, 4, SEG_CTEXT, 0xFF, PAL(palette2)},
+ {0x04, VPARAM(0x04), CGA, 2, SEG_CTEXT, 0xFF, PAL(palette1)},
+ {0x05, VPARAM(0x05), CGA, 2, SEG_CTEXT, 0xFF, PAL(palette1)},
+ {0x06, VPARAM(0x06), CGA, 1, SEG_CTEXT, 0xFF, PAL(palette1)},
+ {0x07, VPARAM(0x07), MTEXT, 4, SEG_MTEXT, 0xFF, PAL(palette0)},
+ {0x0D, VPARAM(0x0d), PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette1)},
+ {0x0E, VPARAM(0x0e), PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette1)},
+ {0x0F, VPARAM(0x11), PLANAR1, 1, SEG_GRAPH, 0xFF, PAL(palette0)},
+ {0x10, VPARAM(0x12), PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
+ {0x11, VPARAM(0x1a), PLANAR1, 1, SEG_GRAPH, 0xFF, PAL(palette2)},
+ {0x12, VPARAM(0x1b), PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
+ {0x13, VPARAM(0x1c), LINEAR8, 8, SEG_GRAPH, 0xFF, PAL(palette3)},
+ {0x6A, VPARAM(0x1d), PLANAR4, 4, SEG_GRAPH, 0xFF, PAL(palette2)},
};
struct vgamode_s *