Removed "svga" display library designed for the obsolete Linux SVGALib.

The latest release is from 2001 and it will not work on modern Linux systems.
Parts of the SVGALib code have been moved to the Linux kernel and the X11 and
SDL libraries are using it as a video driver.
This commit is contained in:
Volker Ruppert 2020-11-25 07:56:32 +00:00
parent d357de7baf
commit aaf8c9d4e4
13 changed files with 35 additions and 682 deletions

View File

@ -56,7 +56,6 @@
# amigaos use native AmigaOS libraries
# sdl use SDL 1.2.x library, cross platform
# sdl2 use SDL 2.x library, cross platform
# svga use SVGALIB library for Linux, allows graphics without X11
# term text only, uses curses/ncurses library, cross platform
# rfb provides an interface to AT&T's VNC viewer, cross platform
# vncsrv use LibVNCServer for extended RFB(VNC) support

View File

@ -4,6 +4,7 @@ Changes after 2.6.11:
- General
- Save/Restore bugfixes
- Removed legacy "load32bitOShack" feature.
- Removed "svga" display library designed for the obsolete Linux SVGALib.
- CPU/CPUDB
- Bugfixes for CPU emulation correctness (CPUID/VMX initialization fixes to support Windows Hyper-V as guest in Bochs)

View File

@ -922,9 +922,6 @@ void bx_init_options()
#if BX_WITH_SDL2
"sdl2",
#endif
#if BX_WITH_SVGA
"svga",
#endif
#if BX_WITH_TERM
"term",
#endif

View File

@ -288,7 +288,6 @@
#define BX_WITH_AMIGAOS 0
#define BX_WITH_SDL 0
#define BX_WITH_SDL2 0
#define BX_WITH_SVGA 0
#define BX_WITH_WX 0
// BX_USE_TEXTCONFIG should be set to 1 unless Bochs is compiled

82
bochs/configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Id: configure.in 13888 2020-06-12 07:23:15Z vruppert .
# From configure.in Id: configure.in 13935 2020-09-03 15:19:37Z vruppert .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69.
#
@ -1074,7 +1074,6 @@ with_vncsrv
with_amigaos
with_sdl
with_sdl2
with_svga
with_wx
with_all_libs
enable_xpm
@ -1817,7 +1816,6 @@ Optional Packages:
--with-amigaos use AmigaOS (or MorphOS) GUI
--with-sdl use SDL libraries
--with-sdl2 use SDL2 libraries
--with-svga use SVGALib libraries
--with-wx use wxWidgets libraries
--with-all-libs compile all guis that Bochs supports
@ -3418,7 +3416,6 @@ $as_echo "$ADD_FLAGS" >&6; }
if (test "$with_sdl" != yes) && \
(test "$with_sdl2" != yes) && \
(test "$with_svga" != yes) && \
(test "$with_x11" != yes) && \
(test "$with_win32" != yes) && \
(test "$with_nogui" != yes) && \
@ -5201,7 +5198,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 5204 "configure"' > conftest.$ac_ext
echo '#line 5201 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -6889,11 +6886,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:6892: $lt_compile\"" >&5)
(eval echo "\"\$as_me:6889: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:6896: \$? = $ac_status" >&5
echo "$as_me:6893: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -7122,11 +7119,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7125: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7122: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7129: \$? = $ac_status" >&5
echo "$as_me:7126: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -7189,11 +7186,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7192: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7189: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7196: \$? = $ac_status" >&5
echo "$as_me:7193: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -8979,7 +8976,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 8982 "configure"
#line 8979 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -9077,7 +9074,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 9080 "configure"
#line 9077 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11192,11 +11189,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:11195: $lt_compile\"" >&5)
(eval echo "\"\$as_me:11192: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:11199: \$? = $ac_status" >&5
echo "$as_me:11196: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -11259,11 +11256,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:11262: $lt_compile\"" >&5)
(eval echo "\"\$as_me:11259: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:11266: \$? = $ac_status" >&5
echo "$as_me:11263: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -12284,7 +12281,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 12287 "configure"
#line 12284 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -12382,7 +12379,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 12385 "configure"
#line 12382 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -13205,11 +13202,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:13208: $lt_compile\"" >&5)
(eval echo "\"\$as_me:13205: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:13212: \$? = $ac_status" >&5
echo "$as_me:13209: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -13272,11 +13269,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:13275: $lt_compile\"" >&5)
(eval echo "\"\$as_me:13272: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:13279: \$? = $ac_status" >&5
echo "$as_me:13276: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -15237,11 +15234,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:15240: $lt_compile\"" >&5)
(eval echo "\"\$as_me:15237: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:15244: \$? = $ac_status" >&5
echo "$as_me:15241: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -15470,11 +15467,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:15473: $lt_compile\"" >&5)
(eval echo "\"\$as_me:15470: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:15477: \$? = $ac_status" >&5
echo "$as_me:15474: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings
@ -15537,11 +15534,11 @@ else
-e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:15540: $lt_compile\"" >&5)
(eval echo "\"\$as_me:15537: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:15544: \$? = $ac_status" >&5
echo "$as_me:15541: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -17327,7 +17324,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 17330 "configure"
#line 17327 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -17425,7 +17422,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 17428 "configure"
#line 17425 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -19112,7 +19109,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 19115 "configure"
#line 19112 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -24443,13 +24440,6 @@ fi
# Check whether --with-svga was given.
if test "${with_svga+set}" = set; then :
withval=$with_svga;
fi
# Check whether --with-wx was given.
if test "${with_wx+set}" = set; then :
withval=$with_wx;
@ -24759,20 +24749,6 @@ if test "$with_sdl2" = yes; then
use_gui_console=1
fi
if test "$with_svga" = yes; then
display_libs="$display_libs svga"
$as_echo "#define BX_WITH_SVGA 1" >>confdefs.h
SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_SVGA)"
# GUI_*FLAGS are added to the compilation of every bochs file, not just
# the files in gui/*.cc.
GUI_CFLAGS="$GUI_CFLAGS"
GUI_CXXFLAGS="$GUI_CXXFLAGS"
GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_SVGA)"
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: This Bochs feature is not maintained yet and may fail" >&5
$as_echo "$as_me: WARNING: This Bochs feature is not maintained yet and may fail" >&2;}
fi
if test "$with_rfb" = yes; then
display_libs="$display_libs rfb"
GUI_DLL_TARGETS="$GUI_DLL_TARGETS bx_rfb.dll"

View File

@ -100,7 +100,6 @@ AC_MSG_RESULT($ADD_FLAGS)
dnl // make sure the default gui is enabled if no other chosen
if (test "$with_sdl" != yes) && \
(test "$with_sdl2" != yes) && \
(test "$with_svga" != yes) && \
(test "$with_x11" != yes) && \
(test "$with_win32" != yes) && \
(test "$with_nogui" != yes) && \
@ -2240,10 +2239,6 @@ AC_ARG_WITH(sdl2,
[ --with-sdl2 use SDL2 libraries],
)
AC_ARG_WITH(svga,
[ --with-svga use SVGALib libraries],
)
AC_ARG_WITH(wx,
[ --with-wx use wxWidgets libraries],
)
@ -2489,18 +2484,6 @@ if test "$with_sdl2" = yes; then
use_gui_console=1
fi
if test "$with_svga" = yes; then
display_libs="$display_libs svga"
AC_DEFINE(BX_WITH_SVGA, 1)
SPECIFIC_GUI_OBJS="$SPECIFIC_GUI_OBJS \$(GUI_OBJS_SVGA)"
# GUI_*FLAGS are added to the compilation of every bochs file, not just
# the files in gui/*.cc.
GUI_CFLAGS="$GUI_CFLAGS"
GUI_CXXFLAGS="$GUI_CXXFLAGS"
GUI_LINK_OPTS="$GUI_LINK_OPTS \$(GUI_LINK_OPTS_SVGA)"
AC_MSG_WARN([This Bochs feature is not maintained yet and may fail])
fi
if test "$with_rfb" = yes; then
display_libs="$display_libs rfb"
GUI_DLL_TARGETS="$GUI_DLL_TARGETS bx_rfb.dll"

View File

@ -2091,14 +2091,6 @@ In Bochs 1.3 and before, the X11 GUI was always the default.
see <xref linkend="compile-wx">.
</entry>
</row>
<row>
<entry>--with-svga</entry>
<entry>Use SVGALIB library for Linux. This allows a full-screen
text and graphics display without X windows. The SVGALIB port
was written by Igor Popik.
WARNING: This Bochs feature is not maintained yet and may fail.
</entry>
</row>
<row>
<entry>--with-nogui</entry>
<entry>No native GUI; just use blank stubs. This is if you don't
@ -3422,10 +3414,6 @@ See the examples below for other currently supported options.
<entry>use SDL 2.x library, cross platform,
details in <xref linkend="compile-sdl2"></entry>
</row>
<row>
<entry>svga</entry>
<entry>use SVGALIB library for Linux, allows graphics without X windows</entry>
</row>
<row>
<entry>term</entry>
<entry>text only, uses curses/ncurses library, cross platform</entry>
@ -7144,11 +7132,6 @@ simulation is starting.
<entry>PCSPK</entry>
<entry>Lowlevel support for the PC speaker</entry>
</row>
<row>
<entry>VGAGUI</entry>
<entry>VGAGUI</entry>
<entry>SVGA gui</entry>
</row>
<row>
<entry>TERM</entry>
<entry>TERM</entry>

View File

@ -54,7 +54,6 @@ BX_INCDIRS = -I.. -I$(srcdir)/.. -I../iodev -I$(srcdir)/../iodev -I../@INSTRUMEN
GUI_OBJS_X11 = x.o
GUI_OBJS_SDL = sdl.o
GUI_OBJS_SDL2 = sdl2.o
GUI_OBJS_SVGA = svga.o
GUI_OBJS_WIN32 = win32.o
GUI_OBJS_MACOS = macintosh.o
GUI_OBJS_CARBON = carbon.o
@ -75,7 +74,6 @@ X_PRE_LIBS = @X_PRE_LIBS@
GUI_LINK_OPTS_X = $(X_LIBS) $(X_PRE_LIBS)
GUI_LINK_OPTS_SDL = @GUI_LINK_OPTS_SDL@
GUI_LINK_OPTS_SDL2 = @GUI_LINK_OPTS_SDL2@
GUI_LINK_OPTS_SVGA = -lvga -lvgagl
GUI_LINK_OPTS_RFB = @RFB_LIBS@
GUI_LINK_OPTS_RFB_VCPP = user32.lib @RFB_LIBS@
GUI_LINK_OPTS_VNCSRV = @GUI_LINK_OPTS_VNCSRV@
@ -128,9 +126,6 @@ libbx_sdl.la: sdl.lo
libbx_sdl2.la: sdl2.lo
$(LIBTOOL) --mode=link --tag CXX $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_SDL2)
libbx_svga.la: svga.lo
$(LIBTOOL) --mode=link --tag CXX $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_SVGA)
libbx_rfb.la: rfb.lo
$(LIBTOOL) --mode=link --tag CXX $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_RFB)
@ -272,11 +267,6 @@ siminterface.o: siminterface.@CPP_SUFFIX@ ../param_names.h ../iodev/iodev.h \
../memory/memory-bochs.h ../pc_system.h ../gui/gui.h \
../instrument/stubs/instrument.h ../plugin.h ../extplugin.h \
../iodev/virt_timer.h
svga.o: svga.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
../config.h ../osdep.h ../gui/siminterface.h ../cpudb.h \
../gui/paramtree.h ../memory/memory-bochs.h ../pc_system.h ../gui/gui.h \
../instrument/stubs/instrument.h ../param_names.h ../iodev/iodev.h \
../plugin.h ../extplugin.h
term.o: term.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
../config.h ../osdep.h ../gui/siminterface.h ../cpudb.h \
../gui/paramtree.h ../memory/memory-bochs.h ../pc_system.h ../gui/gui.h \
@ -399,11 +389,6 @@ siminterface.lo: siminterface.@CPP_SUFFIX@ ../param_names.h ../iodev/iodev.h \
../memory/memory-bochs.h ../pc_system.h ../gui/gui.h \
../instrument/stubs/instrument.h ../plugin.h ../extplugin.h \
../iodev/virt_timer.h
svga.lo: svga.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
../config.h ../osdep.h ../gui/siminterface.h ../cpudb.h \
../gui/paramtree.h ../memory/memory-bochs.h ../pc_system.h ../gui/gui.h \
../instrument/stubs/instrument.h ../param_names.h ../iodev/iodev.h \
../plugin.h ../extplugin.h
term.lo: term.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
../config.h ../osdep.h ../gui/siminterface.h ../cpudb.h \
../gui/paramtree.h ../memory/memory-bochs.h ../pc_system.h ../gui/gui.h \

View File

@ -138,8 +138,8 @@ public:
virtual void set_tooltip(unsigned hbar_id, const char *tip) {}
// set_display_mode() changes the mode between the configuration interface
// and the simulation. This is primarily intended for display libraries
// which have a full-screen mode such as SDL, term, and svgalib. The display
// mode is set to DISP_MODE_CONFIG before displaying any configuration menus,
// which have a full-screen mode such as SDL or term. The display mode is
// set to DISP_MODE_CONFIG before displaying any configuration menus,
// for panics that requires user input, when entering the debugger, etc. It
// is set to DISP_MODE_SIM when the Bochs simulation resumes. The
// enum is defined in gui/siminterface.h.

View File

@ -675,8 +675,8 @@ typedef Bit32s (*addon_option_save_t)(FILE *fp);
// bx_gui->set_display_mode() changes the mode between the configuration
// interface and the simulation. This is primarily intended for display
// libraries which have a full-screen mode such as SDL, term, and svgalib. The
// display mode is set to DISP_MODE_CONFIG before displaying any configuration
// libraries which have a full-screen mode such as SDL or term. The display
// mode is set to DISP_MODE_CONFIG before displaying any configuration
// menus, for panics that requires user input, when entering the debugger, etc.
// It is set to DISP_MODE_SIM when the Bochs simulation resumes. The constants
// are defined here so that configuration interfaces can use them with the

View File

@ -1,566 +0,0 @@
/////////////////////////////////////////////////////////////////////////
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2009-2017 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#define _MULTI_THREAD
// Define BX_PLUGGABLE in files that can be compiled into plugins. For
// platforms that require a special tag on exported symbols, BX_PLUGGABLE
// is used to know when we are exporting symbols and when we are importing.
#define BX_PLUGGABLE
#include "bochs.h"
#include "param_names.h"
#include "iodev.h"
#if BX_WITH_SVGA
#include <stdlib.h>
#include </usr/include/vga.h>
#include <vgagl.h>
#include <vgakeyboard.h>
#include <vgamouse.h>
#include "font/vga.bitmap.h"
//#include "icon_bochs.h"
class bx_svga_gui_c : public bx_gui_c {
public:
bx_svga_gui_c (void);
DECLARE_GUI_VIRTUAL_METHODS()
virtual void set_display_mode (disp_mode_t newmode);
};
// declare one instance of the gui object and call macro to insert the
// plugin code
static bx_svga_gui_c *theGui = NULL;
IMPLEMENT_GUI_PLUGIN_CODE(svga)
#define LOG_THIS theGui->
static unsigned res_x, res_y;
static unsigned fontwidth, fontheight;
static unsigned char vgafont[256 * 16];
static int clut8 = 0;
GraphicsContext *screen = NULL;
static int save_vga_mode;
static int save_vga_pal[256 * 3];
static Bit8u fontbuffer[0x2000];
static bx_bool ctrll_pressed = 0;
static unsigned int text_rows=25, text_cols=80;
static unsigned prev_cursor_x=0;
static unsigned prev_cursor_y=0;
void keyboard_handler(int scancode, int press);
void mouse_handler(int button, int dx, int dy, int dz,
int drx, int dry, int drz);
void create_vga_font()
{
memcpy(vgafont, bx_vgafont, sizeof(bx_vgafont));
for (unsigned i=0;i< sizeof(bx_vgafont);i++) {
vgafont[i] = reverse_bitorder(vgafont[i]);
}
}
bx_svga_gui_c::bx_svga_gui_c()
{
put("SVGA");
}
// SVGA implementation of the bx_gui_c methods (see nogui.cc for details)
void bx_svga_gui_c::specific_init(int argc, char **argv, unsigned header_bar_y)
{
put("VGAGUI");
if (vga_init() != 0) {
BX_FATAL(("Unable to initialize SVGAlib"));
return;
}
screen = gl_allocatecontext();
fontwidth = 8;
fontheight = 16;
dimension_update(640,400);
create_vga_font();
gl_setfont(fontwidth, fontheight, (void *)vgafont);
gl_setwritemode(FONT_COMPRESSED);
keyboard_init();
keyboard_seteventhandler((__keyboard_handler) keyboard_handler);
vga_setmousesupport(1);
mouse_seteventhandler((__mouse_handler) mouse_handler);
if (vga_ext_set(VGA_EXT_AVAILABLE, VGA_AVAIL_FLAGS) & VGA_CLUT8) {
vga_ext_set(VGA_EXT_SET, VGA_CLUT8);
clut8 = 1;
}
// Save settings to prepare for mode transition in set_display_mode.
// If DISP_MODE_SIM is called first, these values will be used.
save_vga_mode = vga_getcurrentmode();
vga_getpalvec(0, 256, save_vga_pal);
}
void bx_svga_gui_c::text_update(
Bit8u *old_text,
Bit8u *new_text,
unsigned long cursor_x,
unsigned long cursor_y,
bx_vga_tminfo_t *tm_info)
{
Bit8u *old_line, *new_line;
unsigned int curs, hchars, i, j, offset, rows, x, y;
char s[] = " ";
int fg, bg;
bx_bool force_update = 0, blink_state, blink_mode;
int text_palette[16];
// first check if the screen needs to be redrawn completely
blink_mode = (tm_info->blink_flags & BX_TEXT_BLINK_MODE) > 0;
blink_state = (tm_info->blink_flags & BX_TEXT_BLINK_STATE) > 0;
if (blink_mode) {
if (tm_info->blink_flags & BX_TEXT_BLINK_TOGGLE)
force_update = 1;
}
if (charmap_updated) {
BX_INFO(("charmap update. Font Height is %d", fontheight));
for (unsigned c = 0; c<256; c++) {
if (char_changed[c]) {
j = c * fontheight;
for(i=0; i<fontheight; i++) {
fontbuffer[j++] = vga_charmap[(c<<5)+i];
}
char_changed[c] = 0;
}
}
gl_setfont(fontwidth, fontheight, (void *)fontbuffer);
force_update = 1;
charmap_updated = 0;
}
for (i=0; i<16; i++) {
text_palette[i] = tm_info->actl_palette[i];
}
// invalidate character at previous and new cursor location
if((prev_cursor_y < text_rows) && (prev_cursor_x < text_cols)) {
curs = prev_cursor_y * tm_info->line_offset + prev_cursor_x * 2;
old_text[curs] = ~new_text[curs];
}
if((tm_info->cs_start <= tm_info->cs_end) && (tm_info->cs_start < fontheight) &&
(cursor_y < text_rows) && (cursor_x < text_cols)) {
curs = cursor_y * tm_info->line_offset + cursor_x * 2;
old_text[curs] = ~new_text[curs];
} else {
curs = 0xffff;
}
rows = text_rows;
y = 0;
do {
hchars = text_cols;
new_line = new_text;
old_line = old_text;
x = 0;
offset = y * tm_info->line_offset;
do {
if (force_update || (old_text[0] != new_text[0])
|| (old_text[1] != new_text[1])) {
s[0] = new_text[0];
fg = text_palette[new_text[1] & 0x0F];
if (blink_mode) {
bg = text_palette[(new_text[1] & 0x70) >> 4];
if (!blink_state && (new_text[1] & 0x80))
fg = bg;
} else {
bg = text_palette[(new_text[1] & 0xF0) >> 4];
}
if (offset == curs) {
gl_setfontcolors(fg, bg);
} else {
gl_setfontcolors(bg, fg);
}
gl_write(x * fontwidth, y * fontheight, s);
}
x++;
new_text+=2;
old_text+=2;
offset+=2;
} while (--hchars);
y++;
new_text = new_line + tm_info->line_offset;
old_text = old_line + tm_info->line_offset;
} while (--rows);
prev_cursor_x = cursor_x;
prev_cursor_y = cursor_y;
}
int bx_svga_gui_c::get_clipboard_text(Bit8u **bytes, Bit32s *nbytes)
{
return 0;
}
int bx_svga_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
{
return 0;
}
void bx_svga_gui_c::graphics_tile_update(Bit8u *snapshot, unsigned x, unsigned y)
{
if ((y + y_tilesize) > res_y) {
gl_putbox(x, y, x_tilesize, (res_y - y), snapshot);
} else {
gl_putbox(x, y, x_tilesize, y_tilesize, snapshot);
}
}
static Bit32u vga_to_bx_key(int key)
{
ctrll_pressed = 0;
switch (key) {
case SCANCODE_ESCAPE: return BX_KEY_ESC;
case SCANCODE_1: return BX_KEY_1;
case SCANCODE_2: return BX_KEY_2;
case SCANCODE_3: return BX_KEY_3;
case SCANCODE_4: return BX_KEY_4;
case SCANCODE_5: return BX_KEY_5;
case SCANCODE_6: return BX_KEY_6;
case SCANCODE_7: return BX_KEY_7;
case SCANCODE_8: return BX_KEY_8;
case SCANCODE_9: return BX_KEY_9;
case SCANCODE_0: return BX_KEY_0;
case SCANCODE_MINUS: return BX_KEY_MINUS;
case SCANCODE_EQUAL: return BX_KEY_EQUALS;
case SCANCODE_TAB: return BX_KEY_TAB;
case SCANCODE_BACKSPACE: return BX_KEY_BACKSPACE;
case SCANCODE_Q: return BX_KEY_Q;
case SCANCODE_W: return BX_KEY_W;
case SCANCODE_E: return BX_KEY_E;
case SCANCODE_R: return BX_KEY_R;
case SCANCODE_T: return BX_KEY_T;
case SCANCODE_Y: return BX_KEY_Y;
case SCANCODE_U: return BX_KEY_U;
case SCANCODE_I: return BX_KEY_I;
case SCANCODE_O: return BX_KEY_O;
case SCANCODE_P: return BX_KEY_P;
case SCANCODE_BRACKET_LEFT: return BX_KEY_LEFT_BRACKET;
case SCANCODE_BRACKET_RIGHT: return BX_KEY_RIGHT_BRACKET;
case SCANCODE_ENTER: return BX_KEY_ENTER;
case SCANCODE_LEFTCONTROL:
ctrll_pressed = 1;
return BX_KEY_CTRL_L;
case SCANCODE_A: return BX_KEY_A;
case SCANCODE_S: return BX_KEY_S;
case SCANCODE_D: return BX_KEY_D;
case SCANCODE_F: return BX_KEY_F;
case SCANCODE_G: return BX_KEY_G;
case SCANCODE_H: return BX_KEY_H;
case SCANCODE_J: return BX_KEY_J;
case SCANCODE_K: return BX_KEY_K;
case SCANCODE_L: return BX_KEY_L;
case SCANCODE_SEMICOLON: return BX_KEY_SEMICOLON;
case SCANCODE_APOSTROPHE: return BX_KEY_SINGLE_QUOTE;
case SCANCODE_GRAVE: return BX_KEY_GRAVE;
case SCANCODE_LEFTSHIFT: return BX_KEY_SHIFT_L;
case SCANCODE_BACKSLASH: return BX_KEY_BACKSLASH;
case SCANCODE_Z: return BX_KEY_Z;
case SCANCODE_X: return BX_KEY_X;
case SCANCODE_C: return BX_KEY_C;
case SCANCODE_V: return BX_KEY_V;
case SCANCODE_B: return BX_KEY_B;
case SCANCODE_N: return BX_KEY_N;
case SCANCODE_M: return BX_KEY_M;
case SCANCODE_COMMA: return BX_KEY_COMMA;
case SCANCODE_PERIOD: return BX_KEY_PERIOD;
case SCANCODE_SLASH: return BX_KEY_SLASH;
case SCANCODE_RIGHTSHIFT: return BX_KEY_SHIFT_R;
case SCANCODE_KEYPADMULTIPLY: return BX_KEY_KP_MULTIPLY;
case SCANCODE_LEFTALT: return BX_KEY_ALT_L;
case SCANCODE_SPACE: return BX_KEY_SPACE;
case SCANCODE_CAPSLOCK: return BX_KEY_CAPS_LOCK;
case SCANCODE_F1: return BX_KEY_F1;
case SCANCODE_F2: return BX_KEY_F2;
case SCANCODE_F3: return BX_KEY_F3;
case SCANCODE_F4: return BX_KEY_F4;
case SCANCODE_F5: return BX_KEY_F5;
case SCANCODE_F6: return BX_KEY_F6;
case SCANCODE_F7: return BX_KEY_F7;
case SCANCODE_F8: return BX_KEY_F8;
case SCANCODE_F9: return BX_KEY_F9;
case SCANCODE_F10: return BX_KEY_F10;
case SCANCODE_NUMLOCK: return BX_KEY_NUM_LOCK;
case SCANCODE_SCROLLLOCK: return BX_KEY_SCRL_LOCK;
case SCANCODE_KEYPAD7: return BX_KEY_KP_HOME;
case SCANCODE_KEYPAD8: return BX_KEY_KP_UP;
case SCANCODE_KEYPAD9: return BX_KEY_KP_PAGE_UP;
case SCANCODE_KEYPADMINUS: return BX_KEY_KP_SUBTRACT;
case SCANCODE_KEYPAD4: return BX_KEY_KP_LEFT;
case SCANCODE_KEYPAD5: return BX_KEY_KP_5;
case SCANCODE_KEYPAD6: return BX_KEY_KP_RIGHT;
case SCANCODE_KEYPADPLUS: return BX_KEY_KP_ADD;
case SCANCODE_KEYPAD1: return BX_KEY_KP_END;
case SCANCODE_KEYPAD2: return BX_KEY_KP_DOWN;
case SCANCODE_KEYPAD3: return BX_KEY_KP_PAGE_DOWN;
case SCANCODE_KEYPAD0: return BX_KEY_KP_INSERT;
// case SCANCODE_KEYPADPERIOD: return BX_KEY_KP_; /* ??? */
// case SCANCODE_LESS: return BX_KEY_KP_LESS; /* ??? */
case SCANCODE_F11: return BX_KEY_F11;
case SCANCODE_F12: return BX_KEY_F12;
case SCANCODE_KEYPADENTER: return BX_KEY_KP_ENTER;
case SCANCODE_RIGHTCONTROL: return BX_KEY_CTRL_R;
case SCANCODE_KEYPADDIVIDE: return BX_KEY_KP_DIVIDE;
case SCANCODE_PRINTSCREEN: return BX_KEY_PRINT;
case SCANCODE_RIGHTALT: return BX_KEY_ALT_R;
case SCANCODE_BREAK: return BX_KEY_PAUSE;
case SCANCODE_HOME: return BX_KEY_HOME;
case SCANCODE_CURSORBLOCKUP: return BX_KEY_UP;
case SCANCODE_PAGEUP: return BX_KEY_PAGE_UP;
case SCANCODE_CURSORBLOCKLEFT: return BX_KEY_LEFT;
case SCANCODE_CURSORBLOCKRIGHT: return BX_KEY_RIGHT;
case SCANCODE_END: return BX_KEY_END;
case SCANCODE_CURSORBLOCKDOWN: return BX_KEY_DOWN;
case SCANCODE_PAGEDOWN: return BX_KEY_PAGE_DOWN;
case SCANCODE_INSERT: return BX_KEY_INSERT;
case SCANCODE_REMOVE: return BX_KEY_DELETE;
case SCANCODE_RIGHTWIN: return BX_KEY_WIN_R;
case SCANCODE_LEFTWIN: return BX_KEY_WIN_L;
default: return 0;
}
}
void keyboard_handler(int scancode, int press)
{
if (scancode != SCANCODE_F12) {
int bx_key = vga_to_bx_key(scancode);
Bit32u key_state;
if (press) {
key_state = BX_KEY_PRESSED;
} else {
key_state = BX_KEY_RELEASED;
}
DEV_kbd_gen_scancode(bx_key | key_state);
} else {
BX_INFO(("F12 pressed"));
// show runtime options menu, which uses stdin/stdout
SIM->configuration_interface (NULL, CI_RUNTIME_CONFIG);
}
}
void mouse_handler(int button, int dx, int dy, int dz,
int drx, int dry, int drz)
{
int buttons = 0;
if (button & MOUSE_LEFTBUTTON) {
buttons |= 0x01;
}
if (button & MOUSE_RIGHTBUTTON) {
buttons |= 0x02;
}
if (button & MOUSE_MIDDLEBUTTON) {
buttons |= 0x04;
}
if (ctrll_pressed && ((buttons == 0x04) || (buttons == 0x05))) {
bx_bool old = SIM->get_param_bool(BXPN_MOUSE_ENABLED)->get();
SIM->get_param_bool(BXPN_MOUSE_ENABLED)->set(!old);
} else {
DEV_mouse_motion((int) (0.25 * dx), (int) -(0.25 * dy), 0, buttons, 0);
}
}
void bx_svga_gui_c::handle_events(void)
{
keyboard_update();
keyboard_clearstate();
mouse_update();
}
void bx_svga_gui_c::flush(void)
{
gl_copyscreen(screen);
}
void bx_svga_gui_c::clear_screen(void)
{
gl_clearscreen(0);
}
bx_bool bx_svga_gui_c::palette_change(Bit8u index, Bit8u red, Bit8u green, Bit8u blue)
{
// without VGA_CLUT8 extension we have only 6 bits for each r,g,b value
if (!clut8 && (red > 63 || green > 63 || blue > 63)) {
red = red >> 2;
green = green >> 2;
blue = blue >> 2;
}
vga_setpalette(index, red, green, blue);
return 1;
}
void bx_svga_gui_c::dimension_update(
unsigned x,
unsigned y,
unsigned fheight,
unsigned fwidth,
unsigned bpp)
{
int newmode = 0;
if (bpp > 8) {
BX_PANIC(("%d bpp graphics mode not supported yet", bpp));
}
guest_textmode = (fheight > 0);
guest_xres = x;
guest_yres = y;
guest_bpp = bpp;
if (guest_textmode) {
text_cols = x / fwidth;
text_rows = y / fheight;
fontheight = fheight;
if (fwidth != 8) {
x = x * 8 / fwidth;
}
fontwidth = 8;
}
if ((x == res_x) && (y == res_y)) return;
if (x == 640 && y == 480) {
newmode = G640x480x256;
} else if (x == 640 && y == 400) {
newmode = G640x400x256;
} else if (x == 800 && y == 600) {
newmode = G800x600x256;
} else if (x == 1024 && y == 768) {
newmode = G1024x768x256;
}
if (!vga_hasmode(newmode)) {
newmode = G640x480x256; // trying "default" mode...
}
vga_getpalvec(0, 256, save_vga_pal);
if (vga_setmode(newmode) != 0)
{
BX_FATAL(("Unable to set requested videomode: %ix%i", x, y));
}
gl_setcontextvga(newmode);
gl_getcontext(screen);
gl_setcontextvgavirtual(newmode);
vga_setpalvec(0, 256, save_vga_pal);
save_vga_mode = newmode;
res_x = x;
res_y = y;
}
unsigned bx_svga_gui_c::create_bitmap(
const unsigned char *bmap,
unsigned xdim,
unsigned ydim)
{
return 0;
}
unsigned bx_svga_gui_c::headerbar_bitmap(
unsigned bmap_id,
unsigned alignment,
void (*f)(void))
{
return 0;
}
void bx_svga_gui_c::replace_bitmap(unsigned hbar_id, unsigned bmap_id)
{
}
void bx_svga_gui_c::show_headerbar(void)
{
}
void bx_svga_gui_c::mouse_enabled_changed_specific (bx_bool val)
{
}
void bx_svga_gui_c::exit(void)
{
vga_setmode(TEXT);
keyboard_close();
mouse_close();
}
void bx_svga_gui_c::set_display_mode (disp_mode_t newmode)
{
// if no mode change, do nothing.
if (disp_mode == newmode) return;
// remember the display mode for next time
disp_mode = newmode;
switch (newmode) {
case DISP_MODE_CONFIG:
BX_DEBUG (("switch to configuration mode (back to console)"));
// remember old values and switch to text mode
save_vga_mode = vga_getcurrentmode();
vga_getpalvec(0, 256, save_vga_pal);
keyboard_close();
vga_setmode(TEXT);
break;
case DISP_MODE_SIM:
BX_DEBUG (("switch to simulation mode (fullscreen)"));
keyboard_init();
keyboard_seteventhandler((__keyboard_handler) keyboard_handler);
vga_setmode(save_vga_mode);
vga_setpalvec(0, 256, save_vga_pal);
break;
}
}
#endif /* if BX_WITH_SVGA */

View File

@ -2,7 +2,7 @@
// $Id$
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002-2017 The Bochs Project
// Copyright (C) 2002-2020 The Bochs Project
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
@ -822,9 +822,6 @@ static builtin_plugin_t builtin_plugins[] = {
#if BX_WITH_SDL2
BUILTIN_GUI_PLUGIN_ENTRY(sdl2),
#endif
#if BX_WITH_SVGA
BUILTIN_GUI_PLUGIN_ENTRY(svga),
#endif
#if BX_WITH_TERM
BUILTIN_GUI_PLUGIN_ENTRY(term),
#endif

View File

@ -455,7 +455,6 @@ DECLARE_PLUGIN_INIT_FINI_FOR_GUI_MODULE(nogui)
DECLARE_PLUGIN_INIT_FINI_FOR_GUI_MODULE(rfb)
DECLARE_PLUGIN_INIT_FINI_FOR_GUI_MODULE(sdl)
DECLARE_PLUGIN_INIT_FINI_FOR_GUI_MODULE(sdl2)
DECLARE_PLUGIN_INIT_FINI_FOR_GUI_MODULE(svga)
DECLARE_PLUGIN_INIT_FINI_FOR_GUI_MODULE(term)
DECLARE_PLUGIN_INIT_FINI_FOR_GUI_MODULE(vncsrv)
DECLARE_PLUGIN_INIT_FINI_FOR_GUI_MODULE(win32)