Signed-off-by: Kevin O'Connor kevin@koconnor.net --- vgasrc/vga.c | 6 +++--- vgasrc/vgatables.c | 4 ++-- vgasrc/vgatables.h | 12 +++++++++++- 3 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/vgasrc/vga.c b/vgasrc/vga.c index d1de5cc..ee10704 100644 --- a/vgasrc/vga.c +++ b/vgasrc/vga.c @@ -420,7 +420,7 @@ vga_set_mode(u8 mode, u8 noclearmem) // 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... @@ -1586,8 +1586,8 @@ vga_post(struct bregs *regs) // 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()); + SET_VGA(video_save_pointer_table.videoparam + , SEGOFF(get_global_seg(), (u32)video_param_table));
// Fixup checksum extern u8 _rom_header_size, _rom_header_checksum; diff --git a/vgasrc/vgatables.c b/vgasrc/vgatables.c index 0587e65..17a6ca6 100644 --- a/vgasrc/vgatables.c +++ b/vgasrc/vgatables.c @@ -13,6 +13,8 @@ * Video parameter table ****************************************************************/
+struct VideoSavePointer_s video_save_pointer_table VAR16; + struct VideoParam_s video_param_table[] VAR16 = { // index=0x00 no mode defined {}, @@ -414,8 +416,6 @@ find_vga_entry(u8 mode) return NULL; }
-u16 video_save_pointer_table[14] VAR16; -
/**************************************************************** * Static functionality table diff --git a/vgasrc/vgatables.h b/vgasrc/vgatables.h index d2fad8c..ef15b1d 100644 --- a/vgasrc/vgatables.h +++ b/vgasrc/vgatables.h @@ -70,6 +70,16 @@ #define SCREEN_IO_START(x,y,p) (((((x)*(y)) | 0x00ff) + 1) * (p)) #define SCREEN_MEM_START(x,y,p) SCREEN_IO_START(((x)*2),(y),(p))
+// Standard Video Save Pointer Table +struct VideoSavePointer_s { + struct segoff_s videoparam; + struct segoff_s paramdynamicsave; + struct segoff_s textcharset; + struct segoff_s graphcharset; + struct segoff_s secsavepointer; + u8 reserved[8]; +} PACKED; + /* standard BIOS Video Parameter Table */ struct VideoParam_s { u8 twidth; @@ -138,7 +148,7 @@ struct saveDACcolors {
// vgatables.c struct vgamode_s *find_vga_entry(u8 mode); -extern u16 video_save_pointer_table[]; +extern struct VideoSavePointer_s video_save_pointer_table; extern struct VideoParam_s video_param_table[]; extern u8 static_functionality[];