The VBE display extension is now a part of the Bochs core. The configure option

--enable-vbe is now deprecated and the symbols BX_SUPPORT_VBE and
BX_SUPPORT_PCIVGA have been removed. To enable VBE support, the bochsrc option
"vga: extension=" must be set to "vbe". If PCI is present, you can assign the
"pcivga" device to a PCI slot.
This commit is contained in:
Volker Ruppert 2011-03-07 19:01:22 +00:00
parent ab1ea79f2c
commit 8c32359615
10 changed files with 104 additions and 217 deletions

View File

@ -21,7 +21,6 @@
--enable-x86-debugger \
--enable-a20-pin \
--enable-instrumentation=instrument/example1 \
--enable-vbe \
--enable-ne2000 \
--enable-pci \
--enable-acpi \

View File

@ -755,11 +755,7 @@ void bx_init_options()
"VGA Extension",
"Name of the VGA extension",
"none", BX_PATHNAME_LEN);
#if BX_SUPPORT_VBE
vga_extension->set_initial_val("vbe");
#elif BX_SUPPORT_CLGD54XX
vga_extension->set_initial_val("cirrus");
#endif
display->set_options(display->SHOW_PARENT);
// keyboard & mouse subtree

View File

@ -636,9 +636,6 @@ typedef
// limited i440FX PCI support
#define BX_SUPPORT_PCI 0
// Bochs VBE display interface
#define BX_SUPPORT_VBE 0
// CLGD54XX emulation
#define BX_SUPPORT_CLGD54XX 0
@ -649,9 +646,6 @@ typedef
#error To enable ACPI support, you must also enable PCI
#endif
// Experimental VGA on PCI
#define BX_SUPPORT_PCIVGA 0
// Experimental host PCI device mapping
#define BX_SUPPORT_PCIDEV 0

View File

@ -1340,28 +1340,6 @@ AC_ARG_ENABLE(raw-serial,
]
)
AC_MSG_CHECKING(for VESA BIOS extensions)
AC_ARG_ENABLE(vbe,
[ --enable-vbe use VESA BIOS extensions],
[if test "$enableval" = yes; then
AC_MSG_RESULT(yes)
AC_DEFINE(BX_SUPPORT_VBE, 1)
if test "$pci" = 1; then
AC_DEFINE(BX_SUPPORT_PCIVGA, 1)
fi
else
AC_MSG_RESULT(no)
AC_DEFINE(BX_SUPPORT_VBE, 0)
fi],
[
AC_MSG_RESULT(yes)
AC_DEFINE(BX_SUPPORT_VBE, 1)
if test "$pci" = 1; then
AC_DEFINE(BX_SUPPORT_PCIVGA, 1)
fi
]
)
AC_MSG_CHECKING(for CLGD54XX emulation)
AC_ARG_ENABLE(clgd54xx,
[ --enable-clgd54xx enable CLGD54XX emulation],
@ -2793,6 +2771,16 @@ AC_ARG_ENABLE(vme,
AC_MSG_RESULT(no)
])
AC_MSG_CHECKING(for VESA BIOS extensions (deprecated))
AC_ARG_ENABLE(vbe,
[ --enable-vbe use VESA BIOS extensions (deprecated)],
[AC_MSG_RESULT($enableval)
AC_MSG_ERROR([DEPRECATED - this feature always available with .bochsrc option])
],
[
AC_MSG_RESULT(no)
])
# Create some subdirectories for when you run configure from some other
# directory.

View File

@ -401,7 +401,7 @@ currently work with.
<entry>VBE (VESA) Support</entry>
<entry>Yes</entry>
<entry>Currently resolutions up to 2560x1600x32bpp are supported.
You must compile Bochs with VBE enabled and use the LGPL'd VGABIOS.
You must enable VBE with the VGA extension option and use the LGPL'd VGABIOS.
For more information see <xref linkend="vesa-notes">.
</entry>
</row>
@ -2176,13 +2176,6 @@ turn it off.
<entry>no</entry>
<entry>Enable PCI pseudo NIC (network card) support.</entry>
</row>
<row>
<entry>--enable-vbe</entry>
<entry>no</entry>
<entry>Use VGA BIOS Extensions (VBE) by Jeroen Janssen, see <xref linkend="vesa-notes">
for more information.
</entry>
</row>
<row>
<entry>--enable-clgd54xx</entry>
<entry>no</entry>
@ -7201,8 +7194,7 @@ it may even be possible to edit the shortcut before sending it.
</para>
<para>
In order to use VESA VBE, you need to compile Bochs using the <option>--enable-vbe</option>
option and enable it in your <filename>bochsrc</filename> by setting the
In order to use VESA VBE, you need to enable it in your <filename>bochsrc</filename> by setting the
<link linkend="bochsopt-vga">vga option</link> to <parameter>vbe</parameter>.
Finally, you need to use the
<ulink url="http://savannah.nongnu.org/projects/vgabios/">LGPL'd VGABIOS</ulink>

View File

@ -259,12 +259,10 @@ void bx_devices_c::init(BX_MEM_C *newmem)
#if BX_SUPPORT_PCI
if (SIM->get_param_bool(BXPN_I440FX_SUPPORT)->get()) {
#if BX_SUPPORT_PCIVGA && BX_SUPPORT_VBE
if ((DEV_is_pci_device("pcivga")) &&
(!strcmp(SIM->get_param_string(BXPN_VGA_EXTENSION)->getptr(), "vbe"))) {
PLUG_load_plugin(pcivga, PLUGTYPE_OPTIONAL);
}
#endif
#if BX_SUPPORT_USB_UHCI
if (is_usb_uhci_enabled()) {
PLUG_load_plugin(usb_uhci, PLUGTYPE_OPTIONAL);

View File

@ -35,7 +35,7 @@
#include "iodev.h"
#if BX_SUPPORT_PCI && BX_SUPPORT_PCIVGA
#if BX_SUPPORT_PCI
#include "pci.h"
#include "pcivga.h"
@ -192,4 +192,4 @@ void bx_pcivga_c::pci_write_handler(Bit8u address, Bit32u value, unsigned io_len
BX_DEBUG(("write PCI register 0x%02x value 0x%08x", address, value));
}
#endif // BX_SUPPORT_PCI && BX_SUPPORT_PCIVGA
#endif // BX_SUPPORT_PCI

View File

@ -120,10 +120,8 @@ void bx_vga_c::init(void)
{
unsigned i,string_i;
unsigned x,y;
#if BX_SUPPORT_VBE
unsigned addr;
Bit16u max_xres, max_yres, max_bpp;
#endif
int argc;
char *argv[16];
char *ptr;
@ -278,8 +276,7 @@ void bx_vga_c::init(void)
}
}
#if BX_SUPPORT_VBE
// The following is for the vbe display extension
// The following is for the VBE display extension
BX_VGA_THIS vbe.enabled=0;
BX_VGA_THIS vbe.dac_8bit=0;
BX_VGA_THIS vbe.base_address = 0x0000;
@ -337,7 +334,6 @@ void bx_vga_c::init(void)
BX_INFO(("VBE Bochs Display Extension Enabled"));
}
#endif
}
void bx_vga_c::init_iohandlers(bx_read_handler_t f_read, bx_write_handler_t f_write)
@ -499,7 +495,7 @@ void bx_vga_c::register_state(void)
new bx_shadow_bool_c(list, "y_doublescan", &BX_VGA_THIS s.y_doublescan);
new bx_shadow_num_c(list, "last_bpp", &BX_VGA_THIS s.last_bpp);
new bx_shadow_data_c(list, "memory", BX_VGA_THIS s.memory, BX_VGA_THIS s.memsize);
#if BX_SUPPORT_VBE
// register state for Bochs VBE
if (!strcmp(SIM->get_param_string(BXPN_VGA_EXTENSION)->getptr(), "vbe")) {
bx_list_c *vbe = new bx_list_c(list, "vbe", 18);
new bx_shadow_num_c(vbe, "cur_dispi", &BX_VGA_THIS vbe.cur_dispi, BASE_HEX);
@ -520,21 +516,16 @@ void bx_vga_c::register_state(void)
new bx_shadow_bool_c(vbe, "get_capabilities", &BX_VGA_THIS vbe.get_capabilities);
new bx_shadow_bool_c(vbe, "dac_8bit", &BX_VGA_THIS vbe.dac_8bit);
}
#endif
}
void bx_vga_c::after_restore_state(void)
{
for (unsigned i=0; i<256; i++) {
#if BX_SUPPORT_VBE
if (BX_VGA_THIS vbe.dac_8bit) {
bx_gui->palette_change(i, BX_VGA_THIS s.pel.data[i].red,
BX_VGA_THIS s.pel.data[i].green,
BX_VGA_THIS s.pel.data[i].blue);
}
else
#endif
{
} else {
bx_gui->palette_change(i, BX_VGA_THIS s.pel.data[i].red<<2,
BX_VGA_THIS s.pel.data[i].green<<2,
BX_VGA_THIS s.pel.data[i].blue<<2);
@ -544,12 +535,10 @@ void bx_vga_c::after_restore_state(void)
old_iWidth = BX_MAX_XRES;
old_iHeight = BX_MAX_YRES;
BX_VGA_THIS redraw_area(0, 0, BX_MAX_XRES, BX_MAX_YRES);
#if BX_SUPPORT_VBE
if (BX_VGA_THIS vbe.enabled) {
bx_gui->dimension_update(BX_VGA_THIS vbe.xres, BX_VGA_THIS vbe.yres, 0, 0,
BX_VGA_THIS vbe.bpp);
}
#endif
BX_VGA_THIS update();
bx_gui->flush();
}
@ -730,7 +719,7 @@ Bit32u bx_vga_c::read(Bit32u address, unsigned io_len)
case 0x08: case 0x09: case 0x0a: case 0x0b:
case 0x0c: case 0x0d: case 0x0e: case 0x0f:
retval = BX_VGA_THIS s.attribute_ctrl.palette_reg[BX_VGA_THIS s.attribute_ctrl.address];
RETURN(retval);
RETURN(retval);
break;
case 0x10: /* mode control register */
retval =
@ -741,13 +730,13 @@ Bit32u bx_vga_c::read(Bit32u address, unsigned io_len)
(BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_panning_compat << 5) |
(BX_VGA_THIS s.attribute_ctrl.mode_ctrl.pixel_clock_select << 6) |
(BX_VGA_THIS s.attribute_ctrl.mode_ctrl.internal_palette_size << 7);
RETURN(retval);
RETURN(retval);
break;
case 0x11: /* overscan color register */
RETURN(BX_VGA_THIS s.attribute_ctrl.overscan_color);
case 0x11: /* overscan color register */
RETURN(BX_VGA_THIS s.attribute_ctrl.overscan_color);
break;
case 0x12: /* color plane enable */
RETURN(BX_VGA_THIS s.attribute_ctrl.color_plane_enable);
case 0x12: /* color plane enable */
RETURN(BX_VGA_THIS s.attribute_ctrl.color_plane_enable);
break;
case 0x13: /* horizontal PEL panning register */
RETURN(BX_VGA_THIS s.attribute_ctrl.horiz_pel_panning);
@ -1278,21 +1267,17 @@ void bx_vga_c::write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_l
case 2:
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue = value;
#if BX_SUPPORT_VBE
if (BX_VGA_THIS vbe.dac_8bit) {
needs_update |= bx_gui->palette_change(BX_VGA_THIS s.pel.write_data_register,
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].red,
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].green,
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue);
} else {
#endif
needs_update |= bx_gui->palette_change(BX_VGA_THIS s.pel.write_data_register,
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].red<<2,
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].green<<2,
BX_VGA_THIS s.pel.data[BX_VGA_THIS s.pel.write_data_register].blue<<2);
#if BX_SUPPORT_VBE
}
#endif
break;
}
@ -1473,10 +1458,7 @@ void bx_vga_c::write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_l
case 0x13:
case 0x14:
case 0x17:
#if BX_SUPPORT_VBE
if (!BX_VGA_THIS vbe.enabled || (BX_VGA_THIS vbe.bpp == VBE_DISPI_BPP_4))
#endif
{
if (!BX_VGA_THIS vbe.enabled || (BX_VGA_THIS vbe.bpp == VBE_DISPI_BPP_4)) {
// Line offset change
BX_VGA_THIS s.line_offset = BX_VGA_THIS s.CRTC.reg[0x13] << 1;
if (BX_VGA_THIS s.CRTC.reg[0x14] & 0x40) BX_VGA_THIS s.line_offset <<= 2;
@ -1490,7 +1472,6 @@ void bx_vga_c::write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_l
needs_update = 1;
break;
}
}
break;
@ -1519,9 +1500,9 @@ Bit64s bx_vga_c::vga_param_handler(bx_param_c *param, int set, Bit64s val)
{
// handler for runtime parameter 'vga_update_interval'
if (set) {
BX_INFO (("Changing timer interval to %d", (Bit32u)val));
BX_VGA_THIS timer_handler (theVga);
bx_pc_system.activate_timer (BX_VGA_THIS timer_id, (Bit32u)val, 1);
BX_INFO(("Changing timer interval to %d", (Bit32u)val));
BX_VGA_THIS timer_handler(theVga);
bx_pc_system.activate_timer(BX_VGA_THIS timer_id, (Bit32u)val, 1);
}
return val;
}
@ -1567,9 +1548,7 @@ void bx_vga_c::update(void)
if ((bx_pc_system.time_usec() % 13888) < 70)
return;
#if BX_SUPPORT_VBE
if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp != VBE_DISPI_BPP_4))
{
if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp != VBE_DISPI_BPP_4)) {
// specific VBE code display update code
unsigned pitch;
unsigned xc, yc, xti, yti;
@ -1832,7 +1811,7 @@ void bx_vga_c::update(void)
// after a vbe display update, don't try to do any 'normal vga' updates anymore
return;
}
#endif
// fields that effect the way video memory is serialized into screen output:
// GRAPHICS CONTROLLER:
// BX_VGA_THIS s.graphics_ctrl.shift_reg:
@ -1906,19 +1885,14 @@ void bx_vga_c::update(void)
} else { // output data in serial fashion with each display plane
// output on its associated serial output. Standard EGA/VGA format
#if BX_SUPPORT_VBE
if (BX_VGA_THIS vbe.enabled)
{
if (BX_VGA_THIS vbe.enabled) {
plane0 = &BX_VGA_THIS s.memory[0<<VBE_DISPI_4BPP_PLANE_SHIFT];
plane1 = &BX_VGA_THIS s.memory[1<<VBE_DISPI_4BPP_PLANE_SHIFT];
plane2 = &BX_VGA_THIS s.memory[2<<VBE_DISPI_4BPP_PLANE_SHIFT];
plane3 = &BX_VGA_THIS s.memory[3<<VBE_DISPI_4BPP_PLANE_SHIFT];
start_addr = BX_VGA_THIS vbe.virtual_start;
line_compare = 0xffff;
}
else
#endif
{
} else {
plane0 = &BX_VGA_THIS s.memory[0<<16];
plane1 = &BX_VGA_THIS s.memory[1<<16];
plane2 = &BX_VGA_THIS s.memory[2<<16];
@ -2074,8 +2048,8 @@ void bx_vga_c::update(void)
SET_TILE_UPDATED (xti, yti, 0);
bx_gui->graphics_tile_update(BX_VGA_THIS s.tile, xc, yc);
}
}
}
}
}
}
break; // case 2
@ -2216,21 +2190,13 @@ Bit8u bx_vga_c::mem_read(bx_phy_address addr)
Bit32u offset;
Bit8u *plane0, *plane1, *plane2, *plane3;
#if BX_SUPPORT_VBE
// if in a vbe enabled mode, read from the vbe_memory
if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp != VBE_DISPI_BPP_4))
{
return vbe_mem_read(addr);
}
else if ((BX_VGA_THIS vbe.base_address != 0) && (addr >= BX_VGA_THIS vbe.base_address))
{
} else if ((BX_VGA_THIS vbe.base_address != 0) && (addr >= BX_VGA_THIS vbe.base_address)) {
return 0xff;
}
#endif
#if defined(VGA_TRACE_FEATURE)
// BX_DEBUG(("8-bit memory read from 0x%08x", addr));
#endif
#ifdef __OS2__
@ -2268,17 +2234,12 @@ Bit8u bx_vga_c::mem_read(bx_phy_address addr)
return BX_VGA_THIS s.memory[(offset & ~0x03) + (offset % 4)*65536];
}
#if BX_SUPPORT_VBE
if (BX_VGA_THIS vbe.enabled)
{
if (BX_VGA_THIS vbe.enabled) {
plane0 = &BX_VGA_THIS s.memory[(0<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS vbe.bank<<16)];
plane1 = &BX_VGA_THIS s.memory[(1<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS vbe.bank<<16)];
plane2 = &BX_VGA_THIS s.memory[(2<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS vbe.bank<<16)];
plane3 = &BX_VGA_THIS s.memory[(3<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS vbe.bank<<16)];
}
else
#endif
{
} else {
plane0 = &BX_VGA_THIS s.memory[0<<16];
plane1 = &BX_VGA_THIS s.memory[1<<16];
plane2 = &BX_VGA_THIS s.memory[2<<16];
@ -2354,22 +2315,14 @@ void bx_vga_c::mem_write(bx_phy_address addr, Bit8u value)
unsigned start_addr;
Bit8u *plane0, *plane1, *plane2, *plane3;
#if BX_SUPPORT_VBE
// if in a vbe enabled mode, write to the vbe_memory
if ((BX_VGA_THIS vbe.enabled) && (BX_VGA_THIS vbe.bpp != VBE_DISPI_BPP_4))
{
vbe_mem_write(addr, value);
return;
}
else if ((BX_VGA_THIS vbe.base_address != 0) && (addr >= BX_VGA_THIS vbe.base_address))
{
} else if ((BX_VGA_THIS vbe.base_address != 0) && (addr >= BX_VGA_THIS vbe.base_address)) {
return;
}
#endif
#if defined(VGA_TRACE_FEATURE)
//BX_DEBUG(("8-bit memory write to %08x = %02x", addr, value));
#endif
#ifdef __OS2__
@ -2479,17 +2432,12 @@ void bx_vga_c::mem_write(bx_phy_address addr, Bit8u value)
/* addr between 0xA0000 and 0xAFFFF */
#if BX_SUPPORT_VBE
if (BX_VGA_THIS vbe.enabled)
{
if (BX_VGA_THIS vbe.enabled) {
plane0 = &BX_VGA_THIS s.memory[(0<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS vbe.bank<<16)];
plane1 = &BX_VGA_THIS s.memory[(1<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS vbe.bank<<16)];
plane2 = &BX_VGA_THIS s.memory[(2<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS vbe.bank<<16)];
plane3 = &BX_VGA_THIS s.memory[(3<<VBE_DISPI_4BPP_PLANE_SHIFT) + (BX_VGA_THIS vbe.bank<<16)];
}
else
#endif
{
} else {
plane0 = &BX_VGA_THIS s.memory[0<<16];
plane1 = &BX_VGA_THIS s.memory[1<<16];
plane2 = &BX_VGA_THIS s.memory[2<<16];
@ -2898,20 +2846,14 @@ void bx_vga_c::redraw_area(unsigned x0, unsigned y0, unsigned width,
BX_VGA_THIS s.vga_mem_updated = 1;
#if BX_SUPPORT_VBE
if (BX_VGA_THIS s.graphics_ctrl.graphics_alpha || BX_VGA_THIS vbe.enabled) {
#else
if (BX_VGA_THIS s.graphics_ctrl.graphics_alpha) {
#endif
// graphics mode
xmax = old_iWidth;
ymax = old_iHeight;
#if BX_SUPPORT_VBE
if (BX_VGA_THIS vbe.enabled) {
xmax = BX_VGA_THIS vbe.xres;
ymax = BX_VGA_THIS vbe.yres;
}
#endif
xt0 = x0 / X_TILESIZE;
yt0 = y0 / Y_TILESIZE;
if (x0 < xmax) {
@ -2926,7 +2868,7 @@ void bx_vga_c::redraw_area(unsigned x0, unsigned y0, unsigned width,
}
for (yti=yt0; yti<=yt1; yti++) {
for (xti=xt0; xti<=xt1; xti++) {
SET_TILE_UPDATED (xti, yti, 1);
SET_TILE_UPDATED(xti, yti, 1);
}
}
@ -2938,7 +2880,6 @@ void bx_vga_c::redraw_area(unsigned x0, unsigned y0, unsigned width,
}
#if BX_SUPPORT_VBE
bx_bool bx_vga_c::vbe_set_base_addr(Bit32u *addr, Bit8u *pci_conf)
{
if (DEV_pci_set_base_mem(BX_VGA_THIS_PTR, mem_read_handler,
@ -3487,5 +3428,3 @@ Bit32u bx_vga_c::vbe_write(Bit32u address, Bit32u value, unsigned io_len)
} // end switch address
}
#endif

View File

@ -42,72 +42,63 @@
(blue_mask)) \
)
#if BX_SUPPORT_VBE
#define VBE_DISPI_TOTAL_VIDEO_MEMORY_MB 16
#define VBE_DISPI_4BPP_PLANE_SHIFT 22
// Bochs VBE definitions
#define VBE_DISPI_BANK_ADDRESS 0xA0000
#define VBE_DISPI_BANK_SIZE_KB 64
#define VBE_DISPI_TOTAL_VIDEO_MEMORY_MB 16
#define VBE_DISPI_4BPP_PLANE_SHIFT 22
#define VBE_DISPI_MAX_XRES 2560
#define VBE_DISPI_MAX_YRES 1600
#define VBE_DISPI_MAX_BPP 32
#define VBE_DISPI_BANK_ADDRESS 0xA0000
#define VBE_DISPI_BANK_SIZE_KB 64
#define VBE_DISPI_IOPORT_INDEX 0x01CE
#define VBE_DISPI_IOPORT_DATA 0x01CF
#define VBE_DISPI_MAX_XRES 2560
#define VBE_DISPI_MAX_YRES 1600
#define VBE_DISPI_MAX_BPP 32
#define VBE_DISPI_INDEX_ID 0x0
#define VBE_DISPI_INDEX_XRES 0x1
#define VBE_DISPI_INDEX_YRES 0x2
#define VBE_DISPI_INDEX_BPP 0x3
#define VBE_DISPI_INDEX_ENABLE 0x4
#define VBE_DISPI_INDEX_BANK 0x5
#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
#define VBE_DISPI_INDEX_X_OFFSET 0x8
#define VBE_DISPI_INDEX_Y_OFFSET 0x9
#define VBE_DISPI_INDEX_VIDEO_MEMORY_64K 0xa
#define VBE_DISPI_IOPORT_INDEX 0x01CE
#define VBE_DISPI_IOPORT_DATA 0x01CF
#define VBE_DISPI_ID0 0xB0C0
#define VBE_DISPI_ID1 0xB0C1
#define VBE_DISPI_ID2 0xB0C2
#define VBE_DISPI_ID3 0xB0C3
#define VBE_DISPI_ID4 0xB0C4
#define VBE_DISPI_ID5 0xB0C5
#define VBE_DISPI_INDEX_ID 0x0
#define VBE_DISPI_INDEX_XRES 0x1
#define VBE_DISPI_INDEX_YRES 0x2
#define VBE_DISPI_INDEX_BPP 0x3
#define VBE_DISPI_INDEX_ENABLE 0x4
#define VBE_DISPI_INDEX_BANK 0x5
#define VBE_DISPI_INDEX_VIRT_WIDTH 0x6
#define VBE_DISPI_INDEX_VIRT_HEIGHT 0x7
#define VBE_DISPI_INDEX_X_OFFSET 0x8
#define VBE_DISPI_INDEX_Y_OFFSET 0x9
#define VBE_DISPI_INDEX_VIDEO_MEMORY_64K 0xa
#define VBE_DISPI_BPP_4 0x04
#define VBE_DISPI_BPP_8 0x08
#define VBE_DISPI_BPP_15 0x0F
#define VBE_DISPI_BPP_16 0x10
#define VBE_DISPI_BPP_24 0x18
#define VBE_DISPI_BPP_32 0x20
#define VBE_DISPI_ID0 0xB0C0
#define VBE_DISPI_ID1 0xB0C1
#define VBE_DISPI_ID2 0xB0C2
#define VBE_DISPI_ID3 0xB0C3
#define VBE_DISPI_ID4 0xB0C4
#define VBE_DISPI_ID5 0xB0C5
#define VBE_DISPI_DISABLED 0x00
#define VBE_DISPI_ENABLED 0x01
#define VBE_DISPI_GETCAPS 0x02
#define VBE_DISPI_8BIT_DAC 0x20
#define VBE_DISPI_LFB_ENABLED 0x40
#define VBE_DISPI_NOCLEARMEM 0x80
#define VBE_DISPI_BPP_4 0x04
#define VBE_DISPI_BPP_8 0x08
#define VBE_DISPI_BPP_15 0x0F
#define VBE_DISPI_BPP_16 0x10
#define VBE_DISPI_BPP_24 0x18
#define VBE_DISPI_BPP_32 0x20
#define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xE0000000
#define VBE_DISPI_DISABLED 0x00
#define VBE_DISPI_ENABLED 0x01
#define VBE_DISPI_GETCAPS 0x02
#define VBE_DISPI_8BIT_DAC 0x20
#define VBE_DISPI_LFB_ENABLED 0x40
#define VBE_DISPI_NOCLEARMEM 0x80
#define VBE_DISPI_TOTAL_VIDEO_MEMORY_KB (VBE_DISPI_TOTAL_VIDEO_MEMORY_MB * 1024)
#define VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES (VBE_DISPI_TOTAL_VIDEO_MEMORY_KB * 1024)
#define VBE_DISPI_LFB_PHYSICAL_ADDRESS 0xE0000000
#define BX_MAX_XRES VBE_DISPI_MAX_XRES
#define BX_MAX_YRES VBE_DISPI_MAX_YRES
#define VBE_DISPI_TOTAL_VIDEO_MEMORY_KB (VBE_DISPI_TOTAL_VIDEO_MEMORY_MB * 1024)
#define VBE_DISPI_TOTAL_VIDEO_MEMORY_BYTES (VBE_DISPI_TOTAL_VIDEO_MEMORY_KB * 1024)
#elif BX_SUPPORT_CLGD54XX
#define BX_MAX_XRES VBE_DISPI_MAX_XRES
#define BX_MAX_YRES VBE_DISPI_MAX_YRES
#define BX_MAX_XRES 1280
#define BX_MAX_YRES 1024
#else
#define BX_MAX_XRES 800
#define BX_MAX_YRES 600
#endif // BX_SUPPORT_VBE
// End Bochs VBE definitions
#define X_TILESIZE 16
#define Y_TILESIZE 24
@ -141,13 +132,6 @@ public:
virtual void debug_dump(void);
#endif
#if BX_SUPPORT_VBE
virtual bx_bool vbe_set_base_addr(Bit32u *addr, Bit8u *pci_conf);
BX_VGA_SMF Bit8u vbe_mem_read(bx_phy_address addr) BX_CPP_AttrRegparmN(1);
BX_VGA_SMF void vbe_mem_write(bx_phy_address addr, Bit8u value) BX_CPP_AttrRegparmN(2);
#endif
virtual void redraw_area(unsigned x0, unsigned y0,
unsigned width, unsigned height);
@ -171,25 +155,11 @@ protected:
static void write_handler_no_log(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len);
#endif
#if BX_SUPPORT_VBE
static Bit32u vbe_read_handler(void *this_ptr, Bit32u address, unsigned io_len);
static void vbe_write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len);
#endif
#if BX_USE_VGA_SMF == 0
Bit32u read(Bit32u address, unsigned io_len);
#endif
void write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_log);
#if BX_SUPPORT_VBE
#if BX_USE_VGA_SMF == 0
Bit32u vbe_read(Bit32u address, unsigned io_len);
void vbe_write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_log);
#endif
#endif // BX_SUPPORT_VBE
BX_VGA_SMF void update(void);
BX_VGA_SMF void determine_screen_dimensions(unsigned *piHeight, unsigned *piWidth);
@ -305,7 +275,24 @@ protected:
Bit8u last_bpp;
} s; // state information
#if BX_SUPPORT_VBE
int timer_id;
bx_bool extension_init;
bx_bool extension_checked;
// Bochs VBE section
virtual bx_bool vbe_set_base_addr(Bit32u *addr, Bit8u *pci_conf);
BX_VGA_SMF Bit8u vbe_mem_read(bx_phy_address addr) BX_CPP_AttrRegparmN(1);
BX_VGA_SMF void vbe_mem_write(bx_phy_address addr, Bit8u value) BX_CPP_AttrRegparmN(2);
static Bit32u vbe_read_handler(void *this_ptr, Bit32u address, unsigned io_len);
static void vbe_write_handler(void *this_ptr, Bit32u address, Bit32u value, unsigned io_len);
#if BX_USE_VGA_SMF == 0
Bit32u vbe_read(Bit32u address, unsigned io_len);
void vbe_write(Bit32u address, Bit32u value, unsigned io_len, bx_bool no_log);
#endif
struct {
Bit16u cur_dispi;
Bit32u base_address;
@ -329,11 +316,6 @@ protected:
bx_bool get_capabilities;
bx_bool dac_8bit;
} vbe; // VBE state information
#endif
int timer_id;
bx_bool extension_init;
bx_bool extension_checked;
};
#if BX_SUPPORT_CLGD54XX

View File

@ -1084,8 +1084,7 @@ void bx_init_hardware()
SIM->get_param_bool(BXPN_I440FX_SUPPORT)->get() ? "yes" : "no"));
BX_INFO((" SB16 support: %s",BX_SUPPORT_SB16?"yes":"no"));
BX_INFO((" USB support: %s",BX_SUPPORT_PCIUSB?"yes":"no"));
BX_INFO((" VGA extension support: %s %s",BX_SUPPORT_VBE?"vbe":"",
BX_SUPPORT_CLGD54XX?"cirrus":""));
BX_INFO((" VGA extension support: vbe %s", BX_SUPPORT_CLGD54XX?"cirrus":""));
// Check if there is a romimage
if (strcmp(SIM->get_param_string(BXPN_ROM_PATH)->getptr(),"") == 0) {