#include "optionroms.h" // struct pci_data
#include "config.h" // CONFIG_*
#include "vbe.h" // vbe_*
+#include "geodelx.h" // geodelx_init
// XXX
#define DEBUG_VGA_POST 1
#define DEBUG_VGA_10 3
-#define SET_VGA(var, val) SET_FARVAR(get_global_seg(), (var), (val))
/****************************************************************
* PCI Data
// Start address
address = SCREEN_IO_START(nbcols, nbrows, page);
} else {
- struct VideoParam_s *vparam_g = GET_GLOBAL(vmode_g->vparam);
- address = page * GET_GLOBAL(vparam_g->slength);
+ address = page * GET_GLOBAL(vmode_g->slength);
}
vgahw_set_active_page(address);
perform_gray_scale_summing(0x00, 0x100);
}
- struct VideoParam_s *vparam_g = GET_GLOBAL(vmode_g->vparam);
- vgahw_set_mode(vparam_g);
+ vgahw_set_mode(vmode_g);
if (noclearmem == 0x00)
clear_screen(vmode_g);
crtc_addr = VGAREG_MDA_CRTC_ADDRESS;
// Set the BIOS mem
- u16 cheight = GET_GLOBAL(vparam_g->cheight);
+ u16 cheight = GET_GLOBAL(vmode_g->cheight);
SET_BDA(video_mode, mode);
- SET_BDA(video_cols, GET_GLOBAL(vparam_g->twidth));
- SET_BDA(video_pagesize, GET_GLOBAL(vparam_g->slength));
+ SET_BDA(video_cols, GET_GLOBAL(vmode_g->twidth));
+ SET_BDA(video_pagesize, GET_GLOBAL(vmode_g->slength));
SET_BDA(crtc_address, crtc_addr);
- SET_BDA(video_rows, GET_GLOBAL(vparam_g->theightm1));
+ SET_BDA(video_rows, GET_GLOBAL(vmode_g->theight)-1);
SET_BDA(char_height, cheight);
SET_BDA(video_ctl, (0x60 | noclearmem));
SET_BDA(video_switches, 0xF9);
// FIXME We nearly have the good tables. to be reworked
SET_BDA(dcc_index, 0x08); // 8 is VGA should be ok for now
SET_BDA(video_savetable
- , SEGOFF(get_global_seg(), (u32)video_save_pointer_table));
+ , SEGOFF(get_global_seg(), (u32)&video_save_pointer_table));
// FIXME
SET_BDA(video_msr, 0x00); // Unavailable on vanilla vga, but...
struct funcInfo {
- u16 static_functionality_off;
- u16 static_functionality_seg;
+ struct segoff_s static_functionality;
u8 bda_0x49[30];
u8 bda_0x84[3];
u8 dcc_index;
struct funcInfo *info = (void*)(regs->di+0);
memset_far(seg, info, 0, sizeof(*info));
// Address of static functionality table
- SET_FARVAR(seg, info->static_functionality_off, (u32)static_functionality);
- SET_FARVAR(seg, info->static_functionality_seg, get_global_seg());
+ SET_FARVAR(seg, info->static_functionality
+ , SEGOFF(get_global_seg(), (u32)static_functionality));
// Hard coded copy from BIOS area. Should it be cleaner ?
memcpy_far(seg, info->bda_0x49, SEG_BDA, (void*)0x49
SET_FARVAR(seg, info->oem_string,
SEGOFF(get_global_seg(), (u32)VBE_OEM_STRING));
- SET_FARVAR(seg, info->capabilities[0], 0x1); /* 8BIT DAC */
+ SET_FARVAR(seg, info->capabilities, 0x1); /* 8BIT DAC */
/* We generate our mode list in the reserved field of the info block */
SET_FARVAR(seg, info->video_mode, SEGOFF(seg, regs->di + 34));
SET_FARVAR(seg, info->win_size, 64); /* Bank size 64K */
SET_FARVAR(seg, info->winA_seg, 0xA000);
SET_FARVAR(seg, info->winB_seg, 0x0);
- SET_FARVAR(seg, info->win_func_ptr, 0x0);
+ SET_FARVAR(seg, info->win_func_ptr.segoff, 0x0);
SET_FARVAR(seg, info->bytes_per_scanline, modeinfo.linesize);
SET_FARVAR(seg, info->xres, modeinfo.width);
SET_FARVAR(seg, info->yres, modeinfo.height);
vgahw_init();
+ if (CONFIG_VGA_GEODELX)
+ geodelx_init();
+
init_bios_area();
vbe_init(regs->ah, regs->al);
// XXX - clear screen and display info
- // XXX: fill it
- SET_VGA(video_save_pointer_table[0], (u32)video_param_table);
- SET_VGA(video_save_pointer_table[1], get_global_seg());
+ build_video_param();
// Fixup checksum
extern u8 _rom_header_size, _rom_header_checksum;