#include "output.h" // dprintf
#include "std/vbe.h" // VBE_CAPABILITY_8BIT_DAC
#include "stdvga.h" // VGAREG_SEQU_ADDRESS
-#include "vgabios.h" // struct vbe_modeinfo
+#include "vgabios.h" // SET_VGA
+#include "vgautil.h" // VBE_total_memory
#include "x86.h" // outw
#include "stdvga.h" // SEG_CTEXT
#include "string.h" // memset16_far
#include "util.h" // find_cb_table
-#include "vgabios.h" // VGAREG_*
+#include "vgabios.h" // SET_VGA
#include "vgafb.h" // handle_gfx_op
+#include "vgautil.h" // VBE_total_memory
static int CBmode VAR16;
static struct vgamode_s CBmodeinfo VAR16;
#include "output.h" // dprintf
#include "stdvga.h" // VGAREG_SEQU_ADDRESS
#include "string.h" // memset16_far
-#include "vgabios.h" // VBE_VENDOR_STRING
+#include "vgabios.h" // SET_VGA
+#include "vgautil.h" // VBE_total_memory
/****************************************************************
#include "hw/pci_regs.h" // PCI_BASE_ADDRESS_0
#include "output.h" // dprintf
#include "stdvga.h" // stdvga_crtc_write
-#include "vgabios.h" // VGAREG_*
+#include "vgabios.h" // SET_VGA
+#include "vgautil.h" // VBE_total_memory
/****************************************************************
#include "std/vga.h" // struct video_param_s
#include "stdvga.h" // stdvga_find_mode
#include "string.h" // memcpy_far
-#include "vgabios.h" // video_param_table
+#include "vgabios.h" // SET_VGA
+#include "vgautil.h" // vgafont16
/****************************************************************
#include "bregs.h" // struct bregs
#include "vgabios.h" // get_cursor_pos
#include "vgafb.h" // handle_gfx_op
+#include "vgautil.h" // swcursor_check_event
// Draw/undraw a cursor on the framebuffer by xor'ing the cursor cell
static void
#include "output.h" // dprintf
#include "std/vbe.h" // struct vbe_info
#include "string.h" // memset_far
-#include "vgabios.h" // handle_104f
+#include "vgabios.h" // get_current_mode
#include "vgahw.h" // vgahw_set_mode
+#include "vgautil.h" // handle_104f
+
+#define VBE_OEM_STRING "SeaBIOS VBE(C) 2011"
+#define VBE_VENDOR_STRING "SeaBIOS Developers"
+#define VBE_PRODUCT_STRING "SeaBIOS VBE Adapter"
+#define VBE_REVISION_STRING "Rev. 1"
u32 VBE_total_memory VAR16 = 256 * 1024;
u32 VBE_capabilities VAR16;
#include "vgabios.h" // calc_page_size
#include "vgafb.h" // vgafb_write_char
#include "vgahw.h" // vgahw_set_mode
+#include "vgautil.h" // swcursor_pre_handle10
/****************************************************************
return CONFIG_VGA_EMULATE_TEXT && GET_BDA_EXT(flags) & BF_EMULATE_TEXT;
}
+// Write to global variables (during "post" phase only)
+#define SET_VGA(var, val) SET_FARVAR(get_global_seg(), (var), (val))
+
// Debug settings
#define DEBUG_VGA_POST 1
#define DEBUG_VGA_10 3
-// vgafonts.c
-extern u8 vgafont8[];
-extern u8 vgafont14[];
-extern u8 vgafont16[];
-extern u8 vgafont14alt[];
-extern u8 vgafont16alt[];
-
-// vgainit.c
-extern int VgaBDF;
-extern int HaveRunInit;
-
// vgabios.c
-#define SET_VGA(var, val) SET_FARVAR(get_global_seg(), (var), (val))
int vga_bpp(struct vgamode_s *vmode_g);
u16 calc_page_size(u8 memmodel, u16 width, u16 height);
u16 get_cursor_shape(void);
int vga_set_mode(int mode, int flags);
extern struct video_func_static static_functionality;
-// swcursor.c
-struct bregs;
-void swcursor_pre_handle10(struct bregs *regs);
-void swcursor_check_event(void);
-
-// vbe.c
-extern u32 VBE_total_memory;
-extern u32 VBE_capabilities;
-extern u32 VBE_framebuffer;
-extern u16 VBE_win_granularity;
-#define VBE_OEM_STRING "SeaBIOS VBE(C) 2011"
-#define VBE_VENDOR_STRING "SeaBIOS Developers"
-#define VBE_PRODUCT_STRING "SeaBIOS VBE Adapter"
-#define VBE_REVISION_STRING "Rev. 1"
-void handle_104f(struct bregs *regs);
-
#endif // vgabios.h
#include "output.h" // dprintf
#include "stdvga.h" // stdvga_planar4_plane
#include "string.h" // memset_far
-#include "vgabios.h" // vgafb_scroll
+#include "vgabios.h" // get_current_mode
#include "vgafb.h" // vgafb_write_char
#include "vgahw.h" // vgahw_get_linelength
+#include "vgautil.h" // VBE_framebuffer
static inline void
memmove_stride(u16 seg, void *dst, void *src, int copylen, int stride, int lines)
-#include "vgabios.h" // vgafont8
+#include "vgautil.h" // vgafont8
/*
* These fonts come from ftp://ftp.simtel.net/pub/simtelnet/msdos/screen/fntcol16.zip
#include "std/pmm.h" // struct pmmheader
#include "string.h" // checksum_far
#include "util.h" // VERSION
-#include "vgabios.h" // video_save_pointer_table
+#include "vgabios.h" // SET_VGA
#include "vgahw.h" // vgahw_setup
+#include "vgautil.h" // swcursor_check_event
// Type of emulator platform - for dprintf with certain compile options.
int PlatformRunningOn VAR16;
--- /dev/null
+// Misc function and variable declarations.
+#ifndef __VGAUTIL_H
+#define __VGAUTIL_H
+
+#include "types.h" // u8
+
+// swcursor.c
+struct bregs;
+void swcursor_pre_handle10(struct bregs *regs);
+void swcursor_check_event(void);
+
+// vbe.c
+extern u32 VBE_total_memory;
+extern u32 VBE_capabilities;
+extern u32 VBE_framebuffer;
+extern u16 VBE_win_granularity;
+void handle_104f(struct bregs *regs);
+
+// vgafonts.c
+extern u8 vgafont8[];
+extern u8 vgafont14[];
+extern u8 vgafont16[];
+extern u8 vgafont14alt[];
+extern u8 vgafont16alt[];
+
+// vgainit.c
+extern int VgaBDF;
+extern int HaveRunInit;
+
+#endif // vgautil.h