Fail* directories reorganized, Code-cleanup (-> coding-style), Typos+comments fixed.
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1321 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
395
simulators/bochs/gui/Makefile.in
Normal file
395
simulators/bochs/gui/Makefile.in
Normal file
@ -0,0 +1,395 @@
|
||||
# Copyright (C) 2001 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
|
||||
|
||||
# Makefile for the gui component of bochs
|
||||
|
||||
|
||||
@SUFFIX_LINE@
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
bindir = @bindir@
|
||||
libdir = @libdir@
|
||||
datarootdir = @datarootdir@
|
||||
mandir = @mandir@
|
||||
man1dir = $(mandir)/man1
|
||||
man5dir = $(mandir)/man5
|
||||
docdir = $(datarootdir)/doc/bochs
|
||||
sharedir = $(datarootdir)/bochs
|
||||
top_builddir = ..
|
||||
top_srcdir = @top_srcdir@
|
||||
|
||||
SHELL = /bin/sh
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
CXX = @CXX@
|
||||
CXXFLAGS = $(BX_INCDIRS) @CXXFLAGS@ @GUI_CXXFLAGS@
|
||||
LOCAL_CXXFLAGS = @TOOLKIT_CXXFLAGS@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBS = @LIBS@
|
||||
X_CFLAGS = @X_CFLAGS@
|
||||
RANLIB = @RANLIB@
|
||||
PLUGIN_PATH=@libdir@
|
||||
top_builddir = ..
|
||||
LIBTOOL=@LIBTOOL@
|
||||
WIN32_DLL_IMPORT_LIBRARY=../dllexports.a
|
||||
BX_INCDIRS = -I.. -I$(srcdir)/.. -I../iodev -I$(srcdir)/../iodev -I../@INSTRUMENT_DIR@ -I$(srcdir)/../@INSTRUMENT_DIR@
|
||||
|
||||
GUI_OBJS_X11 = x.o
|
||||
GUI_OBJS_SDL = sdl.o
|
||||
GUI_OBJS_SVGA = svga.o
|
||||
GUI_OBJS_BEOS = beos.o
|
||||
GUI_OBJS_WIN32 = win32.o
|
||||
GUI_OBJS_MACOS = macintosh.o
|
||||
GUI_OBJS_CARBON = carbon.o
|
||||
GUI_OBJS_NOGUI = nogui.o
|
||||
GUI_OBJS_TERM = term.o
|
||||
GUI_OBJS_RFB = rfb.o
|
||||
GUI_OBJS_AMIGAOS = amigaos.o
|
||||
GUI_OBJS_WX = wx.o
|
||||
GUI_OBJS_WX_SUPPORT = wxmain.o wxdialog.o
|
||||
OBJS_THAT_CANNOT_BE_PLUGINS = keymap.o gui.o siminterface.o paramtree.o textconfig.o enh_dbg.o @ENH_DBG_OBJS@ @DIALOG_OBJS@
|
||||
OBJS_THAT_CAN_BE_PLUGINS = @GUI_OBJS@
|
||||
|
||||
X_LIBS = @X_LIBS@
|
||||
X_PRE_LIBS = @X_PRE_LIBS@
|
||||
XPM_LIB = @XPM_LIB@
|
||||
GUI_LINK_OPTS_X = $(X_LIBS) $(X_PRE_LIBS) -lX11 $(XPM_LIB) -lXrandr
|
||||
GUI_LINK_OPTS_SDL = `sdl-config --cflags --libs`
|
||||
GUI_LINK_OPTS_SVGA = -lvga -lvgagl
|
||||
GUI_LINK_OPTS_BEOS = -lbe
|
||||
GUI_LINK_OPTS_RFB = @RFB_LIBS@
|
||||
GUI_LINK_OPTS_AMIGAOS =
|
||||
GUI_LINK_OPTS_WIN32 = -luser32 -lgdi32 -lcomdlg32 -lcomctl32
|
||||
GUI_LINK_OPTS_WIN32_VCPP = user32.lib gdi32.lib winmm.lib \
|
||||
comdlg32.lib comctl32.lib wsock32.lib
|
||||
GUI_LINK_OPTS_MACOS =
|
||||
GUI_LINK_OPTS_CARBON = -framework Carbon
|
||||
GUI_LINK_OPTS_NOGUI =
|
||||
GUI_LINK_OPTS_TERM = @GUI_LINK_OPTS_TERM@
|
||||
GUI_LINK_OPTS_WX = @GUI_LINK_OPTS_WX@
|
||||
GUI_LINK_OPTS = @GUI_LINK_OPTS@ @DEVICE_LINK_OPTS@
|
||||
|
||||
NONPLUGIN_OBJS = @GUI_NON_PLUGIN_OBJS@
|
||||
PLUGIN_OBJS = @GUI_PLUGIN_OBJS@
|
||||
|
||||
#
|
||||
# -------- end configurable options --------------------------
|
||||
#
|
||||
|
||||
all: libgui.a
|
||||
|
||||
plugins: $(PLUGIN_OBJS:@PLUGIN_LIBNAME_TRANSFORMATION@)
|
||||
|
||||
libgui.a: $(NONPLUGIN_OBJS)
|
||||
@RMCOMMAND@ libgui.a
|
||||
@MAKELIB@ $(NONPLUGIN_OBJS)
|
||||
@RANLIB@ libgui.a
|
||||
|
||||
# standard compile rule for C++ files
|
||||
.@CPP_SUFFIX@.o:
|
||||
$(CXX) @DASH@c $(CXXFLAGS) $(LOCAL_CXXFLAGS) @CXXFP@$< @OFP@$@
|
||||
|
||||
##### building plugins with libtool
|
||||
%.lo: %.@CPP_SUFFIX@
|
||||
$(LIBTOOL) --mode=compile $(CXX) -c $(CXXFLAGS) $(LOCAL_CXXFLAGS) $< -o $@
|
||||
|
||||
libbx_%.la: %.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH)
|
||||
|
||||
libbx_x.la: x.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_X)
|
||||
|
||||
libbx_sdl.la: sdl.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_SDL)
|
||||
|
||||
libbx_svga.la: svga.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_SVGA)
|
||||
|
||||
libbx_beos.la: beos.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_BEOS)
|
||||
|
||||
libbx_rfb.la: rfb.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_RFB)
|
||||
|
||||
libbx_amigaos.la: amigaos.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_AMIGAOS)
|
||||
|
||||
libbx_win32.la: win32.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_WIN32)
|
||||
|
||||
libbx_macos.la: macos.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_MACOS)
|
||||
|
||||
libbx_carbon.la: carbon.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_CARBON)
|
||||
|
||||
libbx_nogui.la: nogui.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_NOGUI)
|
||||
|
||||
libbx_term.la: term.lo
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $< -o $@ -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_TERM)
|
||||
|
||||
# special link rules for plugins that require more than one object file
|
||||
libbx_wx.la: $(GUI_OBJS_WX:.o=.lo) $(GUI_OBJS_WX_SUPPORT:.o=.lo)
|
||||
$(LIBTOOL) --mode=link $(CXX) -module $(GUI_OBJS_WX:.o=.lo) $(GUI_OBJS_WX_SUPPORT:.o=.lo) -o libbx_wx.la -rpath $(PLUGIN_PATH) $(GUI_LINK_OPTS_WX)
|
||||
|
||||
#### building DLLs for win32 (tested on cygwin only)
|
||||
bx_%.dll: %.o
|
||||
$(CXX) $(CXXFLAGS) -shared -o $@ $< $(WIN32_DLL_IMPORT_LIBRARY) $(GUI_LINK_OPTS_WIN32)
|
||||
|
||||
bx_wx.dll: $(GUI_OBJS_WX) $(GUI_OBJS_WX_SUPPORT)
|
||||
$(CXX) $(CXXFLAGS) -shared -o bx_wx.dll $(GUI_OBJS_WX) $(GUI_OBJS_WX_SUPPORT) $(WIN32_DLL_IMPORT_LIBRARY) `wx-config --libs` -luser32 -lgdi32 -lcomdlg32 -lcomctl32
|
||||
|
||||
bx_sdl.dll: $(GUI_OBJS_SDL)
|
||||
$(CXX) $(CXXFLAGS) -shared -o bx_sdl.dll $(GUI_OBJS_SDL) $(WIN32_DLL_IMPORT_LIBRARY) $(GUI_LINK_OPTS_SDL)
|
||||
|
||||
bx_rfb.dll: $(GUI_OBJS_RFB)
|
||||
$(CXX) $(CXXFLAGS) -shared -o bx_rfb.dll $(GUI_OBJS_RFB) $(WIN32_DLL_IMPORT_LIBRARY) $(GUI_LINK_OPTS_RFB)
|
||||
|
||||
# no need to build DLLs for beos.o
|
||||
# no need to build DLLs for x.o
|
||||
|
||||
##### end DLL section
|
||||
|
||||
clean:
|
||||
@RMCOMMAND@ -rf .libs *.la *.a *.lo *.o *.dll
|
||||
|
||||
dist-clean: clean
|
||||
@RMCOMMAND@ Makefile
|
||||
|
||||
###########################################
|
||||
# all other dependencies generated by
|
||||
# gcc -MM -I.. -I../iodev -I../instrument/stubs `wx-config --cxxflags` *.cc | \
|
||||
# sed -e 's/\.cc/.@CPP_SUFFIX@/g'
|
||||
# gcc -MM -I.. -I../iodev -I../instrument/stubs `wx-config --cxxflags` *.cc | \
|
||||
# sed -e 's/\.cc/.@CPP_SUFFIX@/g' -e 's/\.o:/.lo:/g'
|
||||
#
|
||||
# This means that every source file is listed twice, once with a .o rule
|
||||
# and then again with an identical .lo rule. The .lo rules are used when
|
||||
# building plugins.
|
||||
###########################################
|
||||
amigaos.o: amigaos.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h ../param_names.h ../iodev/iodev.h
|
||||
beos.o: beos.@CPP_SUFFIX@ ../param_names.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h ../iodev/iodev.h
|
||||
carbon.o: carbon.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
keymap.h ../iodev/iodev.h ../param_names.h
|
||||
enh_dbg.o: enh_dbg.@CPP_SUFFIX@ ../config.h
|
||||
gtk_enh_dbg_osdep.o: gtk_enh_dbg_osdep.@CPP_SUFFIX@ ../config.h
|
||||
gui.o: gui.@CPP_SUFFIX@ ../iodev/iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h ../param_names.h ../iodev/vga.h \
|
||||
keymap.h ../gui/bitmaps/floppya.h ../gui/bitmaps/floppyb.h \
|
||||
../gui/bitmaps/mouse.h ../gui/bitmaps/reset.h ../gui/bitmaps/power.h \
|
||||
../gui/bitmaps/snapshot.h ../gui/bitmaps/copy.h ../gui/bitmaps/paste.h \
|
||||
../gui/bitmaps/configbutton.h ../gui/bitmaps/cdromd.h \
|
||||
../gui/bitmaps/userbutton.h ../gui/bitmaps/saverestore.h
|
||||
keymap.o: keymap.@CPP_SUFFIX@ ../param_names.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h keymap.h
|
||||
macintosh.o: macintosh.@CPP_SUFFIX@ ../param_names.h ../bochs.h ../config.h \
|
||||
../osdep.h ../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h ../iodev/iodev.h
|
||||
nogui.o: nogui.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h icon_bochs.h
|
||||
paramtree.o: paramtree.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h paramtree.h
|
||||
rfb.o: rfb.@CPP_SUFFIX@ ../param_names.h ../iodev/iodev.h ../bochs.h ../config.h \
|
||||
../osdep.h ../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h keymap.h icon_bochs.h \
|
||||
../font/vga.bitmap.h sdl.h rfb.h rfbkeys.h
|
||||
sdl.o: sdl.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h keymap.h ../iodev/iodev.h icon_bochs.h sdl.h sdlkeys.h
|
||||
siminterface.o: siminterface.@CPP_SUFFIX@ ../param_names.h ../iodev/iodev.h \
|
||||
../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h ../config.h \
|
||||
../osdep.h ../bxversion.h ../gui/siminterface.h ../gui/paramtree.h \
|
||||
../memory/memory.h ../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h \
|
||||
../gui/gui.h ../instrument/stubs/instrument.h
|
||||
svga.o: svga.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h ../iodev/iodev.h
|
||||
term.o: term.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h ../iodev/iodev.h
|
||||
textconfig.o: textconfig.@CPP_SUFFIX@ ../config.h ../osdep.h ../param_names.h \
|
||||
textconfig.h siminterface.h paramtree.h ../extplugin.h ../ltdl.h
|
||||
win32.o: win32.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h keymap.h ../iodev/iodev.h ../iodev/vga.h
|
||||
win32dialog.o: win32dialog.@CPP_SUFFIX@ win32dialog.h ../config.h
|
||||
win32_enh_dbg_osdep.o: win32_enh_dbg_osdep.@CPP_SUFFIX@ ../config.h
|
||||
win32paramdlg.o: win32paramdlg.@CPP_SUFFIX@ win32dialog.h ../config.h
|
||||
wx.o: wx.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h keymap.h ../iodev/iodev.h \
|
||||
../font/vga.bitmap.h wxmain.h
|
||||
wxdialog.o: wxdialog.@CPP_SUFFIX@ ../config.h ../param_names.h \
|
||||
../osdep.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../bxversion.h wxdialog.h wxmain.h
|
||||
wxmain.o: wxmain.@CPP_SUFFIX@ ../config.h ../param_names.h \
|
||||
../osdep.h ../gui/siminterface.h ../gui/paramtree.h ../bxversion.h \
|
||||
wxdialog.h wxmain.h ../extplugin.h ../ltdl.h bitmaps/cdromd.xpm \
|
||||
bitmaps/copy.xpm bitmaps/floppya.xpm bitmaps/floppyb.xpm bitmaps/paste.xpm \
|
||||
bitmaps/power.xpm bitmaps/reset.xpm bitmaps/snapshot.xpm bitmaps/mouse.xpm \
|
||||
bitmaps/userbutton.xpm bitmaps/saverestore.xpm icon_bochs.xpm
|
||||
x.o: x.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h keymap.h ../iodev/iodev.h enh_dbg.h icon_bochs.xpm \
|
||||
../font/vga.bitmap.h
|
||||
amigaos.lo: amigaos.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h ../param_names.h ../iodev/iodev.h
|
||||
beos.lo: beos.@CPP_SUFFIX@ ../param_names.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h ../iodev/iodev.h
|
||||
carbon.lo: carbon.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
keymap.h ../iodev/iodev.h ../param_names.h
|
||||
enh_dbg.lo: enh_dbg.@CPP_SUFFIX@ ../config.h
|
||||
gtk_enh_dbg_osdep.lo: gtk_enh_dbg_osdep.@CPP_SUFFIX@ ../config.h
|
||||
gui.lo: gui.@CPP_SUFFIX@ ../iodev/iodev.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h ../param_names.h ../iodev/vga.h \
|
||||
keymap.h ../gui/bitmaps/floppya.h ../gui/bitmaps/floppyb.h \
|
||||
../gui/bitmaps/mouse.h ../gui/bitmaps/reset.h ../gui/bitmaps/power.h \
|
||||
../gui/bitmaps/snapshot.h ../gui/bitmaps/copy.h ../gui/bitmaps/paste.h \
|
||||
../gui/bitmaps/configbutton.h ../gui/bitmaps/cdromd.h \
|
||||
../gui/bitmaps/userbutton.h ../gui/bitmaps/saverestore.h
|
||||
keymap.lo: keymap.@CPP_SUFFIX@ ../param_names.h ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h keymap.h
|
||||
macintosh.lo: macintosh.@CPP_SUFFIX@ ../param_names.h ../bochs.h ../config.h \
|
||||
../osdep.h ../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h ../iodev/iodev.h
|
||||
nogui.lo: nogui.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h icon_bochs.h
|
||||
paramtree.lo: paramtree.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h \
|
||||
../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h paramtree.h
|
||||
rfb.lo: rfb.@CPP_SUFFIX@ ../param_names.h ../iodev/iodev.h ../bochs.h ../config.h \
|
||||
../osdep.h ../bx_debug/debug.h ../config.h ../osdep.h ../bxversion.h \
|
||||
../gui/siminterface.h ../gui/paramtree.h ../memory/memory.h \
|
||||
../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h ../gui/gui.h \
|
||||
../instrument/stubs/instrument.h keymap.h icon_bochs.h \
|
||||
../font/vga.bitmap.h sdl.h rfb.h rfbkeys.h
|
||||
sdl.lo: sdl.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h keymap.h ../iodev/iodev.h icon_bochs.h sdl.h sdlkeys.h
|
||||
siminterface.lo: siminterface.@CPP_SUFFIX@ ../param_names.h ../iodev/iodev.h \
|
||||
../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h ../config.h \
|
||||
../osdep.h ../bxversion.h ../gui/siminterface.h ../gui/paramtree.h \
|
||||
../memory/memory.h ../pc_system.h ../plugin.h ../extplugin.h ../ltdl.h \
|
||||
../gui/gui.h ../instrument/stubs/instrument.h
|
||||
svga.lo: svga.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h ../iodev/iodev.h
|
||||
term.lo: term.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h ../iodev/iodev.h
|
||||
textconfig.lo: textconfig.@CPP_SUFFIX@ ../config.h ../osdep.h ../param_names.h \
|
||||
textconfig.h siminterface.h paramtree.h ../extplugin.h ../ltdl.h
|
||||
win32.lo: win32.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h keymap.h ../iodev/iodev.h
|
||||
win32dialog.lo: win32dialog.@CPP_SUFFIX@ win32dialog.h ../config.h
|
||||
win32_enh_dbg_osdep.lo: win32_enh_dbg_osdep.@CPP_SUFFIX@ ../config.h
|
||||
win32paramdlg.lo: win32paramdlg.@CPP_SUFFIX@ win32dialog.h ../config.h
|
||||
wx.lo: wx.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h keymap.h ../iodev/iodev.h \
|
||||
../font/vga.bitmap.h wxmain.h
|
||||
wxdialog.lo: wxdialog.@CPP_SUFFIX@ ../config.h ../param_names.h \
|
||||
../osdep.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../bxversion.h wxdialog.h wxmain.h
|
||||
wxmain.lo: wxmain.@CPP_SUFFIX@ ../config.h ../param_names.h \
|
||||
../osdep.h ../gui/siminterface.h ../gui/paramtree.h ../bxversion.h \
|
||||
wxdialog.h wxmain.h ../extplugin.h ../ltdl.h bitmaps/cdromd.xpm \
|
||||
bitmaps/copy.xpm bitmaps/floppya.xpm bitmaps/floppyb.xpm bitmaps/paste.xpm \
|
||||
bitmaps/power.xpm bitmaps/reset.xpm bitmaps/snapshot.xpm bitmaps/mouse.xpm \
|
||||
bitmaps/userbutton.xpm bitmaps/saverestore.xpm icon_bochs.xpm
|
||||
x.lo: x.@CPP_SUFFIX@ ../bochs.h ../config.h ../osdep.h ../bx_debug/debug.h \
|
||||
../config.h ../osdep.h ../bxversion.h ../gui/siminterface.h \
|
||||
../gui/paramtree.h ../memory/memory.h ../pc_system.h ../plugin.h \
|
||||
../extplugin.h ../ltdl.h ../gui/gui.h ../instrument/stubs/instrument.h \
|
||||
../param_names.h keymap.h ../iodev/iodev.h enh_dbg.h icon_bochs.xpm \
|
||||
../font/vga.bitmap.h
|
||||
200
simulators/bochs/gui/amigagui.h
Normal file
200
simulators/bochs/gui/amigagui.h
Normal file
@ -0,0 +1,200 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <exec/types.h>
|
||||
#include <exec/exec.h>
|
||||
#include <proto/exec.h>
|
||||
#include <proto/dos.h>
|
||||
#include <proto/intuition.h>
|
||||
#include <proto/asl.h>
|
||||
#include <proto/graphics.h>
|
||||
#include <proto/cybergraphics.h>
|
||||
#include <proto/diskfont.h>
|
||||
#include <proto/gadtools.h>
|
||||
#include <proto/iffparse.h>
|
||||
#include <diskfont/diskfont.h>
|
||||
#include <intuition/intuitionbase.h>
|
||||
#include <intuition/pointerclass.h>
|
||||
#include <devices/input.h>
|
||||
#include <devices/inputevent.h>
|
||||
#include <graphics/gfxbase.h>
|
||||
#include <graphics/videocontrol.h>
|
||||
#include <cybergraphx/cybergraphics.h>
|
||||
#include <libraries/gadtools.h>
|
||||
|
||||
#define FULL(x) (x*0x01010101)
|
||||
#define ID_FTXT MAKE_ID('F','T','X','T')
|
||||
#define ID_CHRS MAKE_ID('C','H','R','S')
|
||||
|
||||
|
||||
void check_toolbar(void);
|
||||
|
||||
struct IntuitionBase *IntuitionBase;
|
||||
struct GfxBase *GfxBase;
|
||||
struct Library *KeymapBase;
|
||||
struct Library *GadToolsBase;
|
||||
|
||||
struct Library *CyberGfxBase;
|
||||
struct Library *AslBase;
|
||||
struct Library *DiskfontBase;
|
||||
struct Library *IFFParseBase;
|
||||
struct Screen *screen = NULL, *pub_screen = NULL;
|
||||
struct Window *window = NULL;
|
||||
struct TextFont *vgafont;
|
||||
|
||||
struct IOStdReq *inputReqBlk = NULL;
|
||||
struct MsgPort *inputPort = NULL;
|
||||
struct Interrupt *inputHandler = NULL;
|
||||
|
||||
int input_error = -1;
|
||||
|
||||
LONG pmap[256];
|
||||
ULONG cmap[256];
|
||||
static UWORD *emptypointer;
|
||||
char verstr[256];
|
||||
|
||||
struct TextAttr vgata = {
|
||||
"vga.font",
|
||||
16,
|
||||
NULL
|
||||
};
|
||||
|
||||
struct Image bx_header_image[BX_MAX_PIXMAPS];
|
||||
struct Gadget *bx_header_gadget[BX_MAX_PIXMAPS], *bx_glistptr = NULL, *bx_gadget_handle;
|
||||
static unsigned bx_image_entries = 0, bx_headerbar_entries = 0;
|
||||
static unsigned bx_bordertop, bx_borderleft, bx_borderright, bx_borderbottom,
|
||||
bx_headerbar_y, mouse_button_state = 0, bx_headernext_left,
|
||||
bx_headernext_right, x_tilesize, y_tilesize, bx_mouseX, bx_mouseY;
|
||||
static LONG apen = -1, black = -1, white = -1;
|
||||
BOOL bx_xchanged = FALSE;
|
||||
void *vi;
|
||||
|
||||
extern "C" { void dprintf(char *, ...) __attribute__ ((format (printf, 1, 2)));}
|
||||
|
||||
int w = 648, h = 480, d = 8;
|
||||
|
||||
char HandlerName[]="Bochs InputHandler";
|
||||
|
||||
const unsigned char raw_to_bochs [130] = {
|
||||
BX_KEY_GRAVE,
|
||||
BX_KEY_1, /*1*/
|
||||
BX_KEY_2,
|
||||
BX_KEY_3,
|
||||
BX_KEY_4,
|
||||
BX_KEY_5,
|
||||
BX_KEY_6,
|
||||
BX_KEY_7,
|
||||
BX_KEY_8,
|
||||
BX_KEY_9,
|
||||
BX_KEY_0, /*10*/
|
||||
BX_KEY_MINUS,
|
||||
BX_KEY_EQUALS,
|
||||
BX_KEY_BACKSLASH,
|
||||
0,
|
||||
BX_KEY_KP_INSERT,
|
||||
BX_KEY_Q,
|
||||
BX_KEY_W,
|
||||
BX_KEY_E,
|
||||
BX_KEY_R,
|
||||
BX_KEY_T, /*20*/
|
||||
BX_KEY_Y,
|
||||
BX_KEY_U,
|
||||
BX_KEY_I,
|
||||
BX_KEY_O,
|
||||
BX_KEY_P,
|
||||
BX_KEY_LEFT_BRACKET,
|
||||
BX_KEY_RIGHT_BRACKET,
|
||||
0,
|
||||
BX_KEY_KP_END,
|
||||
BX_KEY_KP_DOWN, /*30*/
|
||||
BX_KEY_KP_PAGE_DOWN,
|
||||
BX_KEY_A,
|
||||
BX_KEY_S,
|
||||
BX_KEY_D,
|
||||
BX_KEY_F,
|
||||
BX_KEY_G,
|
||||
BX_KEY_H,
|
||||
BX_KEY_J,
|
||||
BX_KEY_K,
|
||||
BX_KEY_L, /*40*/
|
||||
BX_KEY_SEMICOLON,
|
||||
BX_KEY_SINGLE_QUOTE,
|
||||
0,
|
||||
0,
|
||||
BX_KEY_KP_LEFT,
|
||||
BX_KEY_KP_5,
|
||||
BX_KEY_KP_RIGHT,
|
||||
0,
|
||||
BX_KEY_Z,
|
||||
BX_KEY_X, /*50*/
|
||||
BX_KEY_C,
|
||||
BX_KEY_V,
|
||||
BX_KEY_B,
|
||||
BX_KEY_N,
|
||||
BX_KEY_M,
|
||||
BX_KEY_COMMA,
|
||||
BX_KEY_PERIOD,
|
||||
BX_KEY_SLASH,
|
||||
0,
|
||||
BX_KEY_KP_DELETE, /*60*/
|
||||
BX_KEY_KP_HOME,
|
||||
BX_KEY_KP_UP,
|
||||
BX_KEY_KP_PAGE_UP,
|
||||
BX_KEY_SPACE,
|
||||
BX_KEY_BACKSPACE,
|
||||
BX_KEY_TAB,
|
||||
BX_KEY_KP_ENTER,
|
||||
BX_KEY_ENTER,
|
||||
BX_KEY_ESC,
|
||||
BX_KEY_DELETE, /*70*/
|
||||
BX_KEY_INSERT,
|
||||
BX_KEY_PAGE_UP,
|
||||
BX_KEY_PAGE_DOWN,
|
||||
BX_KEY_KP_SUBTRACT,
|
||||
BX_KEY_F11,
|
||||
BX_KEY_UP,
|
||||
BX_KEY_DOWN,
|
||||
BX_KEY_RIGHT,
|
||||
BX_KEY_LEFT,
|
||||
BX_KEY_F1, /*80*/
|
||||
BX_KEY_F2,
|
||||
BX_KEY_F3,
|
||||
BX_KEY_F4,
|
||||
BX_KEY_F5,
|
||||
BX_KEY_F6,
|
||||
BX_KEY_F7,
|
||||
BX_KEY_F8,
|
||||
BX_KEY_F9,
|
||||
BX_KEY_F10,
|
||||
0, /*90*/
|
||||
0,
|
||||
BX_KEY_KP_DIVIDE,
|
||||
BX_KEY_KP_MULTIPLY,
|
||||
BX_KEY_KP_ADD,
|
||||
BX_KEY_MENU,
|
||||
BX_KEY_SHIFT_L,
|
||||
BX_KEY_SHIFT_R,
|
||||
BX_KEY_CAPS_LOCK,
|
||||
BX_KEY_CTRL_L,
|
||||
BX_KEY_ALT_L, /*100*/
|
||||
BX_KEY_ALT_R,
|
||||
BX_KEY_WIN_L,
|
||||
BX_KEY_WIN_R,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
BX_KEY_SCRL_LOCK,
|
||||
BX_KEY_PRINT,
|
||||
BX_KEY_NUM_LOCK,
|
||||
BX_KEY_PAUSE, /*110*/
|
||||
BX_KEY_F12,
|
||||
BX_KEY_HOME,
|
||||
BX_KEY_END,
|
||||
BX_KEY_INT_STOP,
|
||||
BX_KEY_INT_FAV,
|
||||
BX_KEY_INT_BACK,
|
||||
BX_KEY_INT_FORWARD,
|
||||
BX_KEY_INT_HOME,
|
||||
BX_KEY_INT_SEARCH
|
||||
};
|
||||
855
simulators/bochs/gui/amigaos.cc
Normal file
855
simulators/bochs/gui/amigaos.cc
Normal file
@ -0,0 +1,855 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2000-2009 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 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_AMIGAOS
|
||||
#include "icon_bochs.h"
|
||||
#include "amigagui.h"
|
||||
|
||||
unsigned long __stack = 100000;
|
||||
static unsigned int text_rows=25, text_cols=80;
|
||||
|
||||
class bx_amigaos_gui_c : public bx_gui_c {
|
||||
public:
|
||||
bx_amigaos_gui_c (void) {}
|
||||
DECLARE_GUI_VIRTUAL_METHODS()
|
||||
};
|
||||
|
||||
// declare one instance of the gui object and call macro to insert the
|
||||
// plugin code
|
||||
static bx_amigaos_gui_c *theGui = NULL;
|
||||
IMPLEMENT_GUI_PLUGIN_CODE(amigaos)
|
||||
|
||||
#define LOG_THIS theGui->
|
||||
|
||||
static void hide_pointer();
|
||||
static void show_pointer();
|
||||
static void freeiff(struct IFFHandle *iff);
|
||||
|
||||
|
||||
static ULONG screenreqfunc(struct Hook *hook, struct ScreenModeRequester *smr, ULONG id)
|
||||
{
|
||||
return IsCyberModeID(id);
|
||||
}
|
||||
|
||||
LONG DispatcherFunc(void)
|
||||
{
|
||||
struct Hook *hook = (Hook *)REG_A0;
|
||||
return (*(LONG(*)(struct Hook *,LONG,LONG))hook->h_SubEntry)(hook,REG_A2,REG_A1);
|
||||
}
|
||||
|
||||
struct InputEvent *MyInputHandler(void)
|
||||
{
|
||||
struct InputEvent *event = (struct InputEvent *)REG_A0;
|
||||
|
||||
if (SIM->get_param_bool(BXPN_MOUSE_ENABLED)->get())
|
||||
{
|
||||
switch(event->ie_Code) {
|
||||
case IECODE_LBUTTON:
|
||||
{
|
||||
mouse_button_state |= 0x01;
|
||||
DEV_mouse_motion(event->ie_position.ie_xy.ie_x, -event->ie_position.ie_xy.ie_y, mouse_button_state);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
case (IECODE_LBUTTON | IECODE_UP_PREFIX):
|
||||
{
|
||||
mouse_button_state &= ~0x01;
|
||||
DEV_mouse_motion(event->ie_position.ie_xy.ie_x, -event->ie_position.ie_xy.ie_y, mouse_button_state);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
case IECODE_RBUTTON:
|
||||
{
|
||||
mouse_button_state |= 0x02;
|
||||
DEV_mouse_motion(event->ie_position.ie_xy.ie_x, -event->ie_position.ie_xy.ie_y, mouse_button_state);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
case (IECODE_RBUTTON | IECODE_UP_PREFIX):
|
||||
{
|
||||
mouse_button_state &= 0x01;
|
||||
DEV_mouse_motion(event->ie_position.ie_xy.ie_x, -event->ie_position.ie_xy.ie_y, mouse_button_state);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
if (event->ie_Class == IECLASS_RAWMOUSE)
|
||||
{
|
||||
DEV_mouse_motion(event->ie_position.ie_xy.ie_x, -event->ie_position.ie_xy.ie_y, mouse_button_state);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return (event);
|
||||
}
|
||||
return (event);
|
||||
}
|
||||
|
||||
void setup_inputhandler(void)
|
||||
{
|
||||
static struct EmulLibEntry GATEMyInputHandler =
|
||||
{
|
||||
TRAP_LIB, 0, (void (*)(void))MyInputHandler
|
||||
};
|
||||
|
||||
|
||||
if (inputPort=CreateMsgPort())
|
||||
{
|
||||
if (inputHandler=(struct Interrupt *)AllocMem(sizeof(struct Interrupt), MEMF_PUBLIC|MEMF_CLEAR))
|
||||
{
|
||||
if (inputReqBlk=(struct IOStdReq *)CreateIORequest(inputPort, sizeof(struct IOStdReq)))
|
||||
{
|
||||
if (!(input_error = OpenDevice("input.device",NULL, (struct IORequest *)inputReqBlk, NULL)))
|
||||
{
|
||||
inputHandler->is_Code=(void(*)())&GATEMyInputHandler;
|
||||
inputHandler->is_Data=NULL;
|
||||
inputHandler->is_Node.ln_Pri=100;
|
||||
inputHandler->is_Node.ln_Name=HandlerName;
|
||||
inputReqBlk->io_Data=(APTR)inputHandler;
|
||||
inputReqBlk->io_Command=IND_ADDHANDLER;
|
||||
DoIO((struct IORequest *)inputReqBlk);
|
||||
}
|
||||
else
|
||||
BX_PANIC(("Amiga: Could not open input.device"));
|
||||
}
|
||||
else
|
||||
BX_PANIC(("Amiga: Could not create I/O request"));
|
||||
}
|
||||
else
|
||||
BX_PANIC(("Amiga: Could not allocate interrupt struct memory"));
|
||||
}
|
||||
else
|
||||
printf(("Amiga: Could not create message port"));
|
||||
}
|
||||
|
||||
bx_bool open_screen(void)
|
||||
{
|
||||
ULONG id = INVALID_ID;
|
||||
|
||||
char *scrmode;
|
||||
struct DrawInfo *screen_drawinfo = NULL;
|
||||
|
||||
struct ScreenModeRequester *smr;
|
||||
|
||||
static struct EmulLibEntry GATEDispatcherFunc =
|
||||
{
|
||||
TRAP_LIB, 0, (void (*)(void))DispatcherFunc
|
||||
};
|
||||
|
||||
struct Hook screenreqhook = { 0, 0, (ULONG(*)())&GATEDispatcherFunc, (ULONG(*)())screenreqfunc, 0 };
|
||||
|
||||
sprintf (verstr, "Bochs x86 Emulator %s", VER_STRING);
|
||||
|
||||
if (SIM->get_param_bool(BXPN_FULLSCREEN)->get())
|
||||
{
|
||||
if((scrmode = SIM->get_param_string(BXPN_SCREENMODE)->getptr()))
|
||||
{
|
||||
id = strtoul(scrmode, NULL, 0);
|
||||
if (!IsCyberModeID(id)) id = INVALID_ID;
|
||||
}
|
||||
|
||||
if (id == INVALID_ID)
|
||||
{
|
||||
if (smr = (ScreenModeRequester *)AllocAslRequestTags(ASL_ScreenModeRequest,
|
||||
ASLSM_DoWidth, TRUE,
|
||||
ASLSM_DoHeight, TRUE,
|
||||
ASLSM_MinDepth, 8,
|
||||
ASLSM_MaxDepth, 32,
|
||||
ASLSM_PropertyFlags, DIPF_IS_WB,
|
||||
ASLSM_PropertyMask, DIPF_IS_WB,
|
||||
ASLSM_FilterFunc, (ULONG) &screenreqhook,
|
||||
TAG_DONE))
|
||||
{
|
||||
if (AslRequest(smr, NULL))
|
||||
{
|
||||
id = smr->sm_DisplayID;
|
||||
FreeAslRequest(smr);
|
||||
}
|
||||
else
|
||||
{
|
||||
FreeAslRequest(smr);
|
||||
BX_PANIC(("Amiga: Can't start without a screen"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
h = GetCyberIDAttr(CYBRIDATTR_HEIGHT, id);
|
||||
w = GetCyberIDAttr(CYBRIDATTR_WIDTH, id);
|
||||
d = GetCyberIDAttr(CYBRIDATTR_DEPTH, id);
|
||||
|
||||
//sprintf(scrmode, "%d", id);
|
||||
//setenv("env:bochs/screenmode", scrmode, 1);
|
||||
|
||||
|
||||
screen = OpenScreenTags(NULL,
|
||||
SA_Width, w,
|
||||
SA_Height, h,
|
||||
SA_Depth, d,
|
||||
SA_Title, verstr,
|
||||
SA_DisplayID, id,
|
||||
SA_ShowTitle, FALSE,
|
||||
SA_Type, PUBLICSCREEN,
|
||||
SA_SharePens, TRUE,
|
||||
TAG_DONE);
|
||||
|
||||
if(!screen)
|
||||
BX_PANIC(("Amiga: Couldn't open screen"));
|
||||
|
||||
window = OpenWindowTags(NULL,
|
||||
WA_CustomScreen,(int)screen,
|
||||
WA_Width,w,
|
||||
WA_Height,h,
|
||||
WA_Title, verstr,
|
||||
WA_IDCMP, IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_INACTIVEWINDOW,
|
||||
WA_ReportMouse, TRUE,
|
||||
WA_RMBTrap, TRUE,
|
||||
WA_Backdrop,TRUE,
|
||||
WA_Borderless,TRUE,
|
||||
WA_Activate,TRUE,
|
||||
TAG_DONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
pub_screen = LockPubScreen(NULL);
|
||||
if (pub_screen != NULL)
|
||||
{
|
||||
screen_drawinfo = GetScreenDrawInfo(pub_screen);
|
||||
if (screen_drawinfo != NULL)
|
||||
{
|
||||
id = GetVPModeID(&pub_screen->ViewPort);
|
||||
d = GetCyberIDAttr(CYBRIDATTR_DEPTH, id);
|
||||
} else {
|
||||
UnlockPubScreen(NULL,pub_screen);
|
||||
BX_PANIC(("Amiga: Couldn't get ScreenDrawInfo"));
|
||||
}
|
||||
|
||||
window = OpenWindowTags(NULL,
|
||||
WA_Width,w,
|
||||
WA_Height,h,
|
||||
WA_Title, verstr,
|
||||
WA_IDCMP, IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_CHANGEWINDOW | IDCMP_INACTIVEWINDOW,
|
||||
WA_RMBTrap, TRUE,
|
||||
WA_DepthGadget, TRUE,
|
||||
WA_ReportMouse, TRUE,
|
||||
WA_DragBar, TRUE,
|
||||
WA_Activate,TRUE,
|
||||
TAG_DONE);
|
||||
|
||||
UnlockPubScreen(NULL,pub_screen);
|
||||
}
|
||||
else
|
||||
BX_PANIC(("Amiga: Couldn't lock the public screen"));
|
||||
}
|
||||
|
||||
if (!window)
|
||||
BX_PANIC(("Amiga: Couldn't open the window"));
|
||||
|
||||
if ((emptypointer = (UWORD *)AllocVec (16, MEMF_CLEAR)) == NULL)
|
||||
BX_PANIC(("Amiga: Couldn't allocate memory"));
|
||||
|
||||
vgafont = OpenDiskFont(&vgata);
|
||||
|
||||
if (SIM->get_param_bool(BXPN_MOUSE_ENABLED)->get())
|
||||
hide_pointer();
|
||||
|
||||
if(!vgafont)
|
||||
BX_PANIC(("Amiga: Couldn't open the vga font"));
|
||||
|
||||
SetFont(window->RPort, vgafont);
|
||||
|
||||
if (NULL == (vi = GetVisualInfo(window->WScreen, TAG_END)))
|
||||
BX_PANIC(("Amiga: GetVisualInfo() failed"));
|
||||
|
||||
bx_gadget_handle = CreateContext(&bx_glistptr);
|
||||
|
||||
bx_bordertop = window->BorderTop;
|
||||
bx_borderleft = window->BorderLeft;
|
||||
bx_borderright = window->BorderRight;
|
||||
bx_borderbottom = window->BorderBottom;
|
||||
bx_headernext_left = bx_borderleft;
|
||||
bx_headernext_right += bx_borderright;
|
||||
|
||||
for (apen = 0; apen < 256; apen++) /*fill the pen map with -1 so we can know which pens to free at exit*/
|
||||
pmap[apen] = -1;
|
||||
|
||||
white = ObtainBestPen(window->WScreen->ViewPort.ColorMap, 0xffffffff, 0xffffffff, 0xffffffff, NULL);
|
||||
black = ObtainBestPen(window->WScreen->ViewPort.ColorMap, 0x00000000, 0x00000000, 0x00000000, NULL);
|
||||
}
|
||||
|
||||
void bx_amigaos_gui_c::specific_init(int argc, char **argv, unsigned tilewidth, unsigned tileheight,
|
||||
unsigned headerbar_y)
|
||||
{
|
||||
x_tilesize = tilewidth;
|
||||
y_tilesize = tileheight;
|
||||
|
||||
bx_headerbar_y = headerbar_y;
|
||||
|
||||
IntuitionBase = (struct IntuitionBase *)OpenLibrary("intuition.library", 39);
|
||||
if (IntuitionBase == NULL)
|
||||
BX_PANIC(("Amiga: Failed to open intuition.library v39 or later!"));
|
||||
if (IntuitionBase->LibNode.lib_Version == 50 && IntuitionBase->LibNode.lib_Revision < 5)
|
||||
BX_PANIC(("Amiga: intuition.library v50 needs to be revision 5 or higher!"));
|
||||
|
||||
GfxBase = (struct GfxBase *)OpenLibrary("graphics.library", 39);
|
||||
if (GfxBase == NULL)
|
||||
BX_PANIC(("Amiga: Failed to open graphics.library v39 or later!"));
|
||||
|
||||
GadToolsBase = OpenLibrary("gadtools.library", 37);
|
||||
if (GadToolsBase == NULL)
|
||||
BX_PANIC(("Amiga: Failed to open gadtools.library v37 or later!"));
|
||||
if (GadToolsBase->lib_Version == 50 && GadToolsBase->lib_Revision < 3)
|
||||
BX_PANIC(("Amiga: gadtools.library v50 needs to be revision 3 or higher!"));
|
||||
|
||||
CyberGfxBase = OpenLibrary("cybergraphics.library", 40);
|
||||
if (CyberGfxBase == NULL)
|
||||
BX_PANIC(("Amiga: Failed to open cybergraphics.library v40 or later!"));
|
||||
|
||||
AslBase = OpenLibrary("asl.library", 38);
|
||||
if (AslBase == NULL)
|
||||
BX_PANIC(("Amiga: Failed to open asl.library v38 or later!"));
|
||||
|
||||
DiskfontBase = OpenLibrary("diskfont.library", 38);
|
||||
if (DiskfontBase == NULL)
|
||||
BX_PANIC(("Amiga: Failed to open diskfont.library v38 or later!"));
|
||||
|
||||
IFFParseBase = OpenLibrary("iffparse.library", 39);
|
||||
if (IFFParseBase == NULL)
|
||||
BX_PANIC(("Amiga: Failed to open iffparse.library v39 or later!"));
|
||||
|
||||
open_screen();
|
||||
setup_inputhandler();
|
||||
|
||||
if (SIM->get_param_bool(BXPN_PRIVATE_COLORMAP)->get()) {
|
||||
BX_ERROR(("Amiga: private_colormap option ignored."));
|
||||
}
|
||||
}
|
||||
|
||||
void bx_amigaos_gui_c::handle_events(void)
|
||||
{
|
||||
void (*func) (void);
|
||||
struct IntuiMessage *imsg = NULL;
|
||||
struct Gadget *gad;
|
||||
ULONG imCode,imClass,imQualifier;
|
||||
Bit32u key_event;
|
||||
|
||||
while ((imsg = (struct IntuiMessage *)GetMsg(window->UserPort)))
|
||||
{
|
||||
gad = (struct Gadget *)imsg->IAddress;
|
||||
key_event= 0;
|
||||
|
||||
imClass = imsg->Class;
|
||||
imCode = imsg->Code;
|
||||
imQualifier = imsg->Qualifier;
|
||||
|
||||
ReplyMsg((struct Message *)imsg);
|
||||
|
||||
switch (imClass) {
|
||||
case IDCMP_RAWKEY:
|
||||
if (imQualifier & IEQUALIFIER_LSHIFT && imQualifier & IEQUALIFIER_CONTROL && imQualifier & IEQUALIFIER_LCOMMAND)
|
||||
{
|
||||
toggle_mouse_enable();
|
||||
break;
|
||||
}
|
||||
|
||||
if(imCode <= 101)
|
||||
key_event = raw_to_bochs[imCode];
|
||||
if(imCode >= 128)
|
||||
key_event = raw_to_bochs[imCode-128] | BX_KEY_RELEASED;
|
||||
if(key_event)
|
||||
DEV_kbd_gen_scancode(key_event);
|
||||
break;
|
||||
|
||||
case GADGETUP:
|
||||
((void (*)()) bx_header_gadget[gad->GadgetID]->UserData)();
|
||||
break;
|
||||
|
||||
case IDCMP_INACTIVEWINDOW:
|
||||
if (SIM->get_param_bool(BXPN_MOUSE_ENABLED)->get())
|
||||
toggle_mouse_enable();
|
||||
break;
|
||||
|
||||
case IDCMP_CHANGEWINDOW:
|
||||
if(bx_xchanged)
|
||||
{
|
||||
bx_amigaos_gui_c::show_headerbar();
|
||||
bx_xchanged = FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void bx_amigaos_gui_c::flush(void) { }
|
||||
|
||||
void bx_amigaos_gui_c::clear_screen(void)
|
||||
{
|
||||
if (d > 8 || !SIM->get_param_bool(BXPN_FULLSCREEN)->get())
|
||||
SetAPen(window->RPort, black);
|
||||
else
|
||||
SetAPen(window->RPort, 0); /*should be ok to clear with the first pen in the map*/
|
||||
RectFill(window->RPort, bx_borderleft, bx_bordertop + bx_headerbar_y, window->Width - bx_borderright - 1, window->Height - bx_borderbottom - 1);
|
||||
}
|
||||
|
||||
void bx_amigaos_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
|
||||
unsigned long cursor_x, unsigned long cursor_y,
|
||||
bx_vga_tminfo_t tm_info)
|
||||
{
|
||||
int i;
|
||||
int cursori;
|
||||
unsigned nchars;
|
||||
char achar;
|
||||
char string[80];
|
||||
int x, y;
|
||||
static int previ;
|
||||
unsigned int fgcolor, bgcolor;
|
||||
|
||||
//current cursor position
|
||||
cursori = (cursor_y * text_cols + cursor_x) * 2;
|
||||
|
||||
// Number of characters on screen, variable number of rows
|
||||
nchars = text_cols * text_rows;
|
||||
|
||||
for (i=0; i<nchars*2; i+=2)
|
||||
{
|
||||
if (i == cursori || i == previ || new_text[i] != old_text[i] || new_text[i+1] != old_text[i+1])
|
||||
{
|
||||
achar = new_text[i];
|
||||
fgcolor = new_text[i+1] & 0x0F;
|
||||
bgcolor = (new_text[i+1] & 0xF0) >> 4;
|
||||
|
||||
if (i == cursori) /*invert the cursor block*/
|
||||
{
|
||||
SetAPen(window->RPort, pmap[bgcolor]);
|
||||
SetBPen(window->RPort, pmap[fgcolor]);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAPen(window->RPort, pmap[fgcolor]);
|
||||
SetBPen(window->RPort, pmap[bgcolor]);
|
||||
}
|
||||
|
||||
x = ((i/2) % text_cols)*window->RPort->TxWidth;
|
||||
y = ((i/2) / text_cols)*window->RPort->TxHeight;
|
||||
|
||||
Move(window->RPort, bx_borderleft + x, bx_bordertop + bx_headerbar_y + y + window->RPort->TxBaseline);
|
||||
Text(window->RPort, &achar, 1);
|
||||
}
|
||||
}
|
||||
|
||||
previ = cursori;
|
||||
|
||||
}
|
||||
|
||||
int bx_amigaos_gui_c::get_clipboard_text(Bit8u **bytes, Bit32s *nbytes)
|
||||
{
|
||||
struct IFFHandle *iff = NULL;
|
||||
long err = 0;
|
||||
struct ContextNode *cn;
|
||||
|
||||
if (!(iff = AllocIFF ()))
|
||||
{
|
||||
BX_INFO(("Amiga: Failed to allocate iff handle"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(iff->iff_Stream = (ULONG) OpenClipboard (0)))
|
||||
{
|
||||
BX_INFO(("Amiga: Failed to open clipboard device"));
|
||||
freeiff(iff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
InitIFFasClip (iff);
|
||||
|
||||
if (err = OpenIFF (iff, IFFF_READ))
|
||||
{
|
||||
BX_INFO(("Amiga: Failed to open clipboard for reading"));
|
||||
freeiff(iff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (err = StopChunk(iff, ID_FTXT, ID_CHRS))
|
||||
{
|
||||
BX_INFO(("Amiga: Failed StopChunk()"));
|
||||
freeiff(iff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
UBYTE readbuf[1024];
|
||||
int len = 0;
|
||||
|
||||
err = ParseIFF(iff, IFFPARSE_SCAN);
|
||||
if(err == IFFERR_EOC) continue;
|
||||
else if(err) break;
|
||||
|
||||
cn = CurrentChunk(iff);
|
||||
|
||||
if((cn) && (cn->cn_Type == ID_FTXT) && (cn->cn_ID == ID_CHRS))
|
||||
{
|
||||
while((len = ReadChunkBytes(iff,readbuf, 1024)) > 0)
|
||||
{
|
||||
Bit8u *buf = new Bit8u[len];
|
||||
memcpy (buf, readbuf, len);
|
||||
*bytes = buf;
|
||||
*nbytes = len;
|
||||
}
|
||||
if(len < 0) err = len;
|
||||
}
|
||||
}
|
||||
|
||||
if(err && (err != IFFERR_EOF))
|
||||
{
|
||||
BX_INFO(("Amiga: Failed to read from clipboard"));
|
||||
freeiff(iff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
freeiff(iff);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
int bx_amigaos_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
|
||||
{
|
||||
struct IFFHandle *iff = NULL;
|
||||
long err = 0;
|
||||
|
||||
BX_INFO(("Amiga: set_clipboard_text"));
|
||||
|
||||
if (!(iff = AllocIFF ()))
|
||||
{
|
||||
BX_INFO(("Amiga: Failed to allocate iff handle"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!(iff->iff_Stream = (ULONG) OpenClipboard (0)))
|
||||
{
|
||||
BX_INFO(("Amiga: Failed to open clipboard device"));
|
||||
freeiff(iff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
InitIFFasClip (iff);
|
||||
|
||||
if (err = OpenIFF (iff, IFFF_WRITE))
|
||||
{
|
||||
BX_INFO(("Amiga: Failed to open clipboard for writing"));
|
||||
freeiff(iff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(!(err = PushChunk(iff, ID_FTXT, ID_FORM, IFFSIZE_UNKNOWN)))
|
||||
{
|
||||
if(!(err=PushChunk(iff, 0, ID_CHRS, IFFSIZE_UNKNOWN)))
|
||||
{
|
||||
if(WriteChunkBytes(iff, text_snapshot, len) != len)
|
||||
err = IFFERR_WRITE;
|
||||
}
|
||||
if(!err) err = PopChunk(iff);
|
||||
}
|
||||
if(!err) err = PopChunk(iff);
|
||||
|
||||
if(err)
|
||||
{
|
||||
BX_INFO(("Amiga: Failed to write text to clipboard"));
|
||||
freeiff(iff);
|
||||
return 0;
|
||||
}
|
||||
|
||||
freeiff(iff);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
bx_bool bx_amigaos_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
||||
{
|
||||
Bit8u *ptr = (Bit8u *)(cmap+index);
|
||||
|
||||
ptr++; /*first 8bits are not defined in the XRGB8 entry*/
|
||||
*ptr = red; ptr++;
|
||||
*ptr = green; ptr++;
|
||||
*ptr = blue;
|
||||
|
||||
if (d > 8 || !SIM->get_param_bool(BXPN_FULLSCREEN)->get())
|
||||
{
|
||||
if(pmap[index] != -1)
|
||||
ReleasePen(window->WScreen->ViewPort.ColorMap, pmap[index]);
|
||||
pmap[index] = ObtainBestPen(window->WScreen->ViewPort.ColorMap, FULL(red), FULL(green), FULL(blue), OBP_Precision, (ULONG) PRECISION_EXACT, TAG_DONE);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetRGB32(&screen->ViewPort, index, red << 24, green << 24, blue << 24);
|
||||
pmap[index] = index;
|
||||
}
|
||||
|
||||
//printf("%d, %d: [%d, %d, %d]\n", pmap[index], index, red, green, blue);
|
||||
|
||||
return(1);
|
||||
}
|
||||
|
||||
void bx_amigaos_gui_c::graphics_tile_update(Bit8u *tile, unsigned x0, unsigned y0)
|
||||
{
|
||||
if (d == 8)
|
||||
WritePixelArray(tile, 0, 0, x_tilesize, window->RPort, bx_borderleft + x0, bx_bordertop + bx_headerbar_y + y0, x_tilesize, y_tilesize, RECTFMT_LUT8);
|
||||
else
|
||||
WriteLUTPixelArray(tile, 0, 0, x_tilesize, window->RPort, cmap, bx_borderleft + x0, bx_bordertop + bx_headerbar_y + y0, x_tilesize, y_tilesize, CTABFMT_XRGB8);
|
||||
}
|
||||
|
||||
void bx_amigaos_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, unsigned fwidth, unsigned bpp)
|
||||
{
|
||||
|
||||
if (bpp > 8) {
|
||||
BX_PANIC(("%d bpp graphics mode not supported yet", bpp));
|
||||
}
|
||||
|
||||
int xdiff = w - x;
|
||||
|
||||
if (fheight > 0) {
|
||||
text_cols = x / fwidth;
|
||||
text_rows = y / fheight;
|
||||
if (fwidth != 8) {
|
||||
x = x * 8 / fwidth;
|
||||
}
|
||||
if (fheight != 16) {
|
||||
y = y * 16 / fheight;
|
||||
}
|
||||
}
|
||||
|
||||
if (!SIM->get_param_bool(BXPN_FULLSCREEN)->get() && (x != w || y != h))
|
||||
{
|
||||
ChangeWindowBox(window, window->LeftEdge, window->TopEdge, x + bx_borderleft + bx_borderright, y + bx_bordertop + bx_borderbottom + bx_headerbar_y);
|
||||
w = x;
|
||||
h = y;
|
||||
}
|
||||
|
||||
/* Now we need to realign the gadgets and refresh the title bar*/
|
||||
|
||||
if(xdiff != 0)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i = 0; i < bx_headerbar_entries; i++)
|
||||
{
|
||||
if(bx_header_gadget[i]->LeftEdge + bx_header_gadget[i]->Width > bx_headernext_left)
|
||||
bx_header_gadget[i]->LeftEdge -= xdiff;
|
||||
}
|
||||
|
||||
bx_xchanged = TRUE;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
unsigned bx_amigaos_gui_c::create_bitmap(const unsigned char *bmap, unsigned xdim, unsigned ydim)
|
||||
{
|
||||
int i = 0;
|
||||
Bit8u *a;
|
||||
|
||||
if (bx_image_entries >= BX_MAX_PIXMAPS) {
|
||||
BX_PANIC(("amiga: too many pixmaps, increase BX_MAX_PIXMAPS"));
|
||||
}
|
||||
|
||||
bx_header_image[bx_image_entries].LeftEdge = 0;
|
||||
bx_header_image[bx_image_entries].TopEdge = 0;
|
||||
bx_header_image[bx_image_entries].Width = xdim;
|
||||
bx_header_image[bx_image_entries].Height = ydim;
|
||||
bx_header_image[bx_image_entries].Depth = 2;
|
||||
bx_header_image[bx_image_entries].ImageData = (UWORD *)bmap;
|
||||
bx_header_image[bx_image_entries].NextImage = NULL;
|
||||
bx_header_image[bx_image_entries].PlanePick = 0x1;
|
||||
if (d > 8 || !SIM->get_param_bool(BXPN_FULLSCREEN)->get())
|
||||
bx_header_image[bx_image_entries].PlaneOnOff = 0x2;
|
||||
|
||||
/*we need to reverse the bitorder for this to work*/
|
||||
|
||||
a = (Bit8u *) bx_header_image[bx_image_entries].ImageData;
|
||||
|
||||
for(i = 0; i <= xdim*ydim/8; i++, a++)
|
||||
{
|
||||
*a = ((*a & 0xf0) >> 4) | ((*a & 0x0f) << 4);
|
||||
*a = ((*a & 0xcc) >> 2) | ((*a & 0x33) << 2);
|
||||
*a = ((*a & 0xaa) >> 1) | ((*a & 0x55) << 1);
|
||||
}
|
||||
|
||||
//dprintf("image data (%d), %lx\n", bx_image_entries, bmap);
|
||||
|
||||
bx_image_entries++;
|
||||
return(bx_image_entries - 1); // return index as handle
|
||||
}
|
||||
|
||||
unsigned bx_amigaos_gui_c::headerbar_bitmap(unsigned bmap_id, unsigned alignment, void (*f)(void))
|
||||
{
|
||||
struct NewGadget ng;
|
||||
|
||||
ng.ng_TopEdge = bx_bordertop;
|
||||
ng.ng_Width = bx_header_image[bmap_id].Width;
|
||||
ng.ng_Height = bx_header_image[bmap_id].Height;
|
||||
ng.ng_VisualInfo = vi;
|
||||
ng.ng_TextAttr = &vgata;
|
||||
ng.ng_GadgetID = bx_headerbar_entries;
|
||||
ng.ng_GadgetText = (UBYTE *)"";
|
||||
ng.ng_Flags = 0;
|
||||
ng.ng_UserData = f;
|
||||
|
||||
if (alignment == BX_GRAVITY_LEFT)
|
||||
{
|
||||
ng.ng_LeftEdge = bx_headernext_left;
|
||||
bx_headernext_left += ng.ng_Width;
|
||||
}
|
||||
else
|
||||
{
|
||||
ng.ng_LeftEdge = window->Width - bx_headernext_right - ng.ng_Width;
|
||||
bx_headernext_right += ng.ng_Width;
|
||||
}
|
||||
|
||||
bx_gadget_handle = bx_header_gadget[bx_headerbar_entries] =
|
||||
CreateGadget(BUTTON_KIND, bx_gadget_handle, &ng, GT_Underscore, '_', TAG_END);
|
||||
|
||||
bx_gadget_handle->GadgetType |= GTYP_BOOLGADGET;
|
||||
bx_gadget_handle->Flags |= GFLG_GADGIMAGE | GFLG_GADGHNONE;
|
||||
bx_gadget_handle->GadgetRender = &bx_header_image[bmap_id];
|
||||
bx_gadget_handle->UserData = f;
|
||||
|
||||
bx_headerbar_entries++;
|
||||
return(bx_headerbar_entries - 1);
|
||||
}
|
||||
|
||||
void bx_amigaos_gui_c::show_headerbar(void)
|
||||
{
|
||||
RemoveGList(window, bx_glistptr, bx_headerbar_entries);
|
||||
|
||||
if (d > 8 || !SIM->get_param_bool(BXPN_FULLSCREEN)->get())
|
||||
SetAPen(window->RPort, white);
|
||||
else
|
||||
SetAPen(window->RPort, 0);
|
||||
RectFill(window->RPort, bx_borderleft, bx_bordertop, window->Width - bx_borderright - 1, bx_headerbar_y + bx_bordertop - 1);
|
||||
|
||||
AddGList(window, bx_glistptr, ~0, bx_headerbar_entries, NULL);
|
||||
RefreshGList(bx_glistptr, window, NULL, bx_headerbar_entries + 1);
|
||||
|
||||
GT_RefreshWindow(window,NULL);
|
||||
}
|
||||
|
||||
void bx_amigaos_gui_c::replace_bitmap(unsigned hbar_id, unsigned bmap_id)
|
||||
{
|
||||
bx_header_gadget[hbar_id]->GadgetRender = &bx_header_image[bmap_id];
|
||||
|
||||
RefreshGList(bx_glistptr, window, NULL, bx_headerbar_entries + 1);
|
||||
}
|
||||
|
||||
void bx_amigaos_gui_c::exit(void)
|
||||
{
|
||||
if(window)
|
||||
{
|
||||
RemoveGList(window, bx_glistptr, bx_headerbar_entries);
|
||||
FreeGadgets(bx_glistptr);
|
||||
FreeVec(emptypointer);
|
||||
|
||||
/*Release the pens*/
|
||||
while (apen >= 0)
|
||||
{
|
||||
if (pmap[apen] == black)
|
||||
black = -1;
|
||||
if (pmap[apen] == white)
|
||||
white = -1;
|
||||
ReleasePen(window->WScreen->ViewPort.ColorMap, pmap[apen]);
|
||||
apen--;
|
||||
}
|
||||
if (black != -1)
|
||||
ReleasePen(window->WScreen->ViewPort.ColorMap, black);
|
||||
if(white != -1)
|
||||
ReleasePen(window->WScreen->ViewPort.ColorMap, white);
|
||||
CloseWindow(window);
|
||||
}
|
||||
|
||||
if(screen)
|
||||
CloseScreen(screen);
|
||||
if(CyberGfxBase)
|
||||
CloseLibrary(CyberGfxBase);
|
||||
if(GadToolsBase)
|
||||
CloseLibrary(GadToolsBase);
|
||||
if(GfxBase)
|
||||
CloseLibrary((struct Library *)GfxBase);
|
||||
if(IntuitionBase)
|
||||
CloseLibrary((struct Library *)IntuitionBase);
|
||||
if(DiskfontBase)
|
||||
CloseLibrary(DiskfontBase);
|
||||
if(AslBase)
|
||||
CloseLibrary(AslBase);
|
||||
if(IFFParseBase)
|
||||
CloseLibrary(IFFParseBase);
|
||||
|
||||
if(!input_error)
|
||||
{
|
||||
inputReqBlk->io_Data=(APTR)inputHandler;
|
||||
inputReqBlk->io_Command=IND_REMHANDLER;
|
||||
DoIO((struct IORequest *)inputReqBlk);
|
||||
CloseDevice((struct IORequest *)inputReqBlk);
|
||||
}
|
||||
|
||||
if(inputReqBlk)
|
||||
DeleteIORequest((struct IORequest *)inputReqBlk);
|
||||
if(inputHandler)
|
||||
FreeMem(inputHandler,sizeof(struct Interrupt));
|
||||
if(inputPort)
|
||||
DeleteMsgPort(inputPort);
|
||||
}
|
||||
|
||||
void show_pointer(void)
|
||||
{
|
||||
ClearPointer(window);
|
||||
}
|
||||
|
||||
void hide_pointer(void)
|
||||
{
|
||||
SetPointer(window, emptypointer, 1, 16, 0, 0);
|
||||
}
|
||||
|
||||
void bx_amigaos_gui_c::mouse_enabled_changed_specific (bx_bool val)
|
||||
{
|
||||
if (val) {
|
||||
BX_INFO(("[AmigaOS] Mouse on"));
|
||||
hide_pointer();
|
||||
} else {
|
||||
BX_INFO(("[AmigaOS] Mouse off"));
|
||||
show_pointer();
|
||||
}
|
||||
}
|
||||
|
||||
void freeiff(struct IFFHandle *iff)
|
||||
{
|
||||
if(iff) {
|
||||
CloseIFF (iff);
|
||||
if (iff->iff_Stream)
|
||||
CloseClipboard((struct ClipboardHandle *) iff->iff_Stream);
|
||||
FreeIFF(iff);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* if BX_WITH_AMIGAOS */
|
||||
1167
simulators/bochs/gui/beos.cc
Normal file
1167
simulators/bochs/gui/beos.cc
Normal file
File diff suppressed because it is too large
Load Diff
34
simulators/bochs/gui/bitmaps/cdromd.h
Normal file
34
simulators/bochs/gui/bitmaps/cdromd.h
Normal file
@ -0,0 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_CDROMD_BMAP_X 32
|
||||
#define BX_CDROMD_BMAP_Y 32
|
||||
|
||||
static const unsigned char bx_cdromd_bmap[(BX_CONFIG_BMAP_X * BX_CONFIG_BMAP_Y)/8] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x0e, 0x00, 0x00, 0x10, 0x12, 0x00,
|
||||
0x00, 0x10, 0x12, 0x00, 0x00, 0x10, 0x12, 0x00, 0x00, 0x60, 0x0e, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x0c, 0x30, 0x00,
|
||||
0x00, 0xe2, 0x47, 0x00, 0x00, 0x19, 0x98, 0x00, 0x80, 0xe6, 0x67, 0x01,
|
||||
0x40, 0x19, 0x98, 0x02, 0x20, 0xe5, 0xa7, 0x04, 0xa0, 0x12, 0x48, 0x05,
|
||||
0x90, 0xca, 0x53, 0x09, 0x50, 0x25, 0xa4, 0x0a, 0x50, 0x15, 0xa8, 0x0a,
|
||||
0x50, 0x15, 0xa8, 0x0a, 0x50, 0x15, 0xa8, 0x0a, 0x50, 0x15, 0xa8, 0x0a,
|
||||
0x50, 0x25, 0xa4, 0x0a, 0x90, 0xca, 0x53, 0x09, 0xa0, 0x12, 0x48, 0x05,
|
||||
0x20, 0xe5, 0xa7, 0x04, 0x40, 0x19, 0x98, 0x02, 0x80, 0xe6, 0x67, 0x01,
|
||||
0x00, 0x19, 0x98, 0x00, 0x00, 0xe2, 0x47, 0x00, 0x00, 0x0c, 0x30, 0x00,
|
||||
0x00, 0xf0, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
static const unsigned char bx_cdromd_eject_bmap[(BX_CONFIG_BMAP_X * BX_CONFIG_BMAP_Y)/8] = {
|
||||
0x01, 0x00, 0x00, 0x80, 0x02, 0x60, 0x0e, 0x40, 0x04, 0x10, 0x12, 0x20,
|
||||
0x08, 0x10, 0x12, 0x10, 0x10, 0x10, 0x12, 0x08, 0x20, 0x60, 0x0e, 0x04,
|
||||
0x40, 0x00, 0x00, 0x02, 0x80, 0xf0, 0x0f, 0x01, 0x00, 0x0d, 0xb0, 0x00,
|
||||
0x00, 0xe2, 0x47, 0x00, 0x00, 0x1d, 0xb8, 0x00, 0x80, 0xee, 0x77, 0x01,
|
||||
0x40, 0x19, 0x98, 0x02, 0x20, 0xe5, 0xa7, 0x04, 0xa0, 0x52, 0x4a, 0x05,
|
||||
0x90, 0xca, 0x53, 0x09, 0x50, 0xa5, 0xa5, 0x0a, 0x50, 0x55, 0xaa, 0x0a,
|
||||
0x50, 0x35, 0xac, 0x0a, 0x50, 0x15, 0xa8, 0x0a, 0x50, 0x1d, 0xb8, 0x0a,
|
||||
0x50, 0x25, 0xa4, 0x0a, 0x90, 0xca, 0x53, 0x09, 0xa0, 0x13, 0xc8, 0x05,
|
||||
0xa0, 0xe5, 0xa7, 0x05, 0x40, 0x19, 0x98, 0x02, 0xa0, 0xe6, 0x67, 0x05,
|
||||
0x10, 0x19, 0x98, 0x08, 0x08, 0xe2, 0x47, 0x10, 0x04, 0x0c, 0x30, 0x20,
|
||||
0x02, 0xf0, 0x0f, 0x40, 0x01, 0x00, 0x00, 0x80
|
||||
};
|
||||
41
simulators/bochs/gui/bitmaps/cdromd.xpm
Normal file
41
simulators/bochs/gui/bitmaps/cdromd.xpm
Normal file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *cdromd_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
"................................",
|
||||
".............##..###............",
|
||||
"............#....#..#...........",
|
||||
"............#....#..#...........",
|
||||
"............#....#..#...........",
|
||||
".............##..###............",
|
||||
"................................",
|
||||
"............########............",
|
||||
"..........##........##..........",
|
||||
".........#...######...#.........",
|
||||
"........#..##......##..#........",
|
||||
".......#.##..######..##.#.......",
|
||||
"......#.#..##......##..#.#......",
|
||||
".....#..#.#..######..#.#..#.....",
|
||||
".....#.#.#..#......#..#.#.#.....",
|
||||
"....#..#.#.#..####..#.#.#..#....",
|
||||
"....#.#.#.#..#....#..#.#.#.#....",
|
||||
"....#.#.#.#.#......#.#.#.#.#....",
|
||||
"....#.#.#.#.#......#.#.#.#.#....",
|
||||
"....#.#.#.#.#......#.#.#.#.#....",
|
||||
"....#.#.#.#.#......#.#.#.#.#....",
|
||||
"....#.#.#.#..#....#..#.#.#.#....",
|
||||
"....#..#.#.#..####..#.#.#..#....",
|
||||
".....#.#.#..#......#..#.#.#.....",
|
||||
".....#..#.#..######..#.#..#.....",
|
||||
"......#.#..##......##..#.#......",
|
||||
".......#.##..######..##.#.......",
|
||||
"........#..##......##..#........",
|
||||
".........#...######...#.........",
|
||||
"..........##........##..........",
|
||||
"............########............",
|
||||
"................................"
|
||||
};
|
||||
16
simulators/bochs/gui/bitmaps/configbutton.h
Normal file
16
simulators/bochs/gui/bitmaps/configbutton.h
Normal file
@ -0,0 +1,16 @@
|
||||
#define BX_CONFIG_BMAP_X 32
|
||||
#define BX_CONFIG_BMAP_Y 32
|
||||
|
||||
static const unsigned char bx_config_bmap[(BX_CONFIG_BMAP_X * BX_CONFIG_BMAP_Y)/8] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x01, 0xfc, 0x7f, 0xc0, 0x03,
|
||||
0xfc, 0xff, 0xc1, 0x03, 0xfc, 0xff, 0xc1, 0x03, 0xfc, 0x7f, 0xc0, 0x03,
|
||||
0x84, 0x07, 0xc0, 0x03, 0x80, 0x07, 0xc0, 0x03, 0x80, 0x07, 0xc0, 0x03,
|
||||
0x80, 0x07, 0xc0, 0x03, 0x80, 0x07, 0xc0, 0x03, 0x80, 0x07, 0xc0, 0x03,
|
||||
0x80, 0x07, 0xc0, 0x03, 0x80, 0x07, 0xc0, 0x03, 0x80, 0x07, 0xc0, 0x03,
|
||||
0x80, 0x07, 0xc0, 0x03, 0x80, 0x07, 0xc0, 0x03, 0x80, 0x07, 0xc0, 0x03,
|
||||
0x80, 0x07, 0xc0, 0x03, 0x80, 0x07, 0xe0, 0x07, 0x80, 0x07, 0xf0, 0x0f,
|
||||
0x80, 0x07, 0x70, 0x0e, 0x80, 0x07, 0x30, 0x0c, 0x80, 0x07, 0x30, 0x0c,
|
||||
0x80, 0x07, 0x20, 0x04, 0x00, 0x00, 0x00, 0x00, 0x38, 0x27, 0xba, 0x1c,
|
||||
0x84, 0x68, 0x8a, 0x02, 0x84, 0xa8, 0xba, 0x32, 0x84, 0x28, 0x8b, 0x22,
|
||||
0x38, 0x27, 0x8a, 0x1c, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
41
simulators/bochs/gui/bitmaps/configbutton.xpm
Normal file
41
simulators/bochs/gui/bitmaps/configbutton.xpm
Normal file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *configbutton_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
"................................",
|
||||
"..#....................##.......",
|
||||
"..#############.......####......",
|
||||
"..###############.....####......",
|
||||
"..###############.....####......",
|
||||
"..#############.......####......",
|
||||
"..#....####...........####......",
|
||||
".......####...........####......",
|
||||
".......####...........####......",
|
||||
".......####...........####......",
|
||||
".......####...........####......",
|
||||
".......####...........####......",
|
||||
".......####...........####......",
|
||||
".......####...........####......",
|
||||
".......####...........####......",
|
||||
".......####...........####......",
|
||||
".......####...........####......",
|
||||
".......####...........####......",
|
||||
".......####...........####......",
|
||||
".......####..........######.....",
|
||||
".......####.........########....",
|
||||
".......####.........###..###....",
|
||||
".......####.........##....##....",
|
||||
".......####.........##....##....",
|
||||
".......####..........#....#.....",
|
||||
"................................",
|
||||
"...###..###..#...#.###.#..###...",
|
||||
"..#....#...#.##..#.#...#.#......",
|
||||
"..#....#...#.#.#.#.###.#.#..##..",
|
||||
"..#....#...#.#..##.#...#.#...#..",
|
||||
"...###..###..#...#.#...#..###...",
|
||||
"................................"
|
||||
};
|
||||
19
simulators/bochs/gui/bitmaps/copy.h
Normal file
19
simulators/bochs/gui/bitmaps/copy.h
Normal file
@ -0,0 +1,19 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_COPY_BMAP_X 32
|
||||
#define BX_COPY_BMAP_Y 32
|
||||
|
||||
static unsigned char bx_copy_bmap[(BX_COPY_BMAP_X*BX_COPY_BMAP_Y)] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
|
||||
0x80, 0x60, 0x4e, 0x02, 0x80, 0x90, 0x52, 0x02, 0x80, 0x90, 0x52, 0x02,
|
||||
0x00, 0x6f, 0x8e, 0x03, 0x00, 0x00, 0x02, 0x02, 0xf8, 0x3f, 0x02, 0x02,
|
||||
0x08, 0x20, 0xc0, 0x01, 0xe8, 0x2b, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00,
|
||||
0xe8, 0x2e, 0x00, 0x00, 0x08, 0x20, 0x00, 0x00, 0xe8, 0x39, 0x00, 0x00,
|
||||
0x08, 0x24, 0x00, 0x00, 0x88, 0x20, 0x00, 0x00, 0xe8, 0xaf, 0xff, 0x03,
|
||||
0x08, 0xa0, 0x00, 0x02, 0xf8, 0xbf, 0xbe, 0x02, 0x00, 0x80, 0x00, 0x02,
|
||||
0x80, 0x88, 0xee, 0x02, 0x80, 0x90, 0x00, 0x02, 0x00, 0xbf, 0x9e, 0x03,
|
||||
0x00, 0x90, 0x40, 0x02, 0x00, 0x88, 0x08, 0x02, 0x00, 0x80, 0xfe, 0x02,
|
||||
0x00, 0x80, 0x00, 0x02, 0x00, 0x80, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
|
||||
41
simulators/bochs/gui/bitmaps/copy.xpm
Normal file
41
simulators/bochs/gui/bitmaps/copy.xpm
Normal file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *copy_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
"................................",
|
||||
"........####....................",
|
||||
".......#........................",
|
||||
".......#.....##..###..#..#......",
|
||||
".......#....#..#.#..#.#..#......",
|
||||
".......#....#..#.#..#.#..#......",
|
||||
"........####.##..###...###......",
|
||||
".................#.......#......",
|
||||
"...###########...#.......#......",
|
||||
"...#.........#........###.......",
|
||||
"...#.#####.#.#..................",
|
||||
"...#.........#..................",
|
||||
"...#.###.###.#..................",
|
||||
"...#.........#..................",
|
||||
"...#.####..###..................",
|
||||
"...#......#..#..................",
|
||||
"...#...#.....#..................",
|
||||
"...#.#######.#.###########......",
|
||||
"...#.........#.#.........#......",
|
||||
"...###########.#.#####.#.#......",
|
||||
"...............#.........#......",
|
||||
".......#...#...#.###.###.#......",
|
||||
".......#....#..#.........#......",
|
||||
"........######.#.####..###......",
|
||||
"............#..#......#..#......",
|
||||
"...........#...#...#.....#......",
|
||||
"...............#.#######.#......",
|
||||
"...............#.........#......",
|
||||
"...............###########......",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................"
|
||||
};
|
||||
34
simulators/bochs/gui/bitmaps/floppya.h
Normal file
34
simulators/bochs/gui/bitmaps/floppya.h
Normal file
@ -0,0 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_FLOPPYA_BMAP_X 32
|
||||
#define BX_FLOPPYA_BMAP_Y 32
|
||||
|
||||
static const unsigned char bx_floppya_bmap[(BX_FLOPPYA_BMAP_X * BX_FLOPPYA_BMAP_Y)/8] = {
|
||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x40, 0x11, 0x00,
|
||||
0x00, 0xc0, 0x01, 0x00, 0x00, 0x60, 0x13, 0x00, 0x00, 0x60, 0x03, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0x01, 0x80, 0x07,
|
||||
0x20, 0xfd, 0xbf, 0x04, 0x20, 0x01, 0x80, 0x04, 0xe0, 0xfd, 0xbf, 0x07,
|
||||
0xe0, 0x01, 0x80, 0x07, 0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x01, 0x80, 0x07,
|
||||
0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x01, 0x80, 0x07, 0xe0, 0xfd, 0xbf, 0x07,
|
||||
0xe0, 0x01, 0x80, 0x07, 0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x01, 0x80, 0x07,
|
||||
0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07,
|
||||
0xe0, 0xff, 0xff, 0x07, 0xe0, 0xaf, 0xea, 0x07, 0xe0, 0xf7, 0xd5, 0x07,
|
||||
0xe0, 0xef, 0xea, 0x07, 0xe0, 0xf7, 0xd5, 0x07, 0xc0, 0xef, 0xea, 0x07,
|
||||
0x80, 0x57, 0xd5, 0x07, 0x00, 0xaf, 0xea, 0x07
|
||||
};
|
||||
|
||||
static const unsigned char bx_floppya_eject_bmap[(BX_FLOPPYA_BMAP_X * BX_FLOPPYA_BMAP_Y)/8] = {
|
||||
0x01, 0x80, 0x00, 0x80, 0x02, 0x40, 0x01, 0x40, 0x04, 0x40, 0x11, 0x20,
|
||||
0x08, 0xc0, 0x01, 0x10, 0x10, 0x60, 0x13, 0x08, 0x20, 0x60, 0x03, 0x04,
|
||||
0x40, 0x00, 0x00, 0x02, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0x01, 0x80, 0x07,
|
||||
0x20, 0xff, 0xff, 0x04, 0x20, 0x05, 0xa0, 0x04, 0xe0, 0xfd, 0xbf, 0x07,
|
||||
0xe0, 0x11, 0x88, 0x07, 0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x41, 0x82, 0x07,
|
||||
0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x81, 0x81, 0x07, 0xe0, 0xfd, 0xbf, 0x07,
|
||||
0xe0, 0x21, 0x84, 0x07, 0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x09, 0x90, 0x07,
|
||||
0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07,
|
||||
0xe0, 0xff, 0xff, 0x07, 0xe0, 0xaf, 0xea, 0x07, 0xe0, 0xf7, 0xd5, 0x07,
|
||||
0xf0, 0xef, 0xea, 0x0f, 0xe8, 0xf7, 0xd5, 0x17, 0xc4, 0xef, 0xea, 0x27,
|
||||
0x82, 0x57, 0xd5, 0x47, 0x01, 0xaf, 0xea, 0x87
|
||||
};
|
||||
41
simulators/bochs/gui/bitmaps/floppya.xpm
Normal file
41
simulators/bochs/gui/bitmaps/floppya.xpm
Normal file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *floppya_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
"...............#................",
|
||||
"..............#.#...............",
|
||||
"..............#.#...#...........",
|
||||
"..............###...............",
|
||||
".............##.##..#...........",
|
||||
".............##.##..............",
|
||||
"................................",
|
||||
".....######################.....",
|
||||
".....####..............####.....",
|
||||
".....#..#.############.#..#.....",
|
||||
".....#..#..............#..#.....",
|
||||
".....####.############.####.....",
|
||||
".....####..............####.....",
|
||||
".....####.############.####.....",
|
||||
".....####..............####.....",
|
||||
".....####.############.####.....",
|
||||
".....####..............####.....",
|
||||
".....####.############.####.....",
|
||||
".....####..............####.....",
|
||||
".....####.############.####.....",
|
||||
".....####..............####.....",
|
||||
".....######################.....",
|
||||
".....######################.....",
|
||||
".....######################.....",
|
||||
".....######################.....",
|
||||
".....#######.#.#.#.#.######.....",
|
||||
".....######.#####.#.#.#####.....",
|
||||
".....#######.###.#.#.######.....",
|
||||
".....######.#####.#.#.#####.....",
|
||||
"......######.###.#.#.######.....",
|
||||
".......####.#.#.#.#.#.#####.....",
|
||||
"........####.#.#.#.#.######....."
|
||||
};
|
||||
34
simulators/bochs/gui/bitmaps/floppyb.h
Normal file
34
simulators/bochs/gui/bitmaps/floppyb.h
Normal file
@ -0,0 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_FLOPPYB_BMAP_X 32
|
||||
#define BX_FLOPPYB_BMAP_Y 32
|
||||
|
||||
static const unsigned char bx_floppyb_bmap[(BX_FLOPPYB_BMAP_X * BX_FLOPPYB_BMAP_Y)/8] = {
|
||||
0x00, 0xe0, 0x00, 0x00, 0x00, 0x20, 0x01, 0x00, 0x00, 0xe0, 0x08, 0x00,
|
||||
0x00, 0x20, 0x01, 0x00, 0x00, 0x20, 0x09, 0x00, 0x00, 0xe0, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0x01, 0x80, 0x07,
|
||||
0x20, 0xfd, 0xbf, 0x04, 0x20, 0x01, 0x80, 0x04, 0xe0, 0xfd, 0xbf, 0x07,
|
||||
0xe0, 0x01, 0x80, 0x07, 0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x01, 0x80, 0x07,
|
||||
0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x01, 0x80, 0x07, 0xe0, 0xfd, 0xbf, 0x07,
|
||||
0xe0, 0x01, 0x80, 0x07, 0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x01, 0x80, 0x07,
|
||||
0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07,
|
||||
0xe0, 0xff, 0xff, 0x07, 0xe0, 0xaf, 0xea, 0x07, 0xe0, 0xf7, 0xd5, 0x07,
|
||||
0xe0, 0xef, 0xea, 0x07, 0xe0, 0xf7, 0xd5, 0x07, 0xc0, 0xef, 0xea, 0x07,
|
||||
0x80, 0x57, 0xd5, 0x07, 0x00, 0xaf, 0xea, 0x07
|
||||
};
|
||||
|
||||
static const unsigned char bx_floppyb_eject_bmap[(BX_FLOPPYB_BMAP_X * BX_FLOPPYB_BMAP_Y)/8] = {
|
||||
0x01, 0xe0, 0x00, 0x80, 0x02, 0x20, 0x01, 0x40, 0x04, 0xe0, 0x08, 0x20,
|
||||
0x08, 0x20, 0x01, 0x10, 0x10, 0x20, 0x09, 0x08, 0x20, 0xe0, 0x00, 0x04,
|
||||
0x40, 0x00, 0x00, 0x02, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0x01, 0x80, 0x07,
|
||||
0x20, 0xff, 0xff, 0x04, 0x20, 0x05, 0xa0, 0x04, 0xe0, 0xfd, 0xbf, 0x07,
|
||||
0xe0, 0x11, 0x88, 0x07, 0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x41, 0x82, 0x07,
|
||||
0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x81, 0x81, 0x07, 0xe0, 0xfd, 0xbf, 0x07,
|
||||
0xe0, 0x21, 0x84, 0x07, 0xe0, 0xfd, 0xbf, 0x07, 0xe0, 0x09, 0x90, 0x07,
|
||||
0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07, 0xe0, 0xff, 0xff, 0x07,
|
||||
0xe0, 0xff, 0xff, 0x07, 0xe0, 0xaf, 0xea, 0x07, 0xe0, 0xf7, 0xd5, 0x07,
|
||||
0xf0, 0xef, 0xea, 0x0f, 0xe8, 0xf7, 0xd5, 0x17, 0xc4, 0xef, 0xea, 0x27,
|
||||
0x82, 0x57, 0xd5, 0x47, 0x01, 0xaf, 0xea, 0x87
|
||||
};
|
||||
41
simulators/bochs/gui/bitmaps/floppyb.xpm
Normal file
41
simulators/bochs/gui/bitmaps/floppyb.xpm
Normal file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *floppyb_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
".............###................",
|
||||
".............#..#...............",
|
||||
".............###...#............",
|
||||
".............#..#...............",
|
||||
".............#..#..#............",
|
||||
".............###................",
|
||||
"................................",
|
||||
".....######################.....",
|
||||
".....####..............####.....",
|
||||
".....#..#.############.#..#.....",
|
||||
".....#..#..............#..#.....",
|
||||
".....####.############.####.....",
|
||||
".....####..............####.....",
|
||||
".....####.############.####.....",
|
||||
".....####..............####.....",
|
||||
".....####.############.####.....",
|
||||
".....####..............####.....",
|
||||
".....####.############.####.....",
|
||||
".....####..............####.....",
|
||||
".....####.############.####.....",
|
||||
".....####..............####.....",
|
||||
".....######################.....",
|
||||
".....######################.....",
|
||||
".....######################.....",
|
||||
".....######################.....",
|
||||
".....#######.#.#.#.#.######.....",
|
||||
".....######.#####.#.#.#####.....",
|
||||
".....#######.###.#.#.######.....",
|
||||
".....######.#####.#.#.#####.....",
|
||||
"......######.###.#.#.######.....",
|
||||
".......####.#.#.#.#.#.#####.....",
|
||||
"........####.#.#.#.#.######....."
|
||||
};
|
||||
34
simulators/bochs/gui/bitmaps/mouse.h
Normal file
34
simulators/bochs/gui/bitmaps/mouse.h
Normal file
@ -0,0 +1,34 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_MOUSE_BMAP_X 32
|
||||
#define BX_MOUSE_BMAP_Y 32
|
||||
|
||||
static unsigned char bx_mouse_bmap[(BX_MOUSE_BMAP_X * BX_MOUSE_BMAP_Y)/8] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xf8, 0x1f, 0x00,
|
||||
0x00, 0x0c, 0x30, 0x00, 0x00, 0x06, 0x60, 0x00, 0x00, 0x06, 0x40, 0x00,
|
||||
0xf8, 0xff, 0xc0, 0x00, 0x0c, 0x80, 0xc1, 0x00, 0x24, 0x22, 0xc1, 0x00,
|
||||
0x74, 0x77, 0x81, 0x00, 0x74, 0x77, 0x81, 0x01, 0x74, 0x77, 0x81, 0x01,
|
||||
0x74, 0x77, 0x01, 0x01, 0x74, 0x77, 0x01, 0x03, 0x74, 0x77, 0x01, 0x06,
|
||||
0x24, 0x22, 0x01, 0x0c, 0x0c, 0x80, 0x01, 0x38, 0x04, 0x00, 0x01, 0x00,
|
||||
0x0c, 0x80, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00, 0x0c, 0x80, 0x01, 0x00,
|
||||
0x04, 0x00, 0x01, 0x00, 0x0c, 0x80, 0x01, 0x00, 0x04, 0x00, 0x01, 0x00,
|
||||
0x0c, 0x80, 0x01, 0x00, 0x14, 0x40, 0x01, 0x00, 0x2c, 0xa0, 0x01, 0x00,
|
||||
0x54, 0x55, 0x01, 0x00, 0xac, 0xaa, 0x01, 0x00, 0xf8, 0xff, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
|
||||
static unsigned char bx_nomouse_bmap[(BX_MOUSE_BMAP_X * BX_MOUSE_BMAP_Y)/8] = {
|
||||
0x01, 0x00, 0x00, 0x80, 0x02, 0xe0, 0x07, 0x40, 0x04, 0xf8, 0x1f, 0x20,
|
||||
0x08, 0x0c, 0x30, 0x10, 0x10, 0x06, 0x60, 0x08, 0x20, 0x06, 0x40, 0x04,
|
||||
0xf8, 0xff, 0xc0, 0x02, 0x8c, 0x80, 0xc1, 0x01, 0x24, 0x23, 0xc1, 0x00,
|
||||
0x74, 0x77, 0xc1, 0x00, 0x74, 0x77, 0xa1, 0x01, 0x74, 0x7f, 0x91, 0x01,
|
||||
0x74, 0x77, 0x09, 0x01, 0x74, 0x77, 0x05, 0x03, 0x74, 0x77, 0x03, 0x06,
|
||||
0x24, 0xa2, 0x01, 0x0c, 0x0c, 0x80, 0x01, 0x38, 0x04, 0x40, 0x03, 0x00,
|
||||
0x0c, 0xa0, 0x05, 0x00, 0x04, 0x10, 0x09, 0x00, 0x0c, 0x88, 0x11, 0x00,
|
||||
0x04, 0x04, 0x21, 0x00, 0x0c, 0x82, 0x41, 0x00, 0x04, 0x01, 0x81, 0x00,
|
||||
0x8c, 0x80, 0x01, 0x01, 0x54, 0x40, 0x01, 0x02, 0x2c, 0xa0, 0x01, 0x04,
|
||||
0x54, 0x55, 0x01, 0x08, 0xac, 0xaa, 0x01, 0x10, 0xfc, 0xff, 0x00, 0x20,
|
||||
0x02, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x80
|
||||
};
|
||||
41
simulators/bochs/gui/bitmaps/mouse.xpm
Normal file
41
simulators/bochs/gui/bitmaps/mouse.xpm
Normal file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *mouse_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
"................................",
|
||||
".............######.............",
|
||||
"...........##########...........",
|
||||
"..........##........##..........",
|
||||
".........##..........##.........",
|
||||
".........##...........#.........",
|
||||
"...#############......##........",
|
||||
"..##...........##.....##........",
|
||||
"..#..#...#...#..#.....##........",
|
||||
"..#.###.###.###.#......#........",
|
||||
"..#.###.###.###.#......##.......",
|
||||
"..#.###.###.###.#......##.......",
|
||||
"..#.###.###.###.#.......#.......",
|
||||
"..#.###.###.###.#.......##......",
|
||||
"..#.###.###.###.#........##.....",
|
||||
"..#..#...#...#..#.........##....",
|
||||
"..##...........##..........###..",
|
||||
"..#.............#...............",
|
||||
"..##...........##...............",
|
||||
"..#.............#...............",
|
||||
"..##...........##...............",
|
||||
"..#.............#...............",
|
||||
"..##...........##...............",
|
||||
"..#.............#...............",
|
||||
"..##...........##...............",
|
||||
"..#.#.........#.#...............",
|
||||
"..##.#.......#.##...............",
|
||||
"..#.#.#.#.#.#.#.#...............",
|
||||
"..##.#.#.#.#.#.##...............",
|
||||
"...#############................",
|
||||
"................................",
|
||||
"................................"
|
||||
};
|
||||
19
simulators/bochs/gui/bitmaps/paste.h
Normal file
19
simulators/bochs/gui/bitmaps/paste.h
Normal file
@ -0,0 +1,19 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_PASTE_BMAP_X 32
|
||||
#define BX_PASTE_BMAP_Y 32
|
||||
|
||||
static unsigned char bx_paste_bmap[(BX_PASTE_BMAP_X*BX_PASTE_BMAP_Y)] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0xe0, 0x01, 0x10, 0x00, 0x20, 0x9a, 0x93, 0x03,
|
||||
0x20, 0x66, 0x78, 0x04, 0xe0, 0xa5, 0xd3, 0x07, 0x20, 0x24, 0x54, 0x00,
|
||||
0x20, 0xd8, 0x93, 0x03, 0x00, 0x80, 0x01, 0x00, 0x00, 0xc0, 0x02, 0x00,
|
||||
0x00, 0x7c, 0x3f, 0x00, 0xc0, 0x83, 0xc1, 0x03, 0x20, 0x02, 0x40, 0x04,
|
||||
0x20, 0x01, 0x80, 0x04, 0x20, 0x01, 0x80, 0x04, 0xa0, 0xff, 0xff, 0x05,
|
||||
0x20, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x04, 0x20, 0xf8, 0x3f, 0x04,
|
||||
0x20, 0x08, 0x20, 0x04, 0x20, 0xe8, 0x2b, 0x04, 0x20, 0x08, 0x20, 0x04,
|
||||
0x20, 0xe8, 0x2e, 0x04, 0x20, 0x08, 0x20, 0x04, 0x20, 0xe8, 0x39, 0x04,
|
||||
0x20, 0x08, 0x24, 0x04, 0x20, 0x88, 0x20, 0x04, 0x20, 0xe8, 0x2f, 0x04,
|
||||
0x20, 0x08, 0x20, 0x04, 0x20, 0xf8, 0x3f, 0x04, 0x20, 0x00, 0x00, 0x04,
|
||||
0xc0, 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, };
|
||||
41
simulators/bochs/gui/bitmaps/paste.xpm
Normal file
41
simulators/bochs/gui/bitmaps/paste.xpm
Normal file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *paste_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
"................................",
|
||||
".....####...........#...........",
|
||||
".....#...#.##..###..#..###......",
|
||||
".....#...##..##....####...#.....",
|
||||
".....####.#..#.###..#.#####.....",
|
||||
".....#....#..#....#.#.#.........",
|
||||
".....#.....##.####..#..###......",
|
||||
"...............##...............",
|
||||
"..............##.#..............",
|
||||
"..........#####.######..........",
|
||||
"......####.....##.....####......",
|
||||
".....#...#............#...#.....",
|
||||
".....#..#..............#..#.....",
|
||||
".....#..#..............#..#.....",
|
||||
".....#.##################.#.....",
|
||||
".....#....................#.....",
|
||||
".....#....................#.....",
|
||||
".....#.....###########....#.....",
|
||||
".....#.....#.........#....#.....",
|
||||
".....#.....#.#####.#.#....#.....",
|
||||
".....#.....#.........#....#.....",
|
||||
".....#.....#.###.###.#....#.....",
|
||||
".....#.....#.........#....#.....",
|
||||
".....#.....#.####..###....#.....",
|
||||
".....#.....#......#..#....#.....",
|
||||
".....#.....#...#.....#....#.....",
|
||||
".....#.....#.#######.#....#.....",
|
||||
".....#.....#.........#....#.....",
|
||||
".....#.....###########....#.....",
|
||||
".....#....................#.....",
|
||||
"......####################......",
|
||||
"................................"
|
||||
};
|
||||
20
simulators/bochs/gui/bitmaps/power.h
Normal file
20
simulators/bochs/gui/bitmaps/power.h
Normal file
@ -0,0 +1,20 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_POWER_BMAP_X 32
|
||||
#define BX_POWER_BMAP_Y 32
|
||||
|
||||
static const unsigned char bx_power_bmap[(BX_POWER_BMAP_X * BX_POWER_BMAP_Y)/8] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00,
|
||||
0x24, 0x67, 0x66, 0x34, 0xa4, 0x28, 0x92, 0x48, 0x9a, 0xa8, 0xfa, 0x04,
|
||||
0x82, 0x64, 0x09, 0x04, 0x07, 0xa3, 0x70, 0x0e, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xf8, 0x03, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0x0f, 0x1e, 0x00,
|
||||
0x80, 0x03, 0x38, 0x00, 0xc0, 0x00, 0x60, 0x00, 0xe0, 0xe0, 0xe0, 0x00,
|
||||
0x60, 0xe0, 0xc0, 0x00, 0x70, 0xe0, 0xc0, 0x01, 0x30, 0xe0, 0x80, 0x01,
|
||||
0x30, 0xe0, 0x80, 0x01, 0x30, 0xe0, 0x80, 0x01, 0x30, 0xe0, 0x80, 0x01,
|
||||
0x30, 0xe0, 0x80, 0x01, 0x70, 0xe0, 0xc0, 0x01, 0x60, 0xe0, 0xc0, 0x00,
|
||||
0xe0, 0xe0, 0xe0, 0x00, 0xc0, 0x00, 0x60, 0x00, 0x80, 0x03, 0x38, 0x00,
|
||||
0x00, 0x0f, 0x1e, 0x00, 0x00, 0xfe, 0x0f, 0x00, 0x00, 0xf8, 0x03, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
41
simulators/bochs/gui/bitmaps/power.xpm
Normal file
41
simulators/bochs/gui/bitmaps/power.xpm
Normal file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *power_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
"................................",
|
||||
"................................",
|
||||
".####...........................",
|
||||
"..#..#..###..##..##..##...#.##..",
|
||||
"..#..#.#...#.#...#..#..#...#..#.",
|
||||
".#.##..#...#.#.#.#.#####..#.....",
|
||||
".#.....#..#..##.#..#......#.....",
|
||||
"###.....##...#.#....###..###....",
|
||||
"................................",
|
||||
"...........#######..............",
|
||||
".........###########............",
|
||||
"........####.....####...........",
|
||||
".......###.........###..........",
|
||||
"......##.............##.........",
|
||||
".....###.....###.....###........",
|
||||
".....##......###......##........",
|
||||
"....###......###......###.......",
|
||||
"....##.......###.......##.......",
|
||||
"....##.......###.......##.......",
|
||||
"....##.......###.......##.......",
|
||||
"....##.......###.......##.......",
|
||||
"....##.......###.......##.......",
|
||||
"....###......###......###.......",
|
||||
".....##......###......##........",
|
||||
".....###.....###.....###........",
|
||||
"......##.............##.........",
|
||||
".......###.........###..........",
|
||||
"........####.....####...........",
|
||||
".........###########............",
|
||||
"...........#######..............",
|
||||
"................................",
|
||||
"................................"
|
||||
};
|
||||
20
simulators/bochs/gui/bitmaps/reset.h
Normal file
20
simulators/bochs/gui/bitmaps/reset.h
Normal file
@ -0,0 +1,20 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_RESET_BMAP_X 32
|
||||
#define BX_RESET_BMAP_Y 32
|
||||
|
||||
static const unsigned char bx_reset_bmap[(BX_RESET_BMAP_X * BX_RESET_BMAP_Y)/8] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3c, 0x00, 0x00, 0x10,
|
||||
0x48, 0x0c, 0xc7, 0x7c, 0x48, 0x92, 0x20, 0x11, 0x34, 0x1f, 0xf3, 0x09,
|
||||
0x24, 0x41, 0x12, 0x48, 0x6e, 0xce, 0xe1, 0x30, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00,
|
||||
0x00, 0xe0, 0x0f, 0x00, 0x00, 0xf0, 0x1f, 0x00, 0x00, 0xe0, 0x3f, 0x00,
|
||||
0x00, 0xc7, 0x38, 0x00, 0x00, 0x87, 0x38, 0x00, 0x00, 0x07, 0x38, 0x00,
|
||||
0x00, 0x07, 0x38, 0x00, 0x00, 0x07, 0x38, 0x00, 0x00, 0x07, 0x38, 0x00,
|
||||
0x00, 0x07, 0x38, 0x00, 0x00, 0xff, 0x3f, 0x00, 0x00, 0xfe, 0x1f, 0x00,
|
||||
0x00, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
41
simulators/bochs/gui/bitmaps/reset.xpm
Normal file
41
simulators/bochs/gui/bitmaps/reset.xpm
Normal file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *reset_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
"................................",
|
||||
".............................#..",
|
||||
"..####......................#...",
|
||||
"...#..#...##....###...##..#####.",
|
||||
"...#..#..#..#..#.....#..#...#...",
|
||||
"..#.##..#####...##..#####..#....",
|
||||
"..#..#..#.....#..#..#......#..#.",
|
||||
".###.##..###..###....###....##..",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"...............#................",
|
||||
"..............##................",
|
||||
".............#######............",
|
||||
"............#########...........",
|
||||
".............#########..........",
|
||||
"........###...##...###..........",
|
||||
"........###....#...###..........",
|
||||
"........###........###..........",
|
||||
"........###........###..........",
|
||||
"........###........###..........",
|
||||
"........###........###..........",
|
||||
"........###........###..........",
|
||||
"........##############..........",
|
||||
".........############...........",
|
||||
"..........##########............",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................"
|
||||
};
|
||||
26
simulators/bochs/gui/bitmaps/saverestore.h
Executable file
26
simulators/bochs/gui/bitmaps/saverestore.h
Executable file
@ -0,0 +1,26 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_SAVE_RESTORE_BMAP_X 32
|
||||
#define BX_SAVE_RESTORE_BMAP_Y 32
|
||||
|
||||
static const unsigned char bx_save_restore_bmap[(BX_SAVE_RESTORE_BMAP_X * BX_SAVE_RESTORE_BMAP_Y)/8] =
|
||||
{
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x2e, 0xdd, 0x9d, 0x3b,
|
||||
0x22, 0x45, 0x45, 0x4a, 0x2c, 0xd9, 0x5d, 0x4a,
|
||||
0x28, 0x51, 0x44, 0x4a, 0xee, 0x5d, 0x5c, 0x3a,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0xe0, 0x01, 0x00, 0x00, 0xe0, 0x01, 0x00,
|
||||
0x00, 0xe0, 0x01, 0x00, 0x00, 0xe0, 0x01, 0x00,
|
||||
0x00, 0xec, 0x0d, 0x00, 0x00, 0xee, 0x1d, 0x00,
|
||||
0x00, 0xef, 0x3d, 0x00, 0x00, 0xe7, 0x39, 0x00,
|
||||
0x00, 0xe7, 0x39, 0x00, 0x00, 0x07, 0x38, 0x00,
|
||||
0x00, 0x07, 0x38, 0x00, 0x00, 0x07, 0x38, 0x00,
|
||||
0x00, 0x07, 0x38, 0x00, 0x00, 0x07, 0x38, 0x00,
|
||||
0x00, 0xff, 0x3f, 0x00, 0x00, 0xfe, 0x1f, 0x00,
|
||||
0x00, 0xfc, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
41
simulators/bochs/gui/bitmaps/saverestore.xpm
Executable file
41
simulators/bochs/gui/bitmaps/saverestore.xpm
Executable file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *saverestore_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
".###.#..#.###.###.###..###.###..",
|
||||
".#...#..#.#...#.#.#...#..#.#..#.",
|
||||
"..##.#..#..##.###.###.#..#.#..#.",
|
||||
"...#.#..#...#.#...#...#..#.#..#.",
|
||||
".###.####.###.#...###.#..#.###..",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
".............####...............",
|
||||
".............####...............",
|
||||
".............####...............",
|
||||
".............####...............",
|
||||
"..........##.####.##............",
|
||||
".........###.####.###...........",
|
||||
"........####.####.####..........",
|
||||
"........###..####..###..........",
|
||||
"........###..####..###..........",
|
||||
"........###........###..........",
|
||||
"........###........###..........",
|
||||
"........###........###..........",
|
||||
"........###........###..........",
|
||||
"........###........###..........",
|
||||
"........##############..........",
|
||||
".........############...........",
|
||||
"..........##########............",
|
||||
"................................",
|
||||
"................................",
|
||||
"................................",
|
||||
};
|
||||
20
simulators/bochs/gui/bitmaps/snapshot.h
Normal file
20
simulators/bochs/gui/bitmaps/snapshot.h
Normal file
@ -0,0 +1,20 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_SNAPSHOT_BMAP_X 32
|
||||
#define BX_SNAPSHOT_BMAP_Y 32
|
||||
|
||||
static const unsigned char bx_snapshot_bmap[(BX_SNAPSHOT_BMAP_X * BX_SNAPSHOT_BMAP_Y)/8] = {
|
||||
0x00, 0x00, 0x20, 0x40, 0x77, 0xe6, 0xee, 0xec, 0x91, 0xa8, 0xa2, 0x52,
|
||||
0x96, 0xac, 0xac, 0x52, 0x94, 0xaa, 0xa8, 0x52, 0xb7, 0xee, 0xae, 0xcc,
|
||||
0x00, 0x20, 0x00, 0x00, 0x00, 0xf0, 0x0f, 0x00, 0x00, 0x08, 0x10, 0x00,
|
||||
0x7c, 0x0f, 0x10, 0x1f, 0xfa, 0x07, 0xa0, 0x2e, 0x42, 0x07, 0xa0, 0x50,
|
||||
0xa3, 0x03, 0xc0, 0xe0, 0xff, 0xee, 0x77, 0xbf, 0x01, 0xf9, 0x9f, 0x40,
|
||||
0x01, 0x1d, 0xb8, 0xa0, 0xff, 0xe5, 0xa7, 0xff, 0xff, 0xba, 0x5a, 0xff,
|
||||
0xff, 0x55, 0xb5, 0xff, 0xff, 0x8d, 0xaa, 0xff, 0xff, 0x16, 0x55, 0xff,
|
||||
0xff, 0xa2, 0x6a, 0xff, 0xff, 0x46, 0x55, 0xff, 0xff, 0xaa, 0x6a, 0xff,
|
||||
0xff, 0x56, 0x55, 0xff, 0xfe, 0xae, 0x6a, 0x7f, 0x00, 0x55, 0xb5, 0x00,
|
||||
0x00, 0xbd, 0xba, 0x00, 0x00, 0xfa, 0x5f, 0x00, 0x00, 0xe4, 0x27, 0x00,
|
||||
0x00, 0x18, 0x18, 0x00, 0x00, 0xe0, 0x07, 0x00
|
||||
};
|
||||
41
simulators/bochs/gui/bitmaps/snapshot.xpm
Normal file
41
simulators/bochs/gui/bitmaps/snapshot.xpm
Normal file
@ -0,0 +1,41 @@
|
||||
/* XPM */
|
||||
static const char *snapshot_xpm[] = {
|
||||
/* width height num_colors chars_per_pixel */
|
||||
" 32 32 2 1",
|
||||
/* colors */
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
".....................#........#.",
|
||||
"###.###..##..###.###.###..##.###",
|
||||
"#...#..#...#.#.#.#...#.#.#..#.#.",
|
||||
".##.#..#..##.#.#..##.#.#.#..#.#.",
|
||||
"..#.#..#.#.#.#.#...#.#.#.#..#.#.",
|
||||
"###.##.#.###.###.###.#.#..##..##",
|
||||
".............#..................",
|
||||
"............########............",
|
||||
"...........#........#...........",
|
||||
"..#####.####........#...#####...",
|
||||
".#.########..........#.#.###.#..",
|
||||
".#....#.###..........#.#....#.#.",
|
||||
"##...#.###............##.....###",
|
||||
"########.###.######.###.######.#",
|
||||
"#.......#..##########..#......#.",
|
||||
"#.......#.###......###.#.....#.#",
|
||||
"#########.#..######..#.#########",
|
||||
"########.#.###.#.#.##.#.########",
|
||||
"#########.#.#.#.#.#.##.#########",
|
||||
"#########.##...#.#.#.#.#########",
|
||||
"########.##.#...#.#.#.#.########",
|
||||
"########.#...#.#.#.#.##.########",
|
||||
"########.##...#.#.#.#.#.########",
|
||||
"########.#.#.#.#.#.#.##.########",
|
||||
"########.##.#.#.#.#.#.#.########",
|
||||
".#######.###.#.#.#.#.##.#######.",
|
||||
"........#.#.#.#.#.#.##.#........",
|
||||
"........#.####.#.#.###.#........",
|
||||
".........#.##########.#.........",
|
||||
"..........#..######..#..........",
|
||||
"...........##......##...........",
|
||||
".............######............."
|
||||
};
|
||||
20
simulators/bochs/gui/bitmaps/userbutton.h
Normal file
20
simulators/bochs/gui/bitmaps/userbutton.h
Normal file
@ -0,0 +1,20 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define BX_USER_BMAP_X 32
|
||||
#define BX_USER_BMAP_Y 32
|
||||
|
||||
static const unsigned char bx_user_bmap[BX_USER_BMAP_X*BX_USER_BMAP_Y/8] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x84, 0x78, 0x9e, 0x07, 0x84, 0x04, 0x82, 0x08,
|
||||
0x84, 0x04, 0x82, 0x08, 0x84, 0x38, 0x9e, 0x07, 0x84, 0x40, 0x82, 0x01,
|
||||
0x84, 0x40, 0x82, 0x06, 0x78, 0x3c, 0x9e, 0x08, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x1c,
|
||||
0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00,
|
||||
0x00, 0x00, 0x80, 0x00, 0xfe, 0xff, 0xff, 0x3f, 0x02, 0x00, 0x00, 0x20,
|
||||
0xaa, 0xaa, 0x2a, 0x2a, 0x02, 0x00, 0x00, 0x20, 0x02, 0x00, 0x00, 0x20,
|
||||
0xaa, 0xaa, 0xaa, 0x2a, 0x52, 0x55, 0x11, 0x25, 0xaa, 0xaa, 0xaa, 0x2a,
|
||||
0x52, 0x55, 0x01, 0x25, 0xaa, 0xaa, 0x82, 0x2a, 0x52, 0x55, 0x11, 0x25,
|
||||
0xaa, 0xbf, 0xaa, 0x2a, 0x02, 0x00, 0x00, 0x20, 0xfe, 0xff, 0xff, 0x3f,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
};
|
||||
40
simulators/bochs/gui/bitmaps/userbutton.xpm
Normal file
40
simulators/bochs/gui/bitmaps/userbutton.xpm
Normal file
@ -0,0 +1,40 @@
|
||||
/* XPM */
|
||||
static const char *userbutton_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 2 1",
|
||||
". c None",
|
||||
"# c #000000",
|
||||
/* pixels */
|
||||
"................................",
|
||||
"..#....#...####..####..####.....",
|
||||
"..#....#..#......#.....#...#....",
|
||||
"..#....#..#......#.....#...#....",
|
||||
"..#....#...###...####..####.....",
|
||||
"..#....#......#..#.....##.......",
|
||||
"..#....#......#..#.....#.##.....",
|
||||
"...####...####...####..#...#....",
|
||||
"................................",
|
||||
"................................",
|
||||
".............................#..",
|
||||
"..........................###...",
|
||||
".........................#......",
|
||||
"........................#.......",
|
||||
".......................#........",
|
||||
".......................#........",
|
||||
".#############################..",
|
||||
".#...........................#..",
|
||||
".#.#.#.#.#.#.#.#.#.#.#...#.#.#..",
|
||||
".#...........................#..",
|
||||
".#...........................#..",
|
||||
".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#..",
|
||||
".#..#.#.#.#.#.#.#...#...#.#..#..",
|
||||
".#.#.#.#.#.#.#.#.#.#.#.#.#.#.#..",
|
||||
".#..#.#.#.#.#.#.#.......#.#..#..",
|
||||
".#.#.#.#.#.#.#.#.#.....#.#.#.#..",
|
||||
".#..#.#.#.#.#.#.#...#...#.#..#..",
|
||||
".#.#.#.#######.#.#.#.#.#.#.#.#..",
|
||||
".#...........................#..",
|
||||
".#############################..",
|
||||
"................................",
|
||||
"................................"
|
||||
};
|
||||
2200
simulators/bochs/gui/carbon.cc
Normal file
2200
simulators/bochs/gui/carbon.cc
Normal file
File diff suppressed because it is too large
Load Diff
3381
simulators/bochs/gui/enh_dbg.cc
Executable file
3381
simulators/bochs/gui/enh_dbg.cc
Executable file
File diff suppressed because it is too large
Load Diff
420
simulators/bochs/gui/enh_dbg.h
Executable file
420
simulators/bochs/gui/enh_dbg.h
Executable file
@ -0,0 +1,420 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BOCHS ENHANCED DEBUGGER Ver 1.2
|
||||
// (C) Chourdakis Michael, 2008
|
||||
// http://www.turboirc.com
|
||||
//
|
||||
// Modified by Bruce Ewing
|
||||
//
|
||||
|
||||
#ifndef BX_ENH_DBG_DEF_H
|
||||
#define BX_ENH_DBG_DEF_H
|
||||
|
||||
#if BX_DEBUGGER && BX_DEBUGGER_GUI
|
||||
|
||||
#ifndef IS_WIN98
|
||||
// workaround broken code if IS_WIN98 not defined
|
||||
#define IS_WIN98
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
#define FALSE 0
|
||||
#endif
|
||||
|
||||
#ifndef TRUE
|
||||
#define TRUE 1
|
||||
#endif
|
||||
|
||||
void MoveLists();
|
||||
void SetStatusText(int column, const char *buf); // should it be here ?
|
||||
void MakeListsGray();
|
||||
void DispMessage(const char *msg, const char *title);
|
||||
void InsertListRow(char *ColumnText[], int ColumnCount, int listnum, int LineCount, int grouping);
|
||||
void StartListUpdate(int listnum);
|
||||
void EndListUpdate(int listnum);
|
||||
void RedrawColumns(int listnum);
|
||||
void Invalidate(int i);
|
||||
void TakeInputFocus();
|
||||
bx_bool ShowAskDialog();
|
||||
bx_bool NewFont();
|
||||
void GrayMenuItem(int flag, int CmdIndex);
|
||||
void ShowMemData(bx_bool initting);
|
||||
void SetMenuCheckmark (int flag, int CmdIndex);
|
||||
void ClearInputWindow();
|
||||
void VSizeChange();
|
||||
void ToggleWSchecks(int newWS, int oldWS);
|
||||
void SetOutWinTxt();
|
||||
void ShowFW();
|
||||
void GetInputEntry(char *buf);
|
||||
void SelectHistory(int UpDown);
|
||||
void DelWatchpoint(bx_watchpoint *wp_array, unsigned *TotEntries, int i);
|
||||
void SetWatchpoint(unsigned *num_watchpoints, bx_watchpoint *watchpoint);
|
||||
|
||||
void HideTree();
|
||||
void FillPTree();
|
||||
|
||||
int GetASMTopIdx();
|
||||
void ScrollASM(int pixels);
|
||||
|
||||
void GetLIText(int listnum, int itemnum, int column, char *buf);
|
||||
void SetLIState(int listnum, int itemnum, bx_bool Select);
|
||||
int GetNextSelectedLI(int listnum, int StartPt);
|
||||
|
||||
bx_bool OSInit();
|
||||
void SpecialInit();
|
||||
|
||||
void HitBreak();
|
||||
void ParseIDText(const char *x);
|
||||
|
||||
extern char *debug_cmd;
|
||||
extern bx_bool debug_cmd_ready;
|
||||
extern bx_bool vgaw_refresh;
|
||||
|
||||
#ifdef WIN32
|
||||
|
||||
#define CHK_CMD_MODEB CMD_MODEB
|
||||
#define CHK_CMD_ONECPU CMD_ONECPU
|
||||
#define CHK_CMD_UCASE CMD_UCASE
|
||||
#define CHK_CMD_IOWIN CMD_IOWIN
|
||||
#define CHK_CMD_SBTN CMD_SBTN
|
||||
#define CHK_CMD_MHEX CMD_MHEX
|
||||
#define CHK_CMD_MASCII CMD_MASCII
|
||||
#define CHK_CMD_LEND CMD_LEND
|
||||
#define CHK_CMD_IGNSA CMD_IGNSA
|
||||
#define CHK_CMD_IGNNT CMD_IGNNT
|
||||
#define CHK_CMD_RCLR CMD_RCLR
|
||||
#define CHK_CMD_EREG CMD_EREG
|
||||
|
||||
#else // GTK+
|
||||
|
||||
// checkmark indices
|
||||
#define MODE_BRK 0
|
||||
#define ONE_CPU 1
|
||||
#define U_CASE 2
|
||||
#define IO_WIN 3
|
||||
#define SHOW_BTN 4
|
||||
#define MD_HEX 5
|
||||
#define MD_ASC 6
|
||||
#define L_END 7
|
||||
#define IGN_SA 8
|
||||
#define IGN_NT 9
|
||||
#define R_CLR 10
|
||||
#define E_REG 11
|
||||
#define S_REG 12
|
||||
#define SYS_R 13
|
||||
#define C_REG 14
|
||||
#define FPU_R 15
|
||||
#define XMM_R 16
|
||||
#define D_REG 17
|
||||
//#define T_REG 18
|
||||
|
||||
#define CHK_CMD_MODEB MODE_BRK
|
||||
#define CHK_CMD_ONECPU ONE_CPU
|
||||
#define CHK_CMD_UCASE U_CASE
|
||||
#define CHK_CMD_IOWIN IO_WIN
|
||||
#define CHK_CMD_SBTN SHOW_BTN
|
||||
#define CHK_CMD_MHEX MD_HEX
|
||||
#define CHK_CMD_MASCII MD_ASC
|
||||
#define CHK_CMD_LEND L_END
|
||||
#define CHK_CMD_IGNSA IGN_SA
|
||||
#define CHK_CMD_IGNNT IGN_NT
|
||||
#define CHK_CMD_RCLR R_CLR
|
||||
#define CHK_CMD_EREG E_REG
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef WIN32
|
||||
|
||||
// Need to define my version of the win32 "virtual keys"
|
||||
|
||||
#define VK_PRIOR 65365
|
||||
#define VK_NEXT 65366
|
||||
#define VK_F2 65471
|
||||
#define VK_F3 65472
|
||||
#define VK_F4 65473
|
||||
#define VK_F5 65474
|
||||
#define VK_F6 65475
|
||||
#define VK_F7 65476
|
||||
#define VK_F8 65477
|
||||
#define VK_F9 65478
|
||||
#define VK_F11 65480
|
||||
#define VK_UP 65362
|
||||
#define VK_DOWN 65364
|
||||
#define VK_RETURN 65293
|
||||
#define VK_LEFT 65361
|
||||
#define VK_RIGHT 65363
|
||||
#define VK_END 65367
|
||||
#define VK_HOME 65360
|
||||
#define VK_DELETE 65535
|
||||
#define VK_ESCAPE 65307
|
||||
|
||||
#endif
|
||||
|
||||
// User Customizable initial settings:
|
||||
|
||||
extern bx_bool SeeReg[8];
|
||||
|
||||
extern bx_bool SingleCPU; // Display all SMP CPUs
|
||||
extern bx_bool ShowIOWindows; // Display the Input and Output Internal Debugger windows
|
||||
extern bx_bool ShowButtons; // Display the top-row Step/Continue pushbuttons
|
||||
extern bx_bool SeeRegColors; // Display registers with background color "groups"
|
||||
extern bx_bool ignoreNxtT; // Do not show "Next at t=" output lines
|
||||
extern bx_bool ignSSDisasm; // Do not show extra disassembly line at each break
|
||||
extern int UprCase; // 1 = convert all Asm, Register names, Register values to uppercase
|
||||
extern int DumpInAsciiMode; // bit 1 = show ASCII in dumps, bit 2 = show hex, value=0 is illegal
|
||||
|
||||
extern bx_bool isLittleEndian;
|
||||
|
||||
// How to use DockOrder: the Register list is window 1, ASM is window 2, MemDump is window 3
|
||||
// Create the hex value with the digits in the order you want the windows to be.
|
||||
// 0x312 would have MemDump on the left, Register in the middle, ASM on the right
|
||||
extern short DockOrder; // set the default List "docking" (Reg, ASM, Dump)
|
||||
|
||||
#define STACK_ENTRIES 50 // # of words/dwords/qwords to display in stack window
|
||||
// Note: STACK_ENTRIES must be <= 512
|
||||
|
||||
// END of User Customizable settings
|
||||
|
||||
#ifndef WIN32
|
||||
#define FMT_LLCAPX "%016llX"
|
||||
#else
|
||||
#define FMT_LLCAPX "%016I64X"
|
||||
#endif
|
||||
|
||||
#define MAX_ASM 2048 // max entries in ASM window
|
||||
|
||||
extern bx_bool SA_valid;
|
||||
extern Bit64u SelectedDataAddress;
|
||||
extern Bit64u CurrentAsmLA; // = EIP/RIP -- for highlighting in ASM window
|
||||
extern Bit64u BottomAsmLA; // beginning and end addrs on ASM window
|
||||
extern Bit64u TopAsmLA;
|
||||
|
||||
extern Bit64u PrevPtime; // any number other than 0
|
||||
extern Bit64u NewPtime; // used to test whether sim has "updated"
|
||||
extern unsigned TotCPUs; // # of CPUs in a multi-CPU simulation
|
||||
extern unsigned CpuSupportSSE; // cpu supports SSE
|
||||
extern unsigned CurrentCPU; // cpu that is being displayed
|
||||
|
||||
// AskTest stuff -- for the generic dialog box
|
||||
struct ASKTEXT {
|
||||
const char* title;
|
||||
const char* prompt;
|
||||
char* reply;
|
||||
};
|
||||
|
||||
extern struct ASKTEXT ask_str;
|
||||
|
||||
// window resizing/docking stuff
|
||||
extern int OneCharWide; // average width of a char in current font (pixels)
|
||||
extern int Sizing; // current "resizing/docking mode"
|
||||
extern int Resize_HiX; // horizontal limits of the current resize operation (pixels)
|
||||
extern int Resize_LoX;
|
||||
extern unsigned ListWidthPix[3]; // set initial proportions of Reg, Asm, Dump windows
|
||||
extern int CurCenterList;
|
||||
extern bx_bool DumpHasFocus;
|
||||
|
||||
// BarClix holds the x-axis position (in pixels or logical units) of the two resizing bars,
|
||||
// in parent coordinates (ie. any window that contains the lists)
|
||||
extern unsigned short BarClix[2];
|
||||
|
||||
extern bx_bool AtBreak; // Status indicators
|
||||
extern bx_bool StatusChange;
|
||||
|
||||
extern bx_bool doOneTimeInit; // Internal flags
|
||||
extern bx_bool ResizeColmns; // address/value column autosize flag
|
||||
extern bx_bool FWflag; // friendly warning has been shown to user once already
|
||||
|
||||
extern Bit64u PStackLA; // to calculate alignment between prev and current stack
|
||||
extern bx_bool StackEntChg[STACK_ENTRIES]; // flag for "change detected" on each stack line
|
||||
|
||||
// List Window indexes = DockOrder window numbers -1
|
||||
#define REG_WND 0
|
||||
#define ASM_WND 1
|
||||
#define DUMP_WND 2
|
||||
|
||||
// DViewModes
|
||||
#define VIEW_MEMDUMP 0
|
||||
#define VIEW_GDT 1
|
||||
#define VIEW_IDT 2
|
||||
#define VIEW_PAGING 3
|
||||
#define VIEW_STACK 4
|
||||
#define VIEW_BREAK 5
|
||||
#define VIEW_PTREE 6
|
||||
|
||||
extern bx_bool DumpInitted; // has the MemDump window ever been filled with data?
|
||||
extern int DumpAlign;
|
||||
extern int PrevDAD; // saves "previous DumpAlign value" (forces column autosize)
|
||||
extern Bit64u DumpStart; // current emulated address (lin or phys) of DataDump
|
||||
extern bx_bool doDumpRefresh;
|
||||
extern int DViewMode;
|
||||
extern bx_bool LinearDump; // FALSE = memdump uses physical addressing
|
||||
|
||||
extern char *tmpcb; // 512b is allocated in bigbuf
|
||||
extern char AsciiHex[512]; // Unsigned char to printable hex xlat table
|
||||
|
||||
#define outbufSIZE 40960
|
||||
extern char bigbuf[outbufSIZE]; // 40K preallocated storage for all char buffers (see DoAllInit)
|
||||
extern char *OutWindow; // buffer for the Output window
|
||||
#define OutWinSIZE 10240
|
||||
extern int PO_Tdelay; // delay before displaying partial output lines
|
||||
|
||||
extern int AsmPgSize;
|
||||
extern int ListLineRatio; // number of vertical pixels in a ListView Item
|
||||
extern int ListVerticalPix; // number of vertical pixels in each List
|
||||
extern int AsmLineCount; // # of disassembled asm lines loaded
|
||||
extern Bit64u AsmLA[MAX_ASM]; // linear address of each disassembled ASM line
|
||||
|
||||
// Command stuff
|
||||
extern int CommandHistoryIdx;
|
||||
#define CmdHistorySize 64
|
||||
extern char *CmdHistory[CmdHistorySize]; // 64 command History storage (fixed 80b each)
|
||||
extern int CmdHInsert; // index of next history entry to store
|
||||
|
||||
// register storage -- names and values
|
||||
#define RAX_Rnum 0
|
||||
#define RBX_Rnum 1
|
||||
#define RCX_Rnum 2
|
||||
#define RDX_Rnum 3
|
||||
#define RSI_Rnum 4
|
||||
#define RDI_Rnum 5
|
||||
#define RBP_Rnum 6
|
||||
#define RSP_Rnum 7
|
||||
#define RIP_Rnum 8
|
||||
#define R8_Rnum 9
|
||||
#define R9_Rnum 10
|
||||
#define R10_Rnum 11
|
||||
#define R11_Rnum 12
|
||||
#define R12_Rnum 13
|
||||
#define R13_Rnum 14
|
||||
#define R14_Rnum 15
|
||||
#define R15_Rnum 16
|
||||
#define EFL_Rnum 17 // it makes the most sense if EFLAGS is between RXX and EXX
|
||||
#define EAX_Rnum 18 // because it "belongs with" both sets of GP registers
|
||||
#define EBX_Rnum 19
|
||||
#define ECX_Rnum 20
|
||||
#define EDX_Rnum 21
|
||||
#define ESI_Rnum 22
|
||||
#define EDI_Rnum 23
|
||||
#define EBP_Rnum 24
|
||||
#define ESP_Rnum 25
|
||||
#define EIP_Rnum 26
|
||||
#define CS_Rnum 27
|
||||
#define DS_Rnum 28
|
||||
#define ES_Rnum 29
|
||||
#define SS_Rnum 30
|
||||
#define FS_Rnum 31
|
||||
#define GS_Rnum 32
|
||||
#define GDTRnum 33
|
||||
#define IDTRnum 34
|
||||
#define LDTRnum 35
|
||||
#define TRRnum 36
|
||||
#define CR0_Rnum 37
|
||||
#define CR2_Rnum 38
|
||||
#define CR3_Rnum 39
|
||||
#define CR4_Rnum 40
|
||||
#define EFER_Rnum 41 // currently used to mark the last entry in rV[]
|
||||
#define ST0_Rnum 42
|
||||
#define ST1_Rnum 43
|
||||
#define ST2_Rnum 44
|
||||
#define ST3_Rnum 45
|
||||
#define ST4_Rnum 46
|
||||
#define ST5_Rnum 47
|
||||
#define ST6_Rnum 48
|
||||
#define ST7_Rnum 49
|
||||
#define XMM0_Rnum 50
|
||||
#define XMM1_Rnum 51
|
||||
#define XMM2_Rnum 52
|
||||
#define XMM3_Rnum 53
|
||||
#define XMM4_Rnum 54
|
||||
#define XMM5_Rnum 55
|
||||
#define XMM6_Rnum 56
|
||||
#define XMM7_Rnum 57
|
||||
#define XMM8_Rnum 58
|
||||
#define XMM9_Rnum 59
|
||||
#define XMMA_Rnum 60
|
||||
#define XMMB_Rnum 61
|
||||
#define XMMC_Rnum 62
|
||||
#define XMMD_Rnum 63
|
||||
#define XMME_Rnum 64
|
||||
#define XMMF_Rnum 65
|
||||
#define DR0_Rnum 66
|
||||
#define DR1_Rnum 67
|
||||
#define DR2_Rnum 68
|
||||
#define DR3_Rnum 69
|
||||
#define DR6_Rnum 70
|
||||
#define DR7_Rnum 71
|
||||
// #define TR0_Rnum 71 -- put Test Registers in here when they are supported
|
||||
#define TOT_REG_NUM 72
|
||||
// extra "register numbers" for registers that have more than one part
|
||||
#define GDTR_Lim 72
|
||||
#define IDTR_Lim 73
|
||||
#define ST0_exp 74
|
||||
#define ST1_exp 75
|
||||
#define ST2_exp 76
|
||||
#define ST3_exp 77
|
||||
#define ST4_exp 78
|
||||
#define ST5_exp 79
|
||||
#define ST6_exp 80
|
||||
#define ST7_exp 81
|
||||
#define XMM0_hi 82
|
||||
#define XMM1_hi 82
|
||||
#define XMM2_hi 83
|
||||
#define XMM3_hi 84
|
||||
#define XMM4_hi 85
|
||||
#define XMM5_hi 86
|
||||
#define XMM6_hi 87
|
||||
#define XMM7_hi 88
|
||||
#define XMM8_hi 89
|
||||
#define XMM9_hi 90
|
||||
#define XMMA_hi 91
|
||||
#define XMMB_hi 92
|
||||
#define XMMC_hi 93
|
||||
#define XMMD_hi 94
|
||||
#define XMME_hi 95
|
||||
#define XMMF_hi 96
|
||||
#define EXTRA_REGS 28
|
||||
|
||||
extern Bit8u RegColor[TOT_REG_NUM]; // specifies foreground and background color of registers
|
||||
// Text color is red if the upper bit is set. Background is set according to ColorList.
|
||||
extern int RitemToRnum[TOT_REG_NUM]; // mapping from Reg List Item# to register number
|
||||
|
||||
// do the linear breakpoint list as 2 arrays, rather than a structure -- much easier to search!
|
||||
extern bx_address BrkLAddr[BX_DBG_MAX_LIN_BPOINTS];
|
||||
extern int BreakCount;
|
||||
|
||||
// Breakpoint Dump Window stuff
|
||||
extern unsigned short BrkpIDMap[256];
|
||||
extern unsigned short WWP_BaseEntry;
|
||||
extern unsigned short RWP_BaseEntry;
|
||||
extern unsigned short EndLinEntry;
|
||||
extern unsigned short EndPhyEntry;
|
||||
extern unsigned short WWPSnapCount;
|
||||
extern unsigned short RWPSnapCount;
|
||||
extern bx_phy_address WWP_Snapshot[16];
|
||||
extern bx_phy_address RWP_Snapshot[16];
|
||||
|
||||
extern int SizeList;
|
||||
extern Bit32s xClick; // halfway through a mouseclick flag + location
|
||||
extern Bit32s yClick; // values are in Listview coordinates
|
||||
|
||||
#include "wenhdbg_res.h" // MenuIDs
|
||||
|
||||
static const char* DC0txt[2] = {"P.Address","L.Address"}; // DumpMode definitions in text
|
||||
|
||||
static const char* BTxt[6] = {
|
||||
"Continue [c]",
|
||||
"Step [s]",
|
||||
"Step N [s ###]",
|
||||
"Refresh",
|
||||
"Break [^C]",
|
||||
"Break All"};
|
||||
|
||||
static int BtnLkup[6] = {
|
||||
CMD_CONT, CMD_STEP1, CMD_STEPN, CMD_RFRSH, CMD_BREAK
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
2393
simulators/bochs/gui/gtk_enh_dbg_osdep.cc
Executable file
2393
simulators/bochs/gui/gtk_enh_dbg_osdep.cc
Executable file
File diff suppressed because it is too large
Load Diff
867
simulators/bochs/gui/gui.cc
Normal file
867
simulators/bochs/gui/gui.cc
Normal file
@ -0,0 +1,867 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002-2009 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
|
||||
|
||||
|
||||
#include <signal.h>
|
||||
#include "iodev.h"
|
||||
#include "vga.h"
|
||||
#include "keymap.h"
|
||||
#include "gui/bitmaps/floppya.h"
|
||||
#include "gui/bitmaps/floppyb.h"
|
||||
#include "gui/bitmaps/mouse.h"
|
||||
#include "gui/bitmaps/reset.h"
|
||||
#include "gui/bitmaps/power.h"
|
||||
#include "gui/bitmaps/snapshot.h"
|
||||
#include "gui/bitmaps/copy.h"
|
||||
#include "gui/bitmaps/paste.h"
|
||||
#include "gui/bitmaps/configbutton.h"
|
||||
#include "gui/bitmaps/cdromd.h"
|
||||
#include "gui/bitmaps/userbutton.h"
|
||||
#include "gui/bitmaps/saverestore.h"
|
||||
|
||||
#if BX_WITH_MACOS
|
||||
# include <Disks.h>
|
||||
#endif
|
||||
|
||||
bx_gui_c *bx_gui = NULL;
|
||||
extern bx_pc_system_c bx_pc_system;
|
||||
#define BX_GUI_THIS bx_gui->
|
||||
#define LOG_THIS BX_GUI_THIS
|
||||
|
||||
#define BX_KEY_UNKNOWN 0x7fffffff
|
||||
#define N_USER_KEYS 37
|
||||
|
||||
typedef struct {
|
||||
const char *key;
|
||||
Bit32u symbol;
|
||||
} user_key_t;
|
||||
|
||||
static user_key_t user_keys[N_USER_KEYS] =
|
||||
{
|
||||
{ "f1", BX_KEY_F1 },
|
||||
{ "f2", BX_KEY_F2 },
|
||||
{ "f3", BX_KEY_F3 },
|
||||
{ "f4", BX_KEY_F4 },
|
||||
{ "f5", BX_KEY_F5 },
|
||||
{ "f6", BX_KEY_F6 },
|
||||
{ "f7", BX_KEY_F7 },
|
||||
{ "f8", BX_KEY_F8 },
|
||||
{ "f9", BX_KEY_F9 },
|
||||
{ "f10", BX_KEY_F10 },
|
||||
{ "f11", BX_KEY_F11 },
|
||||
{ "f12", BX_KEY_F12 },
|
||||
{ "alt", BX_KEY_ALT_L },
|
||||
{ "bksl", BX_KEY_BACKSLASH },
|
||||
{ "bksp", BX_KEY_BACKSPACE },
|
||||
{ "ctrl", BX_KEY_CTRL_L },
|
||||
{ "del", BX_KEY_DELETE },
|
||||
{ "down", BX_KEY_DOWN },
|
||||
{ "end", BX_KEY_END },
|
||||
{ "enter", BX_KEY_ENTER },
|
||||
{ "esc", BX_KEY_ESC },
|
||||
{ "home", BX_KEY_HOME },
|
||||
{ "ins", BX_KEY_INSERT },
|
||||
{ "left", BX_KEY_LEFT },
|
||||
{ "menu", BX_KEY_MENU },
|
||||
{ "minus", BX_KEY_MINUS },
|
||||
{ "pgdwn", BX_KEY_PAGE_DOWN },
|
||||
{ "pgup", BX_KEY_PAGE_UP },
|
||||
{ "plus", BX_KEY_KP_ADD },
|
||||
{ "right", BX_KEY_RIGHT },
|
||||
{ "shift", BX_KEY_SHIFT_L },
|
||||
{ "space", BX_KEY_SPACE },
|
||||
{ "tab", BX_KEY_TAB },
|
||||
{ "up", BX_KEY_UP },
|
||||
{ "win", BX_KEY_WIN_L },
|
||||
{ "print", BX_KEY_PRINT },
|
||||
{ "power", BX_KEY_POWER_POWER }
|
||||
};
|
||||
|
||||
bx_gui_c::bx_gui_c(void)
|
||||
{
|
||||
put("GUI"); // Init in specific_init
|
||||
statusitem_count = 0;
|
||||
framebuffer = NULL;
|
||||
}
|
||||
|
||||
bx_gui_c::~bx_gui_c()
|
||||
{
|
||||
if (framebuffer != NULL) {
|
||||
delete [] framebuffer;
|
||||
}
|
||||
}
|
||||
|
||||
void bx_gui_c::init(int argc, char **argv, unsigned tilewidth, unsigned tileheight)
|
||||
{
|
||||
BX_GUI_THIS new_gfx_api = 0;
|
||||
BX_GUI_THIS host_xres = 640;
|
||||
BX_GUI_THIS host_yres = 480;
|
||||
BX_GUI_THIS host_bpp = 8;
|
||||
BX_GUI_THIS dialog_caps = BX_GUI_DLG_RUNTIME | BX_GUI_DLG_SAVE_RESTORE;
|
||||
|
||||
BX_GUI_THIS toggle_method = SIM->get_param_enum(BXPN_MOUSE_TOGGLE)->get();
|
||||
BX_GUI_THIS toggle_keystate = 0;
|
||||
switch (toggle_method) {
|
||||
case BX_MOUSE_TOGGLE_CTRL_MB:
|
||||
strcpy(mouse_toggle_text, "CTRL + 3rd button");
|
||||
break;
|
||||
case BX_MOUSE_TOGGLE_CTRL_F10:
|
||||
strcpy(mouse_toggle_text, "CTRL + F10");
|
||||
break;
|
||||
case BX_MOUSE_TOGGLE_CTRL_ALT:
|
||||
strcpy(mouse_toggle_text, "CTRL + ALT");
|
||||
break;
|
||||
case BX_MOUSE_TOGGLE_F12:
|
||||
strcpy(mouse_toggle_text, "F12");
|
||||
break;
|
||||
}
|
||||
|
||||
specific_init(argc, argv, tilewidth, tileheight, BX_HEADER_BAR_Y);
|
||||
|
||||
// Define some bitmaps to use in the headerbar
|
||||
BX_GUI_THIS floppyA_bmap_id = create_bitmap(bx_floppya_bmap,
|
||||
BX_FLOPPYA_BMAP_X, BX_FLOPPYA_BMAP_Y);
|
||||
BX_GUI_THIS floppyA_eject_bmap_id = create_bitmap(bx_floppya_eject_bmap,
|
||||
BX_FLOPPYA_BMAP_X, BX_FLOPPYA_BMAP_Y);
|
||||
BX_GUI_THIS floppyB_bmap_id = create_bitmap(bx_floppyb_bmap,
|
||||
BX_FLOPPYB_BMAP_X, BX_FLOPPYB_BMAP_Y);
|
||||
BX_GUI_THIS floppyB_eject_bmap_id = create_bitmap(bx_floppyb_eject_bmap,
|
||||
BX_FLOPPYB_BMAP_X, BX_FLOPPYB_BMAP_Y);
|
||||
BX_GUI_THIS cdromD_bmap_id = create_bitmap(bx_cdromd_bmap,
|
||||
BX_CDROMD_BMAP_X, BX_CDROMD_BMAP_Y);
|
||||
BX_GUI_THIS cdromD_eject_bmap_id = create_bitmap(bx_cdromd_eject_bmap,
|
||||
BX_CDROMD_BMAP_X, BX_CDROMD_BMAP_Y);
|
||||
BX_GUI_THIS mouse_bmap_id = create_bitmap(bx_mouse_bmap,
|
||||
BX_MOUSE_BMAP_X, BX_MOUSE_BMAP_Y);
|
||||
BX_GUI_THIS nomouse_bmap_id = create_bitmap(bx_nomouse_bmap,
|
||||
BX_MOUSE_BMAP_X, BX_MOUSE_BMAP_Y);
|
||||
|
||||
BX_GUI_THIS power_bmap_id = create_bitmap(bx_power_bmap, BX_POWER_BMAP_X, BX_POWER_BMAP_Y);
|
||||
BX_GUI_THIS reset_bmap_id = create_bitmap(bx_reset_bmap, BX_RESET_BMAP_X, BX_RESET_BMAP_Y);
|
||||
BX_GUI_THIS snapshot_bmap_id = create_bitmap(bx_snapshot_bmap, BX_SNAPSHOT_BMAP_X, BX_SNAPSHOT_BMAP_Y);
|
||||
//DanceOS
|
||||
#ifdef DANCEOS_RESTORE
|
||||
BX_GUI_THIS restore_bmap_id = create_bitmap(bx_floppya_bmap, BX_FLOPPYA_BMAP_X, BX_FLOPPYA_BMAP_Y);
|
||||
#endif
|
||||
BX_GUI_THIS copy_bmap_id = create_bitmap(bx_copy_bmap, BX_COPY_BMAP_X, BX_COPY_BMAP_Y);
|
||||
BX_GUI_THIS paste_bmap_id = create_bitmap(bx_paste_bmap, BX_PASTE_BMAP_X, BX_PASTE_BMAP_Y);
|
||||
BX_GUI_THIS config_bmap_id = create_bitmap(bx_config_bmap, BX_CONFIG_BMAP_X, BX_CONFIG_BMAP_Y);
|
||||
BX_GUI_THIS user_bmap_id = create_bitmap(bx_user_bmap, BX_USER_BMAP_X, BX_USER_BMAP_Y);
|
||||
BX_GUI_THIS save_restore_bmap_id = create_bitmap(bx_save_restore_bmap,
|
||||
BX_SAVE_RESTORE_BMAP_X, BX_SAVE_RESTORE_BMAP_Y);
|
||||
|
||||
// Add the initial bitmaps to the headerbar, and enable callback routine, for use
|
||||
// when that bitmap is clicked on
|
||||
|
||||
// Floppy A:
|
||||
BX_GUI_THIS floppyA_status = SIM->get_param_bool(BXPN_FLOPPYA_STATUS)->get();
|
||||
if (BX_GUI_THIS floppyA_status)
|
||||
BX_GUI_THIS floppyA_hbar_id = headerbar_bitmap(BX_GUI_THIS floppyA_bmap_id,
|
||||
BX_GRAVITY_LEFT, floppyA_handler);
|
||||
else
|
||||
BX_GUI_THIS floppyA_hbar_id = headerbar_bitmap(BX_GUI_THIS floppyA_eject_bmap_id,
|
||||
BX_GRAVITY_LEFT, floppyA_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS floppyA_hbar_id, "Change floppy A: media");
|
||||
|
||||
// Floppy B:
|
||||
BX_GUI_THIS floppyB_status = SIM->get_param_bool(BXPN_FLOPPYB_STATUS)->get();
|
||||
if (BX_GUI_THIS floppyB_status)
|
||||
BX_GUI_THIS floppyB_hbar_id = headerbar_bitmap(BX_GUI_THIS floppyB_bmap_id,
|
||||
BX_GRAVITY_LEFT, floppyB_handler);
|
||||
else
|
||||
BX_GUI_THIS floppyB_hbar_id = headerbar_bitmap(BX_GUI_THIS floppyB_eject_bmap_id,
|
||||
BX_GRAVITY_LEFT, floppyB_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS floppyB_hbar_id, "Change floppy B: media");
|
||||
|
||||
// CDROM,
|
||||
// the harddrive object is not initialised yet,
|
||||
// so we just set the bitmap to ejected for now
|
||||
BX_GUI_THIS cdromD_hbar_id = headerbar_bitmap(BX_GUI_THIS cdromD_eject_bmap_id,
|
||||
BX_GRAVITY_LEFT, cdromD_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS cdromD_hbar_id, "Change first CDROM media");
|
||||
|
||||
// Mouse button
|
||||
if (SIM->get_param_bool(BXPN_MOUSE_ENABLED)->get())
|
||||
BX_GUI_THIS mouse_hbar_id = headerbar_bitmap(BX_GUI_THIS mouse_bmap_id,
|
||||
BX_GRAVITY_LEFT, toggle_mouse_enable);
|
||||
else
|
||||
BX_GUI_THIS mouse_hbar_id = headerbar_bitmap(BX_GUI_THIS nomouse_bmap_id,
|
||||
BX_GRAVITY_LEFT, toggle_mouse_enable);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS mouse_hbar_id, "Enable mouse capture");
|
||||
|
||||
// These are the buttons on the right side. They are created in order
|
||||
// of right to left.
|
||||
|
||||
// Power button
|
||||
BX_GUI_THIS power_hbar_id = headerbar_bitmap(BX_GUI_THIS power_bmap_id,
|
||||
BX_GRAVITY_RIGHT, power_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS power_hbar_id, "Turn power off");
|
||||
// Save/Restore Button
|
||||
BX_GUI_THIS save_restore_hbar_id = headerbar_bitmap(BX_GUI_THIS save_restore_bmap_id,
|
||||
BX_GRAVITY_RIGHT, save_restore_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS save_restore_hbar_id, "Save simulation state");
|
||||
// Reset button
|
||||
BX_GUI_THIS reset_hbar_id = headerbar_bitmap(BX_GUI_THIS reset_bmap_id,
|
||||
BX_GRAVITY_RIGHT, reset_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS reset_hbar_id, "Reset the system");
|
||||
// Configure button
|
||||
BX_GUI_THIS config_hbar_id = headerbar_bitmap(BX_GUI_THIS config_bmap_id,
|
||||
BX_GRAVITY_RIGHT, config_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS config_hbar_id, "Runtime config dialog");
|
||||
//DanceOS
|
||||
// Fake-Restore button
|
||||
#ifdef DANCEOS_RESTORE
|
||||
BX_GUI_THIS restore_hbar_id = headerbar_bitmap(BX_GUI_THIS restore_bmap_id,
|
||||
BX_GRAVITY_RIGHT, restore_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS restore_hbar_id, "Restore...");
|
||||
#endif
|
||||
// Snapshot button
|
||||
BX_GUI_THIS snapshot_hbar_id = headerbar_bitmap(BX_GUI_THIS snapshot_bmap_id,
|
||||
BX_GRAVITY_RIGHT, snapshot_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS snapshot_hbar_id, "Save snapshot of the text mode screen");
|
||||
// Paste button
|
||||
BX_GUI_THIS paste_hbar_id = headerbar_bitmap(BX_GUI_THIS paste_bmap_id,
|
||||
BX_GRAVITY_RIGHT, paste_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS paste_hbar_id, "Paste clipboard text as emulated keystrokes");
|
||||
// Copy button
|
||||
BX_GUI_THIS copy_hbar_id = headerbar_bitmap(BX_GUI_THIS copy_bmap_id,
|
||||
BX_GRAVITY_RIGHT, copy_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS copy_hbar_id, "Copy text mode screen to the clipboard");
|
||||
// User button
|
||||
BX_GUI_THIS user_hbar_id = headerbar_bitmap(BX_GUI_THIS user_bmap_id,
|
||||
BX_GRAVITY_RIGHT, userbutton_handler);
|
||||
BX_GUI_THIS set_tooltip(BX_GUI_THIS user_hbar_id, "Send keyboard shortcut");
|
||||
|
||||
if (SIM->get_param_bool(BXPN_TEXT_SNAPSHOT_CHECK)->get()) {
|
||||
bx_pc_system.register_timer(this, bx_gui_c::snapshot_checker, (unsigned) 1000000, 1, 1, "snap_chk");
|
||||
}
|
||||
|
||||
BX_GUI_THIS charmap_updated = 0;
|
||||
|
||||
if (!BX_GUI_THIS new_gfx_api && (BX_GUI_THIS framebuffer == NULL)) {
|
||||
BX_GUI_THIS framebuffer = new Bit8u[BX_MAX_XRES * BX_MAX_YRES * 4];
|
||||
}
|
||||
show_headerbar();
|
||||
}
|
||||
|
||||
void bx_gui_c::cleanup(void)
|
||||
{
|
||||
statusitem_count = 0;
|
||||
}
|
||||
|
||||
void bx_gui_c::update_drive_status_buttons(void)
|
||||
{
|
||||
BX_GUI_THIS floppyA_status = SIM->get_param_bool(BXPN_FLOPPYA_STATUS)->get();
|
||||
BX_GUI_THIS floppyB_status = SIM->get_param_bool(BXPN_FLOPPYB_STATUS)->get();
|
||||
Bit32u handle = DEV_hd_get_first_cd_handle();
|
||||
BX_GUI_THIS cdromD_status = DEV_hd_get_cd_media_status(handle);
|
||||
if (BX_GUI_THIS floppyA_status)
|
||||
replace_bitmap(BX_GUI_THIS floppyA_hbar_id, BX_GUI_THIS floppyA_bmap_id);
|
||||
else {
|
||||
#if BX_WITH_MACOS
|
||||
// If we are using the Mac floppy driver, eject the disk
|
||||
// from the floppy drive. This doesn't work in MacOS X.
|
||||
if (!strcmp(SIM->get_param_string(BXPN_FLOPPYA_PATH)->getptr(), SuperDrive))
|
||||
DiskEject(1);
|
||||
#endif
|
||||
replace_bitmap(BX_GUI_THIS floppyA_hbar_id, BX_GUI_THIS floppyA_eject_bmap_id);
|
||||
}
|
||||
if (BX_GUI_THIS floppyB_status)
|
||||
replace_bitmap(BX_GUI_THIS floppyB_hbar_id, BX_GUI_THIS floppyB_bmap_id);
|
||||
else {
|
||||
#if BX_WITH_MACOS
|
||||
// If we are using the Mac floppy driver, eject the disk
|
||||
// from the floppy drive. This doesn't work in MacOS X.
|
||||
if (!strcmp(SIM->get_param_string(BXPN_FLOPPYB_PATH)->getptr(), SuperDrive))
|
||||
DiskEject(1);
|
||||
#endif
|
||||
replace_bitmap(BX_GUI_THIS floppyB_hbar_id, BX_GUI_THIS floppyB_eject_bmap_id);
|
||||
}
|
||||
if (BX_GUI_THIS cdromD_status)
|
||||
replace_bitmap(BX_GUI_THIS cdromD_hbar_id, BX_GUI_THIS cdromD_bmap_id);
|
||||
else {
|
||||
replace_bitmap(BX_GUI_THIS cdromD_hbar_id, BX_GUI_THIS cdromD_eject_bmap_id);
|
||||
}
|
||||
}
|
||||
|
||||
void bx_gui_c::floppyA_handler(void)
|
||||
{
|
||||
if (SIM->get_param_enum(BXPN_FLOPPYA_DEVTYPE)->get() == BX_FDD_NONE)
|
||||
return; // no primary floppy device present
|
||||
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_FLOPPY) {
|
||||
// instead of just toggling the status, call win32dialog to bring up
|
||||
// a dialog asking what disk image you want to switch to.
|
||||
int ret = SIM->ask_param(BXPN_FLOPPYA_PATH);
|
||||
if (ret > 0) {
|
||||
BX_GUI_THIS update_drive_status_buttons();
|
||||
}
|
||||
return;
|
||||
}
|
||||
BX_GUI_THIS floppyA_status = !BX_GUI_THIS floppyA_status;
|
||||
DEV_floppy_set_media_status(0, BX_GUI_THIS floppyA_status);
|
||||
BX_GUI_THIS update_drive_status_buttons();
|
||||
}
|
||||
|
||||
void bx_gui_c::floppyB_handler(void)
|
||||
{
|
||||
if (SIM->get_param_enum(BXPN_FLOPPYB_DEVTYPE)->get() == BX_FDD_NONE)
|
||||
return; // no secondary floppy device present
|
||||
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_FLOPPY) {
|
||||
// instead of just toggling the status, call win32dialog to bring up
|
||||
// a dialog asking what disk image you want to switch to.
|
||||
int ret = SIM->ask_param(BXPN_FLOPPYB_PATH);
|
||||
if (ret > 0) {
|
||||
BX_GUI_THIS update_drive_status_buttons();
|
||||
}
|
||||
return;
|
||||
}
|
||||
BX_GUI_THIS floppyB_status = !BX_GUI_THIS floppyB_status;
|
||||
DEV_floppy_set_media_status(1, BX_GUI_THIS floppyB_status);
|
||||
BX_GUI_THIS update_drive_status_buttons();
|
||||
}
|
||||
|
||||
void bx_gui_c::cdromD_handler(void)
|
||||
{
|
||||
Bit32u handle = DEV_hd_get_first_cd_handle();
|
||||
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_CDROM) {
|
||||
// instead of just toggling the status, call win32dialog to bring up
|
||||
// a dialog asking what disk image you want to switch to.
|
||||
// This code handles the first cdrom only. The cdrom drives #2, #3 and
|
||||
// #4 are handled in the win32 runtime dialog.
|
||||
bx_param_c *cdrom = SIM->get_first_cdrom();
|
||||
if (cdrom == NULL)
|
||||
return; // no cdrom found
|
||||
int ret = SIM->ask_param(cdrom);
|
||||
if (ret > 0) {
|
||||
BX_GUI_THIS update_drive_status_buttons();
|
||||
}
|
||||
return;
|
||||
}
|
||||
BX_GUI_THIS cdromD_status =
|
||||
DEV_hd_set_cd_media_status(handle, !BX_GUI_THIS cdromD_status);
|
||||
BX_GUI_THIS update_drive_status_buttons();
|
||||
}
|
||||
|
||||
void bx_gui_c::reset_handler(void)
|
||||
{
|
||||
BX_INFO(("system RESET callback"));
|
||||
bx_pc_system.Reset(BX_RESET_HARDWARE);
|
||||
}
|
||||
|
||||
void bx_gui_c::power_handler(void)
|
||||
{
|
||||
// test case for yes/no dialog: confirm power off
|
||||
//if (!SIM->ask_yes_no("Quit Bochs", "Are you sure ?", 0))
|
||||
// return;
|
||||
// the user pressed power button, so there's no doubt they want bochs
|
||||
// to quit. Change panics to fatal for the GUI and then do a panic.
|
||||
bx_user_quit = 1;
|
||||
LOG_THIS setonoff(LOGLEV_PANIC, ACT_FATAL);
|
||||
BX_PANIC (("POWER button turned off."));
|
||||
// shouldn't reach this point, but if you do, QUIT!!!
|
||||
fprintf (stderr, "Bochs is exiting because you pressed the power button.\n");
|
||||
BX_EXIT (1);
|
||||
}
|
||||
|
||||
Bit32s bx_gui_c::make_text_snapshot(char **snapshot, Bit32u *length)
|
||||
{
|
||||
Bit8u* raw_snap = NULL;
|
||||
char *clean_snap;
|
||||
unsigned line_addr, txt_addr, txHeight, txWidth;
|
||||
|
||||
DEV_vga_get_text_snapshot(&raw_snap, &txHeight, &txWidth);
|
||||
if (txHeight <= 0) return -1;
|
||||
clean_snap = (char*) malloc(txHeight*(txWidth+2)+1);
|
||||
txt_addr = 0;
|
||||
for (unsigned i=0; i<txHeight; i++) {
|
||||
line_addr = i * txWidth * 2;
|
||||
for (unsigned j=0; j<(txWidth*2); j+=2) {
|
||||
if (!raw_snap[line_addr+j])
|
||||
raw_snap[line_addr+j] = 0x20;
|
||||
clean_snap[txt_addr++] = raw_snap[line_addr+j];
|
||||
}
|
||||
while ((txt_addr > 0) && (clean_snap[txt_addr-1] == ' ')) txt_addr--;
|
||||
#ifdef WIN32
|
||||
if(!(SIM->get_param_bool(BXPN_TEXT_SNAPSHOT_CHECK)->get())) {
|
||||
clean_snap[txt_addr++] = 13;
|
||||
}
|
||||
#endif
|
||||
clean_snap[txt_addr++] = 10;
|
||||
}
|
||||
clean_snap[txt_addr] = 0;
|
||||
*snapshot = clean_snap;
|
||||
*length = txt_addr;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// create a text snapshot and copy to the system clipboard. On guis that
|
||||
// we haven't figured out how to support yet, dump to a file instead.
|
||||
void bx_gui_c::copy_handler(void)
|
||||
{
|
||||
Bit32u len;
|
||||
char *text_snapshot;
|
||||
if (make_text_snapshot (&text_snapshot, &len) < 0) {
|
||||
BX_INFO(("copy button failed, mode not implemented"));
|
||||
return;
|
||||
}
|
||||
if (!BX_GUI_THIS set_clipboard_text(text_snapshot, len)) {
|
||||
// platform specific code failed, use portable code instead
|
||||
FILE *fp = fopen("copy.txt", "w");
|
||||
fwrite(text_snapshot, 1, len, fp);
|
||||
fclose(fp);
|
||||
}
|
||||
free(text_snapshot);
|
||||
}
|
||||
|
||||
// Check the current text snapshot against file snapchk.txt.
|
||||
void bx_gui_c::snapshot_checker(void *this_ptr)
|
||||
{
|
||||
char filename[BX_PATHNAME_LEN];
|
||||
strcpy(filename,"snapchk.txt");
|
||||
FILE *fp = fopen(filename, "rb");
|
||||
if(fp) {
|
||||
char *text_snapshot;
|
||||
Bit32u len;
|
||||
if (make_text_snapshot (&text_snapshot, &len) < 0) {
|
||||
return;
|
||||
}
|
||||
char *compare_snapshot = (char *) malloc((len+1) * sizeof(char));
|
||||
fread(compare_snapshot, 1, len, fp);
|
||||
fclose(fp);
|
||||
strcpy(filename,"snapmask.txt");
|
||||
fp=fopen(filename, "rb");
|
||||
if(fp) {
|
||||
char *mask_snapshot = (char *) malloc((len+1) * sizeof(char));
|
||||
unsigned i;
|
||||
bx_bool flag = 1;
|
||||
fread(mask_snapshot, 1, len, fp);
|
||||
fclose(fp);
|
||||
for(i=0;i<len;i++) {
|
||||
if((text_snapshot[i] != compare_snapshot[i]) &&
|
||||
(compare_snapshot[i] == mask_snapshot[i])) {
|
||||
flag = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(flag) {
|
||||
if(!memcmp(text_snapshot,compare_snapshot,len)) {
|
||||
BX_PASS(("Test Passed."));
|
||||
} else {
|
||||
BX_PASS(("Test Passed with Mask."));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(!memcmp(text_snapshot,compare_snapshot,len)) {
|
||||
BX_PASS(("Test Passed."));
|
||||
}
|
||||
}
|
||||
free(compare_snapshot);
|
||||
free(text_snapshot);
|
||||
}
|
||||
}
|
||||
|
||||
// create a text snapshot and dump it to a file
|
||||
void bx_gui_c::snapshot_handler(void)
|
||||
{
|
||||
char *text_snapshot;
|
||||
Bit32u len;
|
||||
if (make_text_snapshot (&text_snapshot, &len) < 0) {
|
||||
BX_ERROR(("snapshot button failed, mode not implemented"));
|
||||
return;
|
||||
}
|
||||
//FIXME
|
||||
char filename[BX_PATHNAME_LEN];
|
||||
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_SNAPSHOT) {
|
||||
int ret = SIM->ask_filename (filename, sizeof(filename),
|
||||
"Save snapshot as...", "snapshot.txt",
|
||||
bx_param_string_c::SAVE_FILE_DIALOG);
|
||||
if (ret < 0) { // cancelled
|
||||
free(text_snapshot);
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
strcpy (filename, "snapshot.txt");
|
||||
}
|
||||
FILE *fp = fopen(filename, "wb");
|
||||
fwrite(text_snapshot, 1, len, fp);
|
||||
fclose(fp);
|
||||
free(text_snapshot);
|
||||
}
|
||||
|
||||
// Read ASCII chars from the system clipboard and paste them into bochs.
|
||||
// Note that paste cannot work with the key mapping tables loaded.
|
||||
void bx_gui_c::paste_handler(void)
|
||||
{
|
||||
Bit32s nbytes;
|
||||
Bit8u *bytes;
|
||||
if (!bx_keymap.isKeymapLoaded ()) {
|
||||
BX_ERROR (("keyboard_mapping disabled, so paste cannot work"));
|
||||
return;
|
||||
}
|
||||
if (!BX_GUI_THIS get_clipboard_text(&bytes, &nbytes)) {
|
||||
BX_ERROR (("paste not implemented on this platform"));
|
||||
return;
|
||||
}
|
||||
BX_INFO (("pasting %d bytes", nbytes));
|
||||
DEV_kbd_paste_bytes (bytes, nbytes);
|
||||
}
|
||||
|
||||
void bx_gui_c::config_handler(void)
|
||||
{
|
||||
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_RUNTIME) {
|
||||
SIM->configuration_interface(NULL, CI_RUNTIME_CONFIG);
|
||||
}
|
||||
}
|
||||
|
||||
void bx_gui_c::toggle_mouse_enable(void)
|
||||
{
|
||||
int old = SIM->get_param_bool(BXPN_MOUSE_ENABLED)->get();
|
||||
BX_DEBUG (("toggle mouse_enabled, now %d", !old));
|
||||
SIM->get_param_bool(BXPN_MOUSE_ENABLED)->set(!old);
|
||||
}
|
||||
|
||||
bx_bool bx_gui_c::mouse_toggle_check(Bit32u key, bx_bool pressed)
|
||||
{
|
||||
Bit32u newstate;
|
||||
bx_bool toggle = 0;
|
||||
|
||||
newstate = toggle_keystate;
|
||||
if (pressed) {
|
||||
newstate |= key;
|
||||
if (newstate == toggle_keystate) return 0;
|
||||
switch (toggle_method) {
|
||||
case BX_MOUSE_TOGGLE_CTRL_MB:
|
||||
toggle = (newstate & BX_GUI_MT_CTRL_MB) == BX_GUI_MT_CTRL_MB;
|
||||
if (!toggle) {
|
||||
toggle = (newstate & BX_GUI_MT_CTRL_LRB) == BX_GUI_MT_CTRL_LRB;
|
||||
}
|
||||
break;
|
||||
case BX_MOUSE_TOGGLE_CTRL_F10:
|
||||
toggle = (newstate & BX_GUI_MT_CTRL_F10) == BX_GUI_MT_CTRL_F10;
|
||||
break;
|
||||
case BX_MOUSE_TOGGLE_CTRL_ALT:
|
||||
toggle = (newstate & BX_GUI_MT_CTRL_ALT) == BX_GUI_MT_CTRL_ALT;
|
||||
break;
|
||||
case BX_MOUSE_TOGGLE_F12:
|
||||
toggle = (newstate == BX_GUI_MT_F12);
|
||||
break;
|
||||
}
|
||||
toggle_keystate = newstate;
|
||||
} else {
|
||||
toggle_keystate &= ~key;
|
||||
}
|
||||
return toggle;
|
||||
}
|
||||
|
||||
const char* bx_gui_c::get_toggle_info(void)
|
||||
{
|
||||
return mouse_toggle_text;
|
||||
}
|
||||
|
||||
Bit32u get_user_key(char *key)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
while (i < N_USER_KEYS) {
|
||||
if (!strcmp(key, user_keys[i].key))
|
||||
return user_keys[i].symbol;
|
||||
i++;
|
||||
}
|
||||
return BX_KEY_UNKNOWN;
|
||||
}
|
||||
|
||||
void bx_gui_c::userbutton_handler(void)
|
||||
{
|
||||
Bit32u shortcut[4];
|
||||
Bit32u symbol;
|
||||
char user_shortcut[512];
|
||||
char *ptr;
|
||||
int i, len = 0, ret = 1;
|
||||
|
||||
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_USER) {
|
||||
ret = SIM->ask_param(BXPN_USER_SHORTCUT);
|
||||
}
|
||||
strcpy(user_shortcut, SIM->get_param_string(BXPN_USER_SHORTCUT)->getptr());
|
||||
if ((ret > 0) && user_shortcut[0] && (strcmp(user_shortcut, "none"))) {
|
||||
ptr = strtok(user_shortcut, "-");
|
||||
if ((strcmp(ptr, SIM->get_param_string(BXPN_USER_SHORTCUT)->getptr())) ||
|
||||
(strlen(SIM->get_param_string(BXPN_USER_SHORTCUT)->getptr()) < 6)) {
|
||||
while (ptr) {
|
||||
symbol = get_user_key(ptr);
|
||||
if (symbol == BX_KEY_UNKNOWN) {
|
||||
BX_ERROR(("Unknown shortcut %s ignored", ptr));
|
||||
return;
|
||||
}
|
||||
shortcut[len++] = symbol;
|
||||
ptr = strtok(NULL, "-");
|
||||
}
|
||||
} else {
|
||||
BX_ERROR(("Unknown shortcut %s ignored", user_shortcut));
|
||||
return;
|
||||
}
|
||||
i = 0;
|
||||
while (i < len) {
|
||||
DEV_kbd_gen_scancode(shortcut[i++]);
|
||||
}
|
||||
i--;
|
||||
while (i >= 0) {
|
||||
DEV_kbd_gen_scancode(shortcut[i--] | BX_KEY_RELEASED);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void bx_gui_c::save_restore_handler(void)
|
||||
{
|
||||
int ret;
|
||||
char sr_path[BX_PATHNAME_LEN];
|
||||
|
||||
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_SAVE_RESTORE) {
|
||||
sr_path[0] = 0;
|
||||
ret = SIM->ask_filename(sr_path, sizeof(sr_path),
|
||||
"Save Bochs state to folder...", "none",
|
||||
bx_param_string_c::SELECT_FOLDER_DLG);
|
||||
if ((ret >= 0) && (strcmp(sr_path, "none"))) {
|
||||
if (SIM->save_state(sr_path)) {
|
||||
if (!SIM->ask_yes_no("WARNING",
|
||||
"The save function currently doesn't handle the state of hard drive images,\n"
|
||||
"so we don't recommend to continue, unless you are running a read-only\n"
|
||||
"guest system (e.g. Live-CD).\n\n"
|
||||
"Do you want to continue?", 0)) {
|
||||
power_handler();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//DanceOS
|
||||
#ifdef DANCEOS_RESTORE
|
||||
void bx_gui_c::restore_handler(void)
|
||||
{
|
||||
int ret;
|
||||
char temp_path[BX_PATHNAME_LEN];
|
||||
|
||||
//gui 631
|
||||
if (BX_GUI_THIS dialog_caps & BX_GUI_DLG_SAVE_RESTORE) {
|
||||
temp_path[0] = 0;
|
||||
ret = SIM->ask_filename(temp_path, sizeof(temp_path),
|
||||
"Restore Bochs state from folder...", "none",
|
||||
bx_param_string_c::SELECT_FOLDER_DLG);
|
||||
if ((ret >= 0) && (strcmp(temp_path, "none"))) {
|
||||
|
||||
fail::restore_bochs_request = true;
|
||||
fail::sr_path = temp_path;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
void bx_gui_c::mouse_enabled_changed(bx_bool val)
|
||||
{
|
||||
// This is only called when SIM->get_init_done is 1. Note that VAL
|
||||
// is the new value of mouse_enabled, which may not match the old
|
||||
// value which is still in SIM->get_param_bool(BXPN_MOUSE_ENABLED)->get().
|
||||
BX_DEBUG (("replacing the mouse bitmaps"));
|
||||
if (val)
|
||||
BX_GUI_THIS replace_bitmap(BX_GUI_THIS mouse_hbar_id, BX_GUI_THIS mouse_bmap_id);
|
||||
else
|
||||
BX_GUI_THIS replace_bitmap(BX_GUI_THIS mouse_hbar_id, BX_GUI_THIS nomouse_bmap_id);
|
||||
// give the GUI a chance to respond to the event. Most guis will hide
|
||||
// the native mouse cursor and do something to trap the mouse inside the
|
||||
// bochs VGA display window.
|
||||
BX_GUI_THIS mouse_enabled_changed_specific (val);
|
||||
}
|
||||
|
||||
void bx_gui_c::init_signal_handlers()
|
||||
{
|
||||
#if BX_GUI_SIGHANDLER
|
||||
if (bx_gui_sighandler)
|
||||
{
|
||||
Bit32u mask = bx_gui->get_sighandler_mask ();
|
||||
for (Bit32u sig=0; sig<32; sig++)
|
||||
{
|
||||
if (mask & (1<<sig))
|
||||
signal (sig, bx_signal_handler);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void bx_gui_c::set_text_charmap(Bit8u *fbuffer)
|
||||
{
|
||||
memcpy(& BX_GUI_THIS vga_charmap, fbuffer, 0x2000);
|
||||
for (unsigned i=0; i<256; i++) BX_GUI_THIS char_changed[i] = 1;
|
||||
BX_GUI_THIS charmap_updated = 1;
|
||||
}
|
||||
|
||||
void bx_gui_c::set_text_charbyte(Bit16u address, Bit8u data)
|
||||
{
|
||||
BX_GUI_THIS vga_charmap[address] = data;
|
||||
BX_GUI_THIS char_changed[address >> 5] = 1;
|
||||
BX_GUI_THIS charmap_updated = 1;
|
||||
}
|
||||
|
||||
void bx_gui_c::beep_on(float frequency)
|
||||
{
|
||||
BX_INFO(("GUI Beep ON (frequency=%.2f)", frequency));
|
||||
}
|
||||
|
||||
void bx_gui_c::beep_off()
|
||||
{
|
||||
BX_INFO(("GUI Beep OFF"));
|
||||
}
|
||||
|
||||
int bx_gui_c::register_statusitem(const char *text)
|
||||
{
|
||||
if (statusitem_count < BX_MAX_STATUSITEMS) {
|
||||
strncpy(statusitem_text[statusitem_count], text, 8);
|
||||
statusitem_text[statusitem_count][7] = 0;
|
||||
return statusitem_count++;
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
void bx_gui_c::get_capabilities(Bit16u *xres, Bit16u *yres, Bit16u *bpp)
|
||||
{
|
||||
*xres = 1024;
|
||||
*yres = 768;
|
||||
*bpp = 32;
|
||||
}
|
||||
|
||||
bx_svga_tileinfo_t *bx_gui_c::graphics_tile_info(bx_svga_tileinfo_t *info)
|
||||
{
|
||||
if (!info) {
|
||||
info = (bx_svga_tileinfo_t *)malloc(sizeof(bx_svga_tileinfo_t));
|
||||
if (!info) {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
BX_GUI_THIS host_pitch = BX_GUI_THIS host_xres * ((BX_GUI_THIS host_bpp + 1) >> 3);
|
||||
|
||||
info->bpp = BX_GUI_THIS host_bpp;
|
||||
info->pitch = BX_GUI_THIS host_pitch;
|
||||
switch (info->bpp) {
|
||||
case 15:
|
||||
info->red_shift = 15;
|
||||
info->green_shift = 10;
|
||||
info->blue_shift = 5;
|
||||
info->red_mask = 0x7c00;
|
||||
info->green_mask = 0x03e0;
|
||||
info->blue_mask = 0x001f;
|
||||
break;
|
||||
case 16:
|
||||
info->red_shift = 16;
|
||||
info->green_shift = 11;
|
||||
info->blue_shift = 5;
|
||||
info->red_mask = 0xf800;
|
||||
info->green_mask = 0x07e0;
|
||||
info->blue_mask = 0x001f;
|
||||
break;
|
||||
case 24:
|
||||
case 32:
|
||||
info->red_shift = 24;
|
||||
info->green_shift = 16;
|
||||
info->blue_shift = 8;
|
||||
info->red_mask = 0xff0000;
|
||||
info->green_mask = 0x00ff00;
|
||||
info->blue_mask = 0x0000ff;
|
||||
break;
|
||||
}
|
||||
info->is_indexed = (BX_GUI_THIS host_bpp == 8);
|
||||
#ifdef BX_LITTLE_ENDIAN
|
||||
info->is_little_endian = 1;
|
||||
#else
|
||||
info->is_little_endian = 0;
|
||||
#endif
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
Bit8u *bx_gui_c::graphics_tile_get(unsigned x0, unsigned y0,
|
||||
unsigned *w, unsigned *h)
|
||||
{
|
||||
if (x0+X_TILESIZE > BX_GUI_THIS host_xres) {
|
||||
*w = BX_GUI_THIS host_xres - x0;
|
||||
}
|
||||
else {
|
||||
*w = X_TILESIZE;
|
||||
}
|
||||
|
||||
if (y0+Y_TILESIZE > BX_GUI_THIS host_yres) {
|
||||
*h = BX_GUI_THIS host_yres - y0;
|
||||
}
|
||||
else {
|
||||
*h = Y_TILESIZE;
|
||||
}
|
||||
|
||||
return (Bit8u *)framebuffer + y0 * BX_GUI_THIS host_pitch +
|
||||
x0 * ((BX_GUI_THIS host_bpp + 1) >> 3);
|
||||
}
|
||||
|
||||
void bx_gui_c::graphics_tile_update_in_place(unsigned x0, unsigned y0,
|
||||
unsigned w, unsigned h)
|
||||
{
|
||||
Bit8u tile[X_TILESIZE * Y_TILESIZE * 4];
|
||||
Bit8u *tile_ptr, *fb_ptr;
|
||||
Bit16u xc, yc, fb_pitch, tile_pitch;
|
||||
Bit8u r, diffx, diffy;
|
||||
|
||||
diffx = (x0 % X_TILESIZE);
|
||||
diffy = (y0 % Y_TILESIZE);
|
||||
if (diffx > 0) {
|
||||
x0 -= diffx;
|
||||
w += diffx;
|
||||
}
|
||||
if (diffy > 0) {
|
||||
y0 -= diffy;
|
||||
h += diffy;
|
||||
}
|
||||
fb_pitch = BX_GUI_THIS host_pitch;
|
||||
tile_pitch = X_TILESIZE * ((BX_GUI_THIS host_bpp + 1) >> 3);
|
||||
for (yc=y0; yc<(y0+h); yc+=Y_TILESIZE) {
|
||||
for (xc=x0; xc<(x0+w); xc+=X_TILESIZE) {
|
||||
fb_ptr = BX_GUI_THIS framebuffer + (yc * fb_pitch + xc * ((BX_GUI_THIS host_bpp + 1) >> 3));
|
||||
tile_ptr = &tile[0];
|
||||
for (r=0; r<h; r++) {
|
||||
memcpy(tile_ptr, fb_ptr, tile_pitch);
|
||||
fb_ptr += fb_pitch;
|
||||
tile_ptr += tile_pitch;
|
||||
}
|
||||
BX_GUI_THIS graphics_tile_update(tile, xc, yc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void bx_gui_c::show_ips(Bit32u ips_count)
|
||||
{
|
||||
#if BX_SHOW_IPS
|
||||
BX_INFO(("ips = %u", ips_count));
|
||||
#endif
|
||||
}
|
||||
|
||||
Bit8u bx_gui_c::get_mouse_headerbar_id()
|
||||
{
|
||||
return BX_GUI_THIS mouse_hbar_id;
|
||||
}
|
||||
437
simulators/bochs/gui/gui.h
Normal file
437
simulators/bochs/gui/gui.h
Normal file
@ -0,0 +1,437 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002-2009 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 BX_MAX_STATUSITEMS 10
|
||||
|
||||
#define BX_GUI_DLG_FLOPPY 0x01
|
||||
#define BX_GUI_DLG_CDROM 0x02
|
||||
#define BX_GUI_DLG_SNAPSHOT 0x04
|
||||
#define BX_GUI_DLG_RUNTIME 0x08
|
||||
#define BX_GUI_DLG_USER 0x10
|
||||
#define BX_GUI_DLG_SAVE_RESTORE 0x20
|
||||
#define BX_GUI_DLG_ALL 0x3F
|
||||
|
||||
// text mode blink feature
|
||||
#define BX_TEXT_BLINK_MODE 0x01
|
||||
#define BX_TEXT_BLINK_TOGGLE 0x02
|
||||
#define BX_TEXT_BLINK_STATE 0x04
|
||||
|
||||
// mouse capture toggle feature
|
||||
#define BX_MT_KEY_CTRL 0x01
|
||||
#define BX_MT_KEY_ALT 0x02
|
||||
#define BX_MT_KEY_F10 0x04
|
||||
#define BX_MT_KEY_F12 0x08
|
||||
#define BX_MT_MBUTTON 0x10
|
||||
#define BX_MT_LBUTTON 0x20
|
||||
#define BX_MT_RBUTTON 0x40
|
||||
|
||||
#define BX_GUI_MT_CTRL_MB 0x11
|
||||
#define BX_GUI_MT_CTRL_LRB 0x61
|
||||
#define BX_GUI_MT_CTRL_F10 0x05
|
||||
#define BX_GUI_MT_F12 0x08
|
||||
#define BX_GUI_MT_CTRL_ALT 0x03
|
||||
|
||||
typedef struct {
|
||||
Bit16u start_address;
|
||||
Bit8u cs_start;
|
||||
Bit8u cs_end;
|
||||
Bit16u line_offset;
|
||||
Bit16u line_compare;
|
||||
Bit8u h_panning;
|
||||
Bit8u v_panning;
|
||||
bx_bool line_graphics;
|
||||
bx_bool split_hpanning;
|
||||
Bit8u blink_flags;
|
||||
} bx_vga_tminfo_t;
|
||||
|
||||
typedef struct {
|
||||
Bit16u bpp, pitch;
|
||||
Bit8u red_shift, green_shift, blue_shift;
|
||||
Bit8u is_indexed, is_little_endian;
|
||||
unsigned long red_mask, green_mask, blue_mask;
|
||||
} bx_svga_tileinfo_t;
|
||||
|
||||
|
||||
BOCHSAPI extern class bx_gui_c *bx_gui;
|
||||
|
||||
#if BX_SUPPORT_X86_64
|
||||
#define BOCHS_WINDOW_NAME "Bochs x86-64 emulator, http://bochs.sourceforge.net/"
|
||||
#else
|
||||
#define BOCHS_WINDOW_NAME "Bochs x86 emulator, http://bochs.sourceforge.net/"
|
||||
#endif
|
||||
|
||||
// The bx_gui_c class provides data and behavior that is common to
|
||||
// all guis. Each gui implementation will override the abstract methods.
|
||||
class BOCHSAPI bx_gui_c : public logfunctions {
|
||||
public:
|
||||
bx_gui_c (void);
|
||||
virtual ~bx_gui_c ();
|
||||
// Define the following functions in the module for your particular GUI
|
||||
// (x.cc, beos.cc, ...)
|
||||
virtual void specific_init(int argc, char **argv,
|
||||
unsigned x_tilesize, unsigned y_tilesize, unsigned header_bar_y) = 0;
|
||||
virtual void text_update(Bit8u *old_text, Bit8u *new_text,
|
||||
unsigned long cursor_x, unsigned long cursor_y,
|
||||
bx_vga_tminfo_t tm_info) = 0;
|
||||
virtual void graphics_tile_update(Bit8u *snapshot, unsigned x, unsigned y) = 0;
|
||||
virtual bx_svga_tileinfo_t *graphics_tile_info(bx_svga_tileinfo_t *info);
|
||||
virtual Bit8u *graphics_tile_get(unsigned x, unsigned y, unsigned *w, unsigned *h);
|
||||
virtual void graphics_tile_update_in_place(unsigned x, unsigned y, unsigned w, unsigned h);
|
||||
virtual void handle_events(void) = 0;
|
||||
virtual void flush(void) = 0;
|
||||
virtual void clear_screen(void) = 0;
|
||||
virtual bx_bool palette_change(unsigned index, unsigned red, unsigned green, unsigned blue) = 0;
|
||||
virtual void dimension_update(unsigned x, unsigned y, unsigned fheight=0, unsigned fwidth=0, unsigned bpp=8) = 0;
|
||||
virtual unsigned create_bitmap(const unsigned char *bmap, unsigned xdim, unsigned ydim) = 0;
|
||||
virtual unsigned headerbar_bitmap(unsigned bmap_id, unsigned alignment, void (*f)(void)) = 0;
|
||||
virtual void replace_bitmap(unsigned hbar_id, unsigned bmap_id) = 0;
|
||||
virtual void show_headerbar(void) = 0;
|
||||
virtual int get_clipboard_text(Bit8u **bytes, Bit32s *nbytes) = 0;
|
||||
virtual int set_clipboard_text(char *snapshot, Bit32u len) = 0;
|
||||
virtual void mouse_enabled_changed_specific (bx_bool val) = 0;
|
||||
virtual void statusbar_setitem(int element, bx_bool active, bx_bool w=0) {}
|
||||
virtual void set_tooltip(unsigned hbar_id, const char *tip) {}
|
||||
virtual void exit(void) = 0;
|
||||
// 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,
|
||||
// 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.
|
||||
virtual void set_display_mode (disp_mode_t newmode) { /* default=no action*/ }
|
||||
// These are only needed for the term gui. For all other guis they will
|
||||
// have no effect.
|
||||
// returns 32-bit bitmask in which 1 means the GUI should handle that signal
|
||||
virtual Bit32u get_sighandler_mask () {return 0;}
|
||||
// called when registered signal arrives
|
||||
virtual void sighandler (int sig) {}
|
||||
#if BX_USE_IDLE_HACK
|
||||
// this is called from the CPU model when the HLT instruction is executed.
|
||||
virtual void sim_is_idle(void) {}
|
||||
#endif
|
||||
virtual void show_ips(Bit32u ips_count);
|
||||
virtual void beep_on(float frequency);
|
||||
virtual void beep_off();
|
||||
virtual void get_capabilities(Bit16u *xres, Bit16u *yres, Bit16u *bpp);
|
||||
|
||||
// The following function(s) are defined already, and your
|
||||
// GUI code calls them
|
||||
static void key_event(Bit32u key);
|
||||
static void set_text_charmap(Bit8u *fbuffer);
|
||||
static void set_text_charbyte(Bit16u address, Bit8u data);
|
||||
static Bit8u get_mouse_headerbar_id();
|
||||
|
||||
void init(int argc, char **argv,
|
||||
unsigned x_tilesize, unsigned y_tilesize);
|
||||
void cleanup(void);
|
||||
void update_drive_status_buttons(void);
|
||||
static void mouse_enabled_changed(bx_bool val);
|
||||
int register_statusitem(const char *text);
|
||||
static void init_signal_handlers();
|
||||
static void toggle_mouse_enable(void);
|
||||
bx_bool mouse_toggle_check(Bit32u key, bx_bool pressed);
|
||||
const char* get_toggle_info(void);
|
||||
|
||||
protected:
|
||||
// And these are defined and used privately in gui.cc
|
||||
static Bit32s make_text_snapshot (char **snapshot, Bit32u *length);
|
||||
static void floppyA_handler(void);
|
||||
static void floppyB_handler(void);
|
||||
static void cdromD_handler(void);
|
||||
static void reset_handler(void);
|
||||
static void power_handler(void);
|
||||
static void copy_handler(void);
|
||||
static void paste_handler(void);
|
||||
static void snapshot_handler(void);
|
||||
//DanceOS
|
||||
#ifdef DANCEOS_RESTORE
|
||||
static void restore_handler(void);
|
||||
#endif
|
||||
|
||||
|
||||
static void snapshot_checker(void *);
|
||||
static void config_handler(void);
|
||||
static void userbutton_handler(void);
|
||||
static void save_restore_handler(void);
|
||||
|
||||
bx_bool floppyA_status;
|
||||
bx_bool floppyB_status;
|
||||
bx_bool cdromD_status;
|
||||
unsigned floppyA_bmap_id, floppyA_eject_bmap_id, floppyA_hbar_id;
|
||||
unsigned floppyB_bmap_id, floppyB_eject_bmap_id, floppyB_hbar_id;
|
||||
unsigned cdromD_bmap_id, cdromD_eject_bmap_id, cdromD_hbar_id;
|
||||
unsigned power_bmap_id, power_hbar_id;
|
||||
unsigned reset_bmap_id, reset_hbar_id;
|
||||
unsigned copy_bmap_id, copy_hbar_id;
|
||||
unsigned paste_bmap_id, paste_hbar_id;
|
||||
unsigned snapshot_bmap_id, snapshot_hbar_id;
|
||||
//DanceOS
|
||||
#ifdef DANCEOS_RESTORE
|
||||
unsigned restore_bmap_id, restore_hbar_id;
|
||||
#endif
|
||||
unsigned config_bmap_id, config_hbar_id;
|
||||
unsigned mouse_bmap_id, nomouse_bmap_id, mouse_hbar_id;
|
||||
unsigned user_bmap_id, user_hbar_id;
|
||||
unsigned save_restore_bmap_id, save_restore_hbar_id;
|
||||
|
||||
unsigned char vga_charmap[0x2000];
|
||||
bx_bool charmap_updated;
|
||||
bx_bool char_changed[256];
|
||||
unsigned statusitem_count;
|
||||
char statusitem_text[BX_MAX_STATUSITEMS][8];
|
||||
disp_mode_t disp_mode;
|
||||
bx_bool new_gfx_api;
|
||||
Bit16u host_xres;
|
||||
Bit16u host_yres;
|
||||
Bit16u host_pitch;
|
||||
Bit8u host_bpp;
|
||||
Bit8u *framebuffer;
|
||||
Bit32u dialog_caps;
|
||||
Bit8u toggle_method;
|
||||
Bit32u toggle_keystate;
|
||||
char mouse_toggle_text[20];
|
||||
};
|
||||
|
||||
|
||||
// Add this macro in the class declaration of each GUI, to define all the
|
||||
// required virtual methods. Example:
|
||||
//
|
||||
// class bx_rfb_gui_c : public bx_gui_c {
|
||||
// public:
|
||||
// bx_rfb_gui_c (void) {}
|
||||
// DECLARE_GUI_VIRTUAL_METHODS()
|
||||
// };
|
||||
// Then, each method must be defined later in the file.
|
||||
#define DECLARE_GUI_VIRTUAL_METHODS() \
|
||||
virtual void specific_init(int argc, char **argv, \
|
||||
unsigned x_tilesize, unsigned y_tilesize, \
|
||||
unsigned header_bar_y); \
|
||||
virtual void text_update(Bit8u *old_text, Bit8u *new_text, \
|
||||
unsigned long cursor_x, unsigned long cursor_y, \
|
||||
bx_vga_tminfo_t tm_info); \
|
||||
virtual void graphics_tile_update(Bit8u *snapshot, unsigned x, unsigned y); \
|
||||
virtual void handle_events(void); \
|
||||
virtual void flush(void); \
|
||||
virtual void clear_screen(void); \
|
||||
virtual bx_bool palette_change(unsigned index, \
|
||||
unsigned red, unsigned green, unsigned blue); \
|
||||
virtual void dimension_update(unsigned x, unsigned y, unsigned fheight=0, \
|
||||
unsigned fwidth=0, unsigned bpp=8); \
|
||||
virtual unsigned create_bitmap(const unsigned char *bmap, \
|
||||
unsigned xdim, unsigned ydim); \
|
||||
virtual unsigned headerbar_bitmap(unsigned bmap_id, unsigned alignment, \
|
||||
void (*f)(void)); \
|
||||
virtual void replace_bitmap(unsigned hbar_id, unsigned bmap_id); \
|
||||
virtual void show_headerbar(void); \
|
||||
virtual int get_clipboard_text(Bit8u **bytes, Bit32s *nbytes); \
|
||||
virtual int set_clipboard_text(char *snapshot, Bit32u len); \
|
||||
virtual void mouse_enabled_changed_specific (bx_bool val); \
|
||||
virtual void exit(void); \
|
||||
/* end of DECLARE_GUI_VIRTUAL_METHODS */
|
||||
|
||||
#define DECLARE_GUI_NEW_VIRTUAL_METHODS() \
|
||||
virtual bx_svga_tileinfo_t *graphics_tile_info(bx_svga_tileinfo_t *info); \
|
||||
virtual Bit8u *graphics_tile_get(unsigned x, unsigned y, \
|
||||
unsigned *w, unsigned *h); \
|
||||
virtual void graphics_tile_update_in_place(unsigned x, unsigned y, \
|
||||
unsigned w, unsigned h);
|
||||
/* end of DECLARE_GUI_NEW_VIRTUAL_METHODS */
|
||||
|
||||
#define BX_HEADER_BAR_Y 32
|
||||
|
||||
#define BX_MAX_PIXMAPS 17
|
||||
#define BX_MAX_HEADERBAR_ENTRIES 13
|
||||
|
||||
// align pixmaps towards left or right side of header bar
|
||||
#define BX_GRAVITY_LEFT 10
|
||||
#define BX_GRAVITY_RIGHT 11
|
||||
|
||||
#define BX_KEY_PRESSED 0x00000000
|
||||
#define BX_KEY_RELEASED 0x80000000
|
||||
|
||||
#define BX_KEY_UNHANDLED 0x10000000
|
||||
|
||||
#define BX_KEY_CTRL_L 0
|
||||
#define BX_KEY_SHIFT_L 1
|
||||
|
||||
#define BX_KEY_F1 2
|
||||
#define BX_KEY_F2 3
|
||||
#define BX_KEY_F3 4
|
||||
#define BX_KEY_F4 5
|
||||
#define BX_KEY_F5 6
|
||||
#define BX_KEY_F6 7
|
||||
#define BX_KEY_F7 8
|
||||
#define BX_KEY_F8 9
|
||||
#define BX_KEY_F9 10
|
||||
#define BX_KEY_F10 11
|
||||
#define BX_KEY_F11 12
|
||||
#define BX_KEY_F12 13
|
||||
|
||||
#define BX_KEY_CTRL_R 14
|
||||
#define BX_KEY_SHIFT_R 15
|
||||
#define BX_KEY_CAPS_LOCK 16
|
||||
#define BX_KEY_NUM_LOCK 17
|
||||
#define BX_KEY_ALT_L 18
|
||||
#define BX_KEY_ALT_R 19
|
||||
|
||||
#define BX_KEY_A 20
|
||||
#define BX_KEY_B 21
|
||||
#define BX_KEY_C 22
|
||||
#define BX_KEY_D 23
|
||||
#define BX_KEY_E 24
|
||||
#define BX_KEY_F 25
|
||||
#define BX_KEY_G 26
|
||||
#define BX_KEY_H 27
|
||||
#define BX_KEY_I 28
|
||||
#define BX_KEY_J 29
|
||||
#define BX_KEY_K 30
|
||||
#define BX_KEY_L 31
|
||||
#define BX_KEY_M 32
|
||||
#define BX_KEY_N 33
|
||||
#define BX_KEY_O 34
|
||||
#define BX_KEY_P 35
|
||||
#define BX_KEY_Q 36
|
||||
#define BX_KEY_R 37
|
||||
#define BX_KEY_S 38
|
||||
#define BX_KEY_T 39
|
||||
#define BX_KEY_U 40
|
||||
#define BX_KEY_V 41
|
||||
#define BX_KEY_W 42
|
||||
#define BX_KEY_X 43
|
||||
#define BX_KEY_Y 44
|
||||
#define BX_KEY_Z 45
|
||||
|
||||
#define BX_KEY_0 46
|
||||
#define BX_KEY_1 47
|
||||
#define BX_KEY_2 48
|
||||
#define BX_KEY_3 49
|
||||
#define BX_KEY_4 50
|
||||
#define BX_KEY_5 51
|
||||
#define BX_KEY_6 52
|
||||
#define BX_KEY_7 53
|
||||
#define BX_KEY_8 54
|
||||
#define BX_KEY_9 55
|
||||
|
||||
#define BX_KEY_ESC 56
|
||||
|
||||
#define BX_KEY_SPACE 57
|
||||
#define BX_KEY_SINGLE_QUOTE 58
|
||||
#define BX_KEY_COMMA 59
|
||||
#define BX_KEY_PERIOD 60
|
||||
#define BX_KEY_SLASH 61
|
||||
|
||||
#define BX_KEY_SEMICOLON 62
|
||||
#define BX_KEY_EQUALS 63
|
||||
|
||||
#define BX_KEY_LEFT_BRACKET 64
|
||||
#define BX_KEY_BACKSLASH 65
|
||||
#define BX_KEY_RIGHT_BRACKET 66
|
||||
#define BX_KEY_MINUS 67
|
||||
#define BX_KEY_GRAVE 68
|
||||
|
||||
#define BX_KEY_BACKSPACE 69
|
||||
#define BX_KEY_ENTER 70
|
||||
#define BX_KEY_TAB 71
|
||||
|
||||
#define BX_KEY_LEFT_BACKSLASH 72
|
||||
#define BX_KEY_PRINT 73
|
||||
#define BX_KEY_SCRL_LOCK 74
|
||||
#define BX_KEY_PAUSE 75
|
||||
|
||||
#define BX_KEY_INSERT 76
|
||||
#define BX_KEY_DELETE 77
|
||||
#define BX_KEY_HOME 78
|
||||
#define BX_KEY_END 79
|
||||
#define BX_KEY_PAGE_UP 80
|
||||
#define BX_KEY_PAGE_DOWN 81
|
||||
|
||||
#define BX_KEY_KP_ADD 82
|
||||
#define BX_KEY_KP_SUBTRACT 83
|
||||
#define BX_KEY_KP_END 84
|
||||
#define BX_KEY_KP_DOWN 85
|
||||
#define BX_KEY_KP_PAGE_DOWN 86
|
||||
#define BX_KEY_KP_LEFT 87
|
||||
#define BX_KEY_KP_RIGHT 88
|
||||
#define BX_KEY_KP_HOME 89
|
||||
#define BX_KEY_KP_UP 90
|
||||
#define BX_KEY_KP_PAGE_UP 91
|
||||
#define BX_KEY_KP_INSERT 92
|
||||
#define BX_KEY_KP_DELETE 93
|
||||
#define BX_KEY_KP_5 94
|
||||
|
||||
#define BX_KEY_UP 95
|
||||
#define BX_KEY_DOWN 96
|
||||
#define BX_KEY_LEFT 97
|
||||
#define BX_KEY_RIGHT 98
|
||||
|
||||
#define BX_KEY_KP_ENTER 99
|
||||
#define BX_KEY_KP_MULTIPLY 100
|
||||
#define BX_KEY_KP_DIVIDE 101
|
||||
|
||||
#define BX_KEY_WIN_L 102
|
||||
#define BX_KEY_WIN_R 103
|
||||
#define BX_KEY_MENU 104
|
||||
|
||||
#define BX_KEY_ALT_SYSREQ 105
|
||||
#define BX_KEY_CTRL_BREAK 106
|
||||
|
||||
#define BX_KEY_INT_BACK 107
|
||||
#define BX_KEY_INT_FORWARD 108
|
||||
#define BX_KEY_INT_STOP 109
|
||||
#define BX_KEY_INT_MAIL 110
|
||||
#define BX_KEY_INT_SEARCH 111
|
||||
#define BX_KEY_INT_FAV 112
|
||||
#define BX_KEY_INT_HOME 113
|
||||
|
||||
#define BX_KEY_POWER_MYCOMP 114
|
||||
#define BX_KEY_POWER_CALC 115
|
||||
#define BX_KEY_POWER_SLEEP 116
|
||||
#define BX_KEY_POWER_POWER 117
|
||||
#define BX_KEY_POWER_WAKE 118
|
||||
|
||||
#define BX_KEY_NBKEYS 119
|
||||
// If you add BX_KEYs Please update
|
||||
// - BX_KEY_NBKEYS
|
||||
// - the scancodes table in the file iodev/scancodes.cc
|
||||
// - the bx_key_symbol table in the file gui/keymap.cc
|
||||
|
||||
|
||||
/////////////// GUI plugin support
|
||||
|
||||
// Define macro to supply gui plugin code. This macro is called once in GUI to
|
||||
// supply the plugin initialization methods. Since it is nearly identical for
|
||||
// each gui module, the macro is easier to maintain than pasting the same code
|
||||
// in each one.
|
||||
//
|
||||
// Each gui should declare a class pointer called "theGui" which is derived
|
||||
// from bx_gui_c, before calling this macro. For example, the SDL port
|
||||
// says:
|
||||
// static bx_sdl_gui_c *theGui;
|
||||
|
||||
#define IMPLEMENT_GUI_PLUGIN_CODE(gui_name) \
|
||||
int lib##gui_name##_LTX_plugin_init(plugin_t *plugin, \
|
||||
plugintype_t type, int argc, char *argv[]) { \
|
||||
genlog->info("installing %s module as the Bochs GUI", #gui_name); \
|
||||
theGui = new bx_##gui_name##_gui_c (); \
|
||||
bx_gui = theGui; \
|
||||
return(0); /* Success */ \
|
||||
} \
|
||||
void lib##gui_name##_LTX_plugin_fini(void) { }
|
||||
36
simulators/bochs/gui/icon_bochs.h
Normal file
36
simulators/bochs/gui/icon_bochs.h
Normal file
@ -0,0 +1,36 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001-2009 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 bochs_icon_width 32
|
||||
#define bochs_icon_height 32
|
||||
|
||||
static unsigned char bochs_icon_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x00,
|
||||
0xe0, 0xff, 0xff, 0x07, 0xf8, 0xff, 0xff, 0x1f, 0xf8, 0xff, 0xff, 0x1f,
|
||||
0xfc, 0xc7, 0xe3, 0x3f, 0xfc, 0xc7, 0xe3, 0x3f, 0xfc, 0xc3, 0xc3, 0x3f,
|
||||
0xfc, 0xc3, 0xc3, 0x3f, 0xf8, 0xc1, 0x83, 0x1f, 0xf0, 0xc0, 0x03, 0x0f,
|
||||
0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00,
|
||||
0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00,
|
||||
0x00, 0xc0, 0x03, 0x00, 0x00, 0xc0, 0x03, 0x00, 0xf0, 0xc0, 0x03, 0x0f,
|
||||
0xf8, 0xc1, 0x83, 0x1f, 0xfc, 0xc3, 0xc3, 0x3f, 0xfc, 0xc3, 0xc3, 0x3f,
|
||||
0xfc, 0xc7, 0xe3, 0x3f, 0xfc, 0xc7, 0xe3, 0x3f, 0xf8, 0xff, 0xff, 0x1f,
|
||||
0xf8, 0xff, 0xff, 0x1f, 0xe0, 0xff, 0xff, 0x07, 0x00, 0xff, 0xff, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
|
||||
45
simulators/bochs/gui/icon_bochs.xpm
Normal file
45
simulators/bochs/gui/icon_bochs.xpm
Normal file
@ -0,0 +1,45 @@
|
||||
/* XPM */
|
||||
static const char *icon_bochs_xpm[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"32 32 7 1",
|
||||
" c black",
|
||||
". c #800000",
|
||||
"X c #808000",
|
||||
"o c yellow",
|
||||
"O c #808080",
|
||||
"+ c #c0c0c0",
|
||||
"@ c None",
|
||||
/* pixels */
|
||||
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
|
||||
"@@@@@@@@@@. +@@@+ +@@@@@@@@@",
|
||||
"@@@@@@@@ Oo @+ .@@@@@@@@",
|
||||
"@@@@@@ ooooo ooo. @@@@@@@",
|
||||
"@@@@ oooooo. oooooX @@@@@",
|
||||
"@+ XoooooO XX ooooooo O@@@",
|
||||
"+ oooooO XXXX X ooooooo @@",
|
||||
"@ ooo XXXXXX XX ooooooX ",
|
||||
"@@. XXXXXXXX XXX Xooooo. ",
|
||||
"@@@@ OXXXXXXXXX XXXXXO oO .@",
|
||||
"@@@@ .XXXXXXX XXXXXXX. @@@",
|
||||
"@+ oo XXXX XXXXXXXX @@@",
|
||||
"@ ooooo XXXXXX O",
|
||||
"@@O oooooo OXXXX. XX Oooo ",
|
||||
"@@@@ .ooooo. XXXXX oooo O@",
|
||||
"@@@@ Oooooo XX. .ooo @@@",
|
||||
"@@@@ XX oooooo .oooo. @@@@",
|
||||
"@@@@ ooXX . ooO o @@@@",
|
||||
"@@@@ oooXX. .Xo XX XXo @@@@",
|
||||
"@@@@ ooooXXXXXXXo XXXX.XXoo @@@@",
|
||||
"@@@+ oooooooooooo XooXXXooo @@@@",
|
||||
"@@@. oooooooooooo Xooooooo @@@@",
|
||||
"@@@+ oooooooooo XoooooX .@@@@@",
|
||||
"@@@@@O XoooooooX ooooo +@@@@@@",
|
||||
"@@@@@@@ ooooooX oooX @@@@@@@@",
|
||||
"@@@@@@@@@ ooooX oo @@@@@@@@@",
|
||||
"@@@@@@@@@@. Ooo. O@@@@@@@@@@",
|
||||
"@@@@@@@@@@@@ @@@@@@@@@@@@",
|
||||
"@@@@@@@@@@@@@@O O@@@@@@@@@@@@@",
|
||||
"@@@@@@@@@@@@@@@@+@@@@@@@@@@@@@@@",
|
||||
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@",
|
||||
"@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"
|
||||
};
|
||||
313
simulators/bochs/gui/keymap.cc
Normal file
313
simulators/bochs/gui/keymap.cc
Normal file
@ -0,0 +1,313 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002-2009 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
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Todo
|
||||
// . Currently supported by sdl, wxGTK and x11. Check if other guis need mapping.
|
||||
// . Tables look-up should be optimised.
|
||||
//
|
||||
|
||||
#include "param_names.h"
|
||||
#include "bochs.h"
|
||||
#include "keymap.h"
|
||||
|
||||
// Table of bochs "BX_KEY_*" symbols
|
||||
// the table must be in BX_KEY_* order
|
||||
const char *bx_key_symbol[BX_KEY_NBKEYS] = {
|
||||
"BX_KEY_CTRL_L", "BX_KEY_SHIFT_L", "BX_KEY_F1",
|
||||
"BX_KEY_F2", "BX_KEY_F3", "BX_KEY_F4",
|
||||
"BX_KEY_F5", "BX_KEY_F6", "BX_KEY_F7",
|
||||
"BX_KEY_F8", "BX_KEY_F9", "BX_KEY_F10",
|
||||
"BX_KEY_F11", "BX_KEY_F12", "BX_KEY_CTRL_R",
|
||||
"BX_KEY_SHIFT_R", "BX_KEY_CAPS_LOCK", "BX_KEY_NUM_LOCK",
|
||||
"BX_KEY_ALT_L", "BX_KEY_ALT_R", "BX_KEY_A",
|
||||
"BX_KEY_B", "BX_KEY_C", "BX_KEY_D",
|
||||
"BX_KEY_E", "BX_KEY_F", "BX_KEY_G",
|
||||
"BX_KEY_H", "BX_KEY_I", "BX_KEY_J",
|
||||
"BX_KEY_K", "BX_KEY_L", "BX_KEY_M",
|
||||
"BX_KEY_N", "BX_KEY_O", "BX_KEY_P",
|
||||
"BX_KEY_Q", "BX_KEY_R", "BX_KEY_S",
|
||||
"BX_KEY_T", "BX_KEY_U", "BX_KEY_V",
|
||||
"BX_KEY_W", "BX_KEY_X", "BX_KEY_Y",
|
||||
"BX_KEY_Z", "BX_KEY_0", "BX_KEY_1",
|
||||
"BX_KEY_2", "BX_KEY_3", "BX_KEY_4",
|
||||
"BX_KEY_5", "BX_KEY_6", "BX_KEY_7",
|
||||
"BX_KEY_8", "BX_KEY_9", "BX_KEY_ESC",
|
||||
"BX_KEY_SPACE", "BX_KEY_SINGLE_QUOTE", "BX_KEY_COMMA",
|
||||
"BX_KEY_PERIOD", "BX_KEY_SLASH", "BX_KEY_SEMICOLON",
|
||||
"BX_KEY_EQUALS", "BX_KEY_LEFT_BRACKET", "BX_KEY_BACKSLASH",
|
||||
"BX_KEY_RIGHT_BRACKET", "BX_KEY_MINUS", "BX_KEY_GRAVE",
|
||||
"BX_KEY_BACKSPACE", "BX_KEY_ENTER", "BX_KEY_TAB",
|
||||
"BX_KEY_LEFT_BACKSLASH", "BX_KEY_PRINT", "BX_KEY_SCRL_LOCK",
|
||||
"BX_KEY_PAUSE", "BX_KEY_INSERT", "BX_KEY_DELETE",
|
||||
"BX_KEY_HOME", "BX_KEY_END", "BX_KEY_PAGE_UP",
|
||||
"BX_KEY_PAGE_DOWN", "BX_KEY_KP_ADD", "BX_KEY_KP_SUBTRACT",
|
||||
"BX_KEY_KP_END", "BX_KEY_KP_DOWN", "BX_KEY_KP_PAGE_DOWN",
|
||||
"BX_KEY_KP_LEFT", "BX_KEY_KP_RIGHT", "BX_KEY_KP_HOME",
|
||||
"BX_KEY_KP_UP", "BX_KEY_KP_PAGE_UP", "BX_KEY_KP_INSERT",
|
||||
"BX_KEY_KP_DELETE", "BX_KEY_KP_5", "BX_KEY_UP",
|
||||
"BX_KEY_DOWN", "BX_KEY_LEFT", "BX_KEY_RIGHT",
|
||||
"BX_KEY_KP_ENTER", "BX_KEY_KP_MULTIPLY", "BX_KEY_KP_DIVIDE",
|
||||
"BX_KEY_WIN_L", "BX_KEY_WIN_R", "BX_KEY_MENU",
|
||||
"BX_KEY_ALT_SYSREQ", "BX_KEY_CTRL_BREAK", "BX_KEY_INT_BACK",
|
||||
"BX_KEY_INT_FORWARD", "BX_KEY_INT_STOP", "BX_KEY_INT_MAIL",
|
||||
"BX_KEY_INT_SEARCH", "BX_KEY_INT_FAV", "BX_KEY_INT_HOME",
|
||||
"BX_KEY_POWER_MYCOMP", "BX_KEY_POWER_CALC", "BX_KEY_POWER_SLEEP",
|
||||
"BX_KEY_POWER_POWER", "BX_KEY_POWER_WAKE",
|
||||
};
|
||||
|
||||
bx_keymap_c bx_keymap;
|
||||
|
||||
#define LOG_THIS bx_keymap.
|
||||
|
||||
bx_keymap_c::bx_keymap_c(void)
|
||||
{
|
||||
put("KMAP");
|
||||
|
||||
keymapCount = 0;
|
||||
keymapTable = (BXKeyEntry *)NULL;
|
||||
}
|
||||
|
||||
bx_keymap_c::~bx_keymap_c(void)
|
||||
{
|
||||
if(keymapTable != NULL) {
|
||||
free(keymapTable);
|
||||
keymapTable = (BXKeyEntry *)NULL;
|
||||
}
|
||||
keymapCount = 0;
|
||||
}
|
||||
|
||||
void bx_keymap_c::loadKeymap(Bit32u stringToSymbol(const char*))
|
||||
{
|
||||
if (SIM->get_param_bool(BXPN_KBD_USEMAPPING)->get()) {
|
||||
loadKeymap(stringToSymbol, SIM->get_param_string(BXPN_KBD_KEYMAP)->getptr());
|
||||
}
|
||||
}
|
||||
|
||||
bx_bool bx_keymap_c::isKeymapLoaded ()
|
||||
{
|
||||
return (keymapCount > 0);
|
||||
}
|
||||
|
||||
|
||||
///////////////////
|
||||
// I'll add these to the keymap object in a minute.
|
||||
static unsigned char *lineptr = NULL;
|
||||
static int lineCount;
|
||||
|
||||
static void init_parse()
|
||||
{
|
||||
lineCount = 0;
|
||||
}
|
||||
|
||||
static void init_parse_line(char *line_to_parse)
|
||||
{
|
||||
// chop off newline
|
||||
lineptr = (unsigned char *)line_to_parse;
|
||||
char *nl;
|
||||
if ((nl = strchr(line_to_parse,'\n')) != NULL) {
|
||||
*nl = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static Bit32s get_next_word(char *output)
|
||||
{
|
||||
char *copyp = output;
|
||||
// find first nonspace
|
||||
while (*lineptr && isspace(*lineptr))
|
||||
lineptr++;
|
||||
if (!*lineptr)
|
||||
return -1; // nothing but spaces until end of line
|
||||
if (*lineptr == '#')
|
||||
return -1; // nothing but a comment
|
||||
// copy nonspaces into the output
|
||||
while (*lineptr && !isspace(*lineptr))
|
||||
*copyp++ = *lineptr++;
|
||||
*copyp=0; // null terminate the copy
|
||||
// there must be at least one nonspace, since that's why we stopped the
|
||||
// first loop!
|
||||
BX_ASSERT (copyp != output);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static Bit32s get_next_keymap_line (FILE *fp, char *bxsym, char *modsym, Bit32s *ascii, char *hostsym)
|
||||
{
|
||||
char line[256];
|
||||
char buf[256];
|
||||
line[0] = 0;
|
||||
while (1) {
|
||||
lineCount++;
|
||||
if (!fgets(line, sizeof(line)-1, fp)) return -1; // EOF
|
||||
init_parse_line (line);
|
||||
if (get_next_word (bxsym) >= 0) {
|
||||
modsym[0] = 0;
|
||||
char *p;
|
||||
if ((p = strchr (bxsym, '+')) != NULL) {
|
||||
*p = 0; // truncate bxsym.
|
||||
p++; // move one char beyond the +
|
||||
strcpy (modsym, p); // copy the rest to modsym
|
||||
}
|
||||
if (get_next_word (buf) < 0) {
|
||||
BX_PANIC (("keymap line %d: expected 3 columns", lineCount));
|
||||
return -1;
|
||||
}
|
||||
if (buf[0] == '\'' && buf[2] == '\'' && buf[3]==0) {
|
||||
*ascii = (Bit8u) buf[1];
|
||||
} else if (!strcmp(buf, "space")) {
|
||||
*ascii = ' ';
|
||||
} else if (!strcmp(buf, "return")) {
|
||||
*ascii = '\n';
|
||||
} else if (!strcmp(buf, "tab")) {
|
||||
*ascii = '\t';
|
||||
} else if (!strcmp(buf, "backslash")) {
|
||||
*ascii = '\\';
|
||||
} else if (!strcmp(buf, "apostrophe")) {
|
||||
*ascii = '\'';
|
||||
} else if (!strcmp(buf, "none")) {
|
||||
*ascii = -1;
|
||||
} else {
|
||||
BX_PANIC (("keymap line %d: ascii equivalent is \"%s\" but it must be char constant like 'x', or one of space,tab,return,none", lineCount, buf));
|
||||
}
|
||||
if (get_next_word (hostsym) < 0) {
|
||||
BX_PANIC (("keymap line %d: expected 3 columns", lineCount));
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
// no words on this line, keep reading.
|
||||
}
|
||||
}
|
||||
|
||||
void bx_keymap_c::loadKeymap(Bit32u stringToSymbol(const char*), const char* filename)
|
||||
{
|
||||
FILE *keymapFile;
|
||||
char baseSym[256], modSym[256], hostSym[256];
|
||||
Bit32s ascii = 0;
|
||||
Bit32u baseKey, modKey, hostKey;
|
||||
struct stat status;
|
||||
|
||||
if (stat(filename, &status)) {
|
||||
BX_PANIC(("Can not stat keymap file '%s'.",filename));
|
||||
}
|
||||
|
||||
if (!(S_ISREG(status.st_mode))) {
|
||||
BX_PANIC(("Keymap file '%s' is not a file",filename));
|
||||
}
|
||||
|
||||
if((keymapFile = fopen(filename,"r"))==NULL) {
|
||||
BX_PANIC(("Can not open keymap file '%s'.",filename));
|
||||
}
|
||||
|
||||
BX_INFO(("Loading keymap from '%s'",filename));
|
||||
init_parse();
|
||||
|
||||
// Read keymap file one line at a time
|
||||
while(1) {
|
||||
if (get_next_keymap_line (keymapFile,
|
||||
baseSym, modSym, &ascii, hostSym) < 0) { break; }
|
||||
|
||||
// convert X_KEY_* symbols to values
|
||||
baseKey = convertStringToBXKey(baseSym);
|
||||
modKey = convertStringToBXKey(modSym);
|
||||
hostKey = 0;
|
||||
if (stringToSymbol != NULL)
|
||||
hostKey = stringToSymbol(hostSym);
|
||||
|
||||
BX_DEBUG(("baseKey='%s' (%d), modSym='%s' (%d), ascii=%d, guisym='%s' (%d)", baseSym, baseKey, modSym, modKey, ascii, hostSym, hostKey));
|
||||
|
||||
// Check if data is valid
|
||||
if (baseKey==BX_KEYMAP_UNKNOWN) {
|
||||
BX_PANIC (("line %d: unknown BX_KEY constant '%s'",lineCount,baseSym));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hostKey==BX_KEYMAP_UNKNOWN) {
|
||||
BX_PANIC (("line %d: unknown host key name '%s' (wrong keymap ?)",lineCount,hostSym));
|
||||
continue;
|
||||
}
|
||||
|
||||
keymapTable=(BXKeyEntry*)realloc(keymapTable,(keymapCount+1) * sizeof(BXKeyEntry));
|
||||
|
||||
if (keymapTable==NULL)
|
||||
BX_PANIC(("Can not allocate memory for keymap table."));
|
||||
|
||||
keymapTable[keymapCount].baseKey=baseKey;
|
||||
keymapTable[keymapCount].modKey=modKey;
|
||||
keymapTable[keymapCount].ascii=ascii;
|
||||
keymapTable[keymapCount].hostKey=hostKey;
|
||||
|
||||
keymapCount++;
|
||||
}
|
||||
|
||||
BX_INFO(("Loaded %d symbols",keymapCount));
|
||||
|
||||
fclose(keymapFile);
|
||||
}
|
||||
|
||||
Bit32u bx_keymap_c::convertStringToBXKey(const char* string)
|
||||
{
|
||||
// We look through the bx_key_symbol table to find the searched string
|
||||
for (Bit16u i=0; i<BX_KEY_NBKEYS; i++) {
|
||||
if (strcmp(string,bx_key_symbol[i])==0) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
// Key is not known
|
||||
return BX_KEYMAP_UNKNOWN;
|
||||
}
|
||||
|
||||
BXKeyEntry *bx_keymap_c::findHostKey(Bit32u key)
|
||||
{
|
||||
// We look through the keymap table to find the searched key
|
||||
for (Bit16u i=0; i<keymapCount; i++) {
|
||||
if (keymapTable[i].hostKey == key) {
|
||||
BX_DEBUG (("key 0x%02x matches hostKey for entry #%d", key, i));
|
||||
return &keymapTable[i];
|
||||
}
|
||||
}
|
||||
BX_DEBUG(("key %02x matches no entries", key));
|
||||
|
||||
// Return default
|
||||
return NULL;
|
||||
}
|
||||
|
||||
BXKeyEntry *bx_keymap_c::findAsciiChar(Bit8u ch)
|
||||
{
|
||||
BX_DEBUG (("findAsciiChar (0x%02x)", ch));
|
||||
|
||||
// We look through the keymap table to find the searched key
|
||||
for (Bit16u i=0; i<keymapCount; i++) {
|
||||
if (keymapTable[i].ascii == ch) {
|
||||
BX_DEBUG (("key %02x matches ascii for entry #%d", ch, i));
|
||||
return &keymapTable[i];
|
||||
}
|
||||
}
|
||||
BX_DEBUG (("key 0x%02x matches no entries", ch));
|
||||
|
||||
// Return default
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *bx_keymap_c::getBXKeyName(Bit32u key)
|
||||
{
|
||||
return bx_key_symbol[key & 0x7fffffff];
|
||||
}
|
||||
79
simulators/bochs/gui/keymap.h
Normal file
79
simulators/bochs/gui/keymap.h
Normal file
@ -0,0 +1,79 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002-2009 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
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Methods of bx_keymap_c :
|
||||
//
|
||||
// - loadKeymap(Bit32u convertStringToSymbol(const char*));
|
||||
// loads the configuration specified keymap file if keymapping is enabled
|
||||
// using convertStringToSymbol to convert strings to client constants
|
||||
//
|
||||
// - loadKeymap(Bit32u convertStringToSymbol(const char*), const char* filename);
|
||||
// loads the specified keymap file
|
||||
// using convertStringToSymbol to convert strings to client constants
|
||||
//
|
||||
// - isKeymapLoaded () returns true if the keymap contains any valid key
|
||||
// entries.
|
||||
//
|
||||
// - convertStringToBXKey
|
||||
// convert a null-terminate string to a BX_KEY code
|
||||
//
|
||||
// - findHostKey(Bit32u key)
|
||||
// - findAsciiChar(Bit8u ch)
|
||||
// Each of these methods returns a pointer to a BXKeyEntry structure
|
||||
// corresponding to a key. findHostKey() finds an entry whose hostKey
|
||||
// value matches the target value, and findAsciiChar() finds an entry
|
||||
// whose ASCII code matches the search value.
|
||||
|
||||
// In case of unknown symbol
|
||||
#define BX_KEYMAP_UNKNOWN 0xFFFFFFFF
|
||||
|
||||
// Structure of an element of the keymap table
|
||||
typedef struct BOCHSAPI {
|
||||
Bit32u baseKey; // base key
|
||||
Bit32u modKey; // modifier key that must be held down
|
||||
Bit32s ascii; // ascii equivalent, if any
|
||||
Bit32u hostKey; // value that the host's OS or library recognizes
|
||||
} BXKeyEntry;
|
||||
|
||||
class BOCHSAPI bx_keymap_c : public logfunctions {
|
||||
public:
|
||||
bx_keymap_c(void);
|
||||
~bx_keymap_c(void);
|
||||
|
||||
void loadKeymap(Bit32u(*)(const char*));
|
||||
void loadKeymap(Bit32u(*)(const char*),const char *filename);
|
||||
bx_bool isKeymapLoaded();
|
||||
|
||||
BXKeyEntry *findHostKey(Bit32u hostkeynum);
|
||||
BXKeyEntry *findAsciiChar(Bit8u ascii);
|
||||
const char *getBXKeyName(Bit32u key);
|
||||
|
||||
private:
|
||||
Bit32u convertStringToBXKey(const char *);
|
||||
|
||||
BXKeyEntry *keymapTable;
|
||||
Bit16u keymapCount;
|
||||
};
|
||||
|
||||
BOCHSAPI extern bx_keymap_c bx_keymap;
|
||||
14
simulators/bochs/gui/keymaps/convertmap.pl
Executable file
14
simulators/bochs/gui/keymaps/convertmap.pl
Executable file
@ -0,0 +1,14 @@
|
||||
#!/usr/bin/perl
|
||||
# little utility script that I used to convert key map files from
|
||||
# the pre-March 11 format to the post-March 11 format. It doesn't
|
||||
# do anything smart with the ascii equivalents and modifiers, so ATM those must
|
||||
# be added by hand.
|
||||
|
||||
while (<STDIN>)
|
||||
{
|
||||
chop;
|
||||
s/^ *//;
|
||||
if (/^#/ || /^ *$/) { print "$_\n"; next;}
|
||||
($key, $equals, $xksym) = split (/ +/);
|
||||
printf ("%-45s %-10s %s\n", $key, 'none', "XK_$xksym");
|
||||
}
|
||||
222
simulators/bochs/gui/keymaps/sdl-pc-de.map
Normal file
222
simulators/bochs/gui/keymaps/sdl-pc-de.map
Normal file
@ -0,0 +1,222 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, DE keymap, SDL gui on X11
|
||||
# Author: Volker Ruppert
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Host_key_name
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Host_key_name
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Host_key_name is the name of the key combination according to the gui library
|
||||
# (X windows, SDL, etc). Each GUI module must provide a function that converts
|
||||
# these host key names into numbers. A pointer to the conversion function is
|
||||
# passed to loadKeymap(), and it is used when parsing the keymap file. As the
|
||||
# keymap file is parsed, the conversion function is called for each host key
|
||||
# name, to convert it into a number. Only the number is stored. If the host
|
||||
# key name is not found, the conversion function returns BX_KEYMAP_UNKNOWN, and
|
||||
# the keymap code will panic, like this:
|
||||
#
|
||||
# [KMAP ] line 51: unknown host key name 'SDLK_PAREN_RIGHT'
|
||||
#
|
||||
# If this happens, you must edit the keymap file, and either correct the host
|
||||
# key name or comment out that line.
|
||||
#
|
||||
|
||||
BX_KEY_0 '0' SDLK_0
|
||||
BX_KEY_0+BX_KEY_SHIFT_L '=' SDLK_EQUALS
|
||||
BX_KEY_1 '1' SDLK_1
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '!' SDLK_EXCLAIM
|
||||
BX_KEY_2 '2' SDLK_2
|
||||
BX_KEY_2+BX_KEY_ALT_R '<27>' SDLK_2
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '"' SDLK_QUOTEDBL
|
||||
BX_KEY_3 '3' SDLK_3
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '<27>' SDLK_3
|
||||
BX_KEY_4 '4' SDLK_4
|
||||
BX_KEY_4+BX_KEY_SHIFT_L '$' SDLK_DOLLAR
|
||||
BX_KEY_4+BX_KEY_ALT_R '<27>' SDLK_4
|
||||
BX_KEY_5 '5' SDLK_5
|
||||
BX_KEY_5+BX_KEY_ALT_R '<27>' SDLK_5
|
||||
BX_KEY_5+BX_KEY_SHIFT_L '%' SDLK_5
|
||||
BX_KEY_6 '6' SDLK_6
|
||||
BX_KEY_6+BX_KEY_SHIFT_L '&' SDLK_AMPERSAND
|
||||
BX_KEY_7 '7' SDLK_7
|
||||
BX_KEY_7+BX_KEY_ALT_R '{' SDLK_7
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '/' SDLK_SLASH
|
||||
BX_KEY_8 '8' SDLK_8
|
||||
BX_KEY_8+BX_KEY_ALT_R '[' SDLK_LEFTBRACKET
|
||||
BX_KEY_8+BX_KEY_SHIFT_L '(' SDLK_LEFTPAREN
|
||||
BX_KEY_9 '9' SDLK_9
|
||||
BX_KEY_9+BX_KEY_ALT_R ']' SDLK_RIGHTBRACKET
|
||||
BX_KEY_9+BX_KEY_SHIFT_L ')' SDLK_RIGHTPAREN
|
||||
BX_KEY_A+BX_KEY_SHIFT_L 'A' SDLK_a
|
||||
BX_KEY_A 'a' SDLK_a
|
||||
BX_KEY_A+BX_KEY_ALT_R '<27>' SDLK_a
|
||||
BX_KEY_B+BX_KEY_SHIFT_L 'B' SDLK_b
|
||||
BX_KEY_B 'b' SDLK_b
|
||||
BX_KEY_C+BX_KEY_SHIFT_L 'C' SDLK_c
|
||||
BX_KEY_C 'c' SDLK_c
|
||||
BX_KEY_C+BX_KEY_ALT_R '<27>' SDLK_c
|
||||
BX_KEY_D+BX_KEY_SHIFT_L 'D' SDLK_d
|
||||
BX_KEY_D 'd' SDLK_d
|
||||
BX_KEY_E+BX_KEY_SHIFT_L 'E' SDLK_e
|
||||
BX_KEY_E+BX_KEY_ALT_R none SDLK_EURO
|
||||
BX_KEY_E 'e' SDLK_e
|
||||
BX_KEY_F+BX_KEY_SHIFT_L 'F' SDLK_f
|
||||
BX_KEY_F 'f' SDLK_f
|
||||
BX_KEY_G+BX_KEY_SHIFT_L 'G' SDLK_g
|
||||
BX_KEY_G 'g' SDLK_g
|
||||
BX_KEY_H+BX_KEY_SHIFT_L 'H' SDLK_h
|
||||
BX_KEY_H 'h' SDLK_h
|
||||
BX_KEY_I+BX_KEY_SHIFT_L 'I' SDLK_i
|
||||
BX_KEY_I 'i' SDLK_i
|
||||
BX_KEY_J+BX_KEY_SHIFT_L 'J' SDLK_j
|
||||
BX_KEY_J 'j' SDLK_j
|
||||
BX_KEY_K+BX_KEY_SHIFT_L 'K' SDLK_k
|
||||
BX_KEY_K 'k' SDLK_k
|
||||
BX_KEY_L+BX_KEY_SHIFT_L 'L' SDLK_l
|
||||
BX_KEY_L 'l' SDLK_l
|
||||
BX_KEY_M+BX_KEY_SHIFT_L 'M' SDLK_m
|
||||
BX_KEY_M 'm' SDLK_m
|
||||
BX_KEY_M+BX_KEY_ALT_R '<27>' SDLK_m
|
||||
BX_KEY_N+BX_KEY_SHIFT_L 'N' SDLK_n
|
||||
BX_KEY_N 'n' SDLK_n
|
||||
BX_KEY_O+BX_KEY_SHIFT_L 'O' SDLK_o
|
||||
BX_KEY_O 'o' SDLK_o
|
||||
BX_KEY_O+BX_KEY_ALT_R '<27>' SDLK_o
|
||||
BX_KEY_P+BX_KEY_SHIFT_L 'P' SDLK_p
|
||||
BX_KEY_P 'p' SDLK_p
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L 'Q' SDLK_q
|
||||
BX_KEY_Q+BX_KEY_ALT_R '@' SDLK_AT
|
||||
BX_KEY_Q 'q' SDLK_q
|
||||
BX_KEY_R+BX_KEY_SHIFT_L 'R' SDLK_r
|
||||
BX_KEY_R+BX_KEY_ALT_R '<27>' SDLK_r
|
||||
BX_KEY_R 'r' SDLK_r
|
||||
BX_KEY_S+BX_KEY_SHIFT_L 'S' SDLK_s
|
||||
BX_KEY_S 's' SDLK_s
|
||||
BX_KEY_T+BX_KEY_SHIFT_L 'T' SDLK_t
|
||||
BX_KEY_T 't' SDLK_t
|
||||
BX_KEY_U+BX_KEY_SHIFT_L 'U' SDLK_u
|
||||
BX_KEY_U 'u' SDLK_u
|
||||
BX_KEY_V+BX_KEY_SHIFT_L 'V' SDLK_v
|
||||
BX_KEY_V 'v' SDLK_v
|
||||
BX_KEY_W+BX_KEY_SHIFT_L 'W' SDLK_w
|
||||
BX_KEY_W 'w' SDLK_w
|
||||
BX_KEY_X+BX_KEY_SHIFT_L 'X' SDLK_x
|
||||
BX_KEY_X+BX_KEY_ALT_R '<27>' SDLK_x
|
||||
BX_KEY_X 'x' SDLK_x
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L 'Z' SDLK_z
|
||||
BX_KEY_Y 'z' SDLK_z
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L 'Y' SDLK_y
|
||||
BX_KEY_Z+BX_KEY_ALT_R '<27>' SDLK_y
|
||||
BX_KEY_Z 'y' SDLK_y
|
||||
BX_KEY_F1 none SDLK_F1
|
||||
BX_KEY_F2 none SDLK_F2
|
||||
BX_KEY_F3 none SDLK_F3
|
||||
BX_KEY_F4 none SDLK_F4
|
||||
BX_KEY_F5 none SDLK_F5
|
||||
BX_KEY_F6 none SDLK_F6
|
||||
BX_KEY_F7 none SDLK_F7
|
||||
BX_KEY_F8 none SDLK_F8
|
||||
BX_KEY_F9 none SDLK_F9
|
||||
BX_KEY_F10 none SDLK_F10
|
||||
BX_KEY_F11 none SDLK_F11
|
||||
BX_KEY_F12 none SDLK_F12
|
||||
BX_KEY_ALT_L none SDLK_LALT
|
||||
BX_KEY_ALT_L none SDLK_LMETA
|
||||
BX_KEY_ALT_R none SDLK_RALT
|
||||
BX_KEY_ALT_R none SDLK_MODE
|
||||
BX_KEY_BACKSLASH apostrophe SDLK_QUOTE
|
||||
BX_KEY_BACKSLASH '#' SDLK_HASH
|
||||
BX_KEY_BACKSPACE none SDLK_BACKSPACE
|
||||
BX_KEY_CAPS_LOCK none SDLK_CAPSLOCK
|
||||
BX_KEY_COMMA ',' SDLK_COMMA
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L ';' SDLK_SEMICOLON
|
||||
BX_KEY_CTRL_L none SDLK_LCTRL
|
||||
BX_KEY_CTRL_R none SDLK_RCTRL
|
||||
BX_KEY_DELETE none SDLK_DELETE
|
||||
BX_KEY_DOWN none SDLK_DOWN
|
||||
BX_KEY_END none SDLK_END
|
||||
BX_KEY_ENTER return SDLK_RETURN
|
||||
BX_KEY_EQUALS none SDLK_WORLD_20
|
||||
BX_KEY_EQUALS+BX_KEY_ALT_R '<27>' SDLK_WORLD_20
|
||||
BX_KEY_EQUALS+BX_KEY_SHIFT_L '`' SDLK_WORLD_20
|
||||
BX_KEY_ESC none SDLK_ESCAPE
|
||||
BX_KEY_GRAVE '^' SDLK_CARET
|
||||
BX_KEY_GRAVE+BX_KEY_SHIFT_L '<27>' SDLK_CARET
|
||||
BX_KEY_GRAVE+BX_KEY_ALT_R '<27>' SDLK_CARET
|
||||
BX_KEY_HOME none SDLK_HOME
|
||||
BX_KEY_INSERT none SDLK_INSERT
|
||||
BX_KEY_KP_5 none SDLK_KP5
|
||||
BX_KEY_KP_ADD none SDLK_KP_PLUS
|
||||
BX_KEY_KP_DELETE none SDLK_KP_PERIOD
|
||||
BX_KEY_KP_DIVIDE none SDLK_KP_DIVIDE
|
||||
BX_KEY_KP_DOWN none SDLK_KP2
|
||||
BX_KEY_KP_END none SDLK_KP1
|
||||
BX_KEY_KP_ENTER none SDLK_KP_ENTER
|
||||
BX_KEY_KP_HOME none SDLK_KP7
|
||||
BX_KEY_KP_INSERT none SDLK_KP0
|
||||
BX_KEY_KP_LEFT none SDLK_KP4
|
||||
BX_KEY_KP_MULTIPLY none SDLK_KP_MULTIPLY
|
||||
BX_KEY_KP_PAGE_DOWN none SDLK_KP3
|
||||
BX_KEY_KP_PAGE_UP none SDLK_KP9
|
||||
BX_KEY_KP_RIGHT none SDLK_KP6
|
||||
BX_KEY_KP_SUBTRACT none SDLK_KP_MINUS
|
||||
BX_KEY_KP_UP none SDLK_KP8
|
||||
BX_KEY_LEFT none SDLK_LEFT
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_ALT_R '|' SDLK_LESS
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' SDLK_GREATER
|
||||
BX_KEY_LEFT_BACKSLASH '<' SDLK_LESS
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '<27>' SDLK_WORLD_92
|
||||
BX_KEY_LEFT_BRACKET '<27>' SDLK_WORLD_92
|
||||
BX_KEY_MENU none SDLK_MENU
|
||||
BX_KEY_MINUS+BX_KEY_ALT_L backslash SDLK_BACKSLASH
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '?' SDLK_QUESTION
|
||||
BX_KEY_MINUS '<27>' SDLK_WORLD_63
|
||||
BX_KEY_NUM_LOCK none SDLK_NUMLOCK
|
||||
BX_KEY_PAGE_DOWN none SDLK_PAGEDOWN
|
||||
BX_KEY_PAGE_UP none SDLK_PAGEUP
|
||||
BX_KEY_PAUSE none SDLK_BREAK
|
||||
BX_KEY_PAUSE none SDLK_PAUSE
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' SDLK_COLON
|
||||
BX_KEY_PERIOD '.' SDLK_PERIOD
|
||||
BX_KEY_PERIOD+BX_KEY_ALT_L '<27>' SDLK_PERIOD
|
||||
BX_KEY_PRINT none SDLK_PRINT
|
||||
BX_KEY_PRINT none SDLK_SYSREQ
|
||||
BX_KEY_RIGHT none SDLK_RIGHT
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R '~' SDLK_PLUS
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '*' SDLK_PLUS
|
||||
BX_KEY_RIGHT_BRACKET '+' SDLK_PLUS
|
||||
BX_KEY_SCRL_LOCK none SDLK_SCROLLOCK
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '<27>' SDLK_WORLD_86
|
||||
BX_KEY_SEMICOLON '<27>' SDLK_WORLD_86
|
||||
BX_KEY_SHIFT_L none SDLK_LSHIFT
|
||||
BX_KEY_SHIFT_R none SDLK_RSHIFT
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '<27>' SDLK_WORLD_68
|
||||
BX_KEY_SINGLE_QUOTE '<27>' SDLK_WORLD_68
|
||||
BX_KEY_SLASH '-' SDLK_MINUS
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT_L '_' SDLK_UNDERSCORE
|
||||
BX_KEY_SPACE space SDLK_SPACE
|
||||
BX_KEY_TAB tab SDLK_TAB
|
||||
BX_KEY_UP none SDLK_UP
|
||||
BX_KEY_WIN_L none SDLK_LSUPER
|
||||
BX_KEY_WIN_R none SDLK_RSUPER
|
||||
211
simulators/bochs/gui/keymaps/sdl-pc-us.map
Normal file
211
simulators/bochs/gui/keymaps/sdl-pc-us.map
Normal file
@ -0,0 +1,211 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, US keymap, SDL gui
|
||||
# Author: Bryce Denney
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Host_key_name
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Host_key_name
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Host_key_name is the name of the key combination according to the gui library
|
||||
# (X windows, SDL, etc). Each GUI module must provide a function that converts
|
||||
# these host key names into numbers. A pointer to the conversion function is
|
||||
# passed to loadKeymap(), and it is used when parsing the keymap file. As the
|
||||
# keymap file is parsed, the conversion function is called for each host key
|
||||
# name, to convert it into a number. Only the number is stored. If the host
|
||||
# key name is not found, the conversion function returns BX_KEYMAP_UNKNOWN, and
|
||||
# the keymap code will panic, like this:
|
||||
#
|
||||
# [KMAP ] line 51: unknown host key name 'SDLK_PAREN_RIGHT'
|
||||
#
|
||||
# If this happens, you must edit the keymap file, and either correct the host
|
||||
# key name or comment out that line.
|
||||
#
|
||||
|
||||
BX_KEY_0 '0' SDLK_0
|
||||
BX_KEY_0+BX_KEY_SHIFT_L ')' SDLK_RIGHTPAREN
|
||||
BX_KEY_1 '1' SDLK_1
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '!' SDLK_EXCLAIM
|
||||
BX_KEY_2 '2' SDLK_2
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '@' SDLK_AT
|
||||
BX_KEY_3 '3' SDLK_3
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '#' SDLK_HASH
|
||||
BX_KEY_4 '4' SDLK_4
|
||||
BX_KEY_4+BX_KEY_SHIFT_L '$' SDLK_DOLLAR
|
||||
BX_KEY_5 '5' SDLK_5
|
||||
#BX_KEY_5+BX_KEY_SHIFT_L '%' SDLK_PERCENT
|
||||
BX_KEY_6 '6' SDLK_6
|
||||
BX_KEY_6+BX_KEY_SHIFT_L '^' SDLK_CARET
|
||||
BX_KEY_7 '7' SDLK_7
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '&' SDLK_AMPERSAND
|
||||
BX_KEY_8 '8' SDLK_8
|
||||
BX_KEY_8+BX_KEY_SHIFT_L '*' SDLK_ASTERISK
|
||||
BX_KEY_9 '9' SDLK_9
|
||||
BX_KEY_9+BX_KEY_SHIFT_L '(' SDLK_LEFTPAREN
|
||||
BX_KEY_A+BX_KEY_SHIFT_L 'A' SDLK_a
|
||||
BX_KEY_A 'a' SDLK_a
|
||||
BX_KEY_B+BX_KEY_SHIFT_L 'B' SDLK_b
|
||||
BX_KEY_B 'b' SDLK_b
|
||||
BX_KEY_C+BX_KEY_SHIFT_L 'C' SDLK_c
|
||||
BX_KEY_C 'c' SDLK_c
|
||||
BX_KEY_D+BX_KEY_SHIFT_L 'D' SDLK_d
|
||||
BX_KEY_D 'd' SDLK_d
|
||||
BX_KEY_E+BX_KEY_SHIFT_L 'E' SDLK_e
|
||||
BX_KEY_E 'e' SDLK_e
|
||||
BX_KEY_F+BX_KEY_SHIFT_L 'F' SDLK_f
|
||||
BX_KEY_F 'f' SDLK_f
|
||||
BX_KEY_G+BX_KEY_SHIFT_L 'G' SDLK_g
|
||||
BX_KEY_G 'g' SDLK_g
|
||||
BX_KEY_H+BX_KEY_SHIFT_L 'H' SDLK_h
|
||||
BX_KEY_H 'h' SDLK_h
|
||||
BX_KEY_I+BX_KEY_SHIFT_L 'I' SDLK_i
|
||||
BX_KEY_I 'i' SDLK_i
|
||||
BX_KEY_J+BX_KEY_SHIFT_L 'J' SDLK_j
|
||||
BX_KEY_J 'j' SDLK_j
|
||||
BX_KEY_K+BX_KEY_SHIFT_L 'K' SDLK_k
|
||||
BX_KEY_K 'k' SDLK_k
|
||||
BX_KEY_L+BX_KEY_SHIFT_L 'L' SDLK_l
|
||||
BX_KEY_L 'l' SDLK_l
|
||||
BX_KEY_M+BX_KEY_SHIFT_L 'M' SDLK_m
|
||||
BX_KEY_M 'm' SDLK_m
|
||||
BX_KEY_N+BX_KEY_SHIFT_L 'N' SDLK_n
|
||||
BX_KEY_N 'n' SDLK_n
|
||||
BX_KEY_O+BX_KEY_SHIFT_L 'O' SDLK_o
|
||||
BX_KEY_O 'o' SDLK_o
|
||||
BX_KEY_P+BX_KEY_SHIFT_L 'P' SDLK_p
|
||||
BX_KEY_P 'p' SDLK_p
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L 'Q' SDLK_q
|
||||
BX_KEY_Q 'q' SDLK_q
|
||||
BX_KEY_R+BX_KEY_SHIFT_L 'R' SDLK_r
|
||||
BX_KEY_R 'r' SDLK_r
|
||||
BX_KEY_S+BX_KEY_SHIFT_L 'S' SDLK_s
|
||||
BX_KEY_S 's' SDLK_s
|
||||
BX_KEY_T+BX_KEY_SHIFT_L 'T' SDLK_t
|
||||
BX_KEY_T 't' SDLK_t
|
||||
BX_KEY_U+BX_KEY_SHIFT_L 'U' SDLK_u
|
||||
BX_KEY_U 'u' SDLK_u
|
||||
BX_KEY_V+BX_KEY_SHIFT_L 'V' SDLK_v
|
||||
BX_KEY_V 'v' SDLK_v
|
||||
BX_KEY_W+BX_KEY_SHIFT_L 'W' SDLK_w
|
||||
BX_KEY_W 'w' SDLK_w
|
||||
BX_KEY_X+BX_KEY_SHIFT_L 'X' SDLK_x
|
||||
BX_KEY_X 'x' SDLK_x
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L 'Y' SDLK_y
|
||||
BX_KEY_Y 'y' SDLK_y
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L 'Z' SDLK_z
|
||||
BX_KEY_Z 'z' SDLK_z
|
||||
BX_KEY_F1 none SDLK_F1
|
||||
BX_KEY_F2 none SDLK_F2
|
||||
BX_KEY_F3 none SDLK_F3
|
||||
BX_KEY_F4 none SDLK_F4
|
||||
BX_KEY_F5 none SDLK_F5
|
||||
BX_KEY_F6 none SDLK_F6
|
||||
BX_KEY_F7 none SDLK_F7
|
||||
BX_KEY_F8 none SDLK_F8
|
||||
BX_KEY_F9 none SDLK_F9
|
||||
BX_KEY_F10 none SDLK_F10
|
||||
BX_KEY_F11 none SDLK_F11
|
||||
BX_KEY_F12 none SDLK_F12
|
||||
BX_KEY_ALT_L none SDLK_LALT
|
||||
BX_KEY_ALT_L none SDLK_LMETA
|
||||
BX_KEY_ALT_R none SDLK_MODE
|
||||
#BX_KEY_ALT_R none SDLK_Multi_key
|
||||
BX_KEY_BACKSLASH backslash SDLK_BACKSLASH
|
||||
#BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '|' SDLK_bar
|
||||
BX_KEY_BACKSPACE none SDLK_BACKSPACE
|
||||
BX_KEY_CAPS_LOCK none SDLK_CAPSLOCK
|
||||
BX_KEY_COMMA ',' SDLK_COMMA
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L '<' SDLK_LESS
|
||||
BX_KEY_CTRL_L none SDLK_LCTRL
|
||||
BX_KEY_CTRL_R none SDLK_RCTRL
|
||||
BX_KEY_DELETE none SDLK_DELETE
|
||||
BX_KEY_DOWN none SDLK_DOWN
|
||||
BX_KEY_END none SDLK_END
|
||||
BX_KEY_ENTER return SDLK_RETURN
|
||||
BX_KEY_EQUALS '=' SDLK_EQUALS
|
||||
BX_KEY_EQUALS+BX_KEY_SHIFT_L '+' SDLK_PLUS
|
||||
BX_KEY_ESC none SDLK_ESCAPE
|
||||
#BX_KEY_GRAVE+BX_KEY_SHIFT_L '~' SDLK_asciitilde
|
||||
BX_KEY_GRAVE '`' SDLK_BACKQUOTE
|
||||
BX_KEY_HOME none SDLK_HOME
|
||||
BX_KEY_INSERT none SDLK_INSERT
|
||||
BX_KEY_KP_5 none SDLK_KP5
|
||||
#BX_KEY_KP_5 none SDLK_KP_BEGIN
|
||||
BX_KEY_KP_ADD none SDLK_KP_PLUS
|
||||
BX_KEY_KP_DELETE none SDLK_KP_PERIOD
|
||||
#BX_KEY_KP_DELETE none SDLK_KP_DELETE
|
||||
BX_KEY_KP_DIVIDE none SDLK_KP_DIVIDE
|
||||
BX_KEY_KP_DOWN none SDLK_KP2
|
||||
#BX_KEY_KP_DOWN none SDLK_KP_DOWN
|
||||
BX_KEY_KP_END none SDLK_KP1
|
||||
#BX_KEY_KP_END none SDLK_KP_END
|
||||
BX_KEY_KP_ENTER none SDLK_KP_ENTER
|
||||
BX_KEY_KP_HOME none SDLK_KP7
|
||||
#BX_KEY_KP_HOME none SDLK_KP_HOME
|
||||
BX_KEY_KP_INSERT none SDLK_KP0
|
||||
#BX_KEY_KP_INSERT none SDLK_KP_INSERT
|
||||
BX_KEY_KP_LEFT none SDLK_KP4
|
||||
#BX_KEY_KP_LEFT none SDLK_KP_LEFT
|
||||
BX_KEY_KP_MULTIPLY none SDLK_KP_MULTIPLY
|
||||
BX_KEY_KP_PAGE_DOWN none SDLK_KP3
|
||||
#BX_KEY_KP_PAGE_DOWN none SDLK_KP_PAGE_DOWN
|
||||
BX_KEY_KP_PAGE_UP none SDLK_KP9
|
||||
#BX_KEY_KP_PAGE_UP none SDLK_KP_PAGE_UP
|
||||
BX_KEY_KP_RIGHT none SDLK_KP6
|
||||
#BX_KEY_KP_RIGHT none SDLK_KP_Right
|
||||
BX_KEY_KP_SUBTRACT none SDLK_KP_MINUS
|
||||
BX_KEY_KP_UP none SDLK_KP8
|
||||
#BX_KEY_KP_UP none SDLK_KP_Up
|
||||
BX_KEY_LEFT none SDLK_LEFT
|
||||
#BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '{' SDLK_BRACELEFT
|
||||
BX_KEY_LEFT_BRACKET '[' SDLK_LEFTBRACKET
|
||||
BX_KEY_MENU none SDLK_MENU
|
||||
BX_KEY_MINUS '-' SDLK_MINUS
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '_' SDLK_UNDERSCORE
|
||||
BX_KEY_NUM_LOCK none SDLK_NUMLOCK
|
||||
BX_KEY_PAGE_DOWN none SDLK_PAGEDOWN
|
||||
BX_KEY_PAGE_UP none SDLK_PAGEUP
|
||||
BX_KEY_PAUSE none SDLK_BREAK
|
||||
BX_KEY_PAUSE none SDLK_PAUSE
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L '>' SDLK_GREATER
|
||||
BX_KEY_PERIOD '.' SDLK_PERIOD
|
||||
BX_KEY_PRINT none SDLK_PRINT
|
||||
BX_KEY_PRINT none SDLK_SYSREQ
|
||||
BX_KEY_RIGHT none SDLK_RIGHT
|
||||
#BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '}' SDLK_BRACERIGHT
|
||||
BX_KEY_RIGHT_BRACKET ']' SDLK_RIGHTBRACKET
|
||||
BX_KEY_SCRL_LOCK none SDLK_SCROLLOCK
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L ':' SDLK_COLON
|
||||
BX_KEY_SEMICOLON ';' SDLK_SEMICOLON
|
||||
BX_KEY_SHIFT_L none SDLK_LSHIFT
|
||||
BX_KEY_SHIFT_R none SDLK_RSHIFT
|
||||
BX_KEY_SINGLE_QUOTE apostrophe SDLK_QUOTE
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '"' SDLK_QUOTEDBL
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT_L '?' SDLK_QUESTION
|
||||
BX_KEY_SLASH '/' SDLK_SLASH
|
||||
BX_KEY_SPACE space SDLK_SPACE
|
||||
#BX_KEY_TAB none SDLK_ISO_LEFT_TAB
|
||||
BX_KEY_TAB tab SDLK_TAB
|
||||
BX_KEY_UP none SDLK_UP
|
||||
BX_KEY_WIN_L none SDLK_LSUPER
|
||||
BX_KEY_WIN_R none SDLK_LSUPER
|
||||
220
simulators/bochs/gui/keymaps/x11-pc-be.map
Normal file
220
simulators/bochs/gui/keymaps/x11-pc-be.map
Normal file
@ -0,0 +1,220 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, BE keymap
|
||||
# Author: Wouter Verhelst,
|
||||
# based on FR keymap by Christophe Bothamy, Bryce Denney
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Xwin_Keysym is the X windows equivalent of the key combination. These
|
||||
# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h.
|
||||
# If you're running X windows, Bochs will take each of these Xwin_Keysyms,
|
||||
# pull off the XK_ in front, and use XStringToKeysym() to change them into
|
||||
# numerical codes. If this lookup fails, you will get a panic and you need
|
||||
# to edit the keymap file.
|
||||
|
||||
BX_KEY_0+BX_KEY_SHIFT_L '0' XK_0
|
||||
BX_KEY_0 '<27>' XK_agrave
|
||||
BX_KEY_0+BX_KEY_ALT_R '}' XK_braceright
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '1' XK_1
|
||||
BX_KEY_1 '&' XK_ampersand
|
||||
BX_KEY_1+BX_KEY_ALT_R '|' XK_bar
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '2' XK_2
|
||||
BX_KEY_2+BX_KEY_ALT_R '@' XK_at
|
||||
BX_KEY_2 '<27>' XK_eacute
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '3' XK_3
|
||||
BX_KEY_3+BX_KEY_ALT_R '#' XK_numbersign
|
||||
BX_KEY_3 '"' XK_quotedbl
|
||||
BX_KEY_4+BX_KEY_SHIFT_L '4' XK_4
|
||||
BX_KEY_4 apostrophe XK_apostrophe
|
||||
BX_KEY_5+BX_KEY_SHIFT_L '5' XK_5
|
||||
BX_KEY_5 '(' XK_parenleft
|
||||
BX_KEY_6+BX_KEY_SHIFT_L '6' XK_6
|
||||
BX_KEY_6+BX_KEY_ALT_R '^' XK_asciicircum
|
||||
BX_KEY_6 '<27>' XK_section
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '7' XK_7
|
||||
BX_KEY_7 '<27>' XK_egrave
|
||||
BX_KEY_8+BX_KEY_SHIFT_L '8' XK_8
|
||||
BX_KEY_8 '!' XK_exclam
|
||||
BX_KEY_9+BX_KEY_SHIFT_L '9' XK_9
|
||||
BX_KEY_9+BX_KEY_ALT_R '{' XK_braceleft
|
||||
BX_KEY_9 '<27>' XK_ccedilla
|
||||
BX_KEY_A+BX_KEY_SHIFT_L 'Q' XK_Q
|
||||
BX_KEY_A 'q' XK_q
|
||||
BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B
|
||||
BX_KEY_B 'b' XK_b
|
||||
BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C
|
||||
BX_KEY_C 'c' XK_c
|
||||
BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D
|
||||
BX_KEY_D 'd' XK_d
|
||||
BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E
|
||||
BX_KEY_E 'e' XK_e
|
||||
BX_KEY_E+BX_KEY_ALT_R none XK_EuroSign
|
||||
BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F
|
||||
BX_KEY_F 'f' XK_f
|
||||
BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G
|
||||
BX_KEY_G 'g' XK_g
|
||||
BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H
|
||||
BX_KEY_H 'h' XK_h
|
||||
BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I
|
||||
BX_KEY_I 'i' XK_i
|
||||
BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J
|
||||
BX_KEY_J 'j' XK_j
|
||||
BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K
|
||||
BX_KEY_K 'k' XK_k
|
||||
BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L
|
||||
BX_KEY_L 'l' XK_l
|
||||
BX_KEY_M+BX_KEY_SHIFT_L '?' XK_question
|
||||
BX_KEY_M ',' XK_comma
|
||||
BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N
|
||||
BX_KEY_N 'n' XK_n
|
||||
BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O
|
||||
BX_KEY_O 'o' XK_o
|
||||
BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P
|
||||
BX_KEY_P 'p' XK_p
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L 'A' XK_A
|
||||
BX_KEY_Q 'a' XK_a
|
||||
BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R
|
||||
BX_KEY_R 'r' XK_r
|
||||
BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S
|
||||
BX_KEY_S 's' XK_s
|
||||
BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T
|
||||
BX_KEY_T 't' XK_t
|
||||
BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U
|
||||
BX_KEY_U 'u' XK_u
|
||||
BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V
|
||||
BX_KEY_V 'v' XK_v
|
||||
BX_KEY_W+BX_KEY_SHIFT_L 'Z' XK_Z
|
||||
BX_KEY_W 'z' XK_z
|
||||
BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X
|
||||
BX_KEY_X 'x' XK_x
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y
|
||||
BX_KEY_Y 'y' XK_y
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L 'W' XK_W
|
||||
BX_KEY_Z 'w' XK_w
|
||||
BX_KEY_F1 none XK_F1
|
||||
BX_KEY_F2 none XK_F2
|
||||
BX_KEY_F3 none XK_F3
|
||||
BX_KEY_F4 none XK_F4
|
||||
BX_KEY_F5 none XK_F5
|
||||
BX_KEY_F6 none XK_F6
|
||||
BX_KEY_F7 none XK_F7
|
||||
BX_KEY_F8 none XK_F8
|
||||
BX_KEY_F9 none XK_F9
|
||||
BX_KEY_F10 none XK_F10
|
||||
BX_KEY_F11 none XK_F11
|
||||
BX_KEY_F12 none XK_F12
|
||||
BX_KEY_ALT_L none XK_Alt_L
|
||||
BX_KEY_ALT_L none XK_Meta_L
|
||||
BX_KEY_ALT_R none XK_Alt_R
|
||||
BX_KEY_ALT_R none XK_Mode_switch
|
||||
BX_KEY_ALT_R none XK_Multi_key
|
||||
BX_KEY_BACKSLASH '<27>' XK_mu
|
||||
BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '<27>' XK_sterling
|
||||
BX_KEY_BACKSLASH+BX_KEY_ALT_R '`' XK_dead_grave
|
||||
BX_KEY_BACKSPACE none XK_BackSpace
|
||||
BX_KEY_CAPS_LOCK none XK_Caps_Lock
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L '.' XK_period
|
||||
BX_KEY_COMMA ';' XK_semicolon
|
||||
BX_KEY_CTRL_L none XK_Control_L
|
||||
BX_KEY_CTRL_R none XK_Control_R
|
||||
BX_KEY_DELETE none XK_Delete
|
||||
BX_KEY_DOWN none XK_Down
|
||||
BX_KEY_END none XK_End
|
||||
BX_KEY_ENTER return XK_Return
|
||||
BX_KEY_EQUALS '-' XK_minus
|
||||
BX_KEY_EQUALS+BX_KEY_SHIFT_L '_' XK_underscore
|
||||
BX_KEY_ESC none XK_Escape
|
||||
BX_KEY_GRAVE '<27>' XK_twosuperior
|
||||
BX_KEY_GRAVE+BX_KEY_SHIFT_L '<27>' XK_threesuperior
|
||||
BX_KEY_HOME none XK_Home
|
||||
BX_KEY_INSERT none XK_Insert
|
||||
BX_KEY_KP_5 none XK_KP_5
|
||||
BX_KEY_KP_5 none XK_KP_Begin
|
||||
BX_KEY_KP_ADD none XK_KP_Add
|
||||
BX_KEY_KP_DELETE none XK_KP_Decimal
|
||||
BX_KEY_KP_DELETE none XK_KP_Delete
|
||||
BX_KEY_KP_DIVIDE none XK_KP_Divide
|
||||
BX_KEY_KP_DOWN none XK_KP_2
|
||||
BX_KEY_KP_DOWN none XK_KP_Down
|
||||
BX_KEY_KP_END none XK_KP_1
|
||||
BX_KEY_KP_END none XK_KP_End
|
||||
BX_KEY_KP_ENTER none XK_KP_Enter
|
||||
BX_KEY_KP_HOME none XK_KP_7
|
||||
BX_KEY_KP_HOME none XK_KP_Home
|
||||
BX_KEY_KP_INSERT none XK_KP_0
|
||||
BX_KEY_KP_INSERT none XK_KP_Insert
|
||||
BX_KEY_KP_LEFT none XK_KP_4
|
||||
BX_KEY_KP_LEFT none XK_KP_Left
|
||||
BX_KEY_KP_MULTIPLY none XK_KP_Multiply
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_3
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_9
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_Page_Up
|
||||
BX_KEY_KP_RIGHT none XK_KP_6
|
||||
BX_KEY_KP_RIGHT none XK_KP_Right
|
||||
BX_KEY_KP_SUBTRACT none XK_KP_Subtract
|
||||
BX_KEY_KP_UP none XK_KP_8
|
||||
BX_KEY_KP_UP none XK_KP_Up
|
||||
BX_KEY_LEFT none XK_Left
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater
|
||||
BX_KEY_LEFT_BACKSLASH '<' XK_less
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_ALT_R backslash XK_backslash
|
||||
BX_KEY_LEFT_BRACKET none XK_dead_circumflex
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L none XK_dead_diaeresis
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_ALT_R '[' XK_bracketleft
|
||||
BX_KEY_MENU none XK_Menu
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '<27>' XK_degree
|
||||
BX_KEY_MINUS ')' XK_parenright
|
||||
BX_KEY_NUM_LOCK none XK_Num_Lock
|
||||
BX_KEY_PAGE_DOWN none XK_Page_Down
|
||||
BX_KEY_PAGE_UP none XK_Page_Up
|
||||
BX_KEY_PAUSE none XK_Break
|
||||
BX_KEY_PAUSE none XK_Pause
|
||||
BX_KEY_PERIOD ':' XK_colon
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L '/' XK_slash
|
||||
BX_KEY_PRINT none XK_Print
|
||||
BX_KEY_PRINT none XK_Sys_Req
|
||||
BX_KEY_RIGHT none XK_Right
|
||||
BX_KEY_RIGHT_BRACKET '$' XK_dollar
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '*' XK_asterisk
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R ']' XK_bracketright
|
||||
BX_KEY_SCRL_LOCK none XK_Scroll_Lock
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L 'M' XK_M
|
||||
BX_KEY_SEMICOLON 'm' XK_m
|
||||
BX_KEY_SHIFT_L none XK_Shift_L
|
||||
BX_KEY_SHIFT_R none XK_Shift_R
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '%' XK_percent
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_ALT_R none XK_dead_acute
|
||||
BX_KEY_SINGLE_QUOTE '<27>' XK_ugrave
|
||||
BX_KEY_SLASH '=' XK_equal
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT_L '+' XK_plus
|
||||
BX_KEY_SLASH+BX_KEY_ALT_R none XK_dead_tilde
|
||||
BX_KEY_SPACE space XK_space
|
||||
BX_KEY_TAB none XK_ISO_Left_Tab
|
||||
BX_KEY_TAB tab XK_Tab
|
||||
BX_KEY_UP none XK_Up
|
||||
BX_KEY_WIN_L none XK_Super_L
|
||||
BX_KEY_WIN_R none XK_Super_R
|
||||
247
simulators/bochs/gui/keymaps/x11-pc-da.map
Normal file
247
simulators/bochs/gui/keymaps/x11-pc-da.map
Normal file
@ -0,0 +1,247 @@
|
||||
# Bochs Keymap file
|
||||
# $Id: x11-pc-da.map,v 0.9 2002/09/02
|
||||
# Target: PC(x86) keyboard, DA keymap
|
||||
# Author: Andreas Ott
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Xwin_Keysym is the X windows equivalent of the key combination. These
|
||||
# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h.
|
||||
# If you're running X windows, Bochs will take each of these Xwin_Keysyms,
|
||||
# pull off the XK_ in front, and use XStringToKeysym() to change them into
|
||||
# numerical codes. If this lookup fails, you will get a panic and you need
|
||||
# to edit the keymap file.
|
||||
|
||||
BX_KEY_0 '0' XK_0
|
||||
BX_KEY_0+BX_KEY_ALT_R '}' XK_braceright
|
||||
BX_KEY_0+BX_KEY_SHIFT_L '=' XK_equal
|
||||
BX_KEY_1 '1' XK_1
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam
|
||||
BX_KEY_1+BX_KEY_ALT_R '<27>' XK_exclamdown
|
||||
BX_KEY_2 '2' XK_2
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '=' XK_quotedbl
|
||||
BX_KEY_2+BX_KEY_ALT_R '@' XK_at # XK_twosuperior
|
||||
BX_KEY_3 '3' XK_3
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '#' XK_numbersign
|
||||
BX_KEY_3+BX_KEY_ALT_R '<27>' XK_sterling
|
||||
BX_KEY_4 '4' XK_4
|
||||
BX_KEY_4+BX_KEY_SHIFT_L '<27>' XK_currency
|
||||
BX_KEY_4+BX_KEY_ALT_R '$' XK_dollar
|
||||
BX_KEY_5 '5' XK_5
|
||||
BX_KEY_5+BX_KEY_ALT_R '<27>' XK_onehalf
|
||||
BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent
|
||||
BX_KEY_6 '6' XK_6
|
||||
BX_KEY_6+BX_KEY_SHIFT_L '&' XK_ampersand
|
||||
BX_KEY_6+BX_KEY_ALT_R '<27>' XK_yen
|
||||
BX_KEY_7 '7' XK_7
|
||||
BX_KEY_7+BX_KEY_ALT_R '{' XK_braceleft
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '/' XK_slash
|
||||
BX_KEY_8 '8' XK_8
|
||||
BX_KEY_8+BX_KEY_ALT_R '[' XK_bracketleft
|
||||
BX_KEY_8+BX_KEY_SHIFT_L '(' XK_parenleft
|
||||
BX_KEY_9 '9' XK_9
|
||||
BX_KEY_9+BX_KEY_ALT_R ']' XK_bracketright
|
||||
BX_KEY_9+BX_KEY_SHIFT_L ')' XK_parenright
|
||||
BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A
|
||||
BX_KEY_A 'a' XK_a
|
||||
BX_KEY_A+BX_KEY_ALT_R '<27>' XK_ordfeminine
|
||||
BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B
|
||||
BX_KEY_B 'b' XK_b
|
||||
BX_KEY_B+BX_KEY_ALT_R none XK_rightdoublequotemark
|
||||
BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C
|
||||
BX_KEY_C 'c' XK_c
|
||||
BX_KEY_C+BX_KEY_ALT_R '<27>' XK_copyright
|
||||
BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D
|
||||
BX_KEY_D 'd' XK_d
|
||||
BX_KEY_D+BX_KEY_ALT_R '<27>' XK_eth
|
||||
BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E
|
||||
BX_KEY_E+BX_KEY_ALT_R '?' XK_EuroSign
|
||||
BX_KEY_E 'e' XK_e
|
||||
BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F
|
||||
BX_KEY_F+BX_KEY_ALT_R '?' XK_dstroke
|
||||
BX_KEY_F 'f' XK_f
|
||||
BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G
|
||||
BX_KEY_G+BX_KEY_ALT_R '?' XK_eng
|
||||
BX_KEY_G 'g' XK_g
|
||||
BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H
|
||||
BX_KEY_H 'h' XK_h
|
||||
BX_KEY_H+BX_KEY_ALT_R '?' XK_hstroke
|
||||
BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I
|
||||
BX_KEY_I 'i' XK_i
|
||||
BX_KEY_I+BX_KEY_ALT_R none XK_rightarrow
|
||||
BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J
|
||||
BX_KEY_J 'j' XK_j
|
||||
BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K
|
||||
BX_KEY_K 'k' XK_k
|
||||
BX_KEY_K+BX_KEY_ALT_R none XK_kra
|
||||
BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L
|
||||
BX_KEY_L 'l' XK_l
|
||||
BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M
|
||||
BX_KEY_M 'm' XK_m
|
||||
BX_KEY_M+BX_KEY_ALT_R '<27>' XK_mu
|
||||
BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N
|
||||
BX_KEY_N 'n' XK_n
|
||||
BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O
|
||||
BX_KEY_O 'o' XK_o
|
||||
BX_KEY_O+BX_KEY_ALT_R none XK_oslash
|
||||
BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P
|
||||
BX_KEY_P 'p' XK_p
|
||||
BX_KEY_P+BX_KEY_ALT_R '<27>' XK_thorn
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q
|
||||
BX_KEY_Q+BX_KEY_ALT_R '@' XK_at
|
||||
BX_KEY_Q 'q' XK_q
|
||||
BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R
|
||||
BX_KEY_R+BX_KEY_ALT_R '<27>' XK_registered
|
||||
BX_KEY_R 'r' XK_r
|
||||
BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S
|
||||
BX_KEY_S 's' XK_s
|
||||
BX_KEY_S+BX_KEY_ALT_R '<27>' XK_ssharp
|
||||
BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T
|
||||
BX_KEY_T 't' XK_t
|
||||
BX_KEY_T+BX_KEY_ALT_R '<27>' XK_thorn
|
||||
BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U
|
||||
BX_KEY_U+BX_KEY_ALT_R none XK_downarrow
|
||||
BX_KEY_U 'u' XK_u
|
||||
BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V
|
||||
BX_KEY_V+BX_KEY_ALT_R none XK_leftdoublequotemark
|
||||
BX_KEY_V 'v' XK_v
|
||||
BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W
|
||||
BX_KEY_W+BX_KEY_ALT_R '?' XK_lstroke
|
||||
BX_KEY_W 'w' XK_w
|
||||
BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X
|
||||
BX_KEY_X+BX_KEY_ALT_R '<27>' XK_guillemotright
|
||||
BX_KEY_X 'x' XK_x
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y
|
||||
BX_KEY_Y+BX_KEY_ALT_R none XK_leftarrow
|
||||
BX_KEY_Y 'y' XK_y
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z
|
||||
BX_KEY_Z+BX_KEY_ALT_R '<27>' XK_guillemotleft
|
||||
BX_KEY_Z 'z' XK_z
|
||||
BX_KEY_F1 none XK_F1
|
||||
BX_KEY_F2 none XK_F2
|
||||
BX_KEY_F3 none XK_F3
|
||||
BX_KEY_F4 none XK_F4
|
||||
BX_KEY_F5 none XK_F5
|
||||
BX_KEY_F6 none XK_F6
|
||||
BX_KEY_F7 none XK_F7
|
||||
BX_KEY_F8 none XK_F8
|
||||
BX_KEY_F9 none XK_F9
|
||||
BX_KEY_F10 none XK_F10
|
||||
BX_KEY_F11 none XK_F11
|
||||
BX_KEY_F12 none XK_F12
|
||||
BX_KEY_ALT_L none XK_Alt_L
|
||||
BX_KEY_ALT_L none XK_Meta_L
|
||||
BX_KEY_ALT_R none XK_Mode_switch
|
||||
BX_KEY_ALT_R none XK_Multi_key
|
||||
BX_KEY_BACKSLASH apostrophe XK_apostrophe
|
||||
BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '*' XK_asterisk
|
||||
BX_KEY_BACKSPACE none XK_BackSpace
|
||||
BX_KEY_CAPS_LOCK none XK_Caps_Lock
|
||||
BX_KEY_COMMA ',' XK_comma
|
||||
BX_KEY_COMMA+BX_KEY_ALT_R none XK_horizconnector
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon
|
||||
BX_KEY_CTRL_L none XK_Control_L
|
||||
BX_KEY_CTRL_R none XK_Control_R
|
||||
BX_KEY_DELETE none XK_Delete
|
||||
BX_KEY_DOWN none XK_Down
|
||||
BX_KEY_END none XK_End
|
||||
BX_KEY_ENTER return XK_Return
|
||||
BX_KEY_EQUALS none XK_acute
|
||||
BX_KEY_EQUALS+BX_KEY_ALT_R '|' XK_bar
|
||||
BX_KEY_EQUALS+BX_KEY_SHIFT_L '`' XK_grave
|
||||
BX_KEY_ESC none XK_Escape
|
||||
BX_KEY_GRAVE '<27>' XK_onehalf
|
||||
BX_KEY_GRAVE+BX_KEY_SHIFT_L '<27>' XK_section
|
||||
BX_KEY_GRAVE+BX_KEY_ALT_R '<27>' XK_threequarters
|
||||
BX_KEY_HOME none XK_Home
|
||||
BX_KEY_INSERT none XK_Insert
|
||||
BX_KEY_KP_5 none XK_KP_5
|
||||
BX_KEY_KP_5 none XK_KP_Begin
|
||||
BX_KEY_KP_ADD none XK_KP_Add
|
||||
BX_KEY_KP_DELETE none XK_KP_Decimal
|
||||
BX_KEY_KP_DELETE none XK_KP_Delete
|
||||
BX_KEY_KP_DIVIDE none XK_KP_Divide
|
||||
BX_KEY_KP_DOWN none XK_KP_2
|
||||
BX_KEY_KP_DOWN none XK_KP_Down
|
||||
BX_KEY_KP_END none XK_KP_1
|
||||
BX_KEY_KP_END none XK_KP_End
|
||||
BX_KEY_KP_ENTER none XK_KP_Enter
|
||||
BX_KEY_KP_HOME none XK_KP_7
|
||||
BX_KEY_KP_HOME none XK_KP_Home
|
||||
BX_KEY_KP_INSERT none XK_KP_0
|
||||
BX_KEY_KP_INSERT none XK_KP_Insert
|
||||
BX_KEY_KP_LEFT none XK_KP_4
|
||||
BX_KEY_KP_LEFT none XK_KP_Left
|
||||
BX_KEY_KP_MULTIPLY none XK_KP_Multiply
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_3
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_9
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_Page_Up
|
||||
BX_KEY_KP_RIGHT none XK_KP_6
|
||||
BX_KEY_KP_RIGHT none XK_KP_Right
|
||||
BX_KEY_KP_SUBTRACT none XK_KP_Subtract
|
||||
BX_KEY_KP_UP none XK_KP_8
|
||||
BX_KEY_KP_UP none XK_KP_Up
|
||||
BX_KEY_LEFT none XK_Left
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_ALT_R backslash XK_backslash
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater
|
||||
BX_KEY_LEFT_BACKSLASH '<' XK_less
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '<27>' XK_Aring
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_ALT_L none XK_diaeresis
|
||||
BX_KEY_LEFT_BRACKET '<27>' XK_aring
|
||||
BX_KEY_MENU none XK_Menu
|
||||
BX_KEY_MINUS+BX_KEY_ALT_R '<27>' XK_plusminus
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '?' XK_question
|
||||
BX_KEY_MINUS '+' XK_plus
|
||||
BX_KEY_NUM_LOCK none XK_Num_Lock
|
||||
BX_KEY_PAGE_DOWN none XK_Page_Down
|
||||
BX_KEY_PAGE_UP none XK_Page_Up
|
||||
BX_KEY_PAUSE none XK_Break
|
||||
BX_KEY_PAUSE none XK_Pause
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' XK_colon
|
||||
BX_KEY_PERIOD '.' XK_period
|
||||
BX_KEY_PERIOD+BX_KEY_ALT_R '<27>' XK_periodcentered
|
||||
BX_KEY_PRINT none XK_Print
|
||||
BX_KEY_PRINT none XK_Sys_Req
|
||||
BX_KEY_RIGHT none XK_Right
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R '~' XK_asciitilde
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '^' XK_asciicircum
|
||||
BX_KEY_RIGHT_BRACKET '"' XK_diaeresis
|
||||
BX_KEY_SCRL_LOCK none XK_Scroll_Lock
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '<27>' XK_AE
|
||||
BX_KEY_SEMICOLON '<27>' XK_ae
|
||||
BX_KEY_SHIFT_L none XK_Shift_L
|
||||
BX_KEY_SHIFT_R none XK_Shift_R
|
||||
BX_KEY_SINGLE_QUOTE '<27>' XK_oslash
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '<27>' XK_Ooblique
|
||||
BX_KEY_SLASH+BX_KEY_ALT_R '<27>' XK_hyphen
|
||||
BX_KEY_SLASH '-' XK_minus
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT_L '_' XK_underscore
|
||||
BX_KEY_SPACE space XK_space
|
||||
BX_KEY_TAB none XK_ISO_Left_Tab
|
||||
BX_KEY_TAB tab XK_Tab
|
||||
BX_KEY_UP none XK_Up
|
||||
BX_KEY_WIN_L none XK_Super_L
|
||||
BX_KEY_WIN_R none XK_Super_R
|
||||
248
simulators/bochs/gui/keymaps/x11-pc-de.map
Normal file
248
simulators/bochs/gui/keymaps/x11-pc-de.map
Normal file
@ -0,0 +1,248 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, DE keymap
|
||||
# Author: Volker Ruppert
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Xwin_Keysym is the X windows equivalent of the key combination. These
|
||||
# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h.
|
||||
# If you're running X windows, Bochs will take each of these Xwin_Keysyms,
|
||||
# pull off the XK_ in front, and use XStringToKeysym() to change them into
|
||||
# numerical codes. If this lookup fails, you will get a panic and you need
|
||||
# to edit the keymap file.
|
||||
|
||||
BX_KEY_0 '0' XK_0
|
||||
BX_KEY_0+BX_KEY_ALT_R '}' XK_braceright
|
||||
BX_KEY_0+BX_KEY_SHIFT_L '=' XK_equal
|
||||
BX_KEY_1 '1' XK_1
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam
|
||||
BX_KEY_1+BX_KEY_ALT_R '<27>' XK_onesuperior
|
||||
BX_KEY_2 '2' XK_2
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '"' XK_quotedbl
|
||||
BX_KEY_2+BX_KEY_ALT_R '<27>' XK_twosuperior
|
||||
BX_KEY_3 '3' XK_3
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '<27>' XK_section
|
||||
BX_KEY_3+BX_KEY_ALT_R '<27>' XK_threesuperior
|
||||
BX_KEY_4 '4' XK_4
|
||||
BX_KEY_4+BX_KEY_SHIFT_L '$' XK_dollar
|
||||
BX_KEY_4+BX_KEY_ALT_R '<27>' XK_onequarter
|
||||
BX_KEY_5 '5' XK_5
|
||||
BX_KEY_5+BX_KEY_ALT_R '<27>' XK_onehalf
|
||||
BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent
|
||||
BX_KEY_6 '6' XK_6
|
||||
BX_KEY_6+BX_KEY_SHIFT_L '&' XK_ampersand
|
||||
BX_KEY_6+BX_KEY_ALT_R '<27>' XK_threequarters
|
||||
BX_KEY_7 '7' XK_7
|
||||
BX_KEY_7+BX_KEY_ALT_R '{' XK_braceleft
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '/' XK_slash
|
||||
BX_KEY_8 '8' XK_8
|
||||
BX_KEY_8+BX_KEY_ALT_R '[' XK_bracketleft
|
||||
BX_KEY_8+BX_KEY_SHIFT_L '(' XK_parenleft
|
||||
BX_KEY_9 '9' XK_9
|
||||
BX_KEY_9+BX_KEY_ALT_R ']' XK_bracketright
|
||||
BX_KEY_9+BX_KEY_SHIFT_L ')' XK_parenright
|
||||
BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A
|
||||
BX_KEY_A 'a' XK_a
|
||||
BX_KEY_A+BX_KEY_ALT_R '<27>' XK_ae
|
||||
BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B
|
||||
BX_KEY_B 'b' XK_b
|
||||
BX_KEY_B+BX_KEY_ALT_R none XK_rightdoublequotemark
|
||||
BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C
|
||||
BX_KEY_C 'c' XK_c
|
||||
BX_KEY_C+BX_KEY_ALT_R '<27>' XK_cent
|
||||
BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D
|
||||
BX_KEY_D 'd' XK_d
|
||||
BX_KEY_D+BX_KEY_ALT_R '<27>' XK_eth
|
||||
BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E
|
||||
BX_KEY_E+BX_KEY_ALT_R none XK_EuroSign
|
||||
BX_KEY_E 'e' XK_e
|
||||
BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F
|
||||
BX_KEY_F+BX_KEY_ALT_R none XK_dstroke
|
||||
BX_KEY_F 'f' XK_f
|
||||
BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G
|
||||
BX_KEY_G+BX_KEY_ALT_R none XK_eng
|
||||
BX_KEY_G 'g' XK_g
|
||||
BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H
|
||||
BX_KEY_H 'h' XK_h
|
||||
BX_KEY_H+BX_KEY_ALT_R none XK_hstroke
|
||||
BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I
|
||||
BX_KEY_I 'i' XK_i
|
||||
BX_KEY_I+BX_KEY_ALT_R none XK_rightarrow
|
||||
BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J
|
||||
BX_KEY_J 'j' XK_j
|
||||
BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K
|
||||
BX_KEY_K 'k' XK_k
|
||||
BX_KEY_K+BX_KEY_ALT_R none XK_kra
|
||||
BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L
|
||||
BX_KEY_L 'l' XK_l
|
||||
BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M
|
||||
BX_KEY_M 'm' XK_m
|
||||
BX_KEY_M+BX_KEY_ALT_R '<27>' XK_mu
|
||||
BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N
|
||||
BX_KEY_N 'n' XK_n
|
||||
BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O
|
||||
BX_KEY_O 'o' XK_o
|
||||
BX_KEY_O+BX_KEY_ALT_R '<27>' XK_oslash
|
||||
BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P
|
||||
BX_KEY_P 'p' XK_p
|
||||
BX_KEY_P+BX_KEY_ALT_R '<27>' XK_thorn
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q
|
||||
BX_KEY_Q+BX_KEY_ALT_R '@' XK_at
|
||||
BX_KEY_Q 'q' XK_q
|
||||
BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R
|
||||
BX_KEY_R+BX_KEY_ALT_R '<27>' XK_paragraph
|
||||
BX_KEY_R 'r' XK_r
|
||||
BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S
|
||||
BX_KEY_S 's' XK_s
|
||||
BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T
|
||||
BX_KEY_T 't' XK_t
|
||||
BX_KEY_T+BX_KEY_ALT_R none XK_tslash
|
||||
BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U
|
||||
BX_KEY_U+BX_KEY_ALT_R none XK_downarrow
|
||||
BX_KEY_U 'u' XK_u
|
||||
BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V
|
||||
BX_KEY_V+BX_KEY_ALT_R none XK_leftdoublequotemark
|
||||
BX_KEY_V 'v' XK_v
|
||||
BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W
|
||||
BX_KEY_W+BX_KEY_ALT_R none XK_lstroke
|
||||
BX_KEY_W 'w' XK_w
|
||||
BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X
|
||||
BX_KEY_X+BX_KEY_ALT_R '<27>' XK_guillemotright
|
||||
BX_KEY_X 'x' XK_x
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L 'Z' XK_Z
|
||||
BX_KEY_Y+BX_KEY_ALT_R none XK_leftarrow
|
||||
BX_KEY_Y 'z' XK_z
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L 'Y' XK_Y
|
||||
BX_KEY_Z+BX_KEY_ALT_R '<27>' XK_guillemotleft
|
||||
BX_KEY_Z 'y' XK_y
|
||||
BX_KEY_F1 none XK_F1
|
||||
BX_KEY_F2 none XK_F2
|
||||
BX_KEY_F3 none XK_F3
|
||||
BX_KEY_F4 none XK_F4
|
||||
BX_KEY_F5 none XK_F5
|
||||
BX_KEY_F6 none XK_F6
|
||||
BX_KEY_F7 none XK_F7
|
||||
BX_KEY_F8 none XK_F8
|
||||
BX_KEY_F9 none XK_F9
|
||||
BX_KEY_F10 none XK_F10
|
||||
BX_KEY_F11 none XK_F11
|
||||
BX_KEY_F12 none XK_F12
|
||||
BX_KEY_ALT_L none XK_Alt_L
|
||||
BX_KEY_ALT_L none XK_Meta_L
|
||||
BX_KEY_ALT_R none XK_Alt_R
|
||||
BX_KEY_ALT_R none XK_Mode_switch
|
||||
BX_KEY_ALT_R none XK_Multi_key
|
||||
BX_KEY_ALT_R none XK_ISO_Level3_Shift
|
||||
BX_KEY_BACKSLASH apostrophe XK_apostrophe
|
||||
BX_KEY_BACKSLASH '#' XK_numbersign
|
||||
BX_KEY_BACKSPACE none XK_BackSpace
|
||||
BX_KEY_CAPS_LOCK none XK_Caps_Lock
|
||||
BX_KEY_COMMA ',' XK_comma
|
||||
BX_KEY_COMMA+BX_KEY_ALT_R none XK_horizconnector
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon
|
||||
BX_KEY_CTRL_L none XK_Control_L
|
||||
BX_KEY_CTRL_R none XK_Control_R
|
||||
BX_KEY_DELETE none XK_Delete
|
||||
BX_KEY_DOWN none XK_Down
|
||||
BX_KEY_END none XK_End
|
||||
BX_KEY_ENTER return XK_Return
|
||||
BX_KEY_EQUALS none XK_acute
|
||||
BX_KEY_EQUALS+BX_KEY_ALT_R '<27>' XK_cedilla
|
||||
BX_KEY_EQUALS+BX_KEY_SHIFT_L '`' XK_grave
|
||||
BX_KEY_ESC none XK_Escape
|
||||
BX_KEY_GRAVE '^' XK_asciicircum
|
||||
BX_KEY_GRAVE+BX_KEY_SHIFT_L '<27>' XK_degree
|
||||
BX_KEY_GRAVE+BX_KEY_ALT_R '<27>' XK_notsign
|
||||
BX_KEY_HOME none XK_Home
|
||||
BX_KEY_INSERT none XK_Insert
|
||||
BX_KEY_KP_5 none XK_KP_5
|
||||
BX_KEY_KP_5 none XK_KP_Begin
|
||||
BX_KEY_KP_ADD none XK_KP_Add
|
||||
BX_KEY_KP_DELETE none XK_KP_Decimal
|
||||
BX_KEY_KP_DELETE none XK_KP_Delete
|
||||
BX_KEY_KP_DIVIDE none XK_KP_Divide
|
||||
BX_KEY_KP_DOWN none XK_KP_2
|
||||
BX_KEY_KP_DOWN none XK_KP_Down
|
||||
BX_KEY_KP_END none XK_KP_1
|
||||
BX_KEY_KP_END none XK_KP_End
|
||||
BX_KEY_KP_ENTER none XK_KP_Enter
|
||||
BX_KEY_KP_HOME none XK_KP_7
|
||||
BX_KEY_KP_HOME none XK_KP_Home
|
||||
BX_KEY_KP_INSERT none XK_KP_0
|
||||
BX_KEY_KP_INSERT none XK_KP_Insert
|
||||
BX_KEY_KP_LEFT none XK_KP_4
|
||||
BX_KEY_KP_LEFT none XK_KP_Left
|
||||
BX_KEY_KP_MULTIPLY none XK_KP_Multiply
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_3
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_9
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_Page_Up
|
||||
BX_KEY_KP_RIGHT none XK_KP_6
|
||||
BX_KEY_KP_RIGHT none XK_KP_Right
|
||||
BX_KEY_KP_SUBTRACT none XK_KP_Subtract
|
||||
BX_KEY_KP_UP none XK_KP_8
|
||||
BX_KEY_KP_UP none XK_KP_Up
|
||||
BX_KEY_LEFT none XK_Left
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_ALT_R '|' XK_bar
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater
|
||||
BX_KEY_LEFT_BACKSLASH '<' XK_less
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '<27>' XK_Udiaeresis
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_ALT_L none XK_diaeresis
|
||||
BX_KEY_LEFT_BRACKET '<27>' XK_udiaeresis
|
||||
BX_KEY_MENU none XK_Menu
|
||||
BX_KEY_MINUS+BX_KEY_ALT_L backslash XK_backslash
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '?' XK_question
|
||||
BX_KEY_MINUS '<27>' XK_ssharp
|
||||
BX_KEY_NUM_LOCK none XK_Num_Lock
|
||||
BX_KEY_PAGE_DOWN none XK_Page_Down
|
||||
BX_KEY_PAGE_UP none XK_Page_Up
|
||||
BX_KEY_PAUSE none XK_Break
|
||||
BX_KEY_PAUSE none XK_Pause
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' XK_colon
|
||||
BX_KEY_PERIOD '.' XK_period
|
||||
BX_KEY_PERIOD+BX_KEY_ALT_L '<27>' XK_periodcentered
|
||||
BX_KEY_PRINT none XK_Print
|
||||
BX_KEY_PRINT none XK_Sys_Req
|
||||
BX_KEY_RIGHT none XK_Right
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R '~' XK_asciitilde
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '*' XK_asterisk
|
||||
BX_KEY_RIGHT_BRACKET '+' XK_plus
|
||||
BX_KEY_SCRL_LOCK none XK_Scroll_Lock
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '<27>' XK_Odiaeresis
|
||||
BX_KEY_SEMICOLON '<27>' XK_odiaeresis
|
||||
BX_KEY_SHIFT_L none XK_Shift_L
|
||||
BX_KEY_SHIFT_R none XK_Shift_R
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '<27>' XK_Adiaeresis
|
||||
BX_KEY_SINGLE_QUOTE '<27>' XK_adiaeresis
|
||||
BX_KEY_SLASH none XK_dead_belowdot
|
||||
BX_KEY_SLASH '-' XK_minus
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT_L '_' XK_underscore
|
||||
BX_KEY_SPACE space XK_space
|
||||
BX_KEY_TAB none XK_ISO_Left_Tab
|
||||
BX_KEY_TAB tab XK_Tab
|
||||
BX_KEY_UP none XK_Up
|
||||
BX_KEY_WIN_L none XK_Super_L
|
||||
BX_KEY_WIN_R none XK_Super_R
|
||||
217
simulators/bochs/gui/keymaps/x11-pc-es.map
Normal file
217
simulators/bochs/gui/keymaps/x11-pc-es.map
Normal file
@ -0,0 +1,217 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, ES keymap
|
||||
# Author: Vicente Hernando Ara
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Xwin_Keysym is the X windows equivalent of the key combination. These
|
||||
# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h.
|
||||
# If you're running X windows, Bochs will take each of these Xwin_Keysyms,
|
||||
# pull off the XK_ in front, and use XStringToKeysym() to change them into
|
||||
# numerical codes. If this lookup fails, you will get a panic and you need
|
||||
# to edit the keymap file.
|
||||
#
|
||||
BX_KEY_0 none XK_0
|
||||
BX_KEY_0 none XK_equal
|
||||
BX_KEY_1 none XK_1
|
||||
BX_KEY_1 none XK_bar
|
||||
BX_KEY_1 none XK_exclam
|
||||
BX_KEY_2 none XK_2
|
||||
BX_KEY_2 none XK_at
|
||||
BX_KEY_2 none XK_quotedbl
|
||||
BX_KEY_3 none XK_3
|
||||
BX_KEY_3 none XK_numbersign
|
||||
BX_KEY_3 none XK_periodcentered
|
||||
BX_KEY_4 none XK_4
|
||||
BX_KEY_4 none XK_dollar
|
||||
BX_KEY_5 none XK_5
|
||||
BX_KEY_5 none XK_percent
|
||||
BX_KEY_6 none XK_6
|
||||
BX_KEY_6 none XK_ampersand
|
||||
BX_KEY_7 none XK_7
|
||||
BX_KEY_7 none XK_slash
|
||||
BX_KEY_8 none XK_8
|
||||
BX_KEY_8 none XK_parenleft
|
||||
BX_KEY_9 none XK_9
|
||||
BX_KEY_9 none XK_parenright
|
||||
BX_KEY_A none XK_A
|
||||
BX_KEY_A none XK_a
|
||||
BX_KEY_B none XK_B
|
||||
BX_KEY_B none XK_b
|
||||
BX_KEY_C none XK_C
|
||||
BX_KEY_C none XK_c
|
||||
BX_KEY_D none XK_D
|
||||
BX_KEY_D none XK_d
|
||||
BX_KEY_E none XK_E
|
||||
BX_KEY_E none XK_EuroSign
|
||||
BX_KEY_E none XK_e
|
||||
BX_KEY_F none XK_F
|
||||
BX_KEY_F none XK_f
|
||||
BX_KEY_G none XK_G
|
||||
BX_KEY_G none XK_g
|
||||
BX_KEY_H none XK_H
|
||||
BX_KEY_H none XK_h
|
||||
BX_KEY_I none XK_I
|
||||
BX_KEY_I none XK_i
|
||||
BX_KEY_J none XK_J
|
||||
BX_KEY_J none XK_j
|
||||
BX_KEY_K none XK_K
|
||||
BX_KEY_K none XK_k
|
||||
BX_KEY_L none XK_L
|
||||
BX_KEY_L none XK_l
|
||||
BX_KEY_M none XK_M
|
||||
BX_KEY_M none XK_m
|
||||
BX_KEY_N none XK_N
|
||||
BX_KEY_N none XK_n
|
||||
BX_KEY_O none XK_O
|
||||
BX_KEY_O none XK_o
|
||||
BX_KEY_P none XK_P
|
||||
BX_KEY_P none XK_p
|
||||
BX_KEY_Q none XK_Q
|
||||
BX_KEY_Q none XK_q
|
||||
BX_KEY_R none XK_R
|
||||
BX_KEY_R none XK_r
|
||||
BX_KEY_S none XK_S
|
||||
BX_KEY_S none XK_s
|
||||
BX_KEY_T none XK_T
|
||||
BX_KEY_T none XK_t
|
||||
BX_KEY_U none XK_U
|
||||
BX_KEY_U none XK_u
|
||||
BX_KEY_V none XK_V
|
||||
BX_KEY_V none XK_v
|
||||
BX_KEY_W none XK_W
|
||||
BX_KEY_W none XK_w
|
||||
BX_KEY_X none XK_X
|
||||
BX_KEY_X none XK_x
|
||||
BX_KEY_Y none XK_Y
|
||||
BX_KEY_Y none XK_y
|
||||
BX_KEY_Z none XK_Z
|
||||
BX_KEY_Z none XK_z
|
||||
BX_KEY_F1 none XK_F1
|
||||
BX_KEY_F2 none XK_F2
|
||||
BX_KEY_F3 none XK_F3
|
||||
BX_KEY_F4 none XK_F4
|
||||
BX_KEY_F5 none XK_F5
|
||||
BX_KEY_F6 none XK_F6
|
||||
BX_KEY_F7 none XK_F7
|
||||
BX_KEY_F8 none XK_F8
|
||||
BX_KEY_F9 none XK_F9
|
||||
BX_KEY_F10 none XK_F10
|
||||
BX_KEY_F11 none XK_F11
|
||||
BX_KEY_F12 none XK_F12
|
||||
BX_KEY_ALT_L none XK_Alt_L
|
||||
BX_KEY_ALT_L none XK_Meta_L
|
||||
BX_KEY_ALT_R none XK_Alt_R
|
||||
BX_KEY_ALT_R none XK_Mode_switch
|
||||
BX_KEY_ALT_R none XK_Multi_key
|
||||
BX_KEY_BACKSLASH none XK_Ccedilla
|
||||
BX_KEY_BACKSLASH none XK_ccedilla
|
||||
BX_KEY_BACKSPACE none XK_BackSpace
|
||||
BX_KEY_CAPS_LOCK none XK_Caps_Lock
|
||||
BX_KEY_COMMA none XK_comma
|
||||
BX_KEY_COMMA none XK_semicolon
|
||||
BX_KEY_CTRL_L none XK_Control_L
|
||||
BX_KEY_CTRL_R none XK_Control_R
|
||||
BX_KEY_DELETE none XK_Delete
|
||||
BX_KEY_DOWN none XK_Down
|
||||
BX_KEY_END none XK_End
|
||||
BX_KEY_ENTER none XK_Return
|
||||
BX_KEY_EQUALS none XK_exclamdown
|
||||
BX_KEY_EQUALS none XK_questiondown
|
||||
BX_KEY_ESC none XK_Escape
|
||||
BX_KEY_GRAVE none XK_asciitilde
|
||||
BX_KEY_GRAVE none XK_backslash
|
||||
BX_KEY_GRAVE none XK_grave
|
||||
BX_KEY_GRAVE none XK_masculine
|
||||
BX_KEY_GRAVE none XK_ordfeminine
|
||||
BX_KEY_HOME none XK_Home
|
||||
BX_KEY_INSERT none XK_Insert
|
||||
BX_KEY_KP_5 none XK_KP_5
|
||||
BX_KEY_KP_5 none XK_KP_Begin
|
||||
BX_KEY_KP_ADD none XK_KP_Add
|
||||
BX_KEY_KP_DELETE none XK_KP_Decimal
|
||||
BX_KEY_KP_DELETE none XK_KP_Delete
|
||||
BX_KEY_KP_DIVIDE none XK_KP_Divide
|
||||
BX_KEY_KP_DOWN none XK_KP_2
|
||||
BX_KEY_KP_DOWN none XK_KP_Down
|
||||
BX_KEY_KP_END none XK_KP_1
|
||||
BX_KEY_KP_END none XK_KP_End
|
||||
BX_KEY_KP_ENTER none XK_KP_Enter
|
||||
BX_KEY_KP_HOME none XK_KP_7
|
||||
BX_KEY_KP_HOME none XK_KP_Home
|
||||
BX_KEY_KP_INSERT none XK_KP_0
|
||||
BX_KEY_KP_INSERT none XK_KP_Insert
|
||||
BX_KEY_KP_LEFT none XK_KP_4
|
||||
BX_KEY_KP_LEFT none XK_KP_Left
|
||||
BX_KEY_KP_MULTIPLY none XK_KP_Multiply
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_3
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_9
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_Page_Up
|
||||
BX_KEY_KP_RIGHT none XK_KP_6
|
||||
BX_KEY_KP_RIGHT none XK_KP_Right
|
||||
BX_KEY_KP_SUBTRACT none XK_KP_Subtract
|
||||
BX_KEY_KP_UP none XK_KP_8
|
||||
BX_KEY_KP_UP none XK_KP_Up
|
||||
BX_KEY_LEFT none XK_Left
|
||||
BX_KEY_LEFT_BACKSLASH none XK_greater
|
||||
BX_KEY_LEFT_BACKSLASH none XK_less
|
||||
BX_KEY_LEFT_BRACKET none XK_braceleft
|
||||
BX_KEY_LEFT_BRACKET none XK_bracketleft
|
||||
BX_KEY_LEFT_BRACKET none XK_dead_circumflex
|
||||
BX_KEY_LEFT_BRACKET none XK_dead_grave
|
||||
BX_KEY_MENU none XK_Menu
|
||||
BX_KEY_MINUS none XK_apostrophe
|
||||
BX_KEY_MINUS none XK_question
|
||||
BX_KEY_NUM_LOCK none XK_Num_Lock
|
||||
BX_KEY_PAGE_DOWN none XK_Page_Down
|
||||
BX_KEY_PAGE_UP none XK_Page_Up
|
||||
BX_KEY_PAUSE none XK_Break
|
||||
BX_KEY_PAUSE none XK_Pause
|
||||
BX_KEY_PERIOD none XK_colon
|
||||
BX_KEY_PERIOD none XK_period
|
||||
BX_KEY_PRINT none XK_Print
|
||||
BX_KEY_PRINT none XK_Sys_Req
|
||||
BX_KEY_RIGHT none XK_Right
|
||||
BX_KEY_RIGHT_BRACKET none XK_asterisk
|
||||
BX_KEY_RIGHT_BRACKET none XK_braceright
|
||||
BX_KEY_RIGHT_BRACKET none XK_bracketright
|
||||
BX_KEY_RIGHT_BRACKET none XK_plus
|
||||
BX_KEY_SCRL_LOCK none XK_Scroll_Lock
|
||||
BX_KEY_SEMICOLON none XK_Ntilde
|
||||
BX_KEY_SEMICOLON none XK_ntilde
|
||||
BX_KEY_SHIFT_L none XK_Shift_L
|
||||
BX_KEY_SHIFT_R none XK_Shift_R
|
||||
BX_KEY_SINGLE_QUOTE none XK_dead_acute
|
||||
BX_KEY_SINGLE_QUOTE none XK_dead_diaeresis
|
||||
BX_KEY_SLASH none XK_minus
|
||||
BX_KEY_SLASH none XK_underscore
|
||||
BX_KEY_SPACE none XK_space
|
||||
BX_KEY_TAB none XK_ISO_Left_Tab
|
||||
BX_KEY_TAB none XK_Tab
|
||||
BX_KEY_UP none XK_Up
|
||||
BX_KEY_WIN_L none XK_Super_L
|
||||
BX_KEY_WIN_R none XK_Super_R
|
||||
218
simulators/bochs/gui/keymaps/x11-pc-fr.map
Normal file
218
simulators/bochs/gui/keymaps/x11-pc-fr.map
Normal file
@ -0,0 +1,218 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, FR keymap
|
||||
# Author: Christophe Bothamy, Bryce Denney
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Xwin_Keysym is the X windows equivalent of the key combination. These
|
||||
# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h.
|
||||
# If you're running X windows, Bochs will take each of these Xwin_Keysyms,
|
||||
# pull off the XK_ in front, and use XStringToKeysym() to change them into
|
||||
# numerical codes. If this lookup fails, you will get a panic and you need
|
||||
# to edit the keymap file.
|
||||
|
||||
BX_KEY_0+BX_KEY_SHIFT_L '0' XK_0
|
||||
BX_KEY_0 '<27>' XK_agrave
|
||||
BX_KEY_0+BX_KEY_ALT_R '@' XK_at
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '1' XK_1
|
||||
BX_KEY_1 '&' XK_ampersand
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '2' XK_2
|
||||
BX_KEY_2+BX_KEY_ALT_R '~' XK_asciitilde
|
||||
BX_KEY_2 '<27>' XK_eacute
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '3' XK_3
|
||||
BX_KEY_3+BX_KEY_ALT_R '#' XK_numbersign
|
||||
BX_KEY_3 '"' XK_quotedbl
|
||||
BX_KEY_4+BX_KEY_SHIFT_L '4' XK_4
|
||||
BX_KEY_4 apostrophe XK_apostrophe
|
||||
BX_KEY_4+BX_KEY_ALT_R '{' XK_braceleft
|
||||
BX_KEY_5+BX_KEY_SHIFT_L '5' XK_5
|
||||
BX_KEY_5+BX_KEY_ALT_R '[' XK_bracketleft
|
||||
BX_KEY_5 '(' XK_parenleft
|
||||
BX_KEY_6+BX_KEY_SHIFT_L '6' XK_6
|
||||
BX_KEY_6+BX_KEY_ALT_R '|' XK_bar
|
||||
BX_KEY_6 '-' XK_minus
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '7' XK_7
|
||||
BX_KEY_7 '<27>' XK_egrave
|
||||
BX_KEY_7+BX_KEY_ALT_R '`' XK_grave
|
||||
BX_KEY_8+BX_KEY_SHIFT_L '8' XK_8
|
||||
BX_KEY_8+BX_KEY_ALT_R backslash XK_backslash
|
||||
BX_KEY_8 '_' XK_underscore
|
||||
BX_KEY_9+BX_KEY_SHIFT_L '9' XK_9
|
||||
BX_KEY_9+BX_KEY_ALT_R '^' XK_asciicircum
|
||||
BX_KEY_9 '<27>' XK_ccedilla
|
||||
BX_KEY_A+BX_KEY_SHIFT_L 'Q' XK_Q
|
||||
BX_KEY_A 'q' XK_q
|
||||
BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B
|
||||
BX_KEY_B 'b' XK_b
|
||||
BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C
|
||||
BX_KEY_C 'c' XK_c
|
||||
BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D
|
||||
BX_KEY_D 'd' XK_d
|
||||
BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E
|
||||
BX_KEY_E 'e' XK_e
|
||||
BX_KEY_E+BX_KEY_ALT_R none XK_EuroSign
|
||||
BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F
|
||||
BX_KEY_F 'f' XK_f
|
||||
BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G
|
||||
BX_KEY_G 'g' XK_g
|
||||
BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H
|
||||
BX_KEY_H 'h' XK_h
|
||||
BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I
|
||||
BX_KEY_I 'i' XK_i
|
||||
BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J
|
||||
BX_KEY_J 'j' XK_j
|
||||
BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K
|
||||
BX_KEY_K 'k' XK_k
|
||||
BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L
|
||||
BX_KEY_L 'l' XK_l
|
||||
BX_KEY_M+BX_KEY_SHIFT_L '?' XK_question
|
||||
BX_KEY_M ',' XK_comma
|
||||
BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N
|
||||
BX_KEY_N 'n' XK_n
|
||||
BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O
|
||||
BX_KEY_O 'o' XK_o
|
||||
BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P
|
||||
BX_KEY_P 'p' XK_p
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L 'A' XK_A
|
||||
BX_KEY_Q 'a' XK_a
|
||||
BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R
|
||||
BX_KEY_R 'r' XK_r
|
||||
BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S
|
||||
BX_KEY_S 's' XK_s
|
||||
BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T
|
||||
BX_KEY_T 't' XK_t
|
||||
BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U
|
||||
BX_KEY_U 'u' XK_u
|
||||
BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V
|
||||
BX_KEY_V 'v' XK_v
|
||||
BX_KEY_W+BX_KEY_SHIFT_L 'Z' XK_Z
|
||||
BX_KEY_W 'z' XK_z
|
||||
BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X
|
||||
BX_KEY_X 'x' XK_x
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y
|
||||
BX_KEY_Y 'y' XK_y
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L 'W' XK_W
|
||||
BX_KEY_Z 'w' XK_w
|
||||
BX_KEY_F1 none XK_F1
|
||||
BX_KEY_F2 none XK_F2
|
||||
BX_KEY_F3 none XK_F3
|
||||
BX_KEY_F4 none XK_F4
|
||||
BX_KEY_F5 none XK_F5
|
||||
BX_KEY_F6 none XK_F6
|
||||
BX_KEY_F7 none XK_F7
|
||||
BX_KEY_F8 none XK_F8
|
||||
BX_KEY_F9 none XK_F9
|
||||
BX_KEY_F10 none XK_F10
|
||||
BX_KEY_F11 none XK_F11
|
||||
BX_KEY_F12 none XK_F12
|
||||
BX_KEY_ALT_L none XK_Alt_L
|
||||
BX_KEY_ALT_L none XK_Meta_L
|
||||
BX_KEY_ALT_R none XK_Alt_R
|
||||
BX_KEY_ALT_R none XK_Mode_switch
|
||||
BX_KEY_ALT_R none XK_Multi_key
|
||||
BX_KEY_BACKSLASH '*' XK_asterisk
|
||||
BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '<27>' XK_mu
|
||||
BX_KEY_BACKSPACE none XK_BackSpace
|
||||
BX_KEY_CAPS_LOCK none XK_Caps_Lock
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L '.' XK_period
|
||||
BX_KEY_COMMA ';' XK_semicolon
|
||||
BX_KEY_CTRL_L none XK_Control_L
|
||||
BX_KEY_CTRL_R none XK_Control_R
|
||||
BX_KEY_DELETE none XK_Delete
|
||||
BX_KEY_DOWN none XK_Down
|
||||
BX_KEY_END none XK_End
|
||||
BX_KEY_ENTER return XK_Return
|
||||
BX_KEY_EQUALS+BX_KEY_ALT_R '}' XK_braceright
|
||||
BX_KEY_EQUALS '=' XK_equal
|
||||
BX_KEY_EQUALS+BX_KEY_SHIFT_L '+' XK_plus
|
||||
BX_KEY_ESC none XK_Escape
|
||||
BX_KEY_GRAVE '<27>' XK_twosuperior
|
||||
BX_KEY_HOME none XK_Home
|
||||
BX_KEY_INSERT none XK_Insert
|
||||
BX_KEY_KP_5 none XK_KP_5
|
||||
BX_KEY_KP_5 none XK_KP_Begin
|
||||
BX_KEY_KP_ADD none XK_KP_Add
|
||||
BX_KEY_KP_DELETE none XK_KP_Decimal
|
||||
BX_KEY_KP_DELETE none XK_KP_Delete
|
||||
BX_KEY_KP_DIVIDE none XK_KP_Divide
|
||||
BX_KEY_KP_DOWN none XK_KP_2
|
||||
BX_KEY_KP_DOWN none XK_KP_Down
|
||||
BX_KEY_KP_END none XK_KP_1
|
||||
BX_KEY_KP_END none XK_KP_End
|
||||
BX_KEY_KP_ENTER none XK_KP_Enter
|
||||
BX_KEY_KP_HOME none XK_KP_7
|
||||
BX_KEY_KP_HOME none XK_KP_Home
|
||||
BX_KEY_KP_INSERT none XK_KP_0
|
||||
BX_KEY_KP_INSERT none XK_KP_Insert
|
||||
BX_KEY_KP_LEFT none XK_KP_4
|
||||
BX_KEY_KP_LEFT none XK_KP_Left
|
||||
BX_KEY_KP_MULTIPLY none XK_KP_Multiply
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_3
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_9
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_Page_Up
|
||||
BX_KEY_KP_RIGHT none XK_KP_6
|
||||
BX_KEY_KP_RIGHT none XK_KP_Right
|
||||
BX_KEY_KP_SUBTRACT none XK_KP_Subtract
|
||||
BX_KEY_KP_UP none XK_KP_8
|
||||
BX_KEY_KP_UP none XK_KP_Up
|
||||
BX_KEY_LEFT none XK_Left
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater
|
||||
BX_KEY_LEFT_BACKSLASH '<' XK_less
|
||||
BX_KEY_LEFT_BRACKET '^' XK_dead_circumflex
|
||||
BX_KEY_LEFT_BRACKET none XK_dead_diaeresis
|
||||
BX_KEY_MENU none XK_Menu
|
||||
BX_KEY_MINUS+BX_KEY_ALT_R ']' XK_bracketright
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '<27>' XK_degree
|
||||
BX_KEY_MINUS ')' XK_parenright
|
||||
BX_KEY_NUM_LOCK none XK_Num_Lock
|
||||
BX_KEY_PAGE_DOWN none XK_Page_Down
|
||||
BX_KEY_PAGE_UP none XK_Page_Up
|
||||
BX_KEY_PAUSE none XK_Break
|
||||
BX_KEY_PAUSE none XK_Pause
|
||||
BX_KEY_PERIOD ':' XK_colon
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L '/' XK_slash
|
||||
BX_KEY_PRINT none XK_Print
|
||||
BX_KEY_PRINT none XK_Sys_Req
|
||||
BX_KEY_RIGHT none XK_Right
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R '<27>' XK_currency
|
||||
BX_KEY_RIGHT_BRACKET '$' XK_dollar
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '<27>' XK_sterling
|
||||
BX_KEY_SCRL_LOCK none XK_Scroll_Lock
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L 'M' XK_M
|
||||
BX_KEY_SEMICOLON 'm' XK_m
|
||||
BX_KEY_SHIFT_L none XK_Shift_L
|
||||
BX_KEY_SHIFT_R none XK_Shift_R
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '%' XK_percent
|
||||
BX_KEY_SINGLE_QUOTE '<27>' XK_ugrave
|
||||
BX_KEY_SLASH '!' XK_exclam
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT_L '<27>' XK_section
|
||||
BX_KEY_SPACE space XK_space
|
||||
BX_KEY_TAB none XK_ISO_Left_Tab
|
||||
BX_KEY_TAB tab XK_Tab
|
||||
BX_KEY_UP none XK_Up
|
||||
BX_KEY_WIN_L none XK_Super_L
|
||||
BX_KEY_WIN_R none XK_Super_R
|
||||
207
simulators/bochs/gui/keymaps/x11-pc-it.map
Normal file
207
simulators/bochs/gui/keymaps/x11-pc-it.map
Normal file
@ -0,0 +1,207 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, IT keymap
|
||||
# Author: Emanuele Goldoni
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Xwin_Keysym is the X windows equivalent of the key combination. These
|
||||
# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h.
|
||||
# If you're running X windows, Bochs will take each of these Xwin_Keysyms,
|
||||
# pull off the XK_ in front, and use XStringToKeysym() to change them into
|
||||
# numerical codes. If this lookup fails, you will get a panic and you need
|
||||
# to edit the keymap file.
|
||||
#
|
||||
|
||||
BX_KEY_0 '0' XK_0
|
||||
BX_KEY_0+BX_KEY_SHIFT_L '=' XK_equal
|
||||
BX_KEY_1 '1' XK_1
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam
|
||||
BX_KEY_2 '2' XK_2
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '"' XK_quotedbl
|
||||
BX_KEY_3 '3' XK_3
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '<27>' XK_sterling
|
||||
BX_KEY_4 '4' XK_4
|
||||
BX_KEY_4+BX_KEY_SHIFT_L '$' XK_dollar
|
||||
BX_KEY_5 '5' XK_5
|
||||
BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent
|
||||
BX_KEY_6 '6' XK_6
|
||||
BX_KEY_6+BX_KEY_SHIFT_L '&' XK_ampersand
|
||||
BX_KEY_7 '7' XK_7
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '/' XK_slash
|
||||
BX_KEY_8 '8' XK_8
|
||||
BX_KEY_8+BX_KEY_SHIFT_L '(' XK_parenleft
|
||||
BX_KEY_9 '9' XK_9
|
||||
BX_KEY_9+BX_KEY_SHIFT_L ')' XK_parenright
|
||||
BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A
|
||||
BX_KEY_A 'a' XK_a
|
||||
BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B
|
||||
BX_KEY_B 'b' XK_b
|
||||
BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C
|
||||
BX_KEY_C 'c' XK_c
|
||||
BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D
|
||||
BX_KEY_D 'd' XK_d
|
||||
BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E
|
||||
BX_KEY_E 'e' XK_e
|
||||
BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F
|
||||
BX_KEY_F 'f' XK_f
|
||||
BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G
|
||||
BX_KEY_G 'g' XK_g
|
||||
BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H
|
||||
BX_KEY_H 'h' XK_h
|
||||
BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I
|
||||
BX_KEY_I 'i' XK_i
|
||||
BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J
|
||||
BX_KEY_J 'j' XK_j
|
||||
BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K
|
||||
BX_KEY_K 'k' XK_k
|
||||
BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L
|
||||
BX_KEY_L 'l' XK_l
|
||||
BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M
|
||||
BX_KEY_M 'm' XK_m
|
||||
BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N
|
||||
BX_KEY_N 'n' XK_n
|
||||
BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O
|
||||
BX_KEY_O 'o' XK_o
|
||||
BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P
|
||||
BX_KEY_P 'p' XK_p
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q
|
||||
BX_KEY_Q 'q' XK_q
|
||||
BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R
|
||||
BX_KEY_R 'r' XK_r
|
||||
BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S
|
||||
BX_KEY_S 's' XK_s
|
||||
BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T
|
||||
BX_KEY_T 't' XK_t
|
||||
BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U
|
||||
BX_KEY_U 'u' XK_u
|
||||
BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V
|
||||
BX_KEY_V 'v' XK_v
|
||||
BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W
|
||||
BX_KEY_W 'w' XK_w
|
||||
BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X
|
||||
BX_KEY_X 'x' XK_x
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y
|
||||
BX_KEY_Y 'y' XK_y
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z
|
||||
BX_KEY_Z 'z' XK_z
|
||||
BX_KEY_F1 none XK_F1
|
||||
BX_KEY_F2 none XK_F2
|
||||
BX_KEY_F3 none XK_F3
|
||||
BX_KEY_F4 none XK_F4
|
||||
BX_KEY_F5 none XK_F5
|
||||
BX_KEY_F6 none XK_F6
|
||||
BX_KEY_F7 none XK_F7
|
||||
BX_KEY_F8 none XK_F8
|
||||
BX_KEY_F9 none XK_F9
|
||||
BX_KEY_F10 none XK_F10
|
||||
BX_KEY_F11 none XK_F11
|
||||
BX_KEY_F12 none XK_F12
|
||||
BX_KEY_ALT_L none XK_Alt_L
|
||||
BX_KEY_ALT_L none XK_Meta_L
|
||||
BX_KEY_ALT_R none XK_Alt_R
|
||||
BX_KEY_ALT_R none XK_Mode_switch
|
||||
BX_KEY_ALT_R none XK_Multi_key
|
||||
BX_KEY_BACKSLASH '<27>' XK_ugrave
|
||||
BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '<27>' XK_section
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater
|
||||
BX_KEY_LEFT_BACKSLASH '<' XK_less
|
||||
BX_KEY_BACKSPACE none XK_BackSpace
|
||||
BX_KEY_CAPS_LOCK none XK_Caps_Lock
|
||||
BX_KEY_COMMA ',' XK_comma
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon
|
||||
BX_KEY_CTRL_L none XK_Control_L
|
||||
BX_KEY_CTRL_R none XK_Control_R
|
||||
BX_KEY_DELETE none XK_Delete
|
||||
BX_KEY_DOWN none XK_Down
|
||||
BX_KEY_END none XK_End
|
||||
BX_KEY_ENTER return XK_Return
|
||||
BX_KEY_EQUALS '<27>' XK_igrave
|
||||
BX_KEY_EQUALS+BX_KEY_SHIFT_L '^' XK_asciicircum
|
||||
BX_KEY_ESC none XK_Escape
|
||||
BX_KEY_GRAVE+BX_KEY_SHIFT_L '|' XK_bar
|
||||
BX_KEY_GRAVE backslash XK_backslash
|
||||
BX_KEY_HOME none XK_Home
|
||||
BX_KEY_INSERT none XK_Insert
|
||||
BX_KEY_KP_5 none XK_KP_5
|
||||
BX_KEY_KP_5 none XK_KP_Begin
|
||||
BX_KEY_KP_ADD none XK_KP_Add
|
||||
BX_KEY_KP_DELETE none XK_KP_Decimal
|
||||
BX_KEY_KP_DELETE none XK_KP_Delete
|
||||
BX_KEY_KP_DIVIDE none XK_KP_Divide
|
||||
BX_KEY_KP_DOWN none XK_KP_2
|
||||
BX_KEY_KP_DOWN none XK_KP_Down
|
||||
BX_KEY_KP_END none XK_KP_1
|
||||
BX_KEY_KP_END none XK_KP_End
|
||||
BX_KEY_KP_ENTER none XK_KP_Enter
|
||||
BX_KEY_KP_HOME none XK_KP_7
|
||||
BX_KEY_KP_HOME none XK_KP_Home
|
||||
BX_KEY_KP_INSERT none XK_KP_0
|
||||
BX_KEY_KP_INSERT none XK_KP_Insert
|
||||
BX_KEY_KP_LEFT none XK_KP_4
|
||||
BX_KEY_KP_LEFT none XK_KP_Left
|
||||
BX_KEY_KP_MULTIPLY none XK_KP_Multiply
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_3
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_9
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_Page_Up
|
||||
BX_KEY_KP_RIGHT none XK_KP_6
|
||||
BX_KEY_KP_RIGHT none XK_KP_Right
|
||||
BX_KEY_KP_SUBTRACT none XK_KP_Subtract
|
||||
BX_KEY_KP_UP none XK_KP_8
|
||||
BX_KEY_KP_UP none XK_KP_Up
|
||||
BX_KEY_LEFT none XK_Left
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '<27>' XK_eacute
|
||||
BX_KEY_LEFT_BRACKET '<27>' XK_egrave
|
||||
BX_KEY_MENU none XK_Menu
|
||||
BX_KEY_MINUS apostrophe XK_apostrophe
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '?' XK_question
|
||||
BX_KEY_NUM_LOCK none XK_Num_Lock
|
||||
BX_KEY_PAGE_DOWN none XK_Page_Down
|
||||
BX_KEY_PAGE_UP none XK_Page_Up
|
||||
BX_KEY_PAUSE none XK_Break
|
||||
BX_KEY_PAUSE none XK_Pause
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' XK_colon
|
||||
BX_KEY_PERIOD '.' XK_period
|
||||
BX_KEY_PRINT none XK_Print
|
||||
BX_KEY_PRINT none XK_Sys_Req
|
||||
BX_KEY_RIGHT none XK_Right
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '*' XK_asterisk
|
||||
BX_KEY_RIGHT_BRACKET '+' XK_plus
|
||||
BX_KEY_SCRL_LOCK none XK_Scroll_Lock
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '<27>' XK_ccedilla
|
||||
BX_KEY_SEMICOLON '<27>' XK_ograve
|
||||
BX_KEY_SHIFT_L none XK_Shift_L
|
||||
BX_KEY_SHIFT_R none XK_Shift_R
|
||||
BX_KEY_SINGLE_QUOTE '<27>' XK_agrave
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '<27>' XK_degree
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT_L '_' XK_underscore
|
||||
BX_KEY_SLASH '-' XK_minus
|
||||
BX_KEY_SPACE space XK_space
|
||||
BX_KEY_TAB none XK_ISO_Left_Tab
|
||||
BX_KEY_TAB tab XK_Tab
|
||||
BX_KEY_UP none XK_Up
|
||||
BX_KEY_WIN_L none XK_Super_L
|
||||
BX_KEY_WIN_R none XK_Super_R
|
||||
211
simulators/bochs/gui/keymaps/x11-pc-ru.map
Normal file
211
simulators/bochs/gui/keymaps/x11-pc-ru.map
Normal file
@ -0,0 +1,211 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, RU keymap
|
||||
# Author: Dmitry Soshnikov
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Xwin_Keysym is the X windows equivalent of the key combination. These
|
||||
# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h.
|
||||
# If you're running X windows, Bochs will take each of these Xwin_Keysyms,
|
||||
# pull off the XK_ in front, and use XStringToKeysym() to change them into
|
||||
# numerical codes. If this lookup fails, you will get a panic and you need
|
||||
# to edit the keymap file.
|
||||
#
|
||||
# Note: this is charset-1251 layout map (using in Windows and some newest
|
||||
# implementations of Linux), which works properly. Users of KOI8-R should
|
||||
# slightly modify the map to achieve proper matching (actually didn't tested.
|
||||
# - D.S.) It concerns of "," and "." symbols, which are placed on the second
|
||||
# row of the keyboard (instead of placing it on "?/" button in charset-1251),
|
||||
# and some other (unimportant) symbols. Main symbolic keyboard should work.
|
||||
|
||||
BX_KEY_0 '0' XK_0
|
||||
BX_KEY_0+BX_KEY_SHIFT_L ')' XK_parenright
|
||||
BX_KEY_1 '1' XK_1
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam
|
||||
BX_KEY_2 '2' XK_2
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '"' XK_quotedbl
|
||||
BX_KEY_3 '3' XK_3
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '?' XK_numerosign
|
||||
BX_KEY_4 '4' XK_4
|
||||
BX_KEY_4+BX_KEY_SHIFT_L ';' XK_semicolon
|
||||
BX_KEY_5 '5' XK_5
|
||||
BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent
|
||||
BX_KEY_6 '6' XK_6
|
||||
BX_KEY_6+BX_KEY_SHIFT_L ':' XK_colon
|
||||
BX_KEY_7 '7' XK_7
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '?' XK_question
|
||||
BX_KEY_8 '8' XK_8
|
||||
BX_KEY_8+BX_KEY_SHIFT_L '*' XK_asterisk
|
||||
BX_KEY_9 '9' XK_9
|
||||
BX_KEY_9+BX_KEY_SHIFT_L '(' XK_parenleft
|
||||
BX_KEY_A+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_EF
|
||||
BX_KEY_A '<27>' XK_Cyrillic_ef
|
||||
BX_KEY_B+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_I
|
||||
BX_KEY_B '<27>' XK_Cyrillic_i
|
||||
BX_KEY_C+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_ES
|
||||
BX_KEY_C '<27>' XK_Cyrillic_es
|
||||
BX_KEY_D+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_VE
|
||||
BX_KEY_D '<27>' XK_Cyrillic_ve
|
||||
BX_KEY_E+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_U
|
||||
BX_KEY_E '<27>' XK_Cyrillic_u
|
||||
BX_KEY_F+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_A
|
||||
BX_KEY_F '<27>' XK_Cyrillic_a
|
||||
BX_KEY_G+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_PE
|
||||
BX_KEY_G '<27>' XK_Cyrillic_pe
|
||||
BX_KEY_H+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_ER
|
||||
BX_KEY_H '<27>' XK_Cyrillic_er
|
||||
BX_KEY_I+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_SHA
|
||||
BX_KEY_I '<27>' XK_Cyrillic_sha
|
||||
BX_KEY_J+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_O
|
||||
BX_KEY_J '<27>' XK_Cyrillic_o
|
||||
BX_KEY_K+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_EL
|
||||
BX_KEY_K '<27>' XK_Cyrillic_el
|
||||
BX_KEY_L+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_DE
|
||||
BX_KEY_L '<27>' XK_Cyrillic_de
|
||||
BX_KEY_M+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_SOFTSIGN
|
||||
BX_KEY_M '<27>' XK_Cyrillic_softsign
|
||||
BX_KEY_N+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_TE
|
||||
BX_KEY_N '<27>' XK_Cyrillic_te
|
||||
BX_KEY_O+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_SHCHA
|
||||
BX_KEY_O '<27>' XK_Cyrillic_shcha
|
||||
BX_KEY_P+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_ZE
|
||||
BX_KEY_P '<27>' XK_Cyrillic_ze
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_SHORTI
|
||||
BX_KEY_Q '<27>' XK_Cyrillic_shorti
|
||||
BX_KEY_R+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_KA
|
||||
BX_KEY_R '<27>' XK_Cyrillic_ka
|
||||
BX_KEY_S+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_YERU
|
||||
BX_KEY_S '<27>' XK_Cyrillic_yeru
|
||||
BX_KEY_T+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_IE
|
||||
BX_KEY_T '<27>' XK_Cyrillic_ie
|
||||
BX_KEY_U+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_GHE
|
||||
BX_KEY_U '<27>' XK_Cyrillic_ghe
|
||||
BX_KEY_V+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_EM
|
||||
BX_KEY_V '<27>' XK_Cyrillic_em
|
||||
BX_KEY_W+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_TSE
|
||||
BX_KEY_W '<27>' XK_Cyrillic_tse
|
||||
BX_KEY_X+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_CHE
|
||||
BX_KEY_X '<27>' XK_Cyrillic_che
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_EN
|
||||
BX_KEY_Y '<27>' XK_Cyrillic_en
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_YA
|
||||
BX_KEY_Z '<27>' XK_Cyrillic_ya
|
||||
BX_KEY_F1 none XK_F1
|
||||
BX_KEY_F2 none XK_F2
|
||||
BX_KEY_F3 none XK_F3
|
||||
BX_KEY_F4 none XK_F4
|
||||
BX_KEY_F5 none XK_F5
|
||||
BX_KEY_F6 none XK_F6
|
||||
BX_KEY_F7 none XK_F7
|
||||
BX_KEY_F8 none XK_F8
|
||||
BX_KEY_F9 none XK_F9
|
||||
BX_KEY_F10 none XK_F10
|
||||
BX_KEY_F11 none XK_F11
|
||||
BX_KEY_F12 none XK_F12
|
||||
BX_KEY_ALT_L none XK_Alt_L
|
||||
BX_KEY_ALT_L none XK_Meta_L
|
||||
BX_KEY_ALT_R none XK_Alt_R
|
||||
BX_KEY_ALT_R none XK_Mode_switch
|
||||
BX_KEY_ALT_R none XK_Multi_key
|
||||
BX_KEY_BACKSLASH backslash XK_backslash
|
||||
BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '|' XK_bar
|
||||
BX_KEY_BACKSPACE none XK_BackSpace
|
||||
BX_KEY_CAPS_LOCK none XK_Caps_Lock
|
||||
BX_KEY_COMMA '<27>' XK_Cyrillic_be
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_BE
|
||||
BX_KEY_CTRL_L none XK_Control_L
|
||||
BX_KEY_CTRL_R none XK_Control_R
|
||||
BX_KEY_DELETE none XK_Delete
|
||||
BX_KEY_DOWN none XK_Down
|
||||
BX_KEY_END none XK_End
|
||||
BX_KEY_ENTER return XK_Return
|
||||
BX_KEY_EQUALS '=' XK_equal
|
||||
BX_KEY_EQUALS+BX_KEY_SHIFT_L '+' XK_plus
|
||||
BX_KEY_ESC none XK_Escape
|
||||
BX_KEY_GRAVE+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_IO
|
||||
BX_KEY_GRAVE '<27>' XK_Cyrillic_io
|
||||
BX_KEY_HOME none XK_Home
|
||||
BX_KEY_INSERT none XK_Insert
|
||||
BX_KEY_KP_5 none XK_KP_5
|
||||
BX_KEY_KP_5 none XK_KP_Begin
|
||||
BX_KEY_KP_ADD none XK_KP_Add
|
||||
BX_KEY_KP_DELETE none XK_KP_Decimal
|
||||
BX_KEY_KP_DELETE none XK_KP_Delete
|
||||
BX_KEY_KP_DIVIDE none XK_KP_Divide
|
||||
BX_KEY_KP_DOWN none XK_KP_2
|
||||
BX_KEY_KP_DOWN none XK_KP_Down
|
||||
BX_KEY_KP_END none XK_KP_1
|
||||
BX_KEY_KP_END none XK_KP_End
|
||||
BX_KEY_KP_ENTER none XK_KP_Enter
|
||||
BX_KEY_KP_HOME none XK_KP_7
|
||||
BX_KEY_KP_HOME none XK_KP_Home
|
||||
BX_KEY_KP_INSERT none XK_KP_0
|
||||
BX_KEY_KP_INSERT none XK_KP_Insert
|
||||
BX_KEY_KP_LEFT none XK_KP_4
|
||||
BX_KEY_KP_LEFT none XK_KP_Left
|
||||
BX_KEY_KP_MULTIPLY none XK_KP_Multiply
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_3
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_9
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_Page_Up
|
||||
BX_KEY_KP_RIGHT none XK_KP_6
|
||||
BX_KEY_KP_RIGHT none XK_KP_Right
|
||||
BX_KEY_KP_SUBTRACT none XK_KP_Subtract
|
||||
BX_KEY_KP_UP none XK_KP_8
|
||||
BX_KEY_KP_UP none XK_KP_Up
|
||||
BX_KEY_LEFT none XK_Left
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_HA
|
||||
BX_KEY_LEFT_BRACKET '<27>' XK_Cyrillic_ha
|
||||
BX_KEY_MENU none XK_Menu
|
||||
BX_KEY_MINUS '-' XK_minus
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '_' XK_underscore
|
||||
BX_KEY_NUM_LOCK none XK_Num_Lock
|
||||
BX_KEY_PAGE_DOWN none XK_Page_Down
|
||||
BX_KEY_PAGE_UP none XK_Page_Up
|
||||
BX_KEY_PAUSE none XK_Break
|
||||
BX_KEY_PAUSE none XK_Pause
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_YU
|
||||
BX_KEY_PERIOD '<27>' XK_Cyrillic_yu
|
||||
BX_KEY_PRINT none XK_Print
|
||||
BX_KEY_PRINT none XK_Sys_Req
|
||||
BX_KEY_RIGHT none XK_Right
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_HARDSIGN
|
||||
BX_KEY_RIGHT_BRACKET '<27>' XK_Cyrillic_hardsign
|
||||
BX_KEY_SCRL_LOCK none XK_Scroll_Lock
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_ZHE
|
||||
BX_KEY_SEMICOLON '<27>' XK_Cyrillic_zhe
|
||||
BX_KEY_SHIFT_L none XK_Shift_L
|
||||
BX_KEY_SHIFT_R none XK_Shift_R
|
||||
BX_KEY_SINGLE_QUOTE '<27>' XK_Cyrillic_e
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '<27>' XK_Cyrillic_E
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT_L ',' XK_comma
|
||||
BX_KEY_SLASH '.' XK_period
|
||||
BX_KEY_SPACE space XK_space
|
||||
BX_KEY_TAB none XK_ISO_Left_Tab
|
||||
BX_KEY_TAB tab XK_Tab
|
||||
BX_KEY_UP none XK_Up
|
||||
BX_KEY_WIN_L none XK_Super_L
|
||||
BX_KEY_WIN_R none XK_Super_R
|
||||
278
simulators/bochs/gui/keymaps/x11-pc-se.map
Normal file
278
simulators/bochs/gui/keymaps/x11-pc-se.map
Normal file
@ -0,0 +1,278 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, SE keymap
|
||||
# Author: Magnus 'Moggen' <20>berg
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Xwin_Keysym is the X windows equivalent of the key combination. These
|
||||
# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h.
|
||||
# If you're running X windows, Bochs will take each of these Xwin_Keysyms,
|
||||
# pull off the XK_ in front, and use XStringToKeysym() to change them into
|
||||
# numerical codes. If this lookup fails, you will get a panic and you need
|
||||
# to edit the keymap file.
|
||||
#
|
||||
|
||||
# Upper key groups
|
||||
BX_KEY_ESC none XK_Escape
|
||||
|
||||
BX_KEY_F1 none XK_F1
|
||||
BX_KEY_F2 none XK_F2
|
||||
BX_KEY_F3 none XK_F3
|
||||
BX_KEY_F4 none XK_F4
|
||||
|
||||
BX_KEY_F5 none XK_F5
|
||||
BX_KEY_F6 none XK_F6
|
||||
BX_KEY_F7 none XK_F7
|
||||
BX_KEY_F8 none XK_F8
|
||||
|
||||
BX_KEY_F9 none XK_F9
|
||||
BX_KEY_F10 none XK_F10
|
||||
BX_KEY_F11 none XK_F11
|
||||
BX_KEY_F12 none XK_F12
|
||||
|
||||
BX_KEY_PRINT none XK_Print
|
||||
BX_KEY_PRINT none XK_Sys_Req
|
||||
BX_KEY_SCRL_LOCK none XK_Scroll_Lock
|
||||
BX_KEY_PAUSE none XK_Break
|
||||
BX_KEY_PAUSE none XK_Pause
|
||||
|
||||
# Main key group
|
||||
# Row 1
|
||||
BX_KEY_GRAVE '<27>' XK_section
|
||||
BX_KEY_GRAVE+BX_KEY_SHIFT_L '<27>' XK_onehalf
|
||||
BX_KEY_GRAVE+BX_KEY_ALT_R '<27>' XK_paragraph
|
||||
BX_KEY_GRAVE+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_threequarters
|
||||
BX_KEY_1 '1' XK_1
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam
|
||||
BX_KEY_1+BX_KEY_ALT_R '<27>' XK_exclamdown
|
||||
BX_KEY_1+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_onesuperior
|
||||
BX_KEY_2 '2' XK_2
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '"' XK_quotedbl
|
||||
BX_KEY_2+BX_KEY_ALT_R '@' XK_at
|
||||
BX_KEY_2+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_twosuperior
|
||||
BX_KEY_3 '3' XK_3
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '#' XK_numbersign
|
||||
BX_KEY_3+BX_KEY_ALT_R '<27>' XK_sterling
|
||||
BX_KEY_3+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_threesuperior
|
||||
BX_KEY_4 '4' XK_4
|
||||
BX_KEY_4+BX_KEY_SHIFT_L '<27>' XK_currency
|
||||
BX_KEY_4+BX_KEY_ALT_R '$' XK_dollar
|
||||
BX_KEY_4+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_onequarter
|
||||
BX_KEY_5 '5' XK_5
|
||||
BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent
|
||||
BX_KEY_5+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_cent
|
||||
BX_KEY_6 '6' XK_6
|
||||
BX_KEY_6+BX_KEY_SHIFT_L '&' XK_ampersand
|
||||
BX_KEY_6+BX_KEY_ALT_R '<27>' XK_yen
|
||||
BX_KEY_7 '7' XK_7
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '/' XK_slash
|
||||
BX_KEY_7+BX_KEY_ALT_R '{' XK_braceleft
|
||||
BX_KEY_7+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_division
|
||||
BX_KEY_8 '8' XK_8
|
||||
BX_KEY_8+BX_KEY_SHIFT_L '(' XK_parenleft
|
||||
BX_KEY_8+BX_KEY_ALT_R '[' XK_bracketleft
|
||||
BX_KEY_9 '9' XK_9
|
||||
BX_KEY_9+BX_KEY_SHIFT_L ')' XK_parenright
|
||||
BX_KEY_9+BX_KEY_ALT_R ']' XK_bracketright
|
||||
BX_KEY_0 '0' XK_0
|
||||
BX_KEY_0+BX_KEY_SHIFT_L '=' XK_equal
|
||||
BX_KEY_0+BX_KEY_ALT_R '}' XK_braceright
|
||||
BX_KEY_0+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_degree
|
||||
BX_KEY_MINUS '+' XK_plus
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '?' XK_question
|
||||
BX_KEY_MINUS+BX_KEY_ALT_L backslash XK_backslash
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_questiondown
|
||||
BX_KEY_EQUALS none XK_dead_acute
|
||||
BX_KEY_EQUALS+BX_KEY_SHIFT_L none XK_dead_grave
|
||||
BX_KEY_EQUALS+BX_KEY_ALT_L '<27>' XK_plusminus
|
||||
BX_KEY_EQUALS+BX_KEY_ALT_L+BX_KEY_ALT_R '<27>' XK_notsign
|
||||
BX_KEY_BACKSPACE none XK_BackSpace
|
||||
|
||||
# Row 2
|
||||
BX_KEY_TAB tab XK_Tab
|
||||
BX_KEY_TAB none XK_ISO_Left_Tab
|
||||
BX_KEY_Q 'q' XK_q
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q
|
||||
BX_KEY_W 'w' XK_w
|
||||
BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W
|
||||
BX_KEY_E 'e' XK_e
|
||||
BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E
|
||||
BX_KEY_E+BX_KEY_SHIFT_L+BX_KEY_ALT_R none XK_EuroSign
|
||||
BX_KEY_R 'r' XK_r
|
||||
BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R
|
||||
BX_KEY_R+BX_KEY_ALT_R '<27>' XK_registered
|
||||
BX_KEY_T 't' XK_t
|
||||
BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T
|
||||
BX_KEY_T+BX_KEY_ALT_R '<27>' XK_thorn
|
||||
BX_KEY_T+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_THORN
|
||||
BX_KEY_Y 'y' XK_y
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y
|
||||
BX_KEY_U 'u' XK_u
|
||||
BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U
|
||||
BX_KEY_I 'i' XK_i
|
||||
BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I
|
||||
BX_KEY_O 'o' XK_o
|
||||
BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O
|
||||
BX_KEY_P 'p' XK_p
|
||||
BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P
|
||||
BX_KEY_LEFT_BRACKET '<27>' XK_aring
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '<27>' XK_Aring
|
||||
BX_KEY_RIGHT_BRACKET none XK_dead_diaeresis
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L none XK_dead_circumflex
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_ALT_R none XK_dead_tilde
|
||||
BX_KEY_ENTER return XK_Return
|
||||
|
||||
# Row 3
|
||||
BX_KEY_CAPS_LOCK none XK_Caps_Lock
|
||||
BX_KEY_A 'a' XK_a
|
||||
BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A
|
||||
BX_KEY_A+BX_KEY_ALT_R '<27>' XK_ordfeminine
|
||||
BX_KEY_A+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_masculine
|
||||
BX_KEY_S 's' XK_s
|
||||
BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S
|
||||
BX_KEY_S+BX_KEY_ALT_R '<27>' XK_ssharp
|
||||
BX_KEY_D 'd' XK_d
|
||||
BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D
|
||||
BX_KEY_D+BX_KEY_ALT_R '<27>' XK_eth
|
||||
BX_KEY_D+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_ETH
|
||||
BX_KEY_F 'f' XK_f
|
||||
BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F
|
||||
BX_KEY_G 'g' XK_g
|
||||
BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G
|
||||
BX_KEY_H 'h' XK_h
|
||||
BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H
|
||||
BX_KEY_J 'j' XK_j
|
||||
BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J
|
||||
BX_KEY_K 'k' XK_k
|
||||
BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K
|
||||
BX_KEY_L 'l' XK_l
|
||||
BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L
|
||||
BX_KEY_SEMICOLON '<27>' XK_odiaeresis
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L '<27>' XK_Odiaeresis
|
||||
BX_KEY_SEMICOLON+BX_KEY_ALT_R '<27>' XK_oslash
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_Ooblique
|
||||
BX_KEY_SINGLE_QUOTE '<27>' XK_adiaeresis
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '<27>' XK_Adiaeresis
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_ALT_R '<27>' XK_ae
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_AE
|
||||
BX_KEY_BACKSLASH apostrophe XK_apostrophe
|
||||
BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '*' XK_asterisk
|
||||
BX_KEY_BACKSLASH+BX_KEY_ALT_R '<27>' XK_acute
|
||||
BX_KEY_BACKSLASH+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_multiply
|
||||
|
||||
# Row 4
|
||||
BX_KEY_SHIFT_L none XK_Shift_L
|
||||
BX_KEY_LEFT_BACKSLASH '<' XK_less
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '>' XK_greater
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_ALT_R '|' XK_bar
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L+BX_KEY_ALT_R '<27>' XK_brokenbar
|
||||
BX_KEY_Z 'z' XK_z
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z
|
||||
BX_KEY_Z+BX_KEY_ALT_R '<27>' XK_guillemotleft
|
||||
BX_KEY_X 'x' XK_x
|
||||
BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X
|
||||
BX_KEY_X+BX_KEY_ALT_R '<27>' XK_guillemotright
|
||||
BX_KEY_C 'c' XK_c
|
||||
BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C
|
||||
BX_KEY_C+BX_KEY_ALT_R '<27>' XK_copyright
|
||||
BX_KEY_V 'v' XK_v
|
||||
BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V
|
||||
BX_KEY_V+BX_KEY_SHIFT_L+BX_KEY_ALT_R '`' XK_grave
|
||||
BX_KEY_B 'b' XK_b
|
||||
BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B
|
||||
BX_KEY_N 'n' XK_n
|
||||
BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N
|
||||
BX_KEY_M 'm' XK_m
|
||||
BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M
|
||||
BX_KEY_M+BX_KEY_ALT_R '<27>' XK_mu
|
||||
BX_KEY_COMMA ',' XK_comma
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon
|
||||
BX_KEY_PERIOD '.' XK_period
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' XK_colon
|
||||
BX_KEY_PERIOD+BX_KEY_ALT_R '<27>' XK_periodcentered
|
||||
BX_KEY_SLASH '-' XK_minus
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT '_' XK_underscore
|
||||
BX_KEY_SLASH+BX_KEY_ALT_R '<27>' XK_hyphen
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT+BX_KEY_ALT_R '<27>' XK_macron
|
||||
BX_KEY_SHIFT_R none XK_Shift_R
|
||||
|
||||
# Row 5
|
||||
BX_KEY_CTRL_L none XK_Control_L
|
||||
BX_KEY_WIN_L none XK_Super_L
|
||||
BX_KEY_ALT_L none XK_Alt_L
|
||||
BX_KEY_ALT_L none XK_Meta_L
|
||||
BX_KEY_SPACE space XK_space
|
||||
BX_KEY_SPACE+BX_KEY_ALT_R none XK_nobreakspace
|
||||
BX_KEY_ALT_R none XK_Alt_R
|
||||
BX_KEY_ALT_R none XK_Mode_switch
|
||||
BX_KEY_ALT_R none XK_Multi_key
|
||||
BX_KEY_WIN_R none XK_Super_R
|
||||
BX_KEY_MENU none XK_Menu
|
||||
BX_KEY_CTRL_R none XK_Control_R
|
||||
|
||||
# Ins/Del/Home/End/PgUp/PgDn
|
||||
BX_KEY_INSERT none XK_Insert
|
||||
BX_KEY_DELETE none XK_Delete
|
||||
BX_KEY_HOME none XK_Home
|
||||
BX_KEY_END none XK_End
|
||||
BX_KEY_PAGE_UP none XK_Page_Up
|
||||
BX_KEY_PAGE_DOWN none XK_Page_Down
|
||||
|
||||
# Arrow keys
|
||||
BX_KEY_LEFT none XK_Left
|
||||
BX_KEY_RIGHT none XK_Right
|
||||
BX_KEY_UP none XK_Up
|
||||
BX_KEY_DOWN none XK_Down
|
||||
|
||||
# Numerical keypad
|
||||
BX_KEY_NUM_LOCK none XK_Num_Lock
|
||||
BX_KEY_KP_DIVIDE none XK_KP_Divide
|
||||
BX_KEY_KP_MULTIPLY none XK_KP_Multiply
|
||||
BX_KEY_KP_SUBTRACT none XK_KP_Subtract
|
||||
BX_KEY_KP_ADD none XK_KP_Add
|
||||
BX_KEY_KP_ENTER none XK_KP_Enter
|
||||
BX_KEY_KP_HOME none XK_KP_7
|
||||
BX_KEY_KP_HOME none XK_KP_Home
|
||||
BX_KEY_KP_UP none XK_KP_8
|
||||
BX_KEY_KP_UP none XK_KP_Up
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_9
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_Page_Up
|
||||
BX_KEY_KP_LEFT none XK_KP_4
|
||||
BX_KEY_KP_LEFT none XK_KP_Left
|
||||
BX_KEY_KP_5 none XK_KP_5
|
||||
BX_KEY_KP_5 none XK_KP_Begin
|
||||
BX_KEY_KP_RIGHT none XK_KP_6
|
||||
BX_KEY_KP_RIGHT none XK_KP_Right
|
||||
BX_KEY_KP_END none XK_KP_1
|
||||
BX_KEY_KP_END none XK_KP_End
|
||||
BX_KEY_KP_DOWN none XK_KP_2
|
||||
BX_KEY_KP_DOWN none XK_KP_Down
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_3
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down
|
||||
BX_KEY_KP_INSERT none XK_KP_0
|
||||
BX_KEY_KP_INSERT none XK_KP_Insert
|
||||
BX_KEY_KP_DELETE none XK_KP_Decimal
|
||||
BX_KEY_KP_DELETE none XK_KP_Delete
|
||||
206
simulators/bochs/gui/keymaps/x11-pc-si.map
Normal file
206
simulators/bochs/gui/keymaps/x11-pc-si.map
Normal file
@ -0,0 +1,206 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, SI keymap
|
||||
# Author: Mitja Ursic
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Xwin_Keysym is the X windows equivalent of the key combination. These
|
||||
# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h.
|
||||
# If you're running X windows, Bochs will take each of these Xwin_Keysyms,
|
||||
# pull off the XK_ in front, and use XStringToKeysym() to change them into
|
||||
# numerical codes. If this lookup fails, you will get a panic and you need
|
||||
# to edit the keymap file.
|
||||
#
|
||||
|
||||
BX_KEY_0 '0' XK_0
|
||||
BX_KEY_0+BX_KEY_SHIFT_L ')' XK_parenright
|
||||
BX_KEY_1 '1' XK_1
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam
|
||||
BX_KEY_2 '2' XK_2
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '@' XK_at
|
||||
BX_KEY_3 '3' XK_3
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '#' XK_numbersign
|
||||
BX_KEY_4 '4' XK_4
|
||||
BX_KEY_4+BX_KEY_SHIFT_L '$' XK_dollar
|
||||
BX_KEY_5 '5' XK_5
|
||||
BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent
|
||||
BX_KEY_6 '6' XK_6
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '&' XK_ampersand
|
||||
BX_KEY_7 '7' XK_7
|
||||
BX_KEY_SLASH none XK_cacute
|
||||
BX_KEY_8 '8' XK_8
|
||||
BX_KEY_KP_MULTIPLY '*' XK_asterisk
|
||||
BX_KEY_9 '9' XK_9
|
||||
BX_KEY_9+BX_KEY_SHIFT_L '(' XK_parenleft
|
||||
BX_KEY_A+BX_KEY_SHIFT_L 'a' XK_A
|
||||
BX_KEY_A 'a' XK_a
|
||||
BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B
|
||||
BX_KEY_B 'b' XK_b
|
||||
BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C
|
||||
BX_KEY_C 'c' XK_c
|
||||
BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D
|
||||
BX_KEY_D 'd' XK_d
|
||||
BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E
|
||||
BX_KEY_E 'e' XK_e
|
||||
BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F
|
||||
BX_KEY_F 'f' XK_f
|
||||
BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G
|
||||
BX_KEY_G 'g' XK_g
|
||||
BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H
|
||||
BX_KEY_H 'h' XK_h
|
||||
BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I
|
||||
BX_KEY_I 'i' XK_i
|
||||
BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J
|
||||
BX_KEY_J 'j' XK_j
|
||||
BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K
|
||||
BX_KEY_K 'k' XK_k
|
||||
BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L
|
||||
BX_KEY_L 'l' XK_l
|
||||
BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M
|
||||
BX_KEY_M 'm' XK_m
|
||||
BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N
|
||||
BX_KEY_N 'n' XK_n
|
||||
BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O
|
||||
BX_KEY_O 'o' XK_o
|
||||
BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P
|
||||
BX_KEY_P 'p' XK_p
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q
|
||||
BX_KEY_Q 'q' XK_q
|
||||
BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R
|
||||
BX_KEY_R 'r' XK_r
|
||||
BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S
|
||||
BX_KEY_S 's' XK_s
|
||||
BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T
|
||||
BX_KEY_T 't' XK_t
|
||||
BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U
|
||||
BX_KEY_U 'u' XK_u
|
||||
BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V
|
||||
BX_KEY_V 'v' XK_v
|
||||
BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W
|
||||
BX_KEY_W 'w' XK_w
|
||||
BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X
|
||||
BX_KEY_X 'x' XK_x
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y
|
||||
BX_KEY_Y 'y' XK_y
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z
|
||||
BX_KEY_Z 'z' XK_z
|
||||
BX_KEY_F1 none XK_F1
|
||||
BX_KEY_F2 none XK_F2
|
||||
BX_KEY_F3 none XK_F3
|
||||
BX_KEY_F4 none XK_F4
|
||||
BX_KEY_F5 none XK_F5
|
||||
BX_KEY_F6 none XK_F6
|
||||
BX_KEY_F7 none XK_F7
|
||||
BX_KEY_F8 none XK_F8
|
||||
BX_KEY_F9 none XK_F9
|
||||
BX_KEY_F10 none XK_F10
|
||||
BX_KEY_F11 none XK_F11
|
||||
BX_KEY_F12 none XK_F12
|
||||
BX_KEY_ALT_L none XK_Alt_L
|
||||
BX_KEY_ALT_L none XK_Meta_L
|
||||
BX_KEY_ALT_R none XK_Alt_R
|
||||
BX_KEY_ALT_R none XK_Mode_switch
|
||||
BX_KEY_ALT_R none XK_Multi_key
|
||||
BX_KEY_BACKSLASH backslash XK_backslash
|
||||
BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '|' XK_bar
|
||||
BX_KEY_BACKSPACE none XK_BackSpace
|
||||
BX_KEY_CAPS_LOCK none XK_Caps_Lock
|
||||
BX_KEY_COMMA ',' XK_comma
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon
|
||||
BX_KEY_CTRL_L none XK_Control_L
|
||||
BX_KEY_CTRL_R none XK_Control_R
|
||||
BX_KEY_DELETE none XK_Delete
|
||||
BX_KEY_DOWN none XK_Down
|
||||
BX_KEY_END none XK_End
|
||||
BX_KEY_ENTER return XK_Return
|
||||
BX_KEY_EQUALS '=' XK_zcaron
|
||||
BX_KEY_KP_ADD '+' XK_plus
|
||||
BX_KEY_ESC none XK_Escape
|
||||
BX_KEY_GRAVE+BX_KEY_SHIFT_L '~' XK_asciitilde
|
||||
BX_KEY_GRAVE '`' XK_grave
|
||||
BX_KEY_HOME none XK_Home
|
||||
BX_KEY_INSERT none XK_Insert
|
||||
BX_KEY_KP_5 none XK_KP_5
|
||||
BX_KEY_KP_5 none XK_KP_Begin
|
||||
BX_KEY_KP_ADD none XK_KP_Add
|
||||
BX_KEY_KP_DELETE none XK_KP_Decimal
|
||||
BX_KEY_KP_DELETE none XK_KP_Delete
|
||||
BX_KEY_KP_DIVIDE none XK_KP_Divide
|
||||
BX_KEY_KP_DOWN none XK_KP_2
|
||||
BX_KEY_KP_DOWN none XK_KP_Down
|
||||
BX_KEY_KP_END none XK_KP_1
|
||||
BX_KEY_KP_END none XK_KP_End
|
||||
BX_KEY_KP_ENTER none XK_KP_Enter
|
||||
BX_KEY_KP_HOME none XK_KP_7
|
||||
BX_KEY_KP_HOME none XK_KP_Home
|
||||
BX_KEY_KP_INSERT none XK_KP_0
|
||||
BX_KEY_KP_INSERT none XK_KP_Insert
|
||||
BX_KEY_KP_LEFT none XK_KP_4
|
||||
BX_KEY_KP_LEFT none XK_KP_Left
|
||||
BX_KEY_KP_MULTIPLY none XK_KP_Multiply
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_3
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_9
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_Page_Up
|
||||
BX_KEY_KP_RIGHT none XK_KP_6
|
||||
BX_KEY_KP_RIGHT none XK_KP_Right
|
||||
BX_KEY_KP_SUBTRACT none XK_KP_Subtract
|
||||
BX_KEY_KP_UP none XK_KP_8
|
||||
BX_KEY_KP_UP none XK_KP_Up
|
||||
BX_KEY_LEFT none XK_Left
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '{' XK_Scaron
|
||||
BX_KEY_LEFT_BRACKET '[' XK_bracketleft
|
||||
BX_KEY_MENU none XK_Menu
|
||||
BX_KEY_MINUS '-' XK_minus
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '_' XK_underscore
|
||||
BX_KEY_NUM_LOCK none XK_Num_Lock
|
||||
BX_KEY_PAGE_DOWN none XK_Page_Down
|
||||
BX_KEY_PAGE_UP none XK_Page_Up
|
||||
BX_KEY_PAUSE none XK_Break
|
||||
BX_KEY_PAUSE none XK_Pause
|
||||
BX_KEY_COMMA ',' XK_comma
|
||||
BX_KEY_PERIOD '.' XK_period
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L ':' XK_colon #more >
|
||||
BX_KEY_PRINT none XK_Print
|
||||
BX_KEY_PRINT none XK_Sys_Req
|
||||
BX_KEY_RIGHT none XK_Right
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '}' XK_Dstroke
|
||||
BX_KEY_RIGHT_BRACKET ']' XK_bracketright
|
||||
BX_KEY_SCRL_LOCK none XK_Scroll_Lock
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L ';' XK_semicolon #less <
|
||||
BX_KEY_SEMICOLON ';' XK_ccaron
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L ':' XK_Ccaron
|
||||
BX_KEY_SHIFT_L none XK_Shift_L
|
||||
BX_KEY_SHIFT_R none XK_Shift_R
|
||||
BX_KEY_SINGLE_QUOTE apostrophe XK_apostrophe
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '"' XK_quotedbl
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT_L '?' XK_question
|
||||
BX_KEY_SPACE space XK_space
|
||||
BX_KEY_TAB none XK_ISO_Left_Tab
|
||||
BX_KEY_TAB tab XK_Tab
|
||||
BX_KEY_UP none XK_Up
|
||||
BX_KEY_WIN_L none XK_Super_L
|
||||
BX_KEY_WIN_R none XK_Super_R
|
||||
209
simulators/bochs/gui/keymaps/x11-pc-uk.map
Normal file
209
simulators/bochs/gui/keymaps/x11-pc-uk.map
Normal file
@ -0,0 +1,209 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, UK keymap
|
||||
# Author: Denis Lenihan
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Xwin_Keysym is the X windows equivalent of the key combination. These
|
||||
# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h.
|
||||
# If you're running X windows, Bochs will take each of these Xwin_Keysyms,
|
||||
# pull off the XK_ in front, and use XStringToKeysym() to change them into
|
||||
# numerical codes. If this lookup fails, you will get a panic and you need
|
||||
# to edit the keymap file.
|
||||
#
|
||||
|
||||
BX_KEY_0 '0' XK_0
|
||||
BX_KEY_0+BX_KEY_SHIFT_L ')' XK_parenright
|
||||
BX_KEY_1 '1' XK_1
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam
|
||||
BX_KEY_2 '2' XK_2
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '"' XK_quotedbl
|
||||
BX_KEY_3 '3' XK_3
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '<27>' XK_sterling
|
||||
BX_KEY_3+BX_KEY_ALT_R '|' XK_EuroSign
|
||||
BX_KEY_4 '4' XK_4
|
||||
BX_KEY_4+BX_KEY_SHIFT_L '$' XK_dollar
|
||||
BX_KEY_5 '5' XK_5
|
||||
BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent
|
||||
BX_KEY_6 '6' XK_6
|
||||
BX_KEY_6+BX_KEY_SHIFT_L '^' XK_asciicircum
|
||||
BX_KEY_7 '7' XK_7
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '&' XK_ampersand
|
||||
BX_KEY_8 '8' XK_8
|
||||
BX_KEY_8+BX_KEY_SHIFT_L '*' XK_asterisk
|
||||
BX_KEY_9 '9' XK_9
|
||||
BX_KEY_9+BX_KEY_SHIFT_L '(' XK_parenleft
|
||||
BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A
|
||||
BX_KEY_A 'a' XK_a
|
||||
BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B
|
||||
BX_KEY_B 'b' XK_b
|
||||
BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C
|
||||
BX_KEY_C 'c' XK_c
|
||||
BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D
|
||||
BX_KEY_D 'd' XK_d
|
||||
BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E
|
||||
BX_KEY_E 'e' XK_e
|
||||
BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F
|
||||
BX_KEY_F 'f' XK_f
|
||||
BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G
|
||||
BX_KEY_G 'g' XK_g
|
||||
BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H
|
||||
BX_KEY_H 'h' XK_h
|
||||
BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I
|
||||
BX_KEY_I 'i' XK_i
|
||||
BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J
|
||||
BX_KEY_J 'j' XK_j
|
||||
BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K
|
||||
BX_KEY_K 'k' XK_k
|
||||
BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L
|
||||
BX_KEY_L 'l' XK_l
|
||||
BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M
|
||||
BX_KEY_M 'm' XK_m
|
||||
BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N
|
||||
BX_KEY_N 'n' XK_n
|
||||
BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O
|
||||
BX_KEY_O 'o' XK_o
|
||||
BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P
|
||||
BX_KEY_P 'p' XK_p
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q
|
||||
BX_KEY_Q 'q' XK_q
|
||||
BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R
|
||||
BX_KEY_R 'r' XK_r
|
||||
BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S
|
||||
BX_KEY_S 's' XK_s
|
||||
BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T
|
||||
BX_KEY_T 't' XK_t
|
||||
BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U
|
||||
BX_KEY_U 'u' XK_u
|
||||
BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V
|
||||
BX_KEY_V 'v' XK_v
|
||||
BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W
|
||||
BX_KEY_W 'w' XK_w
|
||||
BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X
|
||||
BX_KEY_X 'x' XK_x
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y
|
||||
BX_KEY_Y 'y' XK_y
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z
|
||||
BX_KEY_Z 'z' XK_z
|
||||
BX_KEY_F1 none XK_F1
|
||||
BX_KEY_F2 none XK_F2
|
||||
BX_KEY_F3 none XK_F3
|
||||
BX_KEY_F4 none XK_F4
|
||||
BX_KEY_F5 none XK_F5
|
||||
BX_KEY_F6 none XK_F6
|
||||
BX_KEY_F7 none XK_F7
|
||||
BX_KEY_F8 none XK_F8
|
||||
BX_KEY_F9 none XK_F9
|
||||
BX_KEY_F10 none XK_F10
|
||||
BX_KEY_F11 none XK_F11
|
||||
BX_KEY_F12 none XK_F12
|
||||
BX_KEY_ALT_L none XK_Alt_L
|
||||
BX_KEY_ALT_L none XK_Meta_L
|
||||
BX_KEY_ALT_R none XK_Alt_R
|
||||
BX_KEY_ALT_R none XK_Mode_switch
|
||||
BX_KEY_ALT_R none XK_Multi_key
|
||||
BX_KEY_LEFT_BACKSLASH '\' XK_backslash
|
||||
BX_KEY_LEFT_BACKSLASH+BX_KEY_SHIFT_L '|' XK_bar
|
||||
BX_KEY_BACKSLASH '~' XK_asciitilde
|
||||
BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '#' XK_numbersign
|
||||
BX_KEY_BACKSPACE none XK_BackSpace
|
||||
BX_KEY_CAPS_LOCK none XK_Caps_Lock
|
||||
BX_KEY_COMMA ',' XK_comma
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L '<' XK_less
|
||||
BX_KEY_CTRL_L none XK_Control_L
|
||||
BX_KEY_CTRL_R none XK_Control_R
|
||||
BX_KEY_DELETE none XK_Delete
|
||||
BX_KEY_DOWN none XK_Down
|
||||
BX_KEY_END none XK_End
|
||||
BX_KEY_ENTER return XK_Return
|
||||
BX_KEY_EQUALS '=' XK_equal
|
||||
BX_KEY_EQUALS+BX_KEY_SHIFT_L '+' XK_plus
|
||||
BX_KEY_ESC none XK_Escape
|
||||
BX_KEY_GRAVE+BX_KEY_SHIFT_L '<27>' XK_notsign
|
||||
BX_KEY_GRAVE '`' XK_grave
|
||||
BX_KEY_GRAVE+BX_KEY_ALT_R '|' XK_bar
|
||||
BX_KEY_HOME none XK_Home
|
||||
BX_KEY_INSERT none XK_Insert
|
||||
BX_KEY_KP_5 none XK_KP_5
|
||||
BX_KEY_KP_5 none XK_KP_Begin
|
||||
BX_KEY_KP_ADD none XK_KP_Add
|
||||
BX_KEY_KP_DELETE none XK_KP_Decimal
|
||||
BX_KEY_KP_DELETE none XK_KP_Delete
|
||||
BX_KEY_KP_DIVIDE none XK_KP_Divide
|
||||
BX_KEY_KP_DOWN none XK_KP_2
|
||||
BX_KEY_KP_DOWN none XK_KP_Down
|
||||
BX_KEY_KP_END none XK_KP_1
|
||||
BX_KEY_KP_END none XK_KP_End
|
||||
BX_KEY_KP_ENTER none XK_KP_Enter
|
||||
BX_KEY_KP_HOME none XK_KP_7
|
||||
BX_KEY_KP_HOME none XK_KP_Home
|
||||
BX_KEY_KP_INSERT none XK_KP_0
|
||||
BX_KEY_KP_INSERT none XK_KP_Insert
|
||||
BX_KEY_KP_LEFT none XK_KP_4
|
||||
BX_KEY_KP_LEFT none XK_KP_Left
|
||||
BX_KEY_KP_MULTIPLY none XK_KP_Multiply
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_3
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_9
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_Page_Up
|
||||
BX_KEY_KP_RIGHT none XK_KP_6
|
||||
BX_KEY_KP_RIGHT none XK_KP_Right
|
||||
BX_KEY_KP_SUBTRACT none XK_KP_Subtract
|
||||
BX_KEY_KP_UP none XK_KP_8
|
||||
BX_KEY_KP_UP none XK_KP_Up
|
||||
BX_KEY_LEFT none XK_Left
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '{' XK_braceleft
|
||||
BX_KEY_LEFT_BRACKET '[' XK_bracketleft
|
||||
BX_KEY_MENU none XK_Menu
|
||||
BX_KEY_MINUS '-' XK_minus
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '_' XK_underscore
|
||||
BX_KEY_NUM_LOCK none XK_Num_Lock
|
||||
BX_KEY_PAGE_DOWN none XK_Page_Down
|
||||
BX_KEY_PAGE_UP none XK_Page_Up
|
||||
BX_KEY_PAUSE none XK_Break
|
||||
BX_KEY_PAUSE none XK_Pause
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L '>' XK_greater
|
||||
BX_KEY_PERIOD '.' XK_period
|
||||
BX_KEY_PRINT none XK_Print
|
||||
BX_KEY_PRINT none XK_Sys_Req
|
||||
BX_KEY_RIGHT none XK_Right
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '}' XK_braceright
|
||||
BX_KEY_RIGHT_BRACKET ']' XK_bracketright
|
||||
BX_KEY_SCRL_LOCK none XK_Scroll_Lock
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L ':' XK_colon
|
||||
BX_KEY_SEMICOLON ';' XK_semicolon
|
||||
BX_KEY_SHIFT_L none XK_Shift_L
|
||||
BX_KEY_SHIFT_R none XK_Shift_R
|
||||
BX_KEY_SINGLE_QUOTE apostrophe XK_apostrophe
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '@' XK_at
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT_L '?' XK_question
|
||||
BX_KEY_SLASH '/' XK_slash
|
||||
BX_KEY_SPACE space XK_space
|
||||
BX_KEY_TAB none XK_ISO_Left_Tab
|
||||
BX_KEY_TAB tab XK_Tab
|
||||
BX_KEY_UP none XK_Up
|
||||
BX_KEY_WIN_L none XK_Super_L
|
||||
BX_KEY_WIN_R none XK_Super_R
|
||||
205
simulators/bochs/gui/keymaps/x11-pc-us.map
Normal file
205
simulators/bochs/gui/keymaps/x11-pc-us.map
Normal file
@ -0,0 +1,205 @@
|
||||
# Bochs Keymap file
|
||||
# $Id$
|
||||
# Target: PC(x86) keyboard, US keymap
|
||||
# Author: Christophe Bothamy, Bryce Denney
|
||||
#
|
||||
# The keymap file describes the layout of a keyboard, and how it translates
|
||||
# into Bochs key codes.
|
||||
#
|
||||
# Format:
|
||||
# BX_Keysym ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# Or, for keys that require modifiers:
|
||||
# BX_Keysym+BX_Modifier ASCII_equivalent Xwin_Keysym
|
||||
#
|
||||
# BX_Keysym and BX_Modifier must be present in the bx_key_symbol[] list in
|
||||
# gui/keymap.cc. The BX_Modifier is usually a shift key press, but it
|
||||
# could be any key. Presently a maximum of one modifier is supported, but this
|
||||
# could be changed in keymap.h (structure def has only one slot for modifier),
|
||||
# keymap.cc (parsing code), and iodev/keyboard.cc (simulate keypresses for >1
|
||||
# modifier).
|
||||
#
|
||||
# The ASCII_equivalent must be either apostrophe + one character + apostrophe,
|
||||
# or one of these keywords: space, return, tab, backslash, apostrophe, none.
|
||||
# This format is designed to look like a char constant in C, but it's a very
|
||||
# simple parser. There's no concept of backslash being an escape char. The
|
||||
# backslash and apostrophe entries are provided for aesthetic purposes only: no
|
||||
# C++ programmer wants to see '\' or '''. The parser doesn't care, but they are
|
||||
# ugly.
|
||||
#
|
||||
# Xwin_Keysym is the X windows equivalent of the key combination. These
|
||||
# codes should match whatever you find in /usr/X11R6/include/X11/keysymdef.h.
|
||||
# If you're running X windows, Bochs will take each of these Xwin_Keysyms,
|
||||
# pull off the XK_ in front, and use XStringToKeysym() to change them into
|
||||
# numerical codes. If this lookup fails, you will get a panic and you need
|
||||
# to edit the keymap file.
|
||||
#
|
||||
|
||||
BX_KEY_0 '0' XK_0
|
||||
BX_KEY_0+BX_KEY_SHIFT_L ')' XK_parenright
|
||||
BX_KEY_1 '1' XK_1
|
||||
BX_KEY_1+BX_KEY_SHIFT_L '!' XK_exclam
|
||||
BX_KEY_2 '2' XK_2
|
||||
BX_KEY_2+BX_KEY_SHIFT_L '@' XK_at
|
||||
BX_KEY_3 '3' XK_3
|
||||
BX_KEY_3+BX_KEY_SHIFT_L '#' XK_numbersign
|
||||
BX_KEY_4 '4' XK_4
|
||||
BX_KEY_4+BX_KEY_SHIFT_L '$' XK_dollar
|
||||
BX_KEY_5 '5' XK_5
|
||||
BX_KEY_5+BX_KEY_SHIFT_L '%' XK_percent
|
||||
BX_KEY_6 '6' XK_6
|
||||
BX_KEY_6+BX_KEY_SHIFT_L '^' XK_asciicircum
|
||||
BX_KEY_7 '7' XK_7
|
||||
BX_KEY_7+BX_KEY_SHIFT_L '&' XK_ampersand
|
||||
BX_KEY_8 '8' XK_8
|
||||
BX_KEY_8+BX_KEY_SHIFT_L '*' XK_asterisk
|
||||
BX_KEY_9 '9' XK_9
|
||||
BX_KEY_9+BX_KEY_SHIFT_L '(' XK_parenleft
|
||||
BX_KEY_A+BX_KEY_SHIFT_L 'A' XK_A
|
||||
BX_KEY_A 'a' XK_a
|
||||
BX_KEY_B+BX_KEY_SHIFT_L 'B' XK_B
|
||||
BX_KEY_B 'b' XK_b
|
||||
BX_KEY_C+BX_KEY_SHIFT_L 'C' XK_C
|
||||
BX_KEY_C 'c' XK_c
|
||||
BX_KEY_D+BX_KEY_SHIFT_L 'D' XK_D
|
||||
BX_KEY_D 'd' XK_d
|
||||
BX_KEY_E+BX_KEY_SHIFT_L 'E' XK_E
|
||||
BX_KEY_E 'e' XK_e
|
||||
BX_KEY_F+BX_KEY_SHIFT_L 'F' XK_F
|
||||
BX_KEY_F 'f' XK_f
|
||||
BX_KEY_G+BX_KEY_SHIFT_L 'G' XK_G
|
||||
BX_KEY_G 'g' XK_g
|
||||
BX_KEY_H+BX_KEY_SHIFT_L 'H' XK_H
|
||||
BX_KEY_H 'h' XK_h
|
||||
BX_KEY_I+BX_KEY_SHIFT_L 'I' XK_I
|
||||
BX_KEY_I 'i' XK_i
|
||||
BX_KEY_J+BX_KEY_SHIFT_L 'J' XK_J
|
||||
BX_KEY_J 'j' XK_j
|
||||
BX_KEY_K+BX_KEY_SHIFT_L 'K' XK_K
|
||||
BX_KEY_K 'k' XK_k
|
||||
BX_KEY_L+BX_KEY_SHIFT_L 'L' XK_L
|
||||
BX_KEY_L 'l' XK_l
|
||||
BX_KEY_M+BX_KEY_SHIFT_L 'M' XK_M
|
||||
BX_KEY_M 'm' XK_m
|
||||
BX_KEY_N+BX_KEY_SHIFT_L 'N' XK_N
|
||||
BX_KEY_N 'n' XK_n
|
||||
BX_KEY_O+BX_KEY_SHIFT_L 'O' XK_O
|
||||
BX_KEY_O 'o' XK_o
|
||||
BX_KEY_P+BX_KEY_SHIFT_L 'P' XK_P
|
||||
BX_KEY_P 'p' XK_p
|
||||
BX_KEY_Q+BX_KEY_SHIFT_L 'Q' XK_Q
|
||||
BX_KEY_Q 'q' XK_q
|
||||
BX_KEY_R+BX_KEY_SHIFT_L 'R' XK_R
|
||||
BX_KEY_R 'r' XK_r
|
||||
BX_KEY_S+BX_KEY_SHIFT_L 'S' XK_S
|
||||
BX_KEY_S 's' XK_s
|
||||
BX_KEY_T+BX_KEY_SHIFT_L 'T' XK_T
|
||||
BX_KEY_T 't' XK_t
|
||||
BX_KEY_U+BX_KEY_SHIFT_L 'U' XK_U
|
||||
BX_KEY_U 'u' XK_u
|
||||
BX_KEY_V+BX_KEY_SHIFT_L 'V' XK_V
|
||||
BX_KEY_V 'v' XK_v
|
||||
BX_KEY_W+BX_KEY_SHIFT_L 'W' XK_W
|
||||
BX_KEY_W 'w' XK_w
|
||||
BX_KEY_X+BX_KEY_SHIFT_L 'X' XK_X
|
||||
BX_KEY_X 'x' XK_x
|
||||
BX_KEY_Y+BX_KEY_SHIFT_L 'Y' XK_Y
|
||||
BX_KEY_Y 'y' XK_y
|
||||
BX_KEY_Z+BX_KEY_SHIFT_L 'Z' XK_Z
|
||||
BX_KEY_Z 'z' XK_z
|
||||
BX_KEY_F1 none XK_F1
|
||||
BX_KEY_F2 none XK_F2
|
||||
BX_KEY_F3 none XK_F3
|
||||
BX_KEY_F4 none XK_F4
|
||||
BX_KEY_F5 none XK_F5
|
||||
BX_KEY_F6 none XK_F6
|
||||
BX_KEY_F7 none XK_F7
|
||||
BX_KEY_F8 none XK_F8
|
||||
BX_KEY_F9 none XK_F9
|
||||
BX_KEY_F10 none XK_F10
|
||||
BX_KEY_F11 none XK_F11
|
||||
BX_KEY_F12 none XK_F12
|
||||
BX_KEY_ALT_L none XK_Alt_L
|
||||
BX_KEY_ALT_L none XK_Meta_L
|
||||
BX_KEY_ALT_R none XK_Alt_R
|
||||
BX_KEY_ALT_R none XK_Mode_switch
|
||||
BX_KEY_ALT_R none XK_Multi_key
|
||||
BX_KEY_BACKSLASH backslash XK_backslash
|
||||
BX_KEY_BACKSLASH+BX_KEY_SHIFT_L '|' XK_bar
|
||||
BX_KEY_BACKSPACE none XK_BackSpace
|
||||
BX_KEY_CAPS_LOCK none XK_Caps_Lock
|
||||
BX_KEY_COMMA ',' XK_comma
|
||||
BX_KEY_COMMA+BX_KEY_SHIFT_L '<' XK_less
|
||||
BX_KEY_CTRL_L none XK_Control_L
|
||||
BX_KEY_CTRL_R none XK_Control_R
|
||||
BX_KEY_DELETE none XK_Delete
|
||||
BX_KEY_DOWN none XK_Down
|
||||
BX_KEY_END none XK_End
|
||||
BX_KEY_ENTER return XK_Return
|
||||
BX_KEY_EQUALS '=' XK_equal
|
||||
BX_KEY_EQUALS+BX_KEY_SHIFT_L '+' XK_plus
|
||||
BX_KEY_ESC none XK_Escape
|
||||
BX_KEY_GRAVE+BX_KEY_SHIFT_L '~' XK_asciitilde
|
||||
BX_KEY_GRAVE '`' XK_grave
|
||||
BX_KEY_HOME none XK_Home
|
||||
BX_KEY_INSERT none XK_Insert
|
||||
BX_KEY_KP_5 none XK_KP_5
|
||||
BX_KEY_KP_5 none XK_KP_Begin
|
||||
BX_KEY_KP_ADD none XK_KP_Add
|
||||
BX_KEY_KP_DELETE none XK_KP_Decimal
|
||||
BX_KEY_KP_DELETE none XK_KP_Delete
|
||||
BX_KEY_KP_DIVIDE none XK_KP_Divide
|
||||
BX_KEY_KP_DOWN none XK_KP_2
|
||||
BX_KEY_KP_DOWN none XK_KP_Down
|
||||
BX_KEY_KP_END none XK_KP_1
|
||||
BX_KEY_KP_END none XK_KP_End
|
||||
BX_KEY_KP_ENTER none XK_KP_Enter
|
||||
BX_KEY_KP_HOME none XK_KP_7
|
||||
BX_KEY_KP_HOME none XK_KP_Home
|
||||
BX_KEY_KP_INSERT none XK_KP_0
|
||||
BX_KEY_KP_INSERT none XK_KP_Insert
|
||||
BX_KEY_KP_LEFT none XK_KP_4
|
||||
BX_KEY_KP_LEFT none XK_KP_Left
|
||||
BX_KEY_KP_MULTIPLY none XK_KP_Multiply
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_3
|
||||
BX_KEY_KP_PAGE_DOWN none XK_KP_Page_Down
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_9
|
||||
BX_KEY_KP_PAGE_UP none XK_KP_Page_Up
|
||||
BX_KEY_KP_RIGHT none XK_KP_6
|
||||
BX_KEY_KP_RIGHT none XK_KP_Right
|
||||
BX_KEY_KP_SUBTRACT none XK_KP_Subtract
|
||||
BX_KEY_KP_UP none XK_KP_8
|
||||
BX_KEY_KP_UP none XK_KP_Up
|
||||
BX_KEY_LEFT none XK_Left
|
||||
BX_KEY_LEFT_BRACKET+BX_KEY_SHIFT_L '{' XK_braceleft
|
||||
BX_KEY_LEFT_BRACKET '[' XK_bracketleft
|
||||
BX_KEY_MENU none XK_Menu
|
||||
BX_KEY_MINUS '-' XK_minus
|
||||
BX_KEY_MINUS+BX_KEY_SHIFT_L '_' XK_underscore
|
||||
BX_KEY_NUM_LOCK none XK_Num_Lock
|
||||
BX_KEY_PAGE_DOWN none XK_Page_Down
|
||||
BX_KEY_PAGE_UP none XK_Page_Up
|
||||
BX_KEY_PAUSE none XK_Break
|
||||
BX_KEY_PAUSE none XK_Pause
|
||||
BX_KEY_PERIOD+BX_KEY_SHIFT_L '>' XK_greater
|
||||
BX_KEY_PERIOD '.' XK_period
|
||||
BX_KEY_PRINT none XK_Print
|
||||
BX_KEY_PRINT none XK_Sys_Req
|
||||
BX_KEY_RIGHT none XK_Right
|
||||
BX_KEY_RIGHT_BRACKET+BX_KEY_SHIFT_L '}' XK_braceright
|
||||
BX_KEY_RIGHT_BRACKET ']' XK_bracketright
|
||||
BX_KEY_SCRL_LOCK none XK_Scroll_Lock
|
||||
BX_KEY_SEMICOLON+BX_KEY_SHIFT_L ':' XK_colon
|
||||
BX_KEY_SEMICOLON ';' XK_semicolon
|
||||
BX_KEY_SHIFT_L none XK_Shift_L
|
||||
BX_KEY_SHIFT_R none XK_Shift_R
|
||||
BX_KEY_SINGLE_QUOTE apostrophe XK_apostrophe
|
||||
BX_KEY_SINGLE_QUOTE+BX_KEY_SHIFT_L '"' XK_quotedbl
|
||||
BX_KEY_SLASH+BX_KEY_SHIFT_L '?' XK_question
|
||||
BX_KEY_SLASH '/' XK_slash
|
||||
BX_KEY_SPACE space XK_space
|
||||
BX_KEY_TAB none XK_ISO_Left_Tab
|
||||
BX_KEY_TAB tab XK_Tab
|
||||
BX_KEY_UP none XK_Up
|
||||
BX_KEY_WIN_L none XK_Super_L
|
||||
BX_KEY_WIN_R none XK_Super_R
|
||||
1696
simulators/bochs/gui/macintosh.cc
Normal file
1696
simulators/bochs/gui/macintosh.cc
Normal file
File diff suppressed because it is too large
Load Diff
332
simulators/bochs/gui/nogui.cc
Normal file
332
simulators/bochs/gui/nogui.cc
Normal file
@ -0,0 +1,332 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2001-2009 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 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"
|
||||
|
||||
#if BX_WITH_NOGUI
|
||||
#include "icon_bochs.h"
|
||||
|
||||
class bx_nogui_gui_c : public bx_gui_c {
|
||||
public:
|
||||
bx_nogui_gui_c (void) {}
|
||||
DECLARE_GUI_VIRTUAL_METHODS()
|
||||
};
|
||||
|
||||
// declare one instance of the gui object and call macro to insert the
|
||||
// plugin code
|
||||
static bx_nogui_gui_c *theGui = NULL;
|
||||
IMPLEMENT_GUI_PLUGIN_CODE(nogui)
|
||||
|
||||
#define LOG_THIS theGui->
|
||||
|
||||
// This file defines stubs for the GUI interface, which is a
|
||||
// place to start if you want to port bochs to a platform, for
|
||||
// which there is no support for your native GUI, or if you want to compile
|
||||
// bochs without any native GUI support (no output window or
|
||||
// keyboard input will be possible).
|
||||
// Look in 'x.cc', 'beos.cc', and 'win32.cc' for specific
|
||||
// implementations of this interface. -Kevin
|
||||
|
||||
|
||||
|
||||
// ::SPECIFIC_INIT()
|
||||
//
|
||||
// Called from gui.cc, once upon program startup, to allow for the
|
||||
// specific GUI code (X11, BeOS, ...) to be initialized.
|
||||
//
|
||||
// argc, argv: these arguments can be used to initialize the GUI with
|
||||
// specific options (X11 options, BeOS options,...)
|
||||
//
|
||||
// tilewidth, tileheight: for optimization, graphics_tile_update() passes
|
||||
// only updated regions of the screen to the gui code to be redrawn.
|
||||
// These define the dimensions of a region (tile).
|
||||
// headerbar_y: A headerbar (toolbar) is display on the top of the
|
||||
// VGA window, showing floppy status, and other information. It
|
||||
// always assumes the width of the current VGA mode width, but
|
||||
// it's height is defined by this parameter.
|
||||
|
||||
void bx_nogui_gui_c::specific_init(int argc, char **argv, unsigned tilewidth, unsigned tileheight,
|
||||
unsigned headerbar_y)
|
||||
{
|
||||
put("NGUI");
|
||||
UNUSED(argc);
|
||||
UNUSED(argv);
|
||||
UNUSED(tilewidth);
|
||||
UNUSED(tileheight);
|
||||
UNUSED(headerbar_y);
|
||||
|
||||
UNUSED(bochs_icon_bits); // global variable
|
||||
|
||||
if (SIM->get_param_bool(BXPN_PRIVATE_COLORMAP)->get()) {
|
||||
BX_INFO(("private_colormap option ignored."));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ::HANDLE_EVENTS()
|
||||
//
|
||||
// Called periodically (vga_update_interval in .bochsrc) so the
|
||||
// the gui code can poll for keyboard, mouse, and other
|
||||
// relevant events.
|
||||
|
||||
void bx_nogui_gui_c::handle_events(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ::FLUSH()
|
||||
//
|
||||
// Called periodically, requesting that the gui code flush all pending
|
||||
// screen update requests.
|
||||
|
||||
void bx_nogui_gui_c::flush(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ::CLEAR_SCREEN()
|
||||
//
|
||||
// Called to request that the VGA region is cleared. Don't
|
||||
// clear the area that defines the headerbar.
|
||||
|
||||
void bx_nogui_gui_c::clear_screen(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ::TEXT_UPDATE()
|
||||
//
|
||||
// Called in a VGA text mode, to update the screen with
|
||||
// new content.
|
||||
//
|
||||
// old_text: array of character/attributes making up the contents
|
||||
// of the screen from the last call. See below
|
||||
// new_text: array of character/attributes making up the current
|
||||
// contents, which should now be displayed. See below
|
||||
//
|
||||
// format of old_text & new_text: each is tm_info.line_offset*text_rows
|
||||
// bytes long. Each character consists of 2 bytes. The first by is
|
||||
// the character value, the second is the attribute byte.
|
||||
//
|
||||
// cursor_x: new x location of cursor
|
||||
// cursor_y: new y location of cursor
|
||||
// tm_info: this structure contains information for additional
|
||||
// features in text mode (cursor shape, line offset,...)
|
||||
|
||||
void bx_nogui_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
|
||||
unsigned long cursor_x, unsigned long cursor_y,
|
||||
bx_vga_tminfo_t tm_info)
|
||||
{
|
||||
UNUSED(old_text);
|
||||
UNUSED(new_text);
|
||||
UNUSED(cursor_x);
|
||||
UNUSED(cursor_y);
|
||||
UNUSED(tm_info);
|
||||
}
|
||||
|
||||
|
||||
// ::GET_CLIPBOARD_TEXT()
|
||||
//
|
||||
// Called to get text from the GUI clipboard. Returns 1 if successful.
|
||||
|
||||
int bx_nogui_gui_c::get_clipboard_text(Bit8u **bytes, Bit32s *nbytes)
|
||||
{
|
||||
UNUSED(bytes);
|
||||
UNUSED(nbytes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ::SET_CLIPBOARD_TEXT()
|
||||
//
|
||||
// Called to copy the text screen contents to the GUI clipboard.
|
||||
// Returns 1 if successful.
|
||||
|
||||
int bx_nogui_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
|
||||
{
|
||||
UNUSED(text_snapshot);
|
||||
UNUSED(len);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ::PALETTE_CHANGE()
|
||||
//
|
||||
// Allocate a color in the native GUI, for this color, and put
|
||||
// it in the colormap location 'index'.
|
||||
// returns: 0=no screen update needed (color map change has direct effect)
|
||||
// 1=screen updated needed (redraw using current colormap)
|
||||
|
||||
bx_bool bx_nogui_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
||||
{
|
||||
UNUSED(index);
|
||||
UNUSED(red);
|
||||
UNUSED(green);
|
||||
UNUSED(blue);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ::GRAPHICS_TILE_UPDATE()
|
||||
//
|
||||
// Called to request that a tile of graphics be drawn to the
|
||||
// screen, since info in this region has changed.
|
||||
//
|
||||
// tile: array of 8bit values representing a block of pixels with
|
||||
// dimension equal to the 'tilewidth' & 'tileheight' parameters to
|
||||
// ::specific_init(). Each value specifies an index into the
|
||||
// array of colors you allocated for ::palette_change()
|
||||
// x0: x origin of tile
|
||||
// y0: y origin of tile
|
||||
//
|
||||
// note: origin of tile and of window based on (0,0) being in the upper
|
||||
// left of the window.
|
||||
|
||||
void bx_nogui_gui_c::graphics_tile_update(Bit8u *tile, unsigned x0, unsigned y0)
|
||||
{
|
||||
UNUSED(tile);
|
||||
UNUSED(x0);
|
||||
UNUSED(y0);
|
||||
}
|
||||
|
||||
|
||||
// ::DIMENSION_UPDATE()
|
||||
//
|
||||
// Called when the VGA mode changes it's X,Y dimensions.
|
||||
// Resize the window to this size, but you need to add on
|
||||
// the height of the headerbar to the Y value.
|
||||
//
|
||||
// x: new VGA x size
|
||||
// y: new VGA y size (add headerbar_y parameter from ::specific_init().
|
||||
// fheight: new VGA character height in text mode
|
||||
// fwidth : new VGA character width in text mode
|
||||
// bpp : bits per pixel in graphics mode
|
||||
|
||||
void bx_nogui_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, unsigned fwidth, unsigned bpp)
|
||||
{
|
||||
UNUSED(x);
|
||||
UNUSED(y);
|
||||
UNUSED(fheight);
|
||||
UNUSED(fwidth);
|
||||
UNUSED(bpp);
|
||||
}
|
||||
|
||||
|
||||
// ::CREATE_BITMAP()
|
||||
//
|
||||
// Create a monochrome bitmap of size 'xdim' by 'ydim', which will
|
||||
// be drawn in the headerbar. Return an integer ID to the bitmap,
|
||||
// with which the bitmap can be referenced later.
|
||||
//
|
||||
// bmap: packed 8 pixels-per-byte bitmap. The pixel order is:
|
||||
// bit0 is the left most pixel, bit7 is the right most pixel.
|
||||
// xdim: x dimension of bitmap
|
||||
// ydim: y dimension of bitmap
|
||||
|
||||
unsigned bx_nogui_gui_c::create_bitmap(const unsigned char *bmap, unsigned xdim, unsigned ydim)
|
||||
{
|
||||
UNUSED(bmap);
|
||||
UNUSED(xdim);
|
||||
UNUSED(ydim);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ::HEADERBAR_BITMAP()
|
||||
//
|
||||
// Called to install a bitmap in the bochs headerbar (toolbar).
|
||||
//
|
||||
// bmap_id: will correspond to an ID returned from
|
||||
// ::create_bitmap(). 'alignment' is either BX_GRAVITY_LEFT
|
||||
// or BX_GRAVITY_RIGHT, meaning install the bitmap in the next
|
||||
// available leftmost or rightmost space.
|
||||
// alignment: is either BX_GRAVITY_LEFT or BX_GRAVITY_RIGHT,
|
||||
// meaning install the bitmap in the next
|
||||
// available leftmost or rightmost space.
|
||||
// f: a 'C' function pointer to callback when the mouse is clicked in
|
||||
// the boundaries of this bitmap.
|
||||
|
||||
unsigned bx_nogui_gui_c::headerbar_bitmap(unsigned bmap_id, unsigned alignment, void (*f)(void))
|
||||
{
|
||||
UNUSED(bmap_id);
|
||||
UNUSED(alignment);
|
||||
UNUSED(f);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ::SHOW_HEADERBAR()
|
||||
//
|
||||
// Show (redraw) the current headerbar, which is composed of
|
||||
// currently installed bitmaps.
|
||||
|
||||
void bx_nogui_gui_c::show_headerbar(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// ::REPLACE_BITMAP()
|
||||
//
|
||||
// Replace the bitmap installed in the headerbar ID slot 'hbar_id',
|
||||
// with the one specified by 'bmap_id'. 'bmap_id' will have
|
||||
// been generated by ::create_bitmap(). The old and new bitmap
|
||||
// must be of the same size. This allows the bitmap the user
|
||||
// sees to change, when some action occurs. For example when
|
||||
// the user presses on the floppy icon, it then displays
|
||||
// the ejected status.
|
||||
//
|
||||
// hbar_id: headerbar slot ID
|
||||
// bmap_id: bitmap ID
|
||||
|
||||
void bx_nogui_gui_c::replace_bitmap(unsigned hbar_id, unsigned bmap_id)
|
||||
{
|
||||
UNUSED(hbar_id);
|
||||
UNUSED(bmap_id);
|
||||
}
|
||||
|
||||
|
||||
// ::EXIT()
|
||||
//
|
||||
// Called before bochs terminates, to allow for a graceful
|
||||
// exit from the native GUI mechanism.
|
||||
|
||||
void bx_nogui_gui_c::exit(void)
|
||||
{
|
||||
BX_INFO(("bx_nogui_gui_c::exit() not implemented yet."));
|
||||
}
|
||||
|
||||
|
||||
// ::MOUSE_ENABLED_CHANGED_SPECIFIC()
|
||||
//
|
||||
// Called whenever the mouse capture mode should be changed.
|
||||
|
||||
void bx_nogui_gui_c::mouse_enabled_changed_specific(bx_bool val)
|
||||
{
|
||||
}
|
||||
|
||||
#endif /* if BX_WITH_NOGUI */
|
||||
1009
simulators/bochs/gui/paramtree.cc
Executable file
1009
simulators/bochs/gui/paramtree.cc
Executable file
File diff suppressed because it is too large
Load Diff
461
simulators/bochs/gui/paramtree.h
Executable file
461
simulators/bochs/gui/paramtree.h
Executable file
@ -0,0 +1,461 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2010 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
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BX_PARAM_TREE_H
|
||||
#define BX_PARAM_TREE_H
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// parameter classes: bx_param_c and family
|
||||
////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// All variables that can be configured through the CI are declared as
|
||||
// "parameters" or objects of type bx_param_*. There is a bx_param_*
|
||||
// class for each type of data that the user would need to see and
|
||||
// edit, e.g. integer, boolean, enum, string, filename, or list of
|
||||
// other parameters. The purpose of the bx_param_* class, in addition
|
||||
// to storing the parameter's value, is to hold the name, description,
|
||||
// and constraints on the value. The bx_param_* class should hold
|
||||
// everything that the CI would need to display the value and allow
|
||||
// the user to modify it. For integer parameters, the minimum and
|
||||
// maximum allowed value can be defined, and the base in which it
|
||||
// should be displayed and interpreted. For enums, the
|
||||
// bx_param_enum_c structure includes the list of values which the
|
||||
// parameter can have.
|
||||
//
|
||||
// Also, some parameter classes support get/set callback functions to
|
||||
// allow arbitrary code to be executed when the parameter is get/set.
|
||||
// An example of where this is useful: if you disable the NE2K card,
|
||||
// the set() handler for that parameter can tell the user interface
|
||||
// that the NE2K's irq, I/O address, and mac address should be
|
||||
// disabled (greyed out, hidden, or made inaccessible). The get/set
|
||||
// methods can also check if the set() value is acceptable using
|
||||
// whatever means and override it.
|
||||
//
|
||||
// The parameter concept is similar to the use of parameters in JavaBeans.
|
||||
|
||||
class bx_object_c;
|
||||
class bx_param_c;
|
||||
class bx_param_num_c;
|
||||
class bx_param_enum_c;
|
||||
class bx_param_bool_c;
|
||||
class bx_param_string_c;
|
||||
class bx_param_filename_c;
|
||||
class bx_list_c;
|
||||
|
||||
class BOCHSAPI bx_object_c {
|
||||
private:
|
||||
Bit32u id;
|
||||
bx_objtype type;
|
||||
protected:
|
||||
void set_type(bx_objtype _type) { type = _type; }
|
||||
public:
|
||||
bx_object_c(Bit32u _id): id(_id), type(BXT_OBJECT) {}
|
||||
virtual ~bx_object_c() {}
|
||||
Bit32u get_id() const { return id; }
|
||||
Bit8u get_type() const { return type; }
|
||||
};
|
||||
|
||||
#define BASE_DEC 10
|
||||
#define BASE_HEX 16
|
||||
|
||||
class BOCHSAPI bx_param_c : public bx_object_c {
|
||||
BOCHSAPI_CYGONLY static const char *default_text_format;
|
||||
protected:
|
||||
bx_list_c *parent;
|
||||
char *name;
|
||||
char *description;
|
||||
char *label; // label string for text menus and gui dialogs
|
||||
const char *text_format; // printf format string. %d for ints, %s for strings, etc.
|
||||
const char *long_text_format; // printf format string. %d for ints, %s for strings, etc.
|
||||
char *ask_format; // format string for asking for a new value
|
||||
char *group_name; // name of the group the param belongs to
|
||||
int runtime_param;
|
||||
int enabled;
|
||||
Bit32u options;
|
||||
// The dependent_list is initialized to NULL. If dependent_list is modified
|
||||
// to point to a bx_list_c of other parameters, the set() method of the
|
||||
// parameter type will enable those parameters when the enable condition is
|
||||
// true, and disable them it is false.
|
||||
bx_list_c *dependent_list;
|
||||
void *device;
|
||||
public:
|
||||
bx_param_c(Bit32u id, const char *name, const char *description);
|
||||
bx_param_c(Bit32u id, const char *name, const char *label, const char *description);
|
||||
virtual ~bx_param_c();
|
||||
bx_param_c *get_parent() { return (bx_param_c *) parent; }
|
||||
int get_param_path(char *path_out, int maxlen);
|
||||
void set_format(const char *format) {text_format = format;}
|
||||
const char *get_format() const {return text_format;}
|
||||
void set_long_format(const char *format) {long_text_format = format;}
|
||||
const char *get_long_format() const {return long_text_format;}
|
||||
void set_ask_format(const char *format);
|
||||
const char *get_ask_format() const {return ask_format;}
|
||||
void set_label(const char *text);
|
||||
void set_description(const char *text);
|
||||
const char *get_label() const {return label;}
|
||||
void set_runtime_param(int val) { runtime_param = val; }
|
||||
int get_runtime_param() { return runtime_param; }
|
||||
void set_group(const char *group);
|
||||
const char *get_group() const {return group_name;}
|
||||
const char *get_name() const { return name; }
|
||||
const char *get_description() const { return description; }
|
||||
int get_enabled() const { return enabled; }
|
||||
virtual void set_enabled(int enabled) { this->enabled = enabled; }
|
||||
virtual void reset() {}
|
||||
int getint() const {return -1;}
|
||||
static const char* set_default_format(const char *f);
|
||||
static const char *get_default_format() { return default_text_format; }
|
||||
bx_list_c *get_dependent_list() { return dependent_list; }
|
||||
void set_options(Bit32u options) { this->options = options; }
|
||||
Bit32u get_options() const { return options; }
|
||||
void set_device_param(void *dev) { device = dev; }
|
||||
void *get_device_param() { return device; }
|
||||
#if BX_USE_TEXTCONFIG
|
||||
virtual void text_print(FILE *fp) {}
|
||||
virtual int text_ask(FILE *fpin, FILE *fpout) {return -1;}
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef Bit64s (*param_event_handler)(class bx_param_c *, int set, Bit64s val);
|
||||
typedef Bit64s (*param_save_handler)(void *devptr, class bx_param_c *);
|
||||
typedef void (*param_restore_handler)(void *devptr, class bx_param_c *, Bit64s val);
|
||||
typedef int (*param_enable_handler)(class bx_param_c *, int en);
|
||||
|
||||
class BOCHSAPI bx_param_num_c : public bx_param_c {
|
||||
BOCHSAPI_CYGONLY static Bit32u default_base;
|
||||
void update_dependents();
|
||||
protected:
|
||||
Bit64s min, max, initial_val;
|
||||
union _uval_ {
|
||||
Bit64s number; // used by bx_param_num_c
|
||||
Bit64s *p64bit; // used by bx_shadow_num_c
|
||||
Bit32s *p32bit; // used by bx_shadow_num_c
|
||||
Bit16s *p16bit; // used by bx_shadow_num_c
|
||||
Bit8s *p8bit; // used by bx_shadow_num_c
|
||||
bx_bool *pbool; // used by bx_shadow_bool_c
|
||||
} val;
|
||||
param_event_handler handler;
|
||||
void *sr_devptr;
|
||||
param_save_handler save_handler;
|
||||
param_restore_handler restore_handler;
|
||||
param_enable_handler enable_handler;
|
||||
int base;
|
||||
bx_bool is_shadow;
|
||||
public:
|
||||
enum {
|
||||
// When a bx_param_num_c is displayed in dialog, USE_SPIN_CONTROL controls
|
||||
// whether a spin control should be used instead of a simple text control.
|
||||
USE_SPIN_CONTROL = (1<<0)
|
||||
} bx_numopt_bits;
|
||||
bx_param_num_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
const char *label,
|
||||
const char *description,
|
||||
Bit64s min, Bit64s max, Bit64s initial_val,
|
||||
bx_bool is_shadow = 0);
|
||||
virtual void reset() { val.number = initial_val; }
|
||||
void set_handler(param_event_handler handler);
|
||||
void set_sr_handlers(void *devptr, param_save_handler save, param_restore_handler restore);
|
||||
void set_enable_handler(param_enable_handler handler) { enable_handler = handler; }
|
||||
void set_dependent_list(bx_list_c *l);
|
||||
virtual void set_enabled(int enabled);
|
||||
virtual Bit32s get() { return (Bit32s) get64(); }
|
||||
virtual Bit64s get64();
|
||||
virtual void set(Bit64s val);
|
||||
void set_base(int base) { this->base = base; }
|
||||
void set_initial_val(Bit64s initial_val);
|
||||
int get_base() const { return base; }
|
||||
void set_range(Bit64u min, Bit64u max);
|
||||
Bit64s get_min() { return min; }
|
||||
Bit64s get_max() { return max; }
|
||||
static Bit32u set_default_base(Bit32u val);
|
||||
static Bit32u get_default_base() { return default_base; }
|
||||
#if BX_USE_TEXTCONFIG
|
||||
virtual void text_print(FILE *fp);
|
||||
virtual int text_ask(FILE *fpin, FILE *fpout);
|
||||
#endif
|
||||
};
|
||||
|
||||
// a bx_shadow_num_c is like a bx_param_num_c except that it doesn't
|
||||
// store the actual value with its data. Instead, it uses val.p32bit
|
||||
// to keep a pointer to the actual data. This is used to register
|
||||
// existing variables as parameters, without having to access it via
|
||||
// set/get methods.
|
||||
class BOCHSAPI bx_shadow_num_c : public bx_param_num_c {
|
||||
Bit8u varsize; // must be 64, 32, 16, or 8
|
||||
Bit8u lowbit; // range of bits associated with this param
|
||||
Bit64u mask; // mask is ANDed with value before it is returned from get
|
||||
public:
|
||||
bx_shadow_num_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
Bit64s *ptr_to_real_val,
|
||||
int base = BASE_DEC,
|
||||
Bit8u highbit = 63,
|
||||
Bit8u lowbit = 0);
|
||||
bx_shadow_num_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
Bit64u *ptr_to_real_val,
|
||||
int base = BASE_DEC,
|
||||
Bit8u highbit = 63,
|
||||
Bit8u lowbit = 0);
|
||||
bx_shadow_num_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
Bit32s *ptr_to_real_val,
|
||||
int base = BASE_DEC,
|
||||
Bit8u highbit = 31,
|
||||
Bit8u lowbit = 0);
|
||||
bx_shadow_num_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
Bit32u *ptr_to_real_val,
|
||||
int base = BASE_DEC,
|
||||
Bit8u highbit = 31,
|
||||
Bit8u lowbit = 0);
|
||||
bx_shadow_num_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
Bit16s *ptr_to_real_val,
|
||||
int base = BASE_DEC,
|
||||
Bit8u highbit = 15,
|
||||
Bit8u lowbit = 0);
|
||||
bx_shadow_num_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
Bit16u *ptr_to_real_val,
|
||||
int base = BASE_DEC,
|
||||
Bit8u highbit = 15,
|
||||
Bit8u lowbit = 0);
|
||||
bx_shadow_num_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
Bit8s *ptr_to_real_val,
|
||||
int base = BASE_DEC,
|
||||
Bit8u highbit = 7,
|
||||
Bit8u lowbit = 0);
|
||||
bx_shadow_num_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
Bit8u *ptr_to_real_val,
|
||||
int base = BASE_DEC,
|
||||
Bit8u highbit = 7,
|
||||
Bit8u lowbit = 0);
|
||||
virtual Bit64s get64();
|
||||
virtual void set(Bit64s val);
|
||||
virtual void reset();
|
||||
};
|
||||
|
||||
class BOCHSAPI bx_param_bool_c : public bx_param_num_c {
|
||||
// many boolean variables are used to enable/disable modules. In the
|
||||
// user interface, the enable variable should enable/disable all the
|
||||
// other parameters associated with that module.
|
||||
public:
|
||||
bx_param_bool_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
const char *label,
|
||||
const char *description,
|
||||
Bit64s initial_val,
|
||||
bx_bool is_shadow = 0);
|
||||
#if BX_USE_TEXTCONFIG
|
||||
virtual void text_print(FILE *fp);
|
||||
virtual int text_ask(FILE *fpin, FILE *fpout);
|
||||
#endif
|
||||
};
|
||||
|
||||
// a bx_shadow_bool_c is a shadow param based on bx_param_bool_c.
|
||||
class BOCHSAPI bx_shadow_bool_c : public bx_param_bool_c {
|
||||
// each bit of a bitfield can be a separate value. bitnum tells which
|
||||
// bit is used. get/set will only modify that bit.
|
||||
Bit8u bitnum;
|
||||
public:
|
||||
bx_shadow_bool_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
const char *label,
|
||||
bx_bool *ptr_to_real_val,
|
||||
Bit8u bitnum = 0);
|
||||
bx_shadow_bool_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
bx_bool *ptr_to_real_val,
|
||||
Bit8u bitnum = 0);
|
||||
virtual Bit64s get64();
|
||||
virtual void set(Bit64s val);
|
||||
};
|
||||
|
||||
|
||||
class BOCHSAPI bx_param_enum_c : public bx_param_num_c {
|
||||
const char **choices;
|
||||
Bit64u *deps_bitmap;
|
||||
void update_dependents();
|
||||
public:
|
||||
bx_param_enum_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
const char *label,
|
||||
const char *description,
|
||||
const char **choices,
|
||||
Bit64s initial_val,
|
||||
Bit64s value_base = 0);
|
||||
virtual ~bx_param_enum_c();
|
||||
const char *get_choice(int n) { return choices[n]; }
|
||||
const char *get_selected() { return choices[val.number - min]; }
|
||||
int find_by_name(const char *string);
|
||||
virtual void set(Bit64s val);
|
||||
bx_bool set_by_name(const char *string);
|
||||
void set_dependent_list(bx_list_c *l, bx_bool enable_all);
|
||||
void set_dependent_bitmap(Bit64s value, Bit64u bitmap);
|
||||
Bit64u get_dependent_bitmap(Bit64s value);
|
||||
virtual void set_enabled(int enabled);
|
||||
#if BX_USE_TEXTCONFIG
|
||||
virtual void text_print(FILE *fp);
|
||||
virtual int text_ask(FILE *fpin, FILE *fpout);
|
||||
#endif
|
||||
};
|
||||
|
||||
typedef const char* (*param_string_event_handler)(class bx_param_string_c *,
|
||||
int set, const char *oldval, const char *newval, int maxlen);
|
||||
|
||||
class BOCHSAPI bx_param_string_c : public bx_param_c {
|
||||
int maxsize;
|
||||
char *val, *initial_val;
|
||||
param_string_event_handler handler;
|
||||
param_enable_handler enable_handler;
|
||||
char separator;
|
||||
void update_dependents();
|
||||
public:
|
||||
enum {
|
||||
RAW_BYTES = 1, // use binary text editor, like MAC addr
|
||||
IS_FILENAME = 2, // 1=yes it's a filename, 0=not a filename.
|
||||
// Some guis have a file browser. This
|
||||
// bit suggests that they use it.
|
||||
SAVE_FILE_DIALOG = 4, // Use save dialog opposed to open file dialog
|
||||
SELECT_FOLDER_DLG = 8 // Use folder selection dialog
|
||||
} bx_string_opt_bits;
|
||||
bx_param_string_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
const char *label,
|
||||
const char *description,
|
||||
const char *initial_val,
|
||||
int maxsize=-1);
|
||||
virtual ~bx_param_string_c();
|
||||
virtual void reset();
|
||||
void set_handler(param_string_event_handler handler);
|
||||
void set_enable_handler(param_enable_handler handler);
|
||||
virtual void set_enabled(int enabled);
|
||||
void set_dependent_list(bx_list_c *l);
|
||||
Bit32s get(char *buf, int len);
|
||||
char *getptr() {return val; }
|
||||
void set(const char *buf);
|
||||
bx_bool equals(const char *buf);
|
||||
void set_separator(char sep) {separator = sep; }
|
||||
char get_separator() const {return separator; }
|
||||
int get_maxsize() const {return maxsize; }
|
||||
void set_initial_val(const char *buf);
|
||||
#if BX_USE_TEXTCONFIG
|
||||
virtual void text_print(FILE *fp);
|
||||
virtual int text_ask(FILE *fpin, FILE *fpout);
|
||||
#endif
|
||||
};
|
||||
|
||||
// Declare a filename class. It is identical to a string, except that
|
||||
// it initializes the options differently. This is just a shortcut
|
||||
// for declaring a string param and setting the options with IS_FILENAME.
|
||||
class BOCHSAPI bx_param_filename_c : public bx_param_string_c {
|
||||
const char *ext;
|
||||
public:
|
||||
bx_param_filename_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
const char *label,
|
||||
const char *description,
|
||||
const char *initial_val,
|
||||
int maxsize=-1);
|
||||
const char *get_extension() {return ext;}
|
||||
void set_extension(const char *ext) {this->ext = ext;}
|
||||
};
|
||||
|
||||
class BOCHSAPI bx_shadow_data_c : public bx_param_c {
|
||||
Bit32u data_size;
|
||||
Bit8u *data_ptr;
|
||||
public:
|
||||
bx_shadow_data_c(bx_param_c *parent,
|
||||
const char *name,
|
||||
Bit8u *ptr_to_data,
|
||||
Bit32u data_size);
|
||||
Bit8u *getptr() {return data_ptr;}
|
||||
Bit32u get_size() const {return data_size;}
|
||||
};
|
||||
|
||||
#define BX_DEFAULT_LIST_SIZE 6
|
||||
|
||||
class BOCHSAPI bx_list_c : public bx_param_c {
|
||||
protected:
|
||||
// just a list of bx_param_c objects. size tells current number of
|
||||
// objects in the list, and maxsize tells how many list items are
|
||||
// allocated in the constructor.
|
||||
bx_param_c **list;
|
||||
int size, maxsize;
|
||||
// for a menu, the value of choice before the call to "ask" is default.
|
||||
// After ask, choice holds the value that the user chose. Choice defaults
|
||||
// to 1 in the constructor.
|
||||
bx_param_num_c *choice;
|
||||
// title of the menu or series
|
||||
bx_param_string_c *title;
|
||||
void init(const char *list_title);
|
||||
public:
|
||||
enum {
|
||||
// When a bx_list_c is displayed as a menu, SHOW_PARENT controls whether or
|
||||
// not the menu shows a "Return to parent menu" choice or not.
|
||||
SHOW_PARENT = (1<<0),
|
||||
// Some lists are best displayed shown as menus, others as a series of
|
||||
// related questions. This bit suggests to the CI that the series of
|
||||
// questions format is preferred.
|
||||
SERIES_ASK = (1<<1),
|
||||
// When a bx_list_c is displayed in a dialog, USE_TAB_WINDOW suggests
|
||||
// to the CI that each item in the list should be shown as a separate
|
||||
// tab. This would be most appropriate when each item is another list
|
||||
// of parameters.
|
||||
USE_TAB_WINDOW = (1<<2),
|
||||
// When a bx_list_c is displayed in a dialog, the list name is used as the
|
||||
// label of the group box if USE_BOX_TITLE is set. This is only necessary if
|
||||
// more than one list appears in a dialog box.
|
||||
USE_BOX_TITLE = (1<<3),
|
||||
// When a bx_list_c is displayed as a menu, SHOW_GROUP_NAME controls whether
|
||||
// or not the name of group the item belongs to is added to the name of the
|
||||
// item (used in the runtime menu).
|
||||
SHOW_GROUP_NAME = (1<<4)
|
||||
} bx_listopt_bits;
|
||||
bx_list_c(bx_param_c *parent, int maxsize);
|
||||
bx_list_c(bx_param_c *parent, const char *name, int maxsize);
|
||||
bx_list_c(bx_param_c *parent, const char *name, const char *title, int maxsize = BX_DEFAULT_LIST_SIZE);
|
||||
bx_list_c(bx_param_c *parent, const char *name, const char *title, bx_param_c **init_list);
|
||||
virtual ~bx_list_c();
|
||||
bx_list_c *clone();
|
||||
void add(bx_param_c *param);
|
||||
bx_param_c *get(int index);
|
||||
bx_param_c *get_by_name(const char *name);
|
||||
int get_size() const { return size; }
|
||||
bx_param_num_c *get_choice() { return choice; }
|
||||
bx_param_string_c *get_title() { return title; }
|
||||
void set_parent(bx_param_c *newparent);
|
||||
bx_param_c *get_parent() { return parent; }
|
||||
virtual void reset();
|
||||
virtual void clear();
|
||||
virtual void remove(const char *name);
|
||||
#if BX_USE_TEXTCONFIG
|
||||
virtual void text_print(FILE *);
|
||||
virtual int text_ask(FILE *fpin, FILE *fpout);
|
||||
#endif
|
||||
};
|
||||
|
||||
#endif
|
||||
1702
simulators/bochs/gui/rfb.cc
Normal file
1702
simulators/bochs/gui/rfb.cc
Normal file
File diff suppressed because it is too large
Load Diff
392
simulators/bochs/gui/rfb.h
Normal file
392
simulators/bochs/gui/rfb.h
Normal file
@ -0,0 +1,392 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2000-2009 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
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file includes the rfb spec header and the port numbers
|
||||
|
||||
// Define the RFB types
|
||||
typedef Bit32u U32;
|
||||
typedef Bit16u U16;
|
||||
typedef Bit8u U8;
|
||||
typedef Bit32s S32;
|
||||
typedef Bit16s S16;
|
||||
typedef Bit8s S8;
|
||||
|
||||
// Port range
|
||||
#define BX_RFB_PORT_MIN 5900
|
||||
#define BX_RFB_PORT_MAX 5949
|
||||
|
||||
|
||||
// RFB Protocol definitions.
|
||||
// Please refer to the specification document
|
||||
// http://www.realvnc.com/docs/rfbproto.pdf
|
||||
|
||||
typedef struct {
|
||||
U16 xPosition;
|
||||
U16 yPosition;
|
||||
U16 width;
|
||||
U16 height;
|
||||
U32 encodingType;
|
||||
} rfbRectangle;
|
||||
|
||||
#define rfbRectangleSize (sizeof(rfbRectangle))
|
||||
|
||||
|
||||
typedef struct {
|
||||
U8 bitsPerPixel;
|
||||
U8 depth;
|
||||
U8 bigEndianFlag;
|
||||
U8 trueColourFlag;
|
||||
U16 redMax;
|
||||
U16 greenMax;
|
||||
U16 blueMax;
|
||||
U8 redShift;
|
||||
U8 greenShift;
|
||||
U8 blueShift;
|
||||
U8 padding[3];
|
||||
} rfbPixelFormat;
|
||||
|
||||
#define rfbPixelFormatSize (sizeof(rfbPixelFormat))
|
||||
|
||||
|
||||
#define rfbProtocolVersionFormat "RFB %03d.%03d\n"
|
||||
#define rfbServerProtocolMajorVersion 3
|
||||
#define rfbServerProtocolMinorVersion 3
|
||||
|
||||
typedef char rfbProtocolVersionMessage[12 + 1]; // Add 1 for null byte
|
||||
#define rfbProtocolVersionMessageSize (sizeof(rfbProtocolVersionMessage) - 1) // Real Message Length
|
||||
|
||||
|
||||
#define rfbSecurityConnFailed 0
|
||||
#define rfbSecurityNone 1
|
||||
#define rfbSecurityVncAuth 2
|
||||
|
||||
#define rfbSecurityVncAuthOK 0
|
||||
#define rfbSecurityVncAuthFailed 1
|
||||
#define rfbSecurityVncAuthTooMany 2 // No longer used (3.7)
|
||||
|
||||
|
||||
typedef struct {
|
||||
U8 sharedFlag;
|
||||
} rfbClientInitMessage;
|
||||
|
||||
#define rfbClientInitMessageSize (sizeof(rfbClientInitMessage))
|
||||
|
||||
|
||||
typedef struct {
|
||||
U16 framebufferWidth;
|
||||
U16 framebufferHeight;
|
||||
rfbPixelFormat serverPixelFormat;
|
||||
U32 nameLength;
|
||||
// U8[] nameString;
|
||||
} rfbServerInitMessage;
|
||||
|
||||
#define rfbServerInitMessageSize (sizeof(rfbServerInitMessage))
|
||||
|
||||
// Client to Server message types
|
||||
#define rfbSetPixelFormat 0
|
||||
#define rfbFixColourMapEntries 1
|
||||
#define rfbSetEncodings 2
|
||||
#define rfbFramebufferUpdateRequest 3
|
||||
#define rfbKeyEvent 4
|
||||
#define rfbPointerEvent 5
|
||||
#define rfbClientCutText 6
|
||||
|
||||
|
||||
// Client to Server messages
|
||||
|
||||
typedef struct {
|
||||
U8 messageType;
|
||||
U8 padding[3];
|
||||
rfbPixelFormat pixelFormat;
|
||||
} rfbSetPixelFormatMessage;
|
||||
|
||||
#define rfbSetPixelFormatMessageSize (sizeof(rfbSetPixelFormatMessage))
|
||||
|
||||
|
||||
typedef struct {
|
||||
U8 messageType;
|
||||
U8 padding;
|
||||
U16 firstColour;
|
||||
U16 numberOfColours;
|
||||
} rfbFixColourMapEntriesMessage;
|
||||
|
||||
#define rfbFixColourMapEntriesMessageSize (sizeof(rfbFixColourMapEntriesMessage))
|
||||
|
||||
|
||||
typedef struct {
|
||||
U8 messageType;
|
||||
U8 padding;
|
||||
U16 numberOfEncodings;
|
||||
} rfbSetEncodingsMessage;
|
||||
|
||||
#define rfbSetEncodingsMessageSize (sizeof(rfbSetEncodingsMessage))
|
||||
|
||||
|
||||
typedef struct {
|
||||
U8 messageType;
|
||||
U8 incremental;
|
||||
U16 xPosition;
|
||||
U16 yPosition;
|
||||
U16 width;
|
||||
U16 height;
|
||||
} rfbFramebufferUpdateRequestMessage;
|
||||
|
||||
#define rfbFramebufferUpdateRequestMessageSize (sizeof(rfbFramebufferUpdateRequestMessage))
|
||||
|
||||
|
||||
typedef struct {
|
||||
U8 messageType;
|
||||
U8 downFlag;
|
||||
U8 padding[2];
|
||||
U32 key;
|
||||
} rfbKeyEventMessage;
|
||||
|
||||
#define rfbKeyEventMessageSize (sizeof(rfbKeyEventMessage))
|
||||
|
||||
|
||||
typedef struct {
|
||||
U8 messageType;
|
||||
U8 buttonMask;
|
||||
U16 xPosition;
|
||||
U16 yPosition;
|
||||
} rfbPointerEventMessage;
|
||||
|
||||
#define rfbPointerEventMessageSize (sizeof(rfbPointerEventMessage))
|
||||
|
||||
#define rfbButton1Mask 1
|
||||
#define rfbButton2Mask 2
|
||||
#define rfbButton3Mask 4
|
||||
|
||||
|
||||
typedef struct {
|
||||
U8 messageType;
|
||||
U8 padding[3];
|
||||
U32 length;
|
||||
// U8[] text;
|
||||
} rfbClientCutTextMessage;
|
||||
|
||||
#define rfbClientCutTextMessageSize (sizeof(rfbClientCutTextMessage))
|
||||
|
||||
// Fill in correct names
|
||||
typedef union {
|
||||
rfbSetPixelFormatMessage spf;
|
||||
rfbFixColourMapEntriesMessage fcme;
|
||||
rfbSetEncodingsMessage se;
|
||||
rfbFramebufferUpdateRequestMessage fur;
|
||||
rfbKeyEventMessage ke;
|
||||
rfbPointerEventMessage pe;
|
||||
rfbClientCutTextMessage cct;
|
||||
} rfbClientToServerMessage;
|
||||
|
||||
|
||||
// Server to Client message types
|
||||
#define rfbFramebufferUpdate 0
|
||||
#define rfbSetColourMapEntries 1
|
||||
#define rfbBell 2
|
||||
#define rfbServerCutText 3
|
||||
|
||||
// Encoding types
|
||||
#define rfbEncodingRaw 0
|
||||
#define rfbEncodingCopyRect 1
|
||||
#define rfbEncodingRRE 2
|
||||
#define rfbEncodingCoRRE 4
|
||||
#define rfbEncodingHextile 5
|
||||
#define rfbEncodingZRLE 16
|
||||
#define rfbEncodingCursor 0xffffff11
|
||||
#define rfbEncodingDesktopSize 0xffffff21
|
||||
#define rfbEncodingZlib 6
|
||||
#define rfbEncodingTight 7
|
||||
#define rfbEncodingZlibHex 8
|
||||
#define rfbEncodingTightOption00 0xffffff00 // to 0xffffffff except 0xffffff11 and 0xffffff21
|
||||
#define rfbEncodingTightOption01 0xffffff01
|
||||
#define rfbEncodingTightOption02 0xffffff02
|
||||
#define rfbEncodingTightOption03 0xffffff03
|
||||
#define rfbEncodingTightOption04 0xffffff04
|
||||
#define rfbEncodingTightOption05 0xffffff05
|
||||
#define rfbEncodingTightOption06 0xffffff06
|
||||
#define rfbEncodingTightOption07 0xffffff07
|
||||
#define rfbEncodingTightOption08 0xffffff08
|
||||
#define rfbEncodingTightOption09 0xffffff09
|
||||
#define rfbEncodingTightOption0a 0xffffff0a
|
||||
#define rfbEncodingTightOption0b 0xffffff0b
|
||||
#define rfbEncodingTightOption0c 0xffffff0c
|
||||
#define rfbEncodingTightOption0d 0xffffff0d
|
||||
#define rfbEncodingTightOption0e 0xffffff0e
|
||||
#define rfbEncodingTightOption0f 0xffffff0f
|
||||
#define rfbEncodingTightOption10 0xffffff10
|
||||
#define rfbEncodingTightOption12 0xffffff12
|
||||
#define rfbEncodingTightOption13 0xffffff13
|
||||
#define rfbEncodingTightOption14 0xffffff14
|
||||
#define rfbEncodingTightOption15 0xffffff15
|
||||
#define rfbEncodingTightOption16 0xffffff16
|
||||
#define rfbEncodingTightOption17 0xffffff17
|
||||
#define rfbEncodingTightOption18 0xffffff18
|
||||
#define rfbEncodingTightOption19 0xffffff19
|
||||
#define rfbEncodingTightOption1a 0xffffff1a
|
||||
#define rfbEncodingTightOption1b 0xffffff1b
|
||||
#define rfbEncodingTightOption1c 0xffffff1c
|
||||
#define rfbEncodingTightOption1d 0xffffff1d
|
||||
#define rfbEncodingTightOption1e 0xffffff1e
|
||||
#define rfbEncodingTightOption1f 0xffffff1f
|
||||
#define rfbEncodingTightOption20 0xffffff20
|
||||
|
||||
typedef struct {
|
||||
U32 id;
|
||||
const char *name;
|
||||
} rfbEncodingType;
|
||||
|
||||
rfbEncodingType rfbEncodings[] = {
|
||||
{rfbEncodingRaw, "Raw"},
|
||||
{rfbEncodingCopyRect, "CopyRect"},
|
||||
{rfbEncodingRRE, "RRE"},
|
||||
{rfbEncodingCoRRE, "CoRRE"},
|
||||
{rfbEncodingHextile, "Hextile"},
|
||||
{rfbEncodingZRLE, "ZRLE"},
|
||||
{rfbEncodingCursor, "Cursor"},
|
||||
{rfbEncodingDesktopSize, "DesktopSize"},
|
||||
{rfbEncodingZlib, "Zlib"},
|
||||
{rfbEncodingTight, "Tight"},
|
||||
{rfbEncodingZlibHex, "ZlibHex"},
|
||||
{rfbEncodingTightOption00, "TightOption00"},
|
||||
{rfbEncodingTightOption01, "TightOption01"},
|
||||
{rfbEncodingTightOption02, "TightOption02"},
|
||||
{rfbEncodingTightOption03, "TightOption03"},
|
||||
{rfbEncodingTightOption04, "TightOption04"},
|
||||
{rfbEncodingTightOption05, "TightOption05"},
|
||||
{rfbEncodingTightOption06, "TightOption06"},
|
||||
{rfbEncodingTightOption07, "TightOption07"},
|
||||
{rfbEncodingTightOption08, "TightOption08"},
|
||||
{rfbEncodingTightOption09, "TightOption09"},
|
||||
{rfbEncodingTightOption0a, "TightOption0a"},
|
||||
{rfbEncodingTightOption0b, "TightOption0b"},
|
||||
{rfbEncodingTightOption0c, "TightOption0c"},
|
||||
{rfbEncodingTightOption0d, "TightOption0d"},
|
||||
{rfbEncodingTightOption0e, "TightOption0e"},
|
||||
{rfbEncodingTightOption0f, "TightOption0f"},
|
||||
{rfbEncodingTightOption10, "TightOption10"},
|
||||
{rfbEncodingTightOption12, "TightOption12"},
|
||||
{rfbEncodingTightOption13, "TightOption13"},
|
||||
{rfbEncodingTightOption14, "TightOption14"},
|
||||
{rfbEncodingTightOption15, "TightOption15"},
|
||||
{rfbEncodingTightOption16, "TightOption16"},
|
||||
{rfbEncodingTightOption17, "TightOption17"},
|
||||
{rfbEncodingTightOption18, "TightOption18"},
|
||||
{rfbEncodingTightOption19, "TightOption19"},
|
||||
{rfbEncodingTightOption1a, "TightOption1a"},
|
||||
{rfbEncodingTightOption1b, "TightOption1b"},
|
||||
{rfbEncodingTightOption1c, "TightOption1c"},
|
||||
{rfbEncodingTightOption1d, "TightOption1d"},
|
||||
{rfbEncodingTightOption1e, "TightOption1e"},
|
||||
{rfbEncodingTightOption1f, "TightOption1f"},
|
||||
{rfbEncodingTightOption20, "TightOption20"},
|
||||
};
|
||||
|
||||
#define rfbEncodingsCount (sizeof(rfbEncodings) / sizeof(rfbEncodingType))
|
||||
|
||||
// Server To Client Messages
|
||||
|
||||
typedef struct {
|
||||
U8 messageType;
|
||||
U8 padding;
|
||||
U16 numberOfRectangles;
|
||||
} rfbFramebufferUpdateMessage;
|
||||
|
||||
#define rfbFramebufferUpdateMessageSize (sizeof(rfbFramebufferUpdateMessage))
|
||||
|
||||
typedef struct {
|
||||
rfbRectangle r;
|
||||
} rfbFramebufferUpdateRectHeader;
|
||||
|
||||
#define rfbFramebufferUpdateRectHeaderSize (sizeof(rfbFramebufferUpdateRectHeader))
|
||||
|
||||
typedef struct {
|
||||
U16 srcXPosition;
|
||||
U16 srcYPosition;
|
||||
} rfbCopyRect;
|
||||
|
||||
#define rfbCopyRectSize (sizeof(rfbCopyRect))
|
||||
|
||||
|
||||
/* typedef struct { */
|
||||
/* U32 numberOfSubrectangles; */
|
||||
/* PIXEL backgroundPixelValue; */
|
||||
/* } rfbRREHeader; */
|
||||
|
||||
/* #define rfbRREHeaderSize (sizeof(rfbRREHeader)) */
|
||||
|
||||
|
||||
/* typedef struct { */
|
||||
/* U32 numberOfSubrectangles; */
|
||||
/* PIXEL backgroundPixelValue; */
|
||||
/* } rfbCoRRERectangle; */
|
||||
|
||||
/* #define rfbCoRRERectangleSize (sizeof(rfbCoRRERectangle)) */
|
||||
|
||||
|
||||
#define rfbHextileRaw (1 << 0)
|
||||
#define rfbHextileBackgroundSpecified (1 << 1)
|
||||
#define rfbHextileForegroundSpecified (1 << 2)
|
||||
#define rfbHextileAnySubrects (1 << 3)
|
||||
#define rfbHextileSubrectsColoured (1 << 4)
|
||||
|
||||
#define rfbHextilePackXY(x,y) (((x) << 4) | (y))
|
||||
#define rfbHextilePackWH(w,h) ((((w)-1) << 4) | ((h)-1))
|
||||
#define rfbHextileExtractX(byte) ((byte) >> 4)
|
||||
#define rfbHextileExtractY(byte) ((byte) & 0xf)
|
||||
#define rfbHextileExtractW(byte) (((byte) >> 4) + 1)
|
||||
#define rfbHextileExtractH(byte) (((byte) & 0xf) + 1)
|
||||
|
||||
|
||||
typedef struct {
|
||||
U8 messageType;
|
||||
U8 padding;
|
||||
U16 firstColour;
|
||||
U16 numberOfColours;
|
||||
} rfbSetColourMapEntriesMessage;
|
||||
|
||||
#define rfbSetColourMapEntriesMessageSize (sizeof(rfbSetColourMapEntriesMessage))
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
U8 messageType;
|
||||
} rfbBellMessage;
|
||||
|
||||
#define rfbBellMessageSize (sizeof(rfbBellMessage))
|
||||
|
||||
|
||||
|
||||
typedef struct {
|
||||
U8 messageType;
|
||||
U8 padding[3];
|
||||
U32 length;
|
||||
// U8[] text;
|
||||
} rfbServerCutTextMessage;
|
||||
|
||||
#define rfbServerCutTextMessageSize (sizeof(rfbServerCutTextMessage))
|
||||
|
||||
// Fill in correct names
|
||||
typedef union {
|
||||
rfbFramebufferUpdateMessage fu;
|
||||
rfbBellMessage b;
|
||||
rfbServerCutTextMessage sct;
|
||||
} rfbServerToClientMessage;
|
||||
|
||||
632
simulators/bochs/gui/rfbkeys.h
Normal file
632
simulators/bochs/gui/rfbkeys.h
Normal file
@ -0,0 +1,632 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 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
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file includes the rfb key definitions and keyboard mapping stuff
|
||||
|
||||
enum {
|
||||
XK_space = 0x020,
|
||||
XK_exclam,
|
||||
XK_quotedbl,
|
||||
XK_numbersign,
|
||||
XK_dollar,
|
||||
XK_percent,
|
||||
XK_ampersand,
|
||||
XK_apostrophe,
|
||||
XK_parenleft,
|
||||
XK_parenright,
|
||||
XK_asterisk,
|
||||
XK_plus,
|
||||
XK_comma,
|
||||
XK_minus,
|
||||
XK_period,
|
||||
XK_slash,
|
||||
XK_0,
|
||||
XK_1,
|
||||
XK_2,
|
||||
XK_3,
|
||||
XK_4,
|
||||
XK_5,
|
||||
XK_6,
|
||||
XK_7,
|
||||
XK_8,
|
||||
XK_9,
|
||||
XK_colon,
|
||||
XK_semicolon,
|
||||
XK_less,
|
||||
XK_equal,
|
||||
XK_greater,
|
||||
XK_question,
|
||||
XK_at,
|
||||
XK_A,
|
||||
XK_B,
|
||||
XK_C,
|
||||
XK_D,
|
||||
XK_E,
|
||||
XK_F,
|
||||
XK_G,
|
||||
XK_H,
|
||||
XK_I,
|
||||
XK_J,
|
||||
XK_K,
|
||||
XK_L,
|
||||
XK_M,
|
||||
XK_N,
|
||||
XK_O,
|
||||
XK_P,
|
||||
XK_Q,
|
||||
XK_R,
|
||||
XK_S,
|
||||
XK_T,
|
||||
XK_U,
|
||||
XK_V,
|
||||
XK_W,
|
||||
XK_X,
|
||||
XK_Y,
|
||||
XK_Z,
|
||||
XK_bracketleft,
|
||||
XK_backslash,
|
||||
XK_bracketright,
|
||||
XK_asciicircum,
|
||||
XK_underscore,
|
||||
XK_grave,
|
||||
XK_a,
|
||||
XK_b,
|
||||
XK_c,
|
||||
XK_d,
|
||||
XK_e,
|
||||
XK_f,
|
||||
XK_g,
|
||||
XK_h,
|
||||
XK_i,
|
||||
XK_j,
|
||||
XK_k,
|
||||
XK_l,
|
||||
XK_m,
|
||||
XK_n,
|
||||
XK_o,
|
||||
XK_p,
|
||||
XK_q,
|
||||
XK_r,
|
||||
XK_s,
|
||||
XK_t,
|
||||
XK_u,
|
||||
XK_v,
|
||||
XK_w,
|
||||
XK_x,
|
||||
XK_y,
|
||||
XK_z,
|
||||
XK_braceleft,
|
||||
XK_bar,
|
||||
XK_braceright,
|
||||
XK_asciitilde
|
||||
};
|
||||
|
||||
#define XK_nobreakspace 0x00a0
|
||||
#define XK_exclamdown 0x00a1
|
||||
#define XK_cent 0x00a2
|
||||
#define XK_sterling 0x00a3
|
||||
#define XK_currency 0x00a4
|
||||
#define XK_yen 0x00a5
|
||||
#define XK_brokenbar 0x00a6
|
||||
#define XK_section 0x00a7
|
||||
#define XK_diaeresis 0x00a8
|
||||
#define XK_copyright 0x00a9
|
||||
#define XK_ordfeminine 0x00aa
|
||||
#define XK_guillemotleft 0x00ab
|
||||
#define XK_notsign 0x00ac
|
||||
#define XK_hyphen 0x00ad
|
||||
#define XK_registered 0x00ae
|
||||
#define XK_macron 0x00af
|
||||
#define XK_degree 0x00b0
|
||||
#define XK_plusminus 0x00b1
|
||||
#define XK_twosuperior 0x00b2
|
||||
#define XK_threesuperior 0x00b3
|
||||
#define XK_acute 0x00b4
|
||||
#define XK_mu 0x00b5
|
||||
#define XK_paragraph 0x00b6
|
||||
#define XK_periodcentered 0x00b7
|
||||
#define XK_cedilla 0x00b8
|
||||
#define XK_onesuperior 0x00b9
|
||||
#define XK_masculine 0x00ba
|
||||
#define XK_guillemotright 0x00bb
|
||||
#define XK_onequarter 0x00bc
|
||||
#define XK_onehalf 0x00bd
|
||||
#define XK_threequarters 0x00be
|
||||
#define XK_questiondown 0x00bf
|
||||
#define XK_Agrave 0x00c0
|
||||
#define XK_Aacute 0x00c1
|
||||
#define XK_Acircumflex 0x00c2
|
||||
#define XK_Atilde 0x00c3
|
||||
#define XK_Adiaeresis 0x00c4
|
||||
#define XK_Aring 0x00c5
|
||||
#define XK_AE 0x00c6
|
||||
#define XK_Ccedilla 0x00c7
|
||||
#define XK_Egrave 0x00c8
|
||||
#define XK_Eacute 0x00c9
|
||||
#define XK_Ecircumflex 0x00ca
|
||||
#define XK_Ediaeresis 0x00cb
|
||||
#define XK_Igrave 0x00cc
|
||||
#define XK_Iacute 0x00cd
|
||||
#define XK_Icircumflex 0x00ce
|
||||
#define XK_Idiaeresis 0x00cf
|
||||
#define XK_ETH 0x00d0
|
||||
#define XK_Ntilde 0x00d1
|
||||
#define XK_Ograve 0x00d2
|
||||
#define XK_Oacute 0x00d3
|
||||
#define XK_Ocircumflex 0x00d4
|
||||
#define XK_Otilde 0x00d5
|
||||
#define XK_Odiaeresis 0x00d6
|
||||
#define XK_multiply 0x00d7
|
||||
#define XK_Oslash 0x00d8
|
||||
#define XK_Ooblique 0x00d8
|
||||
#define XK_Ugrave 0x00d9
|
||||
#define XK_Uacute 0x00da
|
||||
#define XK_Ucircumflex 0x00db
|
||||
#define XK_Udiaeresis 0x00dc
|
||||
#define XK_Yacute 0x00dd
|
||||
#define XK_THORN 0x00de
|
||||
#define XK_ssharp 0x00df
|
||||
#define XK_agrave 0x00e0
|
||||
#define XK_aacute 0x00e1
|
||||
#define XK_acircumflex 0x00e2
|
||||
#define XK_atilde 0x00e3
|
||||
#define XK_adiaeresis 0x00e4
|
||||
#define XK_aring 0x00e5
|
||||
#define XK_ae 0x00e6
|
||||
#define XK_ccedilla 0x00e7
|
||||
#define XK_egrave 0x00e8
|
||||
#define XK_eacute 0x00e9
|
||||
#define XK_ecircumflex 0x00ea
|
||||
#define XK_ediaeresis 0x00eb
|
||||
#define XK_igrave 0x00ec
|
||||
#define XK_iacute 0x00ed
|
||||
#define XK_icircumflex 0x00ee
|
||||
#define XK_idiaeresis 0x00ef
|
||||
#define XK_eth 0x00f0
|
||||
#define XK_ntilde 0x00f1
|
||||
#define XK_ograve 0x00f2
|
||||
#define XK_oacute 0x00f3
|
||||
#define XK_ocircumflex 0x00f4
|
||||
#define XK_otilde 0x00f5
|
||||
#define XK_odiaeresis 0x00f6
|
||||
#define XK_division 0x00f7
|
||||
#define XK_oslash 0x00f8
|
||||
#define XK_ooblique 0x00f8
|
||||
#define XK_ugrave 0x00f9
|
||||
#define XK_uacute 0x00fa
|
||||
#define XK_ucircumflex 0x00fb
|
||||
#define XK_udiaeresis 0x00fc
|
||||
#define XK_yacute 0x00fd
|
||||
#define XK_thorn 0x00fe
|
||||
#define XK_ydiaeresis 0x00ff
|
||||
|
||||
#define XK_EuroSign 0x20ac
|
||||
|
||||
#define XK_ISO_Level3_Shift 0xFE03
|
||||
#define XK_ISO_Left_Tab 0xFE20
|
||||
|
||||
#define XK_dead_grave 0xFE50
|
||||
#define XK_dead_acute 0xFE51
|
||||
#define XK_dead_circumflex 0xFE52
|
||||
#define XK_dead_tilde 0xFE53
|
||||
|
||||
#define XK_BackSpace 0xFF08
|
||||
#define XK_Tab 0xFF09
|
||||
#define XK_Linefeed 0xFF0A
|
||||
#define XK_Clear 0xFF0B
|
||||
#define XK_Return 0xFF0D
|
||||
#define XK_Pause 0xFF13
|
||||
#define XK_Scroll_Lock 0xFF14
|
||||
#define XK_Sys_Req 0xFF15
|
||||
#define XK_Escape 0xFF1B
|
||||
|
||||
#define XK_Delete 0xFFFF
|
||||
|
||||
#define XK_Home 0xFF50
|
||||
#define XK_Left 0xFF51
|
||||
#define XK_Up 0xFF52
|
||||
#define XK_Right 0xFF53
|
||||
#define XK_Down 0xFF54
|
||||
#define XK_Page_Up 0xFF55
|
||||
#define XK_Page_Down 0xFF56
|
||||
#define XK_End 0xFF57
|
||||
#define XK_Begin 0xFF58
|
||||
|
||||
#define XK_Select 0xFF60
|
||||
#define XK_Print 0xFF61
|
||||
#define XK_Execute 0xFF62
|
||||
#define XK_Insert 0xFF63
|
||||
#define XK_Menu 0xff67
|
||||
#define XK_Cancel 0xFF69
|
||||
#define XK_Help 0xFF6A
|
||||
#define XK_Break 0xFF6B
|
||||
#define XK_Num_Lock 0xFF7F
|
||||
|
||||
#define XK_KP_Space 0xFF80
|
||||
#define XK_KP_Tab 0xFF89
|
||||
#define XK_KP_Enter 0xFF8D
|
||||
|
||||
#define XK_KP_Home 0xFF95
|
||||
#define XK_KP_Left 0xFF96
|
||||
#define XK_KP_Up 0xFF97
|
||||
#define XK_KP_Right 0xFF98
|
||||
#define XK_KP_Down 0xFF99
|
||||
#define XK_KP_Prior 0xFF9A
|
||||
#define XK_KP_Page_Up 0xFF9A
|
||||
#define XK_KP_Next 0xFF9B
|
||||
#define XK_KP_Page_Down 0xFF9B
|
||||
#define XK_KP_End 0xFF9C
|
||||
#define XK_KP_Begin 0xFF9D
|
||||
#define XK_KP_Insert 0xFF9E
|
||||
#define XK_KP_Delete 0xFF9F
|
||||
#define XK_KP_Equal 0xFFBD
|
||||
#define XK_KP_Multiply 0xFFAA
|
||||
#define XK_KP_Add 0xFFAB
|
||||
#define XK_KP_Separator 0xFFAC
|
||||
#define XK_KP_Subtract 0xFFAD
|
||||
#define XK_KP_Decimal 0xFFAE
|
||||
#define XK_KP_Divide 0xFFAF
|
||||
|
||||
#define XK_KP_F1 0xFF91
|
||||
#define XK_KP_F2 0xFF92
|
||||
#define XK_KP_F3 0xFF93
|
||||
#define XK_KP_F4 0xFF94
|
||||
|
||||
#define XK_KP_0 0xFFB0
|
||||
#define XK_KP_1 0xFFB1
|
||||
#define XK_KP_2 0xFFB2
|
||||
#define XK_KP_3 0xFFB3
|
||||
#define XK_KP_4 0xFFB4
|
||||
#define XK_KP_5 0xFFB5
|
||||
#define XK_KP_6 0xFFB6
|
||||
#define XK_KP_7 0xFFB7
|
||||
#define XK_KP_8 0xFFB8
|
||||
#define XK_KP_9 0xFFB9
|
||||
|
||||
#define XK_F1 0xFFBE
|
||||
#define XK_F2 0xFFBF
|
||||
#define XK_F3 0xFFC0
|
||||
#define XK_F4 0xFFC1
|
||||
#define XK_F5 0xFFC2
|
||||
#define XK_F6 0xFFC3
|
||||
#define XK_F7 0xFFC4
|
||||
#define XK_F8 0xFFC5
|
||||
#define XK_F9 0xFFC6
|
||||
#define XK_F10 0xFFC7
|
||||
#define XK_F11 0xFFC8
|
||||
#define XK_F12 0xFFC9
|
||||
|
||||
#define XK_Shift_L 0xFFE1
|
||||
#define XK_Shift_R 0xFFE2
|
||||
#define XK_Control_L 0xFFE3
|
||||
#define XK_Control_R 0xFFE4
|
||||
#define XK_Caps_Lock 0xFFE5
|
||||
#define XK_Shift_Lock 0xFFE6
|
||||
#define XK_Meta_L 0xFFE7
|
||||
#define XK_Meta_R 0xFFE8
|
||||
#define XK_Alt_L 0xFFE9
|
||||
#define XK_Alt_R 0xFFEA
|
||||
#define XK_Super_L 0xFFEB
|
||||
#define XK_Super_R 0xFFEC
|
||||
|
||||
/// key mapping for rfb
|
||||
typedef struct {
|
||||
const char *name;
|
||||
Bit32u value;
|
||||
} rfbKeyTabEntry;
|
||||
|
||||
#define DEF_RFB_KEY(key) \
|
||||
{ #key, key },
|
||||
|
||||
rfbKeyTabEntry rfb_keytable[] = {
|
||||
// this include provides all the entries.
|
||||
DEF_RFB_KEY(XK_space)
|
||||
DEF_RFB_KEY(XK_exclam)
|
||||
DEF_RFB_KEY(XK_quotedbl)
|
||||
DEF_RFB_KEY(XK_numbersign)
|
||||
DEF_RFB_KEY(XK_dollar)
|
||||
DEF_RFB_KEY(XK_percent)
|
||||
DEF_RFB_KEY(XK_ampersand)
|
||||
DEF_RFB_KEY(XK_apostrophe)
|
||||
DEF_RFB_KEY(XK_parenleft)
|
||||
DEF_RFB_KEY(XK_parenright)
|
||||
DEF_RFB_KEY(XK_asterisk)
|
||||
DEF_RFB_KEY(XK_plus)
|
||||
DEF_RFB_KEY(XK_comma)
|
||||
DEF_RFB_KEY(XK_minus)
|
||||
DEF_RFB_KEY(XK_period)
|
||||
DEF_RFB_KEY(XK_slash)
|
||||
DEF_RFB_KEY(XK_0)
|
||||
DEF_RFB_KEY(XK_1)
|
||||
DEF_RFB_KEY(XK_2)
|
||||
DEF_RFB_KEY(XK_3)
|
||||
DEF_RFB_KEY(XK_4)
|
||||
DEF_RFB_KEY(XK_5)
|
||||
DEF_RFB_KEY(XK_6)
|
||||
DEF_RFB_KEY(XK_7)
|
||||
DEF_RFB_KEY(XK_8)
|
||||
DEF_RFB_KEY(XK_9)
|
||||
DEF_RFB_KEY(XK_colon)
|
||||
DEF_RFB_KEY(XK_semicolon)
|
||||
DEF_RFB_KEY(XK_less)
|
||||
DEF_RFB_KEY(XK_equal)
|
||||
DEF_RFB_KEY(XK_greater)
|
||||
DEF_RFB_KEY(XK_question)
|
||||
DEF_RFB_KEY(XK_at)
|
||||
DEF_RFB_KEY(XK_A)
|
||||
DEF_RFB_KEY(XK_B)
|
||||
DEF_RFB_KEY(XK_C)
|
||||
DEF_RFB_KEY(XK_D)
|
||||
DEF_RFB_KEY(XK_E)
|
||||
DEF_RFB_KEY(XK_F)
|
||||
DEF_RFB_KEY(XK_G)
|
||||
DEF_RFB_KEY(XK_H)
|
||||
DEF_RFB_KEY(XK_I)
|
||||
DEF_RFB_KEY(XK_J)
|
||||
DEF_RFB_KEY(XK_K)
|
||||
DEF_RFB_KEY(XK_L)
|
||||
DEF_RFB_KEY(XK_M)
|
||||
DEF_RFB_KEY(XK_N)
|
||||
DEF_RFB_KEY(XK_O)
|
||||
DEF_RFB_KEY(XK_P)
|
||||
DEF_RFB_KEY(XK_Q)
|
||||
DEF_RFB_KEY(XK_R)
|
||||
DEF_RFB_KEY(XK_S)
|
||||
DEF_RFB_KEY(XK_T)
|
||||
DEF_RFB_KEY(XK_U)
|
||||
DEF_RFB_KEY(XK_V)
|
||||
DEF_RFB_KEY(XK_W)
|
||||
DEF_RFB_KEY(XK_X)
|
||||
DEF_RFB_KEY(XK_Y)
|
||||
DEF_RFB_KEY(XK_Z)
|
||||
DEF_RFB_KEY(XK_bracketleft)
|
||||
DEF_RFB_KEY(XK_backslash)
|
||||
DEF_RFB_KEY(XK_bracketright)
|
||||
DEF_RFB_KEY(XK_asciicircum)
|
||||
DEF_RFB_KEY(XK_underscore)
|
||||
DEF_RFB_KEY(XK_grave)
|
||||
DEF_RFB_KEY(XK_a)
|
||||
DEF_RFB_KEY(XK_b)
|
||||
DEF_RFB_KEY(XK_c)
|
||||
DEF_RFB_KEY(XK_d)
|
||||
DEF_RFB_KEY(XK_e)
|
||||
DEF_RFB_KEY(XK_f)
|
||||
DEF_RFB_KEY(XK_g)
|
||||
DEF_RFB_KEY(XK_h)
|
||||
DEF_RFB_KEY(XK_i)
|
||||
DEF_RFB_KEY(XK_j)
|
||||
DEF_RFB_KEY(XK_k)
|
||||
DEF_RFB_KEY(XK_l)
|
||||
DEF_RFB_KEY(XK_m)
|
||||
DEF_RFB_KEY(XK_n)
|
||||
DEF_RFB_KEY(XK_o)
|
||||
DEF_RFB_KEY(XK_p)
|
||||
DEF_RFB_KEY(XK_q)
|
||||
DEF_RFB_KEY(XK_r)
|
||||
DEF_RFB_KEY(XK_s)
|
||||
DEF_RFB_KEY(XK_t)
|
||||
DEF_RFB_KEY(XK_u)
|
||||
DEF_RFB_KEY(XK_v)
|
||||
DEF_RFB_KEY(XK_w)
|
||||
DEF_RFB_KEY(XK_x)
|
||||
DEF_RFB_KEY(XK_y)
|
||||
DEF_RFB_KEY(XK_z)
|
||||
DEF_RFB_KEY(XK_braceleft)
|
||||
DEF_RFB_KEY(XK_bar)
|
||||
DEF_RFB_KEY(XK_braceright)
|
||||
DEF_RFB_KEY(XK_asciitilde)
|
||||
DEF_RFB_KEY(XK_nobreakspace)
|
||||
DEF_RFB_KEY(XK_exclamdown)
|
||||
DEF_RFB_KEY(XK_cent)
|
||||
DEF_RFB_KEY(XK_sterling)
|
||||
DEF_RFB_KEY(XK_currency)
|
||||
DEF_RFB_KEY(XK_yen)
|
||||
DEF_RFB_KEY(XK_brokenbar)
|
||||
DEF_RFB_KEY(XK_section)
|
||||
DEF_RFB_KEY(XK_diaeresis)
|
||||
DEF_RFB_KEY(XK_copyright)
|
||||
DEF_RFB_KEY(XK_ordfeminine)
|
||||
DEF_RFB_KEY(XK_guillemotleft)
|
||||
DEF_RFB_KEY(XK_notsign)
|
||||
DEF_RFB_KEY(XK_hyphen)
|
||||
DEF_RFB_KEY(XK_registered)
|
||||
DEF_RFB_KEY(XK_macron)
|
||||
DEF_RFB_KEY(XK_degree)
|
||||
DEF_RFB_KEY(XK_plusminus)
|
||||
DEF_RFB_KEY(XK_twosuperior)
|
||||
DEF_RFB_KEY(XK_threesuperior)
|
||||
DEF_RFB_KEY(XK_acute)
|
||||
DEF_RFB_KEY(XK_mu)
|
||||
DEF_RFB_KEY(XK_paragraph)
|
||||
DEF_RFB_KEY(XK_periodcentered)
|
||||
DEF_RFB_KEY(XK_cedilla)
|
||||
DEF_RFB_KEY(XK_onesuperior)
|
||||
DEF_RFB_KEY(XK_masculine)
|
||||
DEF_RFB_KEY(XK_guillemotright)
|
||||
DEF_RFB_KEY(XK_onequarter)
|
||||
DEF_RFB_KEY(XK_onehalf)
|
||||
DEF_RFB_KEY(XK_threequarters)
|
||||
DEF_RFB_KEY(XK_questiondown)
|
||||
DEF_RFB_KEY(XK_Agrave)
|
||||
DEF_RFB_KEY(XK_Aacute)
|
||||
DEF_RFB_KEY(XK_Acircumflex)
|
||||
DEF_RFB_KEY(XK_Atilde)
|
||||
DEF_RFB_KEY(XK_Adiaeresis)
|
||||
DEF_RFB_KEY(XK_Aring)
|
||||
DEF_RFB_KEY(XK_AE)
|
||||
DEF_RFB_KEY(XK_Ccedilla)
|
||||
DEF_RFB_KEY(XK_Egrave)
|
||||
DEF_RFB_KEY(XK_Eacute)
|
||||
DEF_RFB_KEY(XK_Ecircumflex)
|
||||
DEF_RFB_KEY(XK_Ediaeresis)
|
||||
DEF_RFB_KEY(XK_Igrave)
|
||||
DEF_RFB_KEY(XK_Iacute)
|
||||
DEF_RFB_KEY(XK_Icircumflex)
|
||||
DEF_RFB_KEY(XK_Idiaeresis)
|
||||
DEF_RFB_KEY(XK_ETH)
|
||||
DEF_RFB_KEY(XK_Ntilde)
|
||||
DEF_RFB_KEY(XK_Ograve)
|
||||
DEF_RFB_KEY(XK_Oacute)
|
||||
DEF_RFB_KEY(XK_Ocircumflex)
|
||||
DEF_RFB_KEY(XK_Otilde)
|
||||
DEF_RFB_KEY(XK_Odiaeresis)
|
||||
DEF_RFB_KEY(XK_multiply)
|
||||
DEF_RFB_KEY(XK_Oslash)
|
||||
DEF_RFB_KEY(XK_Ooblique)
|
||||
DEF_RFB_KEY(XK_Ugrave)
|
||||
DEF_RFB_KEY(XK_Uacute)
|
||||
DEF_RFB_KEY(XK_Ucircumflex)
|
||||
DEF_RFB_KEY(XK_Udiaeresis)
|
||||
DEF_RFB_KEY(XK_Yacute)
|
||||
DEF_RFB_KEY(XK_THORN)
|
||||
DEF_RFB_KEY(XK_ssharp)
|
||||
DEF_RFB_KEY(XK_agrave)
|
||||
DEF_RFB_KEY(XK_aacute)
|
||||
DEF_RFB_KEY(XK_acircumflex)
|
||||
DEF_RFB_KEY(XK_atilde)
|
||||
DEF_RFB_KEY(XK_adiaeresis)
|
||||
DEF_RFB_KEY(XK_aring)
|
||||
DEF_RFB_KEY(XK_ae)
|
||||
DEF_RFB_KEY(XK_ccedilla)
|
||||
DEF_RFB_KEY(XK_egrave)
|
||||
DEF_RFB_KEY(XK_eacute)
|
||||
DEF_RFB_KEY(XK_ecircumflex)
|
||||
DEF_RFB_KEY(XK_ediaeresis)
|
||||
DEF_RFB_KEY(XK_igrave)
|
||||
DEF_RFB_KEY(XK_iacute)
|
||||
DEF_RFB_KEY(XK_icircumflex)
|
||||
DEF_RFB_KEY(XK_idiaeresis)
|
||||
DEF_RFB_KEY(XK_eth)
|
||||
DEF_RFB_KEY(XK_ntilde)
|
||||
DEF_RFB_KEY(XK_ograve)
|
||||
DEF_RFB_KEY(XK_oacute)
|
||||
DEF_RFB_KEY(XK_ocircumflex)
|
||||
DEF_RFB_KEY(XK_otilde)
|
||||
DEF_RFB_KEY(XK_odiaeresis)
|
||||
DEF_RFB_KEY(XK_division)
|
||||
DEF_RFB_KEY(XK_oslash)
|
||||
DEF_RFB_KEY(XK_ooblique)
|
||||
DEF_RFB_KEY(XK_ugrave)
|
||||
DEF_RFB_KEY(XK_uacute)
|
||||
DEF_RFB_KEY(XK_ucircumflex)
|
||||
DEF_RFB_KEY(XK_udiaeresis)
|
||||
DEF_RFB_KEY(XK_yacute)
|
||||
DEF_RFB_KEY(XK_thorn)
|
||||
DEF_RFB_KEY(XK_ydiaeresis)
|
||||
DEF_RFB_KEY(XK_EuroSign)
|
||||
DEF_RFB_KEY(XK_ISO_Level3_Shift)
|
||||
DEF_RFB_KEY(XK_ISO_Left_Tab)
|
||||
DEF_RFB_KEY(XK_dead_grave)
|
||||
DEF_RFB_KEY(XK_dead_acute)
|
||||
DEF_RFB_KEY(XK_dead_circumflex)
|
||||
DEF_RFB_KEY(XK_dead_tilde)
|
||||
DEF_RFB_KEY(XK_BackSpace)
|
||||
DEF_RFB_KEY(XK_Tab)
|
||||
DEF_RFB_KEY(XK_Linefeed)
|
||||
DEF_RFB_KEY(XK_Clear)
|
||||
DEF_RFB_KEY(XK_Return)
|
||||
DEF_RFB_KEY(XK_Pause)
|
||||
DEF_RFB_KEY(XK_Scroll_Lock)
|
||||
DEF_RFB_KEY(XK_Sys_Req)
|
||||
DEF_RFB_KEY(XK_Escape)
|
||||
DEF_RFB_KEY(XK_Delete)
|
||||
DEF_RFB_KEY(XK_Home)
|
||||
DEF_RFB_KEY(XK_Left)
|
||||
DEF_RFB_KEY(XK_Up)
|
||||
DEF_RFB_KEY(XK_Right)
|
||||
DEF_RFB_KEY(XK_Down)
|
||||
DEF_RFB_KEY(XK_Page_Up)
|
||||
DEF_RFB_KEY(XK_Page_Down)
|
||||
DEF_RFB_KEY(XK_End)
|
||||
DEF_RFB_KEY(XK_Begin)
|
||||
DEF_RFB_KEY(XK_Select)
|
||||
DEF_RFB_KEY(XK_Print)
|
||||
DEF_RFB_KEY(XK_Execute)
|
||||
DEF_RFB_KEY(XK_Insert)
|
||||
DEF_RFB_KEY(XK_Menu)
|
||||
DEF_RFB_KEY(XK_Cancel)
|
||||
DEF_RFB_KEY(XK_Help)
|
||||
DEF_RFB_KEY(XK_Break)
|
||||
DEF_RFB_KEY(XK_Num_Lock)
|
||||
DEF_RFB_KEY(XK_KP_Space)
|
||||
DEF_RFB_KEY(XK_KP_Tab)
|
||||
DEF_RFB_KEY(XK_KP_Enter)
|
||||
DEF_RFB_KEY(XK_KP_Home)
|
||||
DEF_RFB_KEY(XK_KP_Left)
|
||||
DEF_RFB_KEY(XK_KP_Up)
|
||||
DEF_RFB_KEY(XK_KP_Right)
|
||||
DEF_RFB_KEY(XK_KP_Down)
|
||||
DEF_RFB_KEY(XK_KP_Prior)
|
||||
DEF_RFB_KEY(XK_KP_Page_Up)
|
||||
DEF_RFB_KEY(XK_KP_Next)
|
||||
DEF_RFB_KEY(XK_KP_Page_Down)
|
||||
DEF_RFB_KEY(XK_KP_End)
|
||||
DEF_RFB_KEY(XK_KP_Begin)
|
||||
DEF_RFB_KEY(XK_KP_Insert)
|
||||
DEF_RFB_KEY(XK_KP_Delete)
|
||||
DEF_RFB_KEY(XK_KP_Equal)
|
||||
DEF_RFB_KEY(XK_KP_Multiply)
|
||||
DEF_RFB_KEY(XK_KP_Add)
|
||||
DEF_RFB_KEY(XK_KP_Separator)
|
||||
DEF_RFB_KEY(XK_KP_Subtract)
|
||||
DEF_RFB_KEY(XK_KP_Decimal)
|
||||
DEF_RFB_KEY(XK_KP_Divide)
|
||||
DEF_RFB_KEY(XK_KP_F1)
|
||||
DEF_RFB_KEY(XK_KP_F2)
|
||||
DEF_RFB_KEY(XK_KP_F3)
|
||||
DEF_RFB_KEY(XK_KP_F4)
|
||||
DEF_RFB_KEY(XK_KP_0)
|
||||
DEF_RFB_KEY(XK_KP_1)
|
||||
DEF_RFB_KEY(XK_KP_2)
|
||||
DEF_RFB_KEY(XK_KP_3)
|
||||
DEF_RFB_KEY(XK_KP_4)
|
||||
DEF_RFB_KEY(XK_KP_5)
|
||||
DEF_RFB_KEY(XK_KP_6)
|
||||
DEF_RFB_KEY(XK_KP_7)
|
||||
DEF_RFB_KEY(XK_KP_8)
|
||||
DEF_RFB_KEY(XK_KP_9)
|
||||
DEF_RFB_KEY(XK_F1)
|
||||
DEF_RFB_KEY(XK_F2)
|
||||
DEF_RFB_KEY(XK_F3)
|
||||
DEF_RFB_KEY(XK_F4)
|
||||
DEF_RFB_KEY(XK_F5)
|
||||
DEF_RFB_KEY(XK_F6)
|
||||
DEF_RFB_KEY(XK_F7)
|
||||
DEF_RFB_KEY(XK_F8)
|
||||
DEF_RFB_KEY(XK_F9)
|
||||
DEF_RFB_KEY(XK_F10)
|
||||
DEF_RFB_KEY(XK_F11)
|
||||
DEF_RFB_KEY(XK_F12)
|
||||
DEF_RFB_KEY(XK_Shift_L)
|
||||
DEF_RFB_KEY(XK_Shift_R)
|
||||
DEF_RFB_KEY(XK_Control_L)
|
||||
DEF_RFB_KEY(XK_Control_R)
|
||||
DEF_RFB_KEY(XK_Caps_Lock)
|
||||
DEF_RFB_KEY(XK_Shift_Lock)
|
||||
DEF_RFB_KEY(XK_Meta_L)
|
||||
DEF_RFB_KEY(XK_Meta_R)
|
||||
DEF_RFB_KEY(XK_Alt_L)
|
||||
DEF_RFB_KEY(XK_Alt_R)
|
||||
DEF_RFB_KEY(XK_Super_L)
|
||||
DEF_RFB_KEY(XK_Super_R)
|
||||
// one final entry to mark the end
|
||||
{ NULL, 0 }
|
||||
};
|
||||
1661
simulators/bochs/gui/sdl.cc
Normal file
1661
simulators/bochs/gui/sdl.cc
Normal file
File diff suppressed because it is too large
Load Diff
804
simulators/bochs/gui/sdl.h
Normal file
804
simulators/bochs/gui/sdl.h
Normal file
@ -0,0 +1,804 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2002-2009 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
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef BX_SDL_H
|
||||
#define BX_SDL_H
|
||||
|
||||
#define BX_HEADERBAR_FG_RED 0x10
|
||||
#define BX_HEADERBAR_FG_GREEN 0x10
|
||||
#define BX_HEADERBAR_FG_BLUE 0x10
|
||||
#define BX_HEADERBAR_BG_RED 0xD0
|
||||
#define BX_HEADERBAR_BG_GREEN 0xD0
|
||||
#define BX_HEADERBAR_BG_BLUE 0xD0
|
||||
|
||||
unsigned char sdl_font8x16[256][16] = {
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, // 0
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 126, 129, 165, 129, 129, 189, // 1
|
||||
153, 129, 129, 126, 0, 0, 0, 0 },
|
||||
{ 0, 0, 126, 255, 219, 255, 255, 195, // 2
|
||||
231, 255, 255, 126, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 108, 254, 254, 254, // 3
|
||||
254, 124, 56, 16, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 16, 56, 124, 254, // 4
|
||||
124, 56, 16, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 24, 60, 60, 231, 231, // 5
|
||||
231, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 24, 60, 126, 255, 255, // 6
|
||||
126, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 24, 60, // 7
|
||||
60, 24, 0, 0, 0, 0, 0, 0 },
|
||||
{ 255, 255, 255, 255, 255, 255, 231, 195, // 8
|
||||
195, 231, 255, 255, 255, 255, 255, 255 },
|
||||
{ 0, 0, 0, 0, 0, 60, 102, 66, // 9
|
||||
66, 102, 60, 0, 0, 0, 0, 0 },
|
||||
{ 255, 255, 255, 255, 255, 195, 153, 189, // 10
|
||||
189, 153, 195, 255, 255, 255, 255, 255 },
|
||||
{ 0, 0, 30, 14, 26, 50, 120, 204, // 11
|
||||
204, 204, 204, 120, 0, 0, 0, 0 },
|
||||
{ 0, 0, 60, 102, 102, 102, 102, 60, // 12
|
||||
24, 126, 24, 24, 0, 0, 0, 0 },
|
||||
{ 0, 0, 63, 51, 63, 48, 48, 48, // 13
|
||||
48, 112, 240, 224, 0, 0, 0, 0 },
|
||||
{ 0, 0, 127, 99, 127, 99, 99, 99, // 14
|
||||
99, 103, 231, 230, 192, 0, 0, 0 },
|
||||
{ 0, 0, 0, 24, 24, 219, 60, 231, // 15
|
||||
60, 219, 24, 24, 0, 0, 0, 0 },
|
||||
{ 0, 128, 192, 224, 240, 248, 254, 248, // 16
|
||||
240, 224, 192, 128, 0, 0, 0, 0 },
|
||||
{ 0, 2, 6, 14, 30, 62, 254, 62, // 17
|
||||
30, 14, 6, 2, 0, 0, 0, 0 },
|
||||
{ 0, 0, 24, 60, 126, 24, 24, 24, // 18
|
||||
126, 60, 24, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 102, 102, 102, 102, 102, 102, // 19
|
||||
102, 0, 102, 102, 0, 0, 0, 0 },
|
||||
{ 0, 0, 127, 219, 219, 219, 123, 27, // 20
|
||||
27, 27, 27, 27, 0, 0, 0, 0 },
|
||||
{ 0, 124, 198, 96, 56, 108, 198, 198, // 21
|
||||
108, 56, 12, 198, 124, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, // 22
|
||||
254, 254, 254, 254, 0, 0, 0, 0 },
|
||||
{ 0, 0, 24, 60, 126, 24, 24, 24, // 23
|
||||
126, 60, 24, 126, 0, 0, 0, 0 },
|
||||
{ 0, 0, 24, 60, 126, 24, 24, 24, // 24
|
||||
24, 24, 24, 24, 0, 0, 0, 0 },
|
||||
{ 0, 0, 24, 24, 24, 24, 24, 24, // 25
|
||||
24, 126, 60, 24, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 24, 12, 254, // 26
|
||||
12, 24, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 48, 96, 254, // 27
|
||||
96, 48, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 192, 192, // 28
|
||||
192, 254, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 40, 108, 254, // 29
|
||||
108, 40, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 16, 56, 56, 124, // 30
|
||||
124, 254, 254, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 254, 254, 124, 124, // 31
|
||||
56, 56, 16, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, // 32
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 24, 60, 60, 60, 24, 24, // 33
|
||||
24, 0, 24, 24, 0, 0, 0, 0 },
|
||||
{ 0, 102, 102, 102, 36, 0, 0, 0, // 34
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 108, 108, 254, 108, 108, // 35
|
||||
108, 254, 108, 108, 0, 0, 0, 0 },
|
||||
{ 24, 24, 124, 198, 194, 192, 124, 6, // 36
|
||||
6, 134, 198, 124, 24, 24, 0, 0 },
|
||||
{ 0, 0, 0, 0, 194, 198, 12, 24, // 37
|
||||
48, 96, 198, 134, 0, 0, 0, 0 },
|
||||
{ 0, 0, 56, 108, 108, 56, 118, 220, // 38
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 48, 48, 48, 96, 0, 0, 0, // 39
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 12, 24, 48, 48, 48, 48, // 40
|
||||
48, 48, 24, 12, 0, 0, 0, 0 },
|
||||
{ 0, 0, 48, 24, 12, 12, 12, 12, // 41
|
||||
12, 12, 24, 48, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 102, 60, 255, // 42
|
||||
60, 102, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 24, 24, 126, // 43
|
||||
24, 24, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, // 44
|
||||
0, 24, 24, 24, 48, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 254, // 45
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, // 46
|
||||
0, 0, 24, 24, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 2, 6, 12, 24, // 47
|
||||
48, 96, 192, 128, 0, 0, 0, 0 },
|
||||
{ 0, 0, 56, 108, 198, 198, 214, 214, // 48
|
||||
198, 198, 108, 56, 0, 0, 0, 0 },
|
||||
{ 0, 0, 24, 56, 120, 24, 24, 24, // 49
|
||||
24, 24, 24, 126, 0, 0, 0, 0 },
|
||||
{ 0, 0, 124, 198, 6, 12, 24, 48, // 50
|
||||
96, 192, 198, 254, 0, 0, 0, 0 },
|
||||
{ 0, 0, 124, 198, 6, 6, 60, 6, // 51
|
||||
6, 6, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 12, 28, 60, 108, 204, 254, // 52
|
||||
12, 12, 12, 30, 0, 0, 0, 0 },
|
||||
{ 0, 0, 254, 192, 192, 192, 252, 6, // 53
|
||||
6, 6, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 56, 96, 192, 192, 252, 198, // 54
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 254, 198, 6, 6, 12, 24, // 55
|
||||
48, 48, 48, 48, 0, 0, 0, 0 },
|
||||
{ 0, 0, 124, 198, 198, 198, 124, 198, // 56
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 124, 198, 198, 198, 126, 6, // 57
|
||||
6, 6, 12, 120, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 24, 24, 0, 0, // 58
|
||||
0, 24, 24, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 24, 24, 0, 0, // 59
|
||||
0, 24, 24, 48, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 6, 12, 24, 48, 96, // 60
|
||||
48, 24, 12, 6, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 126, 0, 0, // 61
|
||||
126, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 96, 48, 24, 12, 6, // 62
|
||||
12, 24, 48, 96, 0, 0, 0, 0 },
|
||||
{ 0, 0, 124, 198, 198, 12, 24, 24, // 63
|
||||
24, 0, 24, 24, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 124, 198, 198, 222, 222, // 64
|
||||
222, 220, 192, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 16, 56, 108, 198, 198, 254, // 65
|
||||
198, 198, 198, 198, 0, 0, 0, 0 },
|
||||
{ 0, 0, 252, 102, 102, 102, 124, 102, // 66
|
||||
102, 102, 102, 252, 0, 0, 0, 0 },
|
||||
{ 0, 0, 60, 102, 194, 192, 192, 192, // 67
|
||||
192, 194, 102, 60, 0, 0, 0, 0 },
|
||||
{ 0, 0, 248, 108, 102, 102, 102, 102, // 68
|
||||
102, 102, 108, 248, 0, 0, 0, 0 },
|
||||
{ 0, 0, 254, 102, 98, 104, 120, 104, // 69
|
||||
96, 98, 102, 254, 0, 0, 0, 0 },
|
||||
{ 0, 0, 254, 102, 98, 104, 120, 104, // 70
|
||||
96, 96, 96, 240, 0, 0, 0, 0 },
|
||||
{ 0, 0, 60, 102, 194, 192, 192, 222, // 71
|
||||
198, 198, 102, 58, 0, 0, 0, 0 },
|
||||
{ 0, 0, 198, 198, 198, 198, 254, 198, // 72
|
||||
198, 198, 198, 198, 0, 0, 0, 0 },
|
||||
{ 0, 0, 60, 24, 24, 24, 24, 24, // 73
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 0, 30, 12, 12, 12, 12, 12, // 74
|
||||
204, 204, 204, 120, 0, 0, 0, 0 },
|
||||
{ 0, 0, 230, 102, 102, 108, 120, 120, // 75
|
||||
108, 102, 102, 230, 0, 0, 0, 0 },
|
||||
{ 0, 0, 240, 96, 96, 96, 96, 96, // 76
|
||||
96, 98, 102, 254, 0, 0, 0, 0 },
|
||||
{ 0, 0, 198, 238, 254, 254, 214, 198, // 77
|
||||
198, 198, 198, 198, 0, 0, 0, 0 },
|
||||
{ 0, 0, 198, 230, 246, 254, 222, 206, // 78
|
||||
198, 198, 198, 198, 0, 0, 0, 0 },
|
||||
{ 0, 0, 124, 198, 198, 198, 198, 198, // 79
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 252, 102, 102, 102, 124, 96, // 80
|
||||
96, 96, 96, 240, 0, 0, 0, 0 },
|
||||
{ 0, 0, 124, 198, 198, 198, 198, 198, // 81
|
||||
198, 214, 222, 124, 12, 14, 0, 0 },
|
||||
{ 0, 0, 252, 102, 102, 102, 124, 108, // 82
|
||||
102, 102, 102, 230, 0, 0, 0, 0 },
|
||||
{ 0, 0, 124, 198, 198, 96, 56, 12, // 83
|
||||
6, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 126, 126, 90, 24, 24, 24, // 84
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 0, 198, 198, 198, 198, 198, 198, // 85
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 198, 198, 198, 198, 198, 198, // 86
|
||||
198, 108, 56, 16, 0, 0, 0, 0 },
|
||||
{ 0, 0, 198, 198, 198, 198, 214, 214, // 87
|
||||
214, 254, 238, 108, 0, 0, 0, 0 },
|
||||
{ 0, 0, 198, 198, 108, 124, 56, 56, // 88
|
||||
124, 108, 198, 198, 0, 0, 0, 0 },
|
||||
{ 0, 0, 102, 102, 102, 102, 60, 24, // 89
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 0, 254, 198, 134, 12, 24, 48, // 90
|
||||
96, 194, 198, 254, 0, 0, 0, 0 },
|
||||
{ 0, 0, 60, 48, 48, 48, 48, 48, // 91
|
||||
48, 48, 48, 60, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 128, 192, 224, 112, 56, // 92
|
||||
28, 14, 6, 2, 0, 0, 0, 0 },
|
||||
{ 0, 0, 60, 12, 12, 12, 12, 12, // 93
|
||||
12, 12, 12, 60, 0, 0, 0, 0 },
|
||||
{ 16, 56, 108, 198, 0, 0, 0, 0, // 94
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, // 95
|
||||
0, 0, 0, 0, 0, 255, 0, 0 },
|
||||
{ 0, 48, 24, 12, 0, 0, 0, 0, // 96
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 120, 12, 124, // 97
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 0, 224, 96, 96, 120, 108, 102, // 98
|
||||
102, 102, 102, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 124, 198, 192, // 99
|
||||
192, 192, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 28, 12, 12, 60, 108, 204, // 100
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 124, 198, 254, // 101
|
||||
192, 192, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 28, 54, 50, 48, 120, 48, // 102
|
||||
48, 48, 48, 120, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 118, 204, 204, // 103
|
||||
204, 204, 204, 124, 12, 204, 120, 0 },
|
||||
{ 0, 0, 224, 96, 96, 108, 118, 102, // 104
|
||||
102, 102, 102, 230, 0, 0, 0, 0 },
|
||||
{ 0, 0, 24, 24, 0, 56, 24, 24, // 105
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 0, 6, 6, 0, 14, 6, 6, // 106
|
||||
6, 6, 6, 6, 102, 102, 60, 0 },
|
||||
{ 0, 0, 224, 96, 96, 102, 108, 120, // 107
|
||||
120, 108, 102, 230, 0, 0, 0, 0 },
|
||||
{ 0, 0, 56, 24, 24, 24, 24, 24, // 108
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 236, 254, 214, // 109
|
||||
214, 214, 214, 198, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 220, 102, 102, // 110
|
||||
102, 102, 102, 102, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 124, 198, 198, // 111
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 220, 102, 102, // 112
|
||||
102, 102, 102, 124, 96, 96, 240, 0 },
|
||||
{ 0, 0, 0, 0, 0, 118, 204, 204, // 113
|
||||
204, 204, 204, 124, 12, 12, 30, 0 },
|
||||
{ 0, 0, 0, 0, 0, 220, 118, 102, // 114
|
||||
96, 96, 96, 240, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 124, 198, 96, // 115
|
||||
56, 12, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 16, 48, 48, 252, 48, 48, // 116
|
||||
48, 48, 54, 28, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 204, 204, 204, // 117
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 198, 198, 198, // 118
|
||||
198, 198, 108, 56, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 198, 198, 214, // 119
|
||||
214, 214, 254, 108, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 198, 108, 56, // 120
|
||||
56, 56, 108, 198, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 198, 198, 198, // 121
|
||||
198, 198, 198, 126, 6, 12, 248, 0 },
|
||||
{ 0, 0, 0, 0, 0, 254, 204, 24, // 122
|
||||
48, 96, 198, 254, 0, 0, 0, 0 },
|
||||
{ 0, 0, 14, 24, 24, 24, 112, 24, // 123
|
||||
24, 24, 24, 14, 0, 0, 0, 0 },
|
||||
{ 0, 0, 24, 24, 24, 24, 24, 24, // 124
|
||||
24, 24, 24, 24, 0, 0, 0, 0 },
|
||||
{ 0, 0, 112, 24, 24, 24, 14, 24, // 125
|
||||
24, 24, 24, 112, 0, 0, 0, 0 },
|
||||
{ 0, 118, 220, 0, 0, 0, 0, 0, // 126
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 16, 56, 108, 198, // 127
|
||||
198, 198, 254, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 60, 102, 194, 192, 192, 192, // 128
|
||||
192, 194, 102, 60, 24, 112, 0, 0 },
|
||||
{ 0, 0, 204, 0, 0, 204, 204, 204, // 129
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 12, 24, 48, 0, 124, 198, 254, // 130
|
||||
192, 192, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 16, 56, 108, 0, 120, 12, 124, // 131
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 0, 204, 0, 0, 120, 12, 124, // 132
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 96, 48, 24, 0, 120, 12, 124, // 133
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 56, 108, 56, 0, 120, 12, 124, // 134
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 124, 198, 192, // 135
|
||||
192, 192, 198, 124, 24, 112, 0, 0 },
|
||||
{ 0, 16, 56, 108, 0, 124, 198, 254, // 136
|
||||
192, 192, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 198, 0, 0, 124, 198, 254, // 137
|
||||
192, 192, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 96, 48, 24, 0, 124, 198, 254, // 138
|
||||
192, 192, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 102, 0, 0, 56, 24, 24, // 139
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 24, 60, 102, 0, 56, 24, 24, // 140
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 96, 48, 24, 0, 56, 24, 24, // 141
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 198, 0, 16, 56, 108, 198, 198, // 142
|
||||
254, 198, 198, 198, 0, 0, 0, 0 },
|
||||
{ 56, 108, 56, 16, 56, 108, 198, 198, // 143
|
||||
254, 198, 198, 198, 0, 0, 0, 0 },
|
||||
{ 12, 24, 0, 254, 102, 98, 104, 120, // 144
|
||||
104, 98, 102, 254, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 236, 54, 54, // 145
|
||||
126, 216, 216, 110, 0, 0, 0, 0 },
|
||||
{ 0, 0, 62, 108, 204, 204, 254, 204, // 146
|
||||
204, 204, 204, 206, 0, 0, 0, 0 },
|
||||
{ 0, 16, 56, 108, 0, 124, 198, 198, // 147
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 198, 0, 0, 124, 198, 198, // 148
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 96, 48, 24, 0, 124, 198, 198, // 149
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 48, 120, 204, 0, 204, 204, 204, // 150
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 96, 48, 24, 0, 204, 204, 204, // 151
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 0, 198, 0, 0, 198, 198, 198, // 152
|
||||
198, 198, 198, 126, 6, 12, 120, 0 },
|
||||
{ 0, 198, 0, 124, 198, 198, 198, 198, // 153
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 198, 0, 198, 198, 198, 198, 198, // 154
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 124, 206, 222, // 155
|
||||
246, 230, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 56, 108, 100, 96, 240, 96, 96, // 156
|
||||
96, 96, 230, 252, 0, 0, 0, 0 },
|
||||
{ 0, 4, 124, 206, 206, 214, 214, 214, // 157
|
||||
214, 230, 230, 124, 64, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 198, 108, 56, // 158
|
||||
56, 108, 198, 0, 0, 0, 0, 0 },
|
||||
{ 0, 14, 27, 24, 24, 24, 126, 24, // 159
|
||||
24, 24, 216, 112, 0, 0, 0, 0 },
|
||||
{ 0, 24, 48, 96, 0, 120, 12, 124, // 160
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 12, 24, 48, 0, 56, 24, 24, // 161
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 24, 48, 96, 0, 124, 198, 198, // 162
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 24, 48, 96, 0, 204, 204, 204, // 163
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 0, 0, 118, 220, 0, 220, 102, 102, // 164
|
||||
102, 102, 102, 102, 0, 0, 0, 0 },
|
||||
{ 118, 220, 0, 198, 230, 246, 254, 222, // 165
|
||||
206, 198, 198, 198, 0, 0, 0, 0 },
|
||||
{ 0, 0, 60, 108, 108, 62, 0, 126, // 166
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 56, 108, 108, 56, 0, 124, // 167
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 48, 48, 0, 48, 48, 96, // 168
|
||||
192, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 124, 130, 178, 170, 178, 170, // 169
|
||||
170, 130, 124, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 254, 6, // 170
|
||||
6, 6, 6, 0, 0, 0, 0, 0 },
|
||||
{ 0, 96, 224, 98, 102, 108, 24, 48, // 171
|
||||
96, 220, 134, 12, 24, 62, 0, 0 },
|
||||
{ 0, 96, 224, 98, 102, 108, 24, 48, // 172
|
||||
102, 206, 154, 63, 6, 6, 0, 0 },
|
||||
{ 0, 0, 24, 24, 0, 24, 24, 24, // 173
|
||||
60, 60, 60, 24, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 54, 108, 216, // 174
|
||||
108, 54, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 216, 108, 54, // 175
|
||||
108, 216, 0, 0, 0, 0, 0, 0 },
|
||||
{ 17, 68, 17, 68, 17, 68, 17, 68, // 176
|
||||
17, 68, 17, 68, 17, 68, 17, 68 },
|
||||
{ 85, 170, 85, 170, 85, 170, 85, 170, // 177
|
||||
85, 170, 85, 170, 85, 170, 85, 170 },
|
||||
{ 221, 119, 221, 119, 221, 119, 221, 119, // 178
|
||||
221, 119, 221, 119, 221, 119, 221, 119 },
|
||||
{ 24, 24, 24, 24, 24, 24, 24, 24, // 179
|
||||
24, 24, 24, 24, 24, 24, 24, 24 },
|
||||
{ 24, 24, 24, 24, 24, 24, 24, 248, // 180
|
||||
24, 24, 24, 24, 24, 24, 24, 24 },
|
||||
{ 96, 192, 16, 56, 108, 198, 198, 254, // 181
|
||||
198, 198, 198, 198, 0, 0, 0, 0 },
|
||||
{ 124, 198, 16, 56, 108, 198, 198, 254, // 182
|
||||
198, 198, 198, 198, 0, 0, 0, 0 },
|
||||
{ 12, 6, 16, 56, 108, 198, 198, 254, // 183
|
||||
198, 198, 198, 198, 0, 0, 0, 0 },
|
||||
{ 0, 0, 124, 130, 154, 162, 162, 162, // 184
|
||||
154, 130, 124, 0, 0, 0, 0, 0 },
|
||||
{ 54, 54, 54, 54, 54, 246, 6, 246, // 185
|
||||
54, 54, 54, 54, 54, 54, 54, 54 },
|
||||
{ 54, 54, 54, 54, 54, 54, 54, 54, // 186
|
||||
54, 54, 54, 54, 54, 54, 54, 54 },
|
||||
{ 0, 0, 0, 0, 0, 254, 6, 246, // 187
|
||||
54, 54, 54, 54, 54, 54, 54, 54 },
|
||||
{ 54, 54, 54, 54, 54, 246, 6, 254, // 188
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 24, 24, 124, 198, 192, 192, // 189
|
||||
198, 124, 24, 24, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 102, 102, 60, 24, 126, // 190
|
||||
24, 126, 24, 24, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 248, // 191
|
||||
24, 24, 24, 24, 24, 24, 24, 24 },
|
||||
{ 24, 24, 24, 24, 24, 24, 24, 31, // 192
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 24, 24, 24, 24, 24, 24, 24, 255, // 193
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 255, // 194
|
||||
24, 24, 24, 24, 24, 24, 24, 24 },
|
||||
{ 24, 24, 24, 24, 24, 24, 24, 31, // 195
|
||||
24, 24, 24, 24, 24, 24, 24, 24 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 255, // 196
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 24, 24, 24, 24, 24, 24, 24, 255, // 197
|
||||
24, 24, 24, 24, 24, 24, 24, 24 },
|
||||
{ 0, 0, 118, 220, 0, 120, 12, 124, // 198
|
||||
204, 204, 204, 118, 0, 0, 0, 0 },
|
||||
{ 118, 220, 0, 56, 108, 198, 198, 254, // 199
|
||||
198, 198, 198, 198, 0, 0, 0, 0 },
|
||||
{ 54, 54, 54, 54, 54, 55, 48, 63, // 200
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 63, 48, 55, // 201
|
||||
54, 54, 54, 54, 54, 54, 54, 54 },
|
||||
{ 54, 54, 54, 54, 54, 247, 0, 255, // 202
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 255, 0, 247, // 203
|
||||
54, 54, 54, 54, 54, 54, 54, 54 },
|
||||
{ 54, 54, 54, 54, 54, 55, 48, 55, // 204
|
||||
54, 54, 54, 54, 54, 54, 54, 54 },
|
||||
{ 0, 0, 0, 0, 0, 255, 0, 255, // 205
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 54, 54, 54, 54, 54, 247, 0, 247, // 206
|
||||
54, 54, 54, 54, 54, 54, 54, 54 },
|
||||
{ 0, 0, 0, 0, 198, 124, 198, 198, // 207
|
||||
198, 198, 124, 198, 0, 0, 0, 0 },
|
||||
{ 0, 0, 52, 24, 44, 6, 62, 102, // 208
|
||||
102, 102, 102, 60, 0, 0, 0, 0 },
|
||||
{ 0, 0, 248, 108, 102, 102, 246, 102, // 209
|
||||
102, 102, 108, 248, 0, 0, 0, 0 },
|
||||
{ 56, 108, 0, 254, 102, 98, 104, 120, // 210
|
||||
104, 98, 102, 254, 0, 0, 0, 0 },
|
||||
{ 0, 198, 0, 254, 102, 98, 104, 120, // 211
|
||||
104, 98, 102, 254, 0, 0, 0, 0 },
|
||||
{ 48, 24, 0, 254, 102, 98, 104, 120, // 212
|
||||
104, 98, 102, 254, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 56, 24, 24, // 213
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 12, 24, 0, 60, 24, 24, 24, 24, // 214
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 60, 102, 0, 60, 24, 24, 24, 24, // 215
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 102, 0, 60, 24, 24, 24, 24, // 216
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 24, 24, 24, 24, 24, 24, 24, 248, // 217
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 31, // 218
|
||||
24, 24, 24, 24, 24, 24, 24, 24 },
|
||||
{ 255, 255, 255, 255, 255, 255, 255, 255, // 219
|
||||
255, 255, 255, 255, 255, 255, 255, 255 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 255, // 220
|
||||
255, 255, 255, 255, 255, 255, 255, 255 },
|
||||
{ 0, 24, 24, 24, 24, 24, 0, 0, // 221
|
||||
24, 24, 24, 24, 24, 0, 0, 0 },
|
||||
{ 48, 24, 0, 60, 24, 24, 24, 24, // 222
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 255, 255, 255, 255, 255, 255, 255, 0, // 223
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 24, 48, 0, 124, 198, 198, 198, 198, // 224
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 120, 204, 204, 204, 216, 204, // 225
|
||||
198, 198, 198, 204, 0, 0, 0, 0 },
|
||||
{ 56, 108, 0, 124, 198, 198, 198, 198, // 226
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 48, 24, 0, 124, 198, 198, 198, 198, // 227
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 118, 220, 0, 124, 198, 198, // 228
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 118, 220, 0, 124, 198, 198, 198, 198, // 229
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 102, 102, 102, // 230
|
||||
102, 102, 102, 124, 96, 96, 192, 0 },
|
||||
{ 0, 0, 224, 96, 96, 124, 102, 102, // 231
|
||||
102, 102, 102, 124, 96, 96, 240, 0 },
|
||||
{ 0, 0, 240, 96, 124, 102, 102, 102, // 232
|
||||
102, 124, 96, 240, 0, 0, 0, 0 },
|
||||
{ 24, 48, 0, 198, 198, 198, 198, 198, // 233
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 56, 108, 0, 198, 198, 198, 198, 198, // 234
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 48, 24, 0, 198, 198, 198, 198, 198, // 235
|
||||
198, 198, 198, 124, 0, 0, 0, 0 },
|
||||
{ 0, 12, 24, 48, 0, 198, 198, 198, // 236
|
||||
198, 198, 198, 126, 6, 12, 248, 0 },
|
||||
{ 12, 24, 0, 102, 102, 102, 102, 60, // 237
|
||||
24, 24, 24, 60, 0, 0, 0, 0 },
|
||||
{ 0, 255, 0, 0, 0, 0, 0, 0, // 238
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 12, 24, 48, 0, 0, 0, 0, // 239
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 254, // 240
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 24, 24, 126, 24, // 241
|
||||
24, 0, 0, 126, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, // 242
|
||||
0, 0, 0, 0, 255, 0, 255, 0 },
|
||||
{ 0, 224, 48, 98, 54, 236, 24, 48, // 243
|
||||
102, 206, 154, 63, 6, 6, 0, 0 },
|
||||
{ 0, 0, 127, 219, 219, 219, 123, 27, // 244
|
||||
27, 27, 27, 27, 0, 0, 0, 0 },
|
||||
{ 0, 124, 198, 96, 56, 108, 198, 198, // 245
|
||||
108, 56, 12, 198, 124, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 24, 0, 126, // 246
|
||||
0, 24, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, // 247
|
||||
0, 0, 0, 24, 12, 120, 0, 0 },
|
||||
{ 0, 56, 108, 108, 56, 0, 0, 0, // 248
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 198, 0, 0, 0, 0, 0, 0, // 249
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 24, // 250
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 24, 56, 24, 24, 24, 60, 0, // 251
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 124, 6, 60, 6, 6, 124, 0, // 252
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 60, 102, 12, 24, 50, 126, 0, // 253
|
||||
0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 126, 126, 126, 126, // 254
|
||||
126, 126, 126, 0, 0, 0, 0, 0 },
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0, // 255
|
||||
0, 0, 0, 0, 0, 0, 0, 0 }};
|
||||
|
||||
unsigned char sdl_font8x8[256][8] = {
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // 0
|
||||
{ 126, 129, 165, 129, 189, 153, 129, 126 }, // 1
|
||||
{ 126, 255, 219, 255, 195, 231, 255, 126 }, // 2
|
||||
{ 108, 254, 254, 254, 124, 56, 16, 0 }, // 3
|
||||
{ 16, 56, 124, 254, 124, 56, 16, 0 }, // 4
|
||||
{ 56, 124, 56, 254, 254, 214, 16, 56 }, // 5
|
||||
{ 16, 56, 124, 254, 254, 124, 16, 56 }, // 6
|
||||
{ 0, 0, 24, 60, 60, 24, 0, 0 }, // 7
|
||||
{ 255, 255, 231, 195, 195, 231, 255, 255 }, // 8
|
||||
{ 0, 60, 102, 66, 66, 102, 60, 0 }, // 9
|
||||
{ 255, 195, 153, 189, 189, 153, 195, 255 }, // 10
|
||||
{ 15, 7, 15, 125, 204, 204, 204, 120 }, // 11
|
||||
{ 60, 102, 102, 102, 60, 24, 126, 24 }, // 12
|
||||
{ 63, 51, 63, 48, 48, 112, 240, 224 }, // 13
|
||||
{ 127, 99, 127, 99, 99, 103, 230, 192 }, // 14
|
||||
{ 24, 219, 60, 231, 231, 60, 219, 24 }, // 15
|
||||
{ 128, 224, 248, 254, 248, 224, 128, 0 }, // 16
|
||||
{ 2, 14, 62, 254, 62, 14, 2, 0 }, // 17
|
||||
{ 24, 60, 126, 24, 24, 126, 60, 24 }, // 18
|
||||
{ 102, 102, 102, 102, 102, 0, 102, 0 }, // 19
|
||||
{ 127, 219, 219, 123, 27, 27, 27, 0 }, // 20
|
||||
{ 62, 97, 60, 102, 102, 60, 134, 124 }, // 21
|
||||
{ 0, 0, 0, 0, 126, 126, 126, 0 }, // 22
|
||||
{ 24, 60, 126, 24, 126, 60, 24, 255 }, // 23
|
||||
{ 24, 60, 126, 24, 24, 24, 24, 0 }, // 24
|
||||
{ 24, 24, 24, 24, 126, 60, 24, 0 }, // 25
|
||||
{ 0, 24, 12, 254, 12, 24, 0, 0 }, // 26
|
||||
{ 0, 48, 96, 254, 96, 48, 0, 0 }, // 27
|
||||
{ 0, 0, 192, 192, 192, 254, 0, 0 }, // 28
|
||||
{ 0, 36, 102, 255, 102, 36, 0, 0 }, // 29
|
||||
{ 0, 24, 60, 126, 255, 255, 0, 0 }, // 30
|
||||
{ 0, 255, 255, 126, 60, 24, 0, 0 }, // 31
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // 32
|
||||
{ 24, 60, 60, 24, 24, 0, 24, 0 }, // 33
|
||||
{ 102, 102, 36, 0, 0, 0, 0, 0 }, // 34
|
||||
{ 108, 108, 254, 108, 254, 108, 108, 0 }, // 35
|
||||
{ 24, 62, 96, 60, 6, 124, 24, 0 }, // 36
|
||||
{ 0, 198, 204, 24, 48, 102, 198, 0 }, // 37
|
||||
{ 56, 108, 56, 118, 220, 204, 118, 0 }, // 38
|
||||
{ 24, 24, 48, 0, 0, 0, 0, 0 }, // 39
|
||||
{ 12, 24, 48, 48, 48, 24, 12, 0 }, // 40
|
||||
{ 48, 24, 12, 12, 12, 24, 48, 0 }, // 41
|
||||
{ 0, 102, 60, 231, 60, 102, 0, 0 }, // 42
|
||||
{ 0, 24, 24, 126, 24, 24, 0, 0 }, // 43
|
||||
{ 0, 0, 0, 0, 0, 24, 24, 48 }, // 44
|
||||
{ 0, 0, 0, 126, 0, 0, 0, 0 }, // 45
|
||||
{ 0, 0, 0, 0, 0, 24, 24, 0 }, // 46
|
||||
{ 6, 12, 24, 48, 96, 192, 128, 0 }, // 47
|
||||
{ 124, 198, 206, 222, 246, 230, 124, 0 }, // 48
|
||||
{ 24, 56, 24, 24, 24, 24, 126, 0 }, // 49
|
||||
{ 124, 198, 6, 28, 48, 102, 254, 0 }, // 50
|
||||
{ 124, 198, 6, 60, 6, 198, 124, 0 }, // 51
|
||||
{ 28, 60, 108, 204, 254, 12, 30, 0 }, // 52
|
||||
{ 254, 192, 192, 252, 6, 198, 124, 0 }, // 53
|
||||
{ 56, 96, 192, 252, 198, 198, 124, 0 }, // 54
|
||||
{ 254, 198, 12, 24, 48, 48, 48, 0 }, // 55
|
||||
{ 124, 198, 198, 124, 198, 198, 124, 0 }, // 56
|
||||
{ 124, 198, 198, 126, 6, 12, 120, 0 }, // 57
|
||||
{ 0, 24, 24, 0, 0, 24, 24, 0 }, // 58
|
||||
{ 0, 24, 24, 0, 0, 24, 24, 48 }, // 59
|
||||
{ 6, 12, 24, 48, 24, 12, 6, 0 }, // 60
|
||||
{ 0, 0, 126, 0, 0, 126, 0, 0 }, // 61
|
||||
{ 96, 48, 24, 12, 24, 48, 96, 0 }, // 62
|
||||
{ 124, 198, 12, 24, 24, 0, 24, 0 }, // 63
|
||||
{ 124, 198, 222, 222, 222, 192, 120, 0 }, // 64
|
||||
{ 56, 108, 198, 254, 198, 198, 198, 0 }, // 65
|
||||
{ 252, 102, 102, 124, 102, 102, 252, 0 }, // 66
|
||||
{ 60, 102, 192, 192, 192, 102, 60, 0 }, // 67
|
||||
{ 248, 108, 102, 102, 102, 108, 248, 0 }, // 68
|
||||
{ 254, 98, 104, 120, 104, 98, 254, 0 }, // 69
|
||||
{ 254, 98, 104, 120, 104, 96, 240, 0 }, // 70
|
||||
{ 60, 102, 192, 192, 206, 102, 58, 0 }, // 71
|
||||
{ 198, 198, 198, 254, 198, 198, 198, 0 }, // 72
|
||||
{ 60, 24, 24, 24, 24, 24, 60, 0 }, // 73
|
||||
{ 30, 12, 12, 12, 204, 204, 120, 0 }, // 74
|
||||
{ 230, 102, 108, 120, 108, 102, 230, 0 }, // 75
|
||||
{ 240, 96, 96, 96, 98, 102, 254, 0 }, // 76
|
||||
{ 198, 238, 254, 254, 214, 198, 198, 0 }, // 77
|
||||
{ 198, 230, 246, 222, 206, 198, 198, 0 }, // 78
|
||||
{ 124, 198, 198, 198, 198, 198, 124, 0 }, // 79
|
||||
{ 252, 102, 102, 124, 96, 96, 240, 0 }, // 80
|
||||
{ 124, 198, 198, 198, 198, 206, 124, 14 }, // 81
|
||||
{ 252, 102, 102, 124, 108, 102, 230, 0 }, // 82
|
||||
{ 60, 102, 48, 24, 12, 102, 60, 0 }, // 83
|
||||
{ 126, 126, 90, 24, 24, 24, 60, 0 }, // 84
|
||||
{ 198, 198, 198, 198, 198, 198, 124, 0 }, // 85
|
||||
{ 198, 198, 198, 198, 198, 108, 56, 0 }, // 86
|
||||
{ 198, 198, 198, 214, 214, 254, 108, 0 }, // 87
|
||||
{ 198, 198, 108, 56, 108, 198, 198, 0 }, // 88
|
||||
{ 102, 102, 102, 60, 24, 24, 60, 0 }, // 89
|
||||
{ 254, 198, 140, 24, 50, 102, 254, 0 }, // 90
|
||||
{ 60, 48, 48, 48, 48, 48, 60, 0 }, // 91
|
||||
{ 192, 96, 48, 24, 12, 6, 2, 0 }, // 92
|
||||
{ 60, 12, 12, 12, 12, 12, 60, 0 }, // 93
|
||||
{ 16, 56, 108, 198, 0, 0, 0, 0 }, // 94
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 255 }, // 95
|
||||
{ 48, 24, 12, 0, 0, 0, 0, 0 }, // 96
|
||||
{ 0, 0, 120, 12, 124, 204, 118, 0 }, // 97
|
||||
{ 224, 96, 124, 102, 102, 102, 220, 0 }, // 98
|
||||
{ 0, 0, 124, 198, 192, 198, 124, 0 }, // 99
|
||||
{ 28, 12, 124, 204, 204, 204, 118, 0 }, // 100
|
||||
{ 0, 0, 124, 198, 254, 192, 124, 0 }, // 101
|
||||
{ 60, 102, 96, 248, 96, 96, 240, 0 }, // 102
|
||||
{ 0, 0, 118, 204, 204, 124, 12, 248 }, // 103
|
||||
{ 224, 96, 108, 118, 102, 102, 230, 0 }, // 104
|
||||
{ 24, 0, 56, 24, 24, 24, 60, 0 }, // 105
|
||||
{ 6, 0, 6, 6, 6, 102, 102, 60 }, // 106
|
||||
{ 224, 96, 102, 108, 120, 108, 230, 0 }, // 107
|
||||
{ 56, 24, 24, 24, 24, 24, 60, 0 }, // 108
|
||||
{ 0, 0, 236, 254, 214, 214, 214, 0 }, // 109
|
||||
{ 0, 0, 220, 102, 102, 102, 102, 0 }, // 110
|
||||
{ 0, 0, 124, 198, 198, 198, 124, 0 }, // 111
|
||||
{ 0, 0, 220, 102, 102, 124, 96, 240 }, // 112
|
||||
{ 0, 0, 118, 204, 204, 124, 12, 30 }, // 113
|
||||
{ 0, 0, 220, 118, 96, 96, 240, 0 }, // 114
|
||||
{ 0, 0, 126, 192, 124, 6, 252, 0 }, // 115
|
||||
{ 48, 48, 252, 48, 48, 54, 28, 0 }, // 116
|
||||
{ 0, 0, 204, 204, 204, 204, 118, 0 }, // 117
|
||||
{ 0, 0, 198, 198, 198, 108, 56, 0 }, // 118
|
||||
{ 0, 0, 198, 214, 214, 254, 108, 0 }, // 119
|
||||
{ 0, 0, 198, 108, 56, 108, 198, 0 }, // 120
|
||||
{ 0, 0, 198, 198, 198, 126, 6, 252 }, // 121
|
||||
{ 0, 0, 126, 76, 24, 50, 126, 0 }, // 122
|
||||
{ 14, 24, 24, 112, 24, 24, 14, 0 }, // 123
|
||||
{ 24, 24, 24, 24, 24, 24, 24, 0 }, // 124
|
||||
{ 112, 24, 24, 14, 24, 24, 112, 0 }, // 125
|
||||
{ 118, 220, 0, 0, 0, 0, 0, 0 }, // 126
|
||||
{ 0, 16, 56, 108, 198, 198, 254, 0 }, // 127
|
||||
{ 124, 198, 192, 192, 198, 124, 12, 120 }, // 128
|
||||
{ 204, 0, 204, 204, 204, 204, 118, 0 }, // 129
|
||||
{ 12, 24, 124, 198, 254, 192, 124, 0 }, // 130
|
||||
{ 124, 130, 120, 12, 124, 204, 118, 0 }, // 131
|
||||
{ 198, 0, 120, 12, 124, 204, 118, 0 }, // 132
|
||||
{ 48, 24, 120, 12, 124, 204, 118, 0 }, // 133
|
||||
{ 48, 48, 120, 12, 124, 204, 118, 0 }, // 134
|
||||
{ 0, 0, 126, 192, 192, 126, 12, 56 }, // 135
|
||||
{ 124, 130, 124, 198, 254, 192, 124, 0 }, // 136
|
||||
{ 198, 0, 124, 198, 254, 192, 124, 0 }, // 137
|
||||
{ 48, 24, 124, 198, 254, 192, 124, 0 }, // 138
|
||||
{ 102, 0, 56, 24, 24, 24, 60, 0 }, // 139
|
||||
{ 124, 130, 56, 24, 24, 24, 60, 0 }, // 140
|
||||
{ 48, 24, 0, 56, 24, 24, 60, 0 }, // 141
|
||||
{ 198, 56, 108, 198, 254, 198, 198, 0 }, // 142
|
||||
{ 56, 108, 124, 198, 254, 198, 198, 0 }, // 143
|
||||
{ 24, 48, 254, 192, 248, 192, 254, 0 }, // 144
|
||||
{ 0, 0, 126, 18, 254, 144, 254, 0 }, // 145
|
||||
{ 62, 108, 204, 254, 204, 204, 206, 0 }, // 146
|
||||
{ 124, 130, 124, 198, 198, 198, 124, 0 }, // 147
|
||||
{ 198, 0, 124, 198, 198, 198, 124, 0 }, // 148
|
||||
{ 48, 24, 124, 198, 198, 198, 124, 0 }, // 149
|
||||
{ 120, 132, 0, 204, 204, 204, 118, 0 }, // 150
|
||||
{ 96, 48, 204, 204, 204, 204, 118, 0 }, // 151
|
||||
{ 198, 0, 198, 198, 198, 126, 6, 252 }, // 152
|
||||
{ 198, 56, 108, 198, 198, 108, 56, 0 }, // 153
|
||||
{ 198, 0, 198, 198, 198, 198, 124, 0 }, // 154
|
||||
{ 0, 2, 124, 206, 214, 230, 124, 128 }, // 155
|
||||
{ 56, 108, 100, 240, 96, 102, 252, 0 }, // 156
|
||||
{ 58, 108, 206, 214, 230, 108, 184, 0 }, // 157
|
||||
{ 0, 198, 108, 56, 108, 198, 0, 0 }, // 158
|
||||
{ 14, 27, 24, 60, 24, 216, 112, 0 }, // 159
|
||||
{ 24, 48, 120, 12, 124, 204, 118, 0 }, // 160
|
||||
{ 12, 24, 0, 56, 24, 24, 60, 0 }, // 161
|
||||
{ 12, 24, 124, 198, 198, 198, 124, 0 }, // 162
|
||||
{ 24, 48, 204, 204, 204, 204, 118, 0 }, // 163
|
||||
{ 118, 220, 0, 220, 102, 102, 102, 0 }, // 164
|
||||
{ 118, 220, 0, 230, 246, 222, 206, 0 }, // 165
|
||||
{ 60, 108, 108, 62, 0, 126, 0, 0 }, // 166
|
||||
{ 56, 108, 108, 56, 0, 124, 0, 0 }, // 167
|
||||
{ 24, 0, 24, 24, 48, 99, 62, 0 }, // 168
|
||||
{ 126, 129, 185, 165, 185, 165, 129, 126 }, // 169
|
||||
{ 0, 0, 0, 254, 6, 6, 0, 0 }, // 170
|
||||
{ 99, 230, 108, 126, 51, 102, 204, 15 }, // 171
|
||||
{ 99, 230, 108, 122, 54, 106, 223, 6 }, // 172
|
||||
{ 24, 0, 24, 24, 60, 60, 24, 0 }, // 173
|
||||
{ 0, 51, 102, 204, 102, 51, 0, 0 }, // 174
|
||||
{ 0, 204, 102, 51, 102, 204, 0, 0 }, // 175
|
||||
{ 34, 136, 34, 136, 34, 136, 34, 136 }, // 176
|
||||
{ 85, 170, 85, 170, 85, 170, 85, 170 }, // 177
|
||||
{ 119, 221, 119, 221, 119, 221, 119, 221 }, // 178
|
||||
{ 24, 24, 24, 24, 24, 24, 24, 24 }, // 179
|
||||
{ 24, 24, 56, 248, 56, 24, 24, 24 }, // 180
|
||||
{ 48, 96, 56, 108, 198, 254, 198, 0 }, // 181
|
||||
{ 124, 130, 56, 108, 198, 254, 198, 0 }, // 182
|
||||
{ 24, 12, 56, 108, 198, 254, 198, 0 }, // 183
|
||||
{ 126, 129, 157, 161, 161, 157, 129, 126 }, // 184
|
||||
{ 54, 54, 246, 6, 246, 54, 54, 54 }, // 185
|
||||
{ 54, 54, 54, 54, 54, 54, 54, 54 }, // 186
|
||||
{ 0, 0, 254, 6, 246, 54, 54, 54 }, // 187
|
||||
{ 54, 54, 246, 6, 254, 0, 0, 0 }, // 188
|
||||
{ 24, 24, 126, 192, 192, 126, 24, 24 }, // 189
|
||||
{ 102, 102, 60, 126, 24, 126, 24, 24 }, // 190
|
||||
{ 0, 0, 0, 240, 56, 24, 24, 24 }, // 191
|
||||
{ 24, 24, 28, 15, 0, 0, 0, 0 }, // 192
|
||||
{ 24, 24, 60, 255, 0, 0, 0, 0 }, // 193
|
||||
{ 0, 0, 0, 255, 60, 24, 24, 24 }, // 194
|
||||
{ 48, 48, 56, 63, 56, 48, 48, 48 }, // 195
|
||||
{ 0, 0, 0, 255, 0, 0, 0, 0 }, // 196
|
||||
{ 24, 24, 24, 60, 231, 60, 24, 24 }, // 197
|
||||
{ 240, 120, 120, 120, 60, 60, 60, 28 }, // 198
|
||||
{ 30, 60, 60, 60, 120, 120, 120, 112 }, // 199
|
||||
{ 15, 63, 63, 120, 120, 0, 1, 3 }, // 200
|
||||
{ 192, 224, 240, 240, 240, 240, 240, 224 }, // 201
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // 202
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // 203
|
||||
{ 30, 30, 14, 15, 15, 7, 7, 0 }, // 204
|
||||
{ 240, 240, 224, 224, 192, 192, 192, 0 }, // 205
|
||||
{ 6, 13, 27, 55, 47, 127, 126, 30 }, // 206
|
||||
{ 0, 252, 255, 255, 143, 119, 243, 3 }, // 207
|
||||
{ 0, 1, 7, 143, 143, 207, 207, 199 }, // 208
|
||||
{ 0, 248, 254, 254, 31, 15, 192, 248 }, // 209
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // 210
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0 }, // 211
|
||||
{ 30, 30, 30, 31, 15, 7, 7, 1 }, // 212
|
||||
{ 3, 3, 3, 7, 143, 255, 254, 252 }, // 213
|
||||
{ 195, 192, 192, 207, 143, 7, 7, 1 }, // 214
|
||||
{ 254, 255, 31, 15, 143, 254, 254, 248 }, // 215
|
||||
{ 102, 0, 60, 24, 24, 24, 60, 0 }, // 216
|
||||
{ 24, 24, 56, 240, 0, 0, 0, 0 }, // 217
|
||||
{ 0, 0, 0, 15, 28, 24, 24, 24 }, // 218
|
||||
{ 255, 255, 255, 255, 255, 255, 255, 255 }, // 219
|
||||
{ 0, 0, 0, 0, 255, 255, 255, 255 }, // 220
|
||||
{ 24, 24, 24, 0, 0, 24, 24, 24 }, // 221
|
||||
{ 48, 24, 60, 24, 24, 24, 60, 0 }, // 222
|
||||
{ 255, 255, 255, 255, 0, 0, 0, 0 }, // 223
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 255 }, // 224
|
||||
{ 0, 0, 0, 0, 0, 255, 0, 255 }, // 225
|
||||
{ 0, 0, 0, 255, 0, 255, 0, 255 }, // 226
|
||||
{ 0, 255, 0, 255, 0, 255, 0, 255 }, // 227
|
||||
{ 0, 255, 0, 255, 0, 255, 0, 0 }, // 228
|
||||
{ 0, 255, 0, 255, 0, 0, 0, 0 }, // 229
|
||||
{ 0, 255, 0, 0, 0, 0, 0, 0 }, // 230
|
||||
{ 224, 128, 0, 0, 0, 0, 128, 224 }, // 231
|
||||
{ 248, 254, 255, 255, 255, 255, 254, 248 }, // 232
|
||||
{ 24, 48, 198, 198, 198, 198, 124, 0 }, // 233
|
||||
{ 124, 130, 0, 198, 198, 198, 124, 0 }, // 234
|
||||
{ 96, 48, 198, 198, 198, 198, 124, 0 }, // 235
|
||||
{ 24, 48, 198, 198, 198, 126, 6, 252 }, // 236
|
||||
{ 12, 24, 102, 102, 60, 24, 60, 0 }, // 237
|
||||
{ 255, 0, 0, 0, 0, 0, 0, 0 }, // 238
|
||||
{ 12, 24, 48, 0, 0, 0, 0, 0 }, // 239
|
||||
{ 0, 0, 0, 126, 0, 0, 0, 0 }, // 240
|
||||
{ 24, 24, 126, 24, 24, 0, 126, 0 }, // 241
|
||||
{ 0, 0, 0, 0, 0, 255, 0, 255 }, // 242
|
||||
{ 225, 50, 228, 58, 246, 42, 95, 134 }, // 243
|
||||
{ 127, 219, 219, 123, 27, 27, 27, 0 }, // 244
|
||||
{ 62, 97, 60, 102, 102, 60, 134, 124 }, // 245
|
||||
{ 0, 24, 0, 126, 0, 24, 0, 0 }, // 246
|
||||
{ 0, 0, 0, 0, 0, 24, 12, 56 }, // 247
|
||||
{ 56, 108, 108, 56, 0, 0, 0, 0 }, // 248
|
||||
{ 0, 198, 0, 0, 0, 0, 0, 0 }, // 249
|
||||
{ 0, 0, 0, 24, 0, 0, 0, 0 }, // 250
|
||||
{ 24, 56, 24, 24, 60, 0, 0, 0 }, // 251
|
||||
{ 120, 12, 56, 12, 120, 0, 0, 0 }, // 252
|
||||
{ 120, 12, 24, 48, 124, 0, 0, 0 }, // 253
|
||||
{ 0, 0, 60, 60, 60, 60, 0, 0 }, // 254
|
||||
{ 0, 0, 0, 0, 0, 0, 0, 0 }}; // 255
|
||||
|
||||
#endif
|
||||
257
simulators/bochs/gui/sdlkeys.h
Normal file
257
simulators/bochs/gui/sdlkeys.h
Normal file
@ -0,0 +1,257 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is simply a list of SDL key symbols taken from <SDL/SDL_keysym.h>.
|
||||
// The order in this file is not important. In sdl.cc, DEF_SDL_KEY() is
|
||||
// defined as a macro and then it includes this file to fill in all the data in
|
||||
// its key mapping table.
|
||||
//
|
||||
// The symbols, such as SDLK_RETURN, are used for two purposes. They
|
||||
// are converted into a string (by the # operator in processor), which is
|
||||
// compared to the host key name in the keymap file. Also, the value of
|
||||
// the symbol is inserted into the key mapping table. Then the value is
|
||||
// compared with the keysym field of each key up/down event as it arrives.
|
||||
//
|
||||
// If you get undefined symbol errors in this file, it must mean that
|
||||
// your SDL library version doesn't define those same SDLK_* symbols in
|
||||
// <SDL/SDL_keysym.h>. You can't fix it with #ifdef SDLK_SYM because
|
||||
// they are enums, so you'll just have to comment out the offending line.
|
||||
// The list was generated using symbols from SDL 1.2.3.
|
||||
|
||||
DEF_SDL_KEY( SDLK_UNKNOWN )
|
||||
DEF_SDL_KEY( SDLK_FIRST )
|
||||
DEF_SDL_KEY( SDLK_BACKSPACE )
|
||||
DEF_SDL_KEY( SDLK_TAB )
|
||||
DEF_SDL_KEY( SDLK_CLEAR )
|
||||
DEF_SDL_KEY( SDLK_RETURN )
|
||||
DEF_SDL_KEY( SDLK_PAUSE )
|
||||
DEF_SDL_KEY( SDLK_ESCAPE )
|
||||
DEF_SDL_KEY( SDLK_SPACE )
|
||||
DEF_SDL_KEY( SDLK_EXCLAIM )
|
||||
DEF_SDL_KEY( SDLK_QUOTEDBL )
|
||||
DEF_SDL_KEY( SDLK_HASH )
|
||||
DEF_SDL_KEY( SDLK_DOLLAR )
|
||||
DEF_SDL_KEY( SDLK_AMPERSAND )
|
||||
DEF_SDL_KEY( SDLK_QUOTE )
|
||||
DEF_SDL_KEY( SDLK_LEFTPAREN )
|
||||
DEF_SDL_KEY( SDLK_RIGHTPAREN )
|
||||
DEF_SDL_KEY( SDLK_ASTERISK )
|
||||
DEF_SDL_KEY( SDLK_PLUS )
|
||||
DEF_SDL_KEY( SDLK_COMMA )
|
||||
DEF_SDL_KEY( SDLK_MINUS )
|
||||
DEF_SDL_KEY( SDLK_PERIOD )
|
||||
DEF_SDL_KEY( SDLK_SLASH )
|
||||
DEF_SDL_KEY( SDLK_0 )
|
||||
DEF_SDL_KEY( SDLK_1 )
|
||||
DEF_SDL_KEY( SDLK_2 )
|
||||
DEF_SDL_KEY( SDLK_3 )
|
||||
DEF_SDL_KEY( SDLK_4 )
|
||||
DEF_SDL_KEY( SDLK_5 )
|
||||
DEF_SDL_KEY( SDLK_6 )
|
||||
DEF_SDL_KEY( SDLK_7 )
|
||||
DEF_SDL_KEY( SDLK_8 )
|
||||
DEF_SDL_KEY( SDLK_9 )
|
||||
DEF_SDL_KEY( SDLK_COLON )
|
||||
DEF_SDL_KEY( SDLK_SEMICOLON )
|
||||
DEF_SDL_KEY( SDLK_LESS )
|
||||
DEF_SDL_KEY( SDLK_EQUALS )
|
||||
DEF_SDL_KEY( SDLK_GREATER )
|
||||
DEF_SDL_KEY( SDLK_QUESTION )
|
||||
DEF_SDL_KEY( SDLK_AT )
|
||||
DEF_SDL_KEY( /* )
|
||||
DEF_SDL_KEY( Skip uppercase letters )
|
||||
DEF_SDL_KEY( */ )
|
||||
DEF_SDL_KEY( SDLK_LEFTBRACKET )
|
||||
DEF_SDL_KEY( SDLK_BACKSLASH )
|
||||
DEF_SDL_KEY( SDLK_RIGHTBRACKET )
|
||||
DEF_SDL_KEY( SDLK_CARET )
|
||||
DEF_SDL_KEY( SDLK_UNDERSCORE )
|
||||
DEF_SDL_KEY( SDLK_BACKQUOTE )
|
||||
DEF_SDL_KEY( SDLK_a )
|
||||
DEF_SDL_KEY( SDLK_b )
|
||||
DEF_SDL_KEY( SDLK_c )
|
||||
DEF_SDL_KEY( SDLK_d )
|
||||
DEF_SDL_KEY( SDLK_e )
|
||||
DEF_SDL_KEY( SDLK_f )
|
||||
DEF_SDL_KEY( SDLK_g )
|
||||
DEF_SDL_KEY( SDLK_h )
|
||||
DEF_SDL_KEY( SDLK_i )
|
||||
DEF_SDL_KEY( SDLK_j )
|
||||
DEF_SDL_KEY( SDLK_k )
|
||||
DEF_SDL_KEY( SDLK_l )
|
||||
DEF_SDL_KEY( SDLK_m )
|
||||
DEF_SDL_KEY( SDLK_n )
|
||||
DEF_SDL_KEY( SDLK_o )
|
||||
DEF_SDL_KEY( SDLK_p )
|
||||
DEF_SDL_KEY( SDLK_q )
|
||||
DEF_SDL_KEY( SDLK_r )
|
||||
DEF_SDL_KEY( SDLK_s )
|
||||
DEF_SDL_KEY( SDLK_t )
|
||||
DEF_SDL_KEY( SDLK_u )
|
||||
DEF_SDL_KEY( SDLK_v )
|
||||
DEF_SDL_KEY( SDLK_w )
|
||||
DEF_SDL_KEY( SDLK_x )
|
||||
DEF_SDL_KEY( SDLK_y )
|
||||
DEF_SDL_KEY( SDLK_z )
|
||||
DEF_SDL_KEY( SDLK_DELETE )
|
||||
DEF_SDL_KEY( SDLK_WORLD_0 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_1 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_2 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_3 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_4 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_5 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_6 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_7 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_8 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_9 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_10 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_11 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_12 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_13 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_14 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_15 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_16 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_17 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_18 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_19 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_20 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_21 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_22 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_23 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_24 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_25 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_26 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_27 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_28 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_29 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_30 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_31 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_32 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_33 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_34 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_35 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_36 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_37 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_38 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_39 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_40 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_41 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_42 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_43 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_44 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_45 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_46 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_47 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_48 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_49 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_50 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_51 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_52 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_53 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_54 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_55 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_56 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_57 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_58 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_59 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_60 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_61 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_62 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_63 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_64 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_65 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_66 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_67 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_68 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_69 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_70 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_71 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_72 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_73 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_74 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_75 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_76 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_77 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_78 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_79 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_80 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_81 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_82 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_83 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_84 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_85 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_86 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_87 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_88 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_89 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_90 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_91 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_92 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_93 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_94 )
|
||||
DEF_SDL_KEY( SDLK_WORLD_95 )
|
||||
DEF_SDL_KEY( SDLK_KP0 )
|
||||
DEF_SDL_KEY( SDLK_KP1 )
|
||||
DEF_SDL_KEY( SDLK_KP2 )
|
||||
DEF_SDL_KEY( SDLK_KP3 )
|
||||
DEF_SDL_KEY( SDLK_KP4 )
|
||||
DEF_SDL_KEY( SDLK_KP5 )
|
||||
DEF_SDL_KEY( SDLK_KP6 )
|
||||
DEF_SDL_KEY( SDLK_KP7 )
|
||||
DEF_SDL_KEY( SDLK_KP8 )
|
||||
DEF_SDL_KEY( SDLK_KP9 )
|
||||
DEF_SDL_KEY( SDLK_KP_PERIOD )
|
||||
DEF_SDL_KEY( SDLK_KP_DIVIDE )
|
||||
DEF_SDL_KEY( SDLK_KP_MULTIPLY )
|
||||
DEF_SDL_KEY( SDLK_KP_MINUS )
|
||||
DEF_SDL_KEY( SDLK_KP_PLUS )
|
||||
DEF_SDL_KEY( SDLK_KP_ENTER )
|
||||
DEF_SDL_KEY( SDLK_KP_EQUALS )
|
||||
DEF_SDL_KEY( SDLK_UP )
|
||||
DEF_SDL_KEY( SDLK_DOWN )
|
||||
DEF_SDL_KEY( SDLK_RIGHT )
|
||||
DEF_SDL_KEY( SDLK_LEFT )
|
||||
DEF_SDL_KEY( SDLK_INSERT )
|
||||
DEF_SDL_KEY( SDLK_HOME )
|
||||
DEF_SDL_KEY( SDLK_END )
|
||||
DEF_SDL_KEY( SDLK_PAGEUP )
|
||||
DEF_SDL_KEY( SDLK_PAGEDOWN )
|
||||
DEF_SDL_KEY( SDLK_F1 )
|
||||
DEF_SDL_KEY( SDLK_F2 )
|
||||
DEF_SDL_KEY( SDLK_F3 )
|
||||
DEF_SDL_KEY( SDLK_F4 )
|
||||
DEF_SDL_KEY( SDLK_F5 )
|
||||
DEF_SDL_KEY( SDLK_F6 )
|
||||
DEF_SDL_KEY( SDLK_F7 )
|
||||
DEF_SDL_KEY( SDLK_F8 )
|
||||
DEF_SDL_KEY( SDLK_F9 )
|
||||
DEF_SDL_KEY( SDLK_F10 )
|
||||
DEF_SDL_KEY( SDLK_F11 )
|
||||
DEF_SDL_KEY( SDLK_F12 )
|
||||
DEF_SDL_KEY( SDLK_F13 )
|
||||
DEF_SDL_KEY( SDLK_F14 )
|
||||
DEF_SDL_KEY( SDLK_F15 )
|
||||
DEF_SDL_KEY( SDLK_NUMLOCK )
|
||||
DEF_SDL_KEY( SDLK_CAPSLOCK )
|
||||
DEF_SDL_KEY( SDLK_SCROLLOCK )
|
||||
DEF_SDL_KEY( SDLK_RSHIFT )
|
||||
DEF_SDL_KEY( SDLK_LSHIFT )
|
||||
DEF_SDL_KEY( SDLK_RCTRL )
|
||||
DEF_SDL_KEY( SDLK_LCTRL )
|
||||
DEF_SDL_KEY( SDLK_RALT )
|
||||
DEF_SDL_KEY( SDLK_LALT )
|
||||
DEF_SDL_KEY( SDLK_RMETA )
|
||||
DEF_SDL_KEY( SDLK_LMETA )
|
||||
DEF_SDL_KEY( SDLK_LSUPER )
|
||||
DEF_SDL_KEY( SDLK_RSUPER )
|
||||
DEF_SDL_KEY( SDLK_MODE )
|
||||
DEF_SDL_KEY( SDLK_COMPOSE )
|
||||
DEF_SDL_KEY( SDLK_HELP )
|
||||
DEF_SDL_KEY( SDLK_PRINT )
|
||||
DEF_SDL_KEY( SDLK_SYSREQ )
|
||||
DEF_SDL_KEY( SDLK_BREAK )
|
||||
DEF_SDL_KEY( SDLK_MENU )
|
||||
DEF_SDL_KEY( SDLK_POWER )
|
||||
DEF_SDL_KEY( SDLK_EURO )
|
||||
DEF_SDL_KEY( SDLK_UNDO )
|
||||
1264
simulators/bochs/gui/siminterface.cc
Normal file
1264
simulators/bochs/gui/siminterface.cc
Normal file
File diff suppressed because it is too large
Load Diff
751
simulators/bochs/gui/siminterface.h
Normal file
751
simulators/bochs/gui/siminterface.h
Normal file
@ -0,0 +1,751 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 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
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Intro to siminterface by Bryce Denney:
|
||||
//
|
||||
// Before I can describe what this file is for, I have to make the
|
||||
// distinction between a configuration interface (CI) and the VGA display
|
||||
// window (VGAW). I will try to avoid the term 'GUI' because it is unclear
|
||||
// if that means CI or VGAW, and because not all interfaces are graphical
|
||||
// anyway.
|
||||
//
|
||||
// The traditional Bochs screen is a window with a large VGA display panel and
|
||||
// a series of buttons (floppy, cdrom, snapshot, power). Over the years, we
|
||||
// have collected many implementations of the VGAW for different environments
|
||||
// and platforms; each implementation is in a separate file under gui/*:
|
||||
// x.cc, win32.cc, beos.cc, macintosh.cc, etc. The files gui.h and gui.cc
|
||||
// define the platform independent part of the VGAW, leaving about 15 methods
|
||||
// of the bx_gui_c class undefined. The platform dependent file must
|
||||
// implement the remaining 15 methods.
|
||||
//
|
||||
// The configuration interface is relatively new, started by Bryce Denney in
|
||||
// June 2001. The CI is intended to allow the user to edit a variety of
|
||||
// configuration and runtime options. Some options, such as memory size or
|
||||
// enabling the ethernet card, should only be changed before the simulation
|
||||
// begins; others, such as floppy disk image, instructions per second, and
|
||||
// logging options can be safely changed at runtime. The CI allows the user to
|
||||
// make these changes. Before the CI existed, only a few things could be
|
||||
// changed at runtime, all linked to clicking on the VGAW buttons.
|
||||
//
|
||||
// At the time that the CI was conceived, we were still debating what form the
|
||||
// user interface part would take: stdin/stdout menus, a graphical application
|
||||
// with menus and dialogs running in a separate thread, or even a tiny web
|
||||
// server that you can connect to with a web browser. As a result the
|
||||
// interface to the CI was designed so that the user interface of the CI
|
||||
// could be replaced easily at compile time, or maybe even at runtime via
|
||||
// a plugin architecture. To this end, we kept a clear separation between
|
||||
// the user interface code and the siminterface, the code that interfaces with
|
||||
// the simulator. The same siminterface is used all the time, while
|
||||
// different implementations of the CI can be switched in reasonably easily.
|
||||
// Only the CI code uses library specific graphics and I/O functions; the
|
||||
// siminterface deals in portable abstractions and callback functions.
|
||||
// The first CI implementation was a series of text mode menus implemented in
|
||||
// textconfig.cc.
|
||||
//
|
||||
// The configuration interface MUST use the siminterface methods to access the
|
||||
// simulator. It should not modify settings in some device with code like
|
||||
// bx_floppy.s.media[2].heads = 17. If such access is needed, then a
|
||||
// siminterface method should be written to make the change on the CI's behalf.
|
||||
// This separation is enforced by the fact that the CI does not even include
|
||||
// bochs.h. You'll notice that textconfig.cc includes osdep.h, textconfig.h,
|
||||
// and siminterface.h, so it doesn't know what bx_floppy or bx_cpu_c are.
|
||||
// I'm sure some people will say is overly restrictive and/or annoying. When I
|
||||
// set it up this way, we were still talking about making the CI in a seperate
|
||||
// process, where direct method calls would be impossible. Also, we have been
|
||||
// considering turning devices into plugin modules which are dynamically
|
||||
// linked. Any direct references to something like bx_floppy.s.media[2].heads
|
||||
// would have to be reworked before a plugin interface was possible as well.
|
||||
//
|
||||
// The siminterface is the glue between the CI and the simulator. There is
|
||||
// just one global instance of the siminterface object, which can be referred
|
||||
// to by the global variable bx_simulator_interface_c *SIM. The base class
|
||||
// bx_simulator_interface_c, contains only virtual functions and it defines the
|
||||
// interface that the CI is allowed to use. In siminterface.cc, a class
|
||||
// called bx_real_sim_c is defined with bx_simulator_interface_c as its parent
|
||||
// class. Bx_real_sim_c implements each of the functions. The separation into
|
||||
// parent class and child class leaves the possibility of making a different
|
||||
// child class that talks to the simulator in a different way (networking for
|
||||
// example). If you were writing a user interface in a separate process, you
|
||||
// could define a subclass of bx_simulator_interface_c called
|
||||
// bx_siminterface_proxy_c which opens up a network port and turns all method
|
||||
// calls into network sends and receives. Because the interface is defined
|
||||
// entirely by the base class, the code that calls the methods would not know
|
||||
// the difference.
|
||||
//
|
||||
// An important part of the siminterface implementation is the use of parameter
|
||||
// classes, or bx_param_*. The parameter classes are described below, where
|
||||
// they are declared. Search for "parameter classes" below for details.
|
||||
//
|
||||
// Also this header file declares data structures for certain events that pass
|
||||
// between the siminterface and the CI. Search for "event structures" below.
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
// BX_USE_TEXTCONFIG should be set to 1 when the text mode configuration interface
|
||||
// is compiled in. This gives each type of parameter a text_print and text_ask
|
||||
// method (defined in gui/textconfig.cc) so that you can call text_ask() on any
|
||||
// kind of parameter to ask the user to edit the value.
|
||||
//
|
||||
// I have been considering whether to use the same strategy for the
|
||||
// wxWidgets interface, but I'm not sure if I like it. One problem is
|
||||
// that in order to declare member functions that are useful for
|
||||
// wxWidgets, the wxWidgets header files would have to be included
|
||||
// before the param object definitions. That means that all the
|
||||
// wxWidgets headers would have be included when compiling every
|
||||
// single bochs file. One of the things I like about the separation
|
||||
// between the simulator and CI is that the two parts can be
|
||||
// compiled without any knowledge of the other. Bochs doesn't include
|
||||
// <wx.h>, and the wxWidgets CI (wxmain.cc) doesn't need to include <bochs.h>.
|
||||
// Aside from making compiles faster, this enforces the use of the siminterface
|
||||
// so it keeps the interface clean (important when we may have multiple UI
|
||||
// implementations for example). This argues for keeping UI-specific
|
||||
// structures out of the simulator interface. It certainly works ok for the
|
||||
// text interface, but that's because FILE* is standard and portable.
|
||||
|
||||
//////////////////////////////////////////////////////
|
||||
|
||||
//DanceOS
|
||||
#ifndef BX_SIMINTERFACE_H
|
||||
# define BX_SIMINTERFACE_H 1
|
||||
|
||||
// list of possible types for bx_param_c and descendant objects
|
||||
typedef enum {
|
||||
BXT_OBJECT = 201,
|
||||
BXT_PARAM,
|
||||
BXT_PARAM_NUM,
|
||||
BXT_PARAM_BOOL,
|
||||
BXT_PARAM_ENUM,
|
||||
BXT_PARAM_STRING,
|
||||
BXT_PARAM_DATA,
|
||||
BXT_LIST
|
||||
} bx_objtype;
|
||||
|
||||
// base value for generated new parameter id
|
||||
#define BXP_NEW_PARAM_ID 1001
|
||||
|
||||
#if BX_SUPPORT_SMP
|
||||
#define BX_SMP_PROCESSORS (bx_cpu_count)
|
||||
#else
|
||||
#define BX_SMP_PROCESSORS 1
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
BX_TOOLBAR_UNDEFINED,
|
||||
BX_TOOLBAR_FLOPPYA,
|
||||
BX_TOOLBAR_FLOPPYB,
|
||||
BX_TOOLBAR_CDROMD,
|
||||
BX_TOOLBAR_RESET,
|
||||
BX_TOOLBAR_POWER,
|
||||
BX_TOOLBAR_SAVE_RESTORE,
|
||||
BX_TOOLBAR_COPY,
|
||||
BX_TOOLBAR_PASTE,
|
||||
BX_TOOLBAR_SNAPSHOT,
|
||||
BX_TOOLBAR_CONFIG,
|
||||
BX_TOOLBAR_MOUSE_EN,
|
||||
BX_TOOLBAR_USER
|
||||
} bx_toolbar_buttons;
|
||||
|
||||
// Log level defines
|
||||
typedef enum {
|
||||
LOGLEV_DEBUG = 0,
|
||||
LOGLEV_INFO,
|
||||
LOGLEV_ERROR,
|
||||
LOGLEV_PANIC,
|
||||
LOGLEV_PASS,
|
||||
N_LOGLEV
|
||||
} bx_log_levels;
|
||||
|
||||
// boot devices (using the same values as the rombios)
|
||||
#define BX_BOOT_NONE 0
|
||||
#define BX_BOOT_FLOPPYA 1
|
||||
#define BX_BOOT_DISKC 2
|
||||
#define BX_BOOT_CDROM 3
|
||||
#define BX_BOOT_NETWORK 4
|
||||
|
||||
// loader hack
|
||||
#define Load32bitOSNone 0
|
||||
#define Load32bitOSLinux 1
|
||||
#define Load32bitOSNullKernel 2 // being developed for plex86
|
||||
#define Load32bitOSLast 2
|
||||
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// event structures for communication between simulator and CI
|
||||
///////////////////////////////////////////////////////////////////
|
||||
// Because the CI (configuration interface) might be in a different
|
||||
// thread or even a different process, we pass events encoded in data
|
||||
// structures to it instead of just calling functions. Each type of
|
||||
// event is declared as a different structure, and then all those
|
||||
// structures are squished into a union in BxEvent. (BTW, this is
|
||||
// almost exactly how X windows event structs work.)
|
||||
//
|
||||
// These are simple structs, unblemished by C++ methods and tricks.
|
||||
// No matter what event type it is, we allocate a BxEvent for each
|
||||
// one, as opposed to trying to save a few bytes on small events by
|
||||
// allocating only the bytes necessary for it. This makes it easy and
|
||||
// fast to store events in a queue, like this
|
||||
// BxEvent event_queue[MAX_EVENTS];
|
||||
//
|
||||
// Events come in two varieties: synchronous and asynchronous. We
|
||||
// have to worry about sync and async events because the CI and the
|
||||
// simulation may be running in different threads. An async event is
|
||||
// the simplest. Whichever thread originates the event just builds
|
||||
// the data structure, sends it, and then continues with its business.
|
||||
// Async events can go in either direction. Synchronous events
|
||||
// require the other thread to "respond" before the originating thread
|
||||
// can continue. It's like a function with a return value; you can't
|
||||
// continue until you get the return value back.
|
||||
//
|
||||
// Examples:
|
||||
//
|
||||
// async event: In the wxWidgets implementation, both the CI and the
|
||||
// VGAW operate in the wxWidgets GUI thread. When the user presses a
|
||||
// key, wxWidgets sends a wxKeyEvent to the VGAW event handler code in
|
||||
// wx.cc. The VGAW handler then builds a BxEvent with
|
||||
// type=BX_ASYNC_EVT_KEY, and fills in the bx_key and raw_scancode
|
||||
// fields. The asynchronous event is placed on the event_queue for
|
||||
// the simulator, then the VGAW handler returns. (With wxWidgets and
|
||||
// many other graphical libaries, the event handler must return
|
||||
// quickly because the window will not be updated until it's done.)
|
||||
// Some time later, the simulator reaches the point where it checks
|
||||
// for new events from the user (actually controlled by
|
||||
// bx_keyb_c::periodic() in iodev/keyboard.cc) and calls
|
||||
// bx_gui.handle_events(). Then all the events in the queue are
|
||||
// processed by the simulator. There is no "response" sent back to
|
||||
// the originating thread.
|
||||
//
|
||||
// sync event: Sometimes the simulator reaches a point where it needs
|
||||
// to ask the user how to proceed. In this case, the simulator sends
|
||||
// a synchronous event because it requires a response before it can
|
||||
// continue. It builds an event structure, perhaps with type
|
||||
// BX_SYNC_EVT_ASK_PARAM, sends it to the user interface
|
||||
// using the event handler function defined by set_notify_callback(),
|
||||
// and pauses the simulation. The user interface asks the user the
|
||||
// question, and puts the answer into the BxEvent.retcode field. The
|
||||
// event handler function returns the modified BxEvent with retcode
|
||||
// filled in, and the simulation continues. The details of this
|
||||
// transaction can be complicated if the simulation and CI are not
|
||||
// in the same thread, but the behavior is as described.
|
||||
//
|
||||
|
||||
///// types and definitions used in event structures
|
||||
|
||||
#define BX_EVT_IS_ASYNC(type) ((type) > __ALL_EVENTS_BELOW_ARE_ASYNC__)
|
||||
|
||||
typedef enum {
|
||||
__ALL_EVENTS_BELOW_ARE_SYNCHRONOUS__ = 2000,
|
||||
BX_SYNC_EVT_GET_PARAM, // CI -> simulator -> CI
|
||||
BX_SYNC_EVT_ASK_PARAM, // simulator -> CI -> simulator
|
||||
BX_SYNC_EVT_TICK, // simulator -> CI, wait for response.
|
||||
BX_SYNC_EVT_LOG_ASK, // simulator -> CI, wait for response.
|
||||
BX_SYNC_EVT_GET_DBG_COMMAND, // simulator -> CI, wait for response.
|
||||
__ALL_EVENTS_BELOW_ARE_ASYNC__,
|
||||
BX_ASYNC_EVT_KEY, // vga window -> simulator
|
||||
BX_ASYNC_EVT_MOUSE, // vga window -> simulator
|
||||
BX_ASYNC_EVT_SET_PARAM, // CI -> simulator
|
||||
BX_ASYNC_EVT_LOG_MSG, // simulator -> CI
|
||||
BX_ASYNC_EVT_DBG_MSG, // simulator -> CI
|
||||
BX_ASYNC_EVT_VALUE_CHANGED, // simulator -> CI
|
||||
BX_ASYNC_EVT_TOOLBAR, // CI -> simulator
|
||||
BX_ASYNC_EVT_REFRESH // simulator -> CI
|
||||
} BxEventType;
|
||||
|
||||
typedef union {
|
||||
Bit32s s32;
|
||||
char *charptr;
|
||||
} AnyParamVal;
|
||||
|
||||
// Define substructures which make up the interior of BxEvent. The
|
||||
// substructures, such as BxKeyEvent or BxMouseEvent, should never be
|
||||
// allocated on their own. They are only intended to be used within
|
||||
// the union in the BxEvent structure.
|
||||
|
||||
// Event type: BX_SYNC_EVT_TICK
|
||||
//
|
||||
// A tick event is synchronous, sent from the simulator to the GUI. The
|
||||
// event doesn't do anything visible. Primarily it gives the GUI a chance
|
||||
// to tell the simulator to quit, if necessary. There may be other uses
|
||||
// for the tick in the future, such as giving some kind of regular
|
||||
// status report or mentioning watched values that changed, but so far
|
||||
// it's just for that one thing. There is no data associated with a
|
||||
// tick event.
|
||||
|
||||
// Event type: BX_ASYNC_EVT_KEY
|
||||
//
|
||||
// A key event can be sent from the VGA window to the Bochs simulator.
|
||||
// It is asynchronous.
|
||||
typedef struct {
|
||||
// what was pressed? This is a BX_KEY_* value. For key releases,
|
||||
// BX_KEY_RELEASED is ORed with the base BX_KEY_*.
|
||||
Bit32u bx_key;
|
||||
bx_bool raw_scancode;
|
||||
} BxKeyEvent;
|
||||
|
||||
// Event type: BX_ASYNC_EVT_MOUSE
|
||||
//
|
||||
// A mouse event can be sent from the VGA window to the Bochs
|
||||
// simulator. It is asynchronous. Currently unused because mouse
|
||||
// events aren't implemented in our wxWidgets code yet.
|
||||
typedef struct {
|
||||
// type is BX_EVT_MOUSE
|
||||
Bit16s dx, dy; // mouse motion delta
|
||||
Bit8u buttons; // which buttons are pressed.
|
||||
// bit 0: 1=left button down, 0=up
|
||||
// bit 1: 1=right button down, 0=up
|
||||
} BxMouseEvent;
|
||||
|
||||
// Event type: BX_SYNC_EVT_GET_PARAM, BX_ASYNC_EVT_SET_PARAM
|
||||
//
|
||||
// Parameter set/get events are initiated by the CI, since Bochs can
|
||||
// always access the parameters directly. So far, I haven't used
|
||||
// these event types. In the CI I just call
|
||||
// SIM->get_param(parameter_id) to get a pointer to the bx_param_c
|
||||
// object and then call the get/set methods. This is okay for
|
||||
// configuration since bochs is not running. However it could be
|
||||
// dangerous for the GUI thread to poke around in Bochs structures
|
||||
// while the thread is running. For these cases, I may have to be
|
||||
// more careful and actually build get/set events and place them on
|
||||
// Bochs's event queue to be processed during SIM->periodic() or
|
||||
// something.
|
||||
typedef struct {
|
||||
// type is BX_EVT_GET_PARAM, BX_EVT_SET_PARAM
|
||||
class bx_param_c *param; // pointer to param structure
|
||||
AnyParamVal val;
|
||||
} BxParamEvent;
|
||||
|
||||
// Event type: BX_SYNC_EVT_ASK_PARAM
|
||||
// Synchronous event sent from the simulator to the CI. This tells the
|
||||
// CI to ask the user to choose the value of a parameter. The CI may
|
||||
// need to discover the type of parameter so that it can use the right
|
||||
// kind of graphical display. The BxParamEvent is used for these events
|
||||
// too.
|
||||
// FIXME: at the moment the GUI implements the ASK_PARAM event for just
|
||||
// a few parameter types. I need to implement the event for all parameter
|
||||
// types.
|
||||
|
||||
// Event type: BX_ASYNC_EVT_VALUE_CHANGED
|
||||
//
|
||||
// Asynchronous event sent from the simulator to the CI, telling it that
|
||||
// some value that it (hopefully) cares about has changed. This isn't
|
||||
// being used yet, but a good example is in a debugger interface, you might
|
||||
// want to maintain a reasonably current display of the PC or some other
|
||||
// simulation state. The CI would set some kind of event mask (which
|
||||
// doesn't exist now of course) and then when certain values change, the
|
||||
// simulator would send this event so that the CI can update. We may need
|
||||
// some kind of "flow control" since the simulator will be able to produce
|
||||
// new events much faster than the gui can accept them.
|
||||
|
||||
// Event type: BX_ASYNC_EVT_LOG_MSG (unused)
|
||||
//
|
||||
// Asynchronous event from the simulator to the CI. When a BX_PANIC,
|
||||
// BX_ERROR, BX_INFO, or BX_DEBUG is found in the simulator code, this
|
||||
// event type can be used to inform the CI of the condition. There is
|
||||
// no point in sending messages to the CI that will not be displayed; these
|
||||
// would only slow the simulation. So we will need some mechanism for
|
||||
// choosing what kinds of events will be delivered to the CI. Normally,
|
||||
// you wouldn't want to look at the log unless something is going wrong.
|
||||
// At that point, you might want to open up a window to watch the debug
|
||||
// messages from one or two devices only.
|
||||
//
|
||||
// Idea: Except for panics that require user attention to continue, it
|
||||
// might be most efficient to just append log messages to a file.
|
||||
// When the user wants to look at the log messages, the gui can reopen
|
||||
// the file (read only), skip to the end, and look backward for a
|
||||
// reasonable number of lines to display (200?). This allows it to
|
||||
// skip over huge bursts of log entries without allocating memory,
|
||||
// synchronizing threads, etc. for each.
|
||||
typedef struct {
|
||||
Bit8u level;
|
||||
const char *prefix;
|
||||
const char *msg;
|
||||
} BxLogMsgEvent;
|
||||
|
||||
// Event type: BX_ASYNC_EVT_DBG_MSG
|
||||
//
|
||||
// Also uses BxLogMsgEvent, but this is a message to be displayed in
|
||||
// the debugger history window.
|
||||
|
||||
// Event type: BX_SYNC_EVT_LOG_ASK
|
||||
//
|
||||
// This is a synchronous version of BX_ASYNC_EVT_LOG_MSG, which is used
|
||||
// when the "action=ask" setting is used. If the simulator runs into a
|
||||
// panic, it sends a synchronous BX_SYNC_EVT_LOG_ASK to the CI to be
|
||||
// displayed. The CI shows a dialog that asks if the user wants to
|
||||
// continue, quit, etc. and sends the answer back to the simulator.
|
||||
// This event also uses BxLogMsgEvent.
|
||||
enum {
|
||||
BX_LOG_ASK_CHOICE_CONTINUE,
|
||||
BX_LOG_ASK_CHOICE_CONTINUE_ALWAYS,
|
||||
BX_LOG_ASK_CHOICE_DIE,
|
||||
BX_LOG_ASK_CHOICE_DUMP_CORE,
|
||||
BX_LOG_ASK_CHOICE_ENTER_DEBUG,
|
||||
BX_LOG_ASK_N_CHOICES,
|
||||
BX_LOG_NOTIFY_FAILED
|
||||
};
|
||||
|
||||
// Event type: BX_SYNC_EVT_GET_DBG_COMMAND
|
||||
//
|
||||
// This is a synchronous event sent from the simulator to the debugger
|
||||
// requesting the next action. In a text mode debugger, this would prompt
|
||||
// the user for the next command. When a new command is ready, the
|
||||
// synchronous event is sent back with its fields filled in.
|
||||
typedef struct {
|
||||
char *command; // null terminated string. allocated by debugger interface
|
||||
// with new operator, freed by simulator with delete.
|
||||
} BxDebugCommand;
|
||||
|
||||
|
||||
|
||||
// Event type: BX_EVT_TOOLBAR
|
||||
// Asynchronous event from the VGAW to the simulator, sent when the user
|
||||
// clicks on a toolbar button. This may one day become something more
|
||||
// general, like a command event, but at the moment it's only needed for
|
||||
// the toolbar events.
|
||||
typedef struct {
|
||||
bx_toolbar_buttons button;
|
||||
bx_bool on; // for toggling buttons, on=true means the toolbar button is
|
||||
// pressed. on=false means it is not pressed.
|
||||
} BxToolbarEvent;
|
||||
|
||||
// The BxEvent structure should be used for all events. Every event has
|
||||
// a type and a spot for a return code (only used for synchronous events).
|
||||
typedef struct {
|
||||
BxEventType type; // what kind is this?
|
||||
Bit32s retcode; // sucess or failure. only used for synchronous events.
|
||||
union {
|
||||
BxKeyEvent key;
|
||||
BxMouseEvent mouse;
|
||||
BxParamEvent param;
|
||||
BxLogMsgEvent logmsg;
|
||||
BxToolbarEvent toolbar;
|
||||
BxDebugCommand debugcmd;
|
||||
} u;
|
||||
} BxEvent;
|
||||
|
||||
#include "paramtree.h"
|
||||
|
||||
// These are the different start modes.
|
||||
enum {
|
||||
// Just start the simulation without running the configuration interface
|
||||
// at all, unless something goes wrong.
|
||||
BX_QUICK_START = 200,
|
||||
// Run the configuration interface. The default action will be to load a
|
||||
// configuration file. This makes sense if a config file could not be
|
||||
// loaded, either because it wasn't found or because it had errors.
|
||||
BX_LOAD_START,
|
||||
// Run the configuration interface. The default action will be to
|
||||
// edit the configuration.
|
||||
BX_EDIT_START,
|
||||
// Run the configuration interface, but make the default action be to
|
||||
// start the simulation.
|
||||
BX_RUN_START
|
||||
};
|
||||
|
||||
enum {
|
||||
BX_MOUSE_TYPE_NONE,
|
||||
BX_MOUSE_TYPE_PS2,
|
||||
BX_MOUSE_TYPE_IMPS2,
|
||||
#if BX_SUPPORT_BUSMOUSE
|
||||
BX_MOUSE_TYPE_BUS,
|
||||
#endif
|
||||
BX_MOUSE_TYPE_SERIAL,
|
||||
BX_MOUSE_TYPE_SERIAL_WHEEL,
|
||||
BX_MOUSE_TYPE_SERIAL_MSYS
|
||||
};
|
||||
|
||||
enum {
|
||||
BX_MOUSE_TOGGLE_CTRL_MB,
|
||||
BX_MOUSE_TOGGLE_CTRL_F10,
|
||||
BX_MOUSE_TOGGLE_CTRL_ALT,
|
||||
BX_MOUSE_TOGGLE_F12
|
||||
};
|
||||
|
||||
#define BX_FDD_NONE 0 // floppy not present
|
||||
#define BX_FDD_525DD 1 // 360K 5.25"
|
||||
#define BX_FDD_525HD 2 // 1.2M 5.25"
|
||||
#define BX_FDD_350DD 3 // 720K 3.5"
|
||||
#define BX_FDD_350HD 4 // 1.44M 3.5"
|
||||
#define BX_FDD_350ED 5 // 2.88M 3.5"
|
||||
|
||||
#define BX_FLOPPY_NONE 10 // media not present
|
||||
#define BX_FLOPPY_1_2 11 // 1.2M 5.25"
|
||||
#define BX_FLOPPY_1_44 12 // 1.44M 3.5"
|
||||
#define BX_FLOPPY_2_88 13 // 2.88M 3.5"
|
||||
#define BX_FLOPPY_720K 14 // 720K 3.5"
|
||||
#define BX_FLOPPY_360K 15 // 360K 5.25"
|
||||
#define BX_FLOPPY_160K 16 // 160K 5.25"
|
||||
#define BX_FLOPPY_180K 17 // 180K 5.25"
|
||||
#define BX_FLOPPY_320K 18 // 320K 5.25"
|
||||
#define BX_FLOPPY_LAST 18 // last legal value of floppy type
|
||||
|
||||
#define BX_FLOPPY_AUTO 19 // autodetect image size
|
||||
#define BX_FLOPPY_UNKNOWN 20 // image size doesn't match one of the types above
|
||||
|
||||
#define BX_ATA_DEVICE_DISK 0
|
||||
#define BX_ATA_DEVICE_CDROM 1
|
||||
#define BX_ATA_DEVICE_LAST 1
|
||||
|
||||
#define BX_ATA_BIOSDETECT_NONE 0
|
||||
#define BX_ATA_BIOSDETECT_AUTO 1
|
||||
#define BX_ATA_BIOSDETECT_CMOS 2
|
||||
|
||||
#define BX_ATA_TRANSLATION_NONE 0
|
||||
#define BX_ATA_TRANSLATION_LBA 1
|
||||
#define BX_ATA_TRANSLATION_LARGE 2
|
||||
#define BX_ATA_TRANSLATION_RECHS 3
|
||||
#define BX_ATA_TRANSLATION_AUTO 4
|
||||
#define BX_ATA_TRANSLATION_LAST 4
|
||||
|
||||
#define BX_HDIMAGE_MODE_FLAT 0
|
||||
#define BX_HDIMAGE_MODE_CONCAT 1
|
||||
#define BX_HDIMAGE_MODE_EXTDISKSIM 2
|
||||
#define BX_HDIMAGE_MODE_DLL_HD 3
|
||||
#define BX_HDIMAGE_MODE_SPARSE 4
|
||||
#define BX_HDIMAGE_MODE_VMWARE3 5
|
||||
#define BX_HDIMAGE_MODE_VMWARE4 6
|
||||
#define BX_HDIMAGE_MODE_UNDOABLE 7
|
||||
#define BX_HDIMAGE_MODE_GROWING 8
|
||||
#define BX_HDIMAGE_MODE_VOLATILE 9
|
||||
#define BX_HDIMAGE_MODE_Z_UNDOABLE 10
|
||||
#define BX_HDIMAGE_MODE_Z_VOLATILE 11
|
||||
#define BX_HDIMAGE_MODE_VVFAT 12
|
||||
#define BX_HDIMAGE_MODE_LAST 12
|
||||
|
||||
#define BX_CLOCK_SYNC_NONE 0
|
||||
#define BX_CLOCK_SYNC_REALTIME 1
|
||||
#define BX_CLOCK_SYNC_SLOWDOWN 2
|
||||
#define BX_CLOCK_SYNC_BOTH 3
|
||||
#define BX_CLOCK_SYNC_LAST 3
|
||||
|
||||
#define BX_CPUID_SUPPORT_NOSSE 0
|
||||
#define BX_CPUID_SUPPORT_SSE 1
|
||||
#define BX_CPUID_SUPPORT_SSE2 2
|
||||
#define BX_CPUID_SUPPORT_SSE3 3
|
||||
#define BX_CPUID_SUPPORT_SSSE3 4
|
||||
#define BX_CPUID_SUPPORT_SSE4_1 5
|
||||
#define BX_CPUID_SUPPORT_SSE4_2 6
|
||||
|
||||
#define BX_CLOCK_TIME0_LOCAL 1
|
||||
#define BX_CLOCK_TIME0_UTC 2
|
||||
|
||||
BOCHSAPI extern const char *floppy_devtype_names[];
|
||||
BOCHSAPI extern const char *floppy_type_names[];
|
||||
BOCHSAPI extern int floppy_type_n_sectors[];
|
||||
BOCHSAPI extern const char *bochs_bootdisk_names[];
|
||||
BOCHSAPI extern const char *hdimage_mode_names[];
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// base class simulator interface, contains just virtual functions.
|
||||
// I'm not longer sure that having a base class is going to be of any
|
||||
// use... -Bryce
|
||||
|
||||
#include <setjmp.h>
|
||||
|
||||
enum ci_command_t { CI_START, CI_RUNTIME_CONFIG, CI_SHUTDOWN };
|
||||
enum ci_return_t {
|
||||
CI_OK, // normal return value
|
||||
CI_ERR_NO_TEXT_CONSOLE // err: can't work because there's no text console
|
||||
};
|
||||
typedef int (*config_interface_callback_t)(void *userdata, ci_command_t command);
|
||||
typedef BxEvent* (*bxevent_handler)(void *theclass, BxEvent *event);
|
||||
typedef Bit32s (*user_option_parser_t)(const char *context, int num_params, char *params[]);
|
||||
typedef Bit32s (*user_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
|
||||
// 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
|
||||
// bx_simulator_interface_c::set_display_mode() method.
|
||||
enum disp_mode_t { DISP_MODE_CONFIG=100, DISP_MODE_SIM };
|
||||
|
||||
class BOCHSAPI bx_simulator_interface_c {
|
||||
public:
|
||||
bx_simulator_interface_c() {}
|
||||
virtual ~bx_simulator_interface_c() {}
|
||||
virtual void set_quit_context(jmp_buf *context) {}
|
||||
virtual int get_init_done() { return -1; }
|
||||
virtual int set_init_done(int n) {return -1;}
|
||||
virtual void reset_all_param() {}
|
||||
// new param methods
|
||||
virtual bx_param_c *get_param(const char *pname, bx_param_c *base=NULL) {return NULL;}
|
||||
virtual bx_param_num_c *get_param_num(const char *pname, bx_param_c *base=NULL) {return NULL;}
|
||||
virtual bx_param_string_c *get_param_string(const char *pname, bx_param_c *base=NULL) {return NULL;}
|
||||
virtual bx_param_bool_c *get_param_bool(const char *pname, bx_param_c *base=NULL) {return NULL;}
|
||||
virtual bx_param_enum_c *get_param_enum(const char *pname, bx_param_c *base=NULL) {return NULL;}
|
||||
virtual unsigned gen_param_id() {return 0;}
|
||||
virtual int get_n_log_modules() {return -1;}
|
||||
virtual char *get_prefix(int mod) {return 0;}
|
||||
virtual int get_log_action(int mod, int level) {return -1;}
|
||||
virtual void set_log_action(int mod, int level, int action) {}
|
||||
virtual int get_default_log_action(int level) {return -1;}
|
||||
virtual void set_default_log_action(int level, int action) {}
|
||||
virtual char *get_action_name(int action) {return 0;}
|
||||
virtual const char *get_log_level_name(int level) {return 0;}
|
||||
virtual int get_max_log_level() {return -1;}
|
||||
|
||||
// exiting is somewhat complicated! The preferred way to exit bochs is
|
||||
// to call BX_EXIT(exitcode). That is defined to call
|
||||
// SIM->quit_sim(exitcode). The quit_sim function first calls
|
||||
// the cleanup functions in bochs so that it can destroy windows
|
||||
// and free up memory, then sends a notify message to the CI
|
||||
// telling it that bochs has stopped.
|
||||
virtual void quit_sim(int code) {}
|
||||
|
||||
virtual int get_exit_code() { return 0; }
|
||||
|
||||
virtual int get_default_rc(char *path, int len) {return -1;}
|
||||
virtual int read_rc(const char *path) {return -1;}
|
||||
virtual int write_rc(const char *rc, int overwrite) {return -1;}
|
||||
virtual int get_log_file(char *path, int len) {return -1;}
|
||||
virtual int set_log_file(char *path) {return -1;}
|
||||
virtual int get_log_prefix(char *prefix, int len) {return -1;}
|
||||
virtual int set_log_prefix(char *prefix) {return -1;}
|
||||
virtual int get_debugger_log_file(char *path, int len) {return -1;}
|
||||
virtual int set_debugger_log_file(char *path) {return -1;}
|
||||
virtual int get_cdrom_options(int drive, bx_list_c **out, int *where = NULL) {return -1;}
|
||||
virtual int hdimage_get_mode(const char *mode) {return -1;}
|
||||
|
||||
// The CI calls set_notify_callback to register its event handler function.
|
||||
// This event handler function is called whenever the simulator needs to
|
||||
// send an event to the CI. For example, if the simulator hits a panic and
|
||||
// wants to ask the user how to proceed, it would call the CI event handler
|
||||
// to ask the CI to display a dialog.
|
||||
//
|
||||
// NOTE: At present, the standard VGAW buttons (floppy, snapshot, power,
|
||||
// etc.) are displayed and handled by gui.cc, not by the CI or siminterface.
|
||||
// gui.cc uses its own callback functions to implement the behavior of
|
||||
// the buttons. Some of these implementations call the siminterface.
|
||||
virtual void set_notify_callback(bxevent_handler func, void *arg) {}
|
||||
virtual void get_notify_callback(bxevent_handler *func, void **arg) {}
|
||||
|
||||
// send an event from the simulator to the CI.
|
||||
virtual BxEvent* sim_to_ci_event(BxEvent *event) {return NULL;}
|
||||
|
||||
// called from simulator when it hits serious errors, to ask if the user
|
||||
// wants to continue or not
|
||||
virtual int log_msg(const char *prefix, int level, const char *msg) {return -1;}
|
||||
|
||||
// tell the CI to ask the user for the value of a parameter.
|
||||
virtual int ask_param(bx_param_c *param) {return -1;}
|
||||
virtual int ask_param(const char *pname) {return -1;}
|
||||
|
||||
// ask the user for a pathname
|
||||
virtual int ask_filename(const char *filename, int maxlen, const char *prompt, const char *the_default, int flags) {return -1;}
|
||||
// yes/no dialog
|
||||
virtual int ask_yes_no(const char *title, const char *prompt, bx_bool the_default) {return -1;}
|
||||
// called at a regular interval, currently by the keyboard handler.
|
||||
virtual void periodic() {}
|
||||
virtual int create_disk_image(const char *filename, int sectors, bx_bool overwrite) {return -3;}
|
||||
// Tell the configuration interface (CI) that some parameter values have
|
||||
// changed. The CI will reread the parameters and change its display if it's
|
||||
// appropriate. Maybe later: mention which params have changed to save time.
|
||||
virtual void refresh_ci() {}
|
||||
// forces a vga update. This was added so that a debugger can force
|
||||
// a vga update when single stepping, without having to wait thousands
|
||||
// of cycles for the normal vga refresh triggered by iodev/keyboard.cc.
|
||||
virtual void refresh_vga() {}
|
||||
// forces a call to bx_gui.handle_events. This was added so that a debugger
|
||||
// can force the gui events to be handled, so that interactive things such
|
||||
// as a toolbar click will be processed.
|
||||
virtual void handle_events() {}
|
||||
// return first hard disk in ATA interface
|
||||
virtual bx_param_c *get_first_cdrom() {return NULL;}
|
||||
// return first cdrom in ATA interface
|
||||
virtual bx_param_c *get_first_hd() {return NULL;}
|
||||
#if BX_DEBUGGER
|
||||
// for debugger: same behavior as pressing control-C
|
||||
virtual void debug_break() {}
|
||||
virtual void debug_interpret_cmd(char *cmd) {}
|
||||
virtual char *debug_get_next_command() {return NULL;}
|
||||
virtual void debug_puts(const char *text) {}
|
||||
#endif
|
||||
virtual void register_configuration_interface(
|
||||
const char* name,
|
||||
config_interface_callback_t callback,
|
||||
void *userdata) {}
|
||||
virtual int configuration_interface(const char* name, ci_command_t command) {return -1; }
|
||||
virtual int begin_simulation(int argc, char *argv[]) {return -1;}
|
||||
typedef bx_bool (*is_sim_thread_func_t)();
|
||||
is_sim_thread_func_t is_sim_thread_func;
|
||||
virtual void set_sim_thread_func(is_sim_thread_func_t func) {
|
||||
is_sim_thread_func = func;
|
||||
}
|
||||
virtual bx_bool is_sim_thread() {return 1;}
|
||||
virtual void set_debug_gui(bx_bool val) {}
|
||||
virtual bx_bool has_debug_gui() const {return 0;}
|
||||
// provide interface to bx_gui->set_display_mode() method for config
|
||||
// interfaces to use.
|
||||
virtual void set_display_mode(disp_mode_t newmode) {}
|
||||
virtual bx_bool test_for_text_console() {return 1;}
|
||||
// user-defined option support
|
||||
virtual bx_bool register_user_option(const char *keyword, user_option_parser_t parser, user_option_save_t save_func) {return 0;}
|
||||
virtual bx_bool unregister_user_option(const char *keyword) {return 0;}
|
||||
virtual bx_bool is_user_option(const char *keyword) {return 0;}
|
||||
virtual Bit32s parse_user_option(const char *context, int num_params, char *params []) {return -1;}
|
||||
virtual Bit32s save_user_options(FILE *fp) {return -1;}
|
||||
// save/restore support
|
||||
virtual void init_save_restore() {}
|
||||
virtual bx_bool save_state(const char *checkpoint_path) {return 0;}
|
||||
virtual bx_bool restore_config() {return 0;}
|
||||
virtual bx_bool restore_logopts() {return 0;}
|
||||
virtual bx_bool restore_hardware() {return 0;}
|
||||
virtual bx_list_c *get_bochs_root() {return NULL;}
|
||||
virtual bx_bool restore_bochs_param(bx_list_c *root, const char *sr_path, const char *restore_name) { return 0; }
|
||||
};
|
||||
|
||||
BOCHSAPI extern bx_simulator_interface_c *SIM;
|
||||
|
||||
BOCHSAPI extern void bx_init_siminterface();
|
||||
BOCHSAPI extern int bx_init_main(int argc, char *argv[]);
|
||||
|
||||
#if defined(__WXMSW__) || defined(WIN32)
|
||||
// Just to provide HINSTANCE, etc. in files that have not included bochs.h.
|
||||
// I don't like this at all, but I don't see a way around it.
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
// define structure to hold data that is passed into our main function.
|
||||
typedef struct BOCHSAPI {
|
||||
// standard argc,argv
|
||||
int argc;
|
||||
char **argv;
|
||||
#ifdef WIN32
|
||||
char initial_dir[MAX_PATH];
|
||||
#endif
|
||||
#ifdef __WXMSW__
|
||||
// these are only used when compiling with wxWidgets. This gives us a
|
||||
// place to store the data that was passed to WinMain.
|
||||
HINSTANCE hInstance;
|
||||
HINSTANCE hPrevInstance;
|
||||
LPSTR m_lpCmdLine;
|
||||
int nCmdShow;
|
||||
#endif
|
||||
} bx_startup_flags_t;
|
||||
|
||||
BOCHSAPI extern bx_startup_flags_t bx_startup_flags;
|
||||
BOCHSAPI extern bx_bool bx_user_quit;
|
||||
BOCHSAPI extern Bit8u bx_cpu_count;
|
||||
|
||||
//DanceOS
|
||||
#endif /* BX_SIMINTERFACE_H */
|
||||
593
simulators/bochs/gui/svga.cc
Normal file
593
simulators/bochs/gui/svga.cc
Normal file
@ -0,0 +1,593 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 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 tilewidth, tileheight;
|
||||
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);
|
||||
|
||||
unsigned char reverse_byteorder(unsigned char b)
|
||||
{
|
||||
unsigned char ret = 0;
|
||||
|
||||
for (unsigned i=0;i<8;i++){
|
||||
ret |= (b & 0x01) << (7 - i);
|
||||
b >>= 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void create_vga_font()
|
||||
{
|
||||
memcpy(vgafont, bx_vgafont, sizeof(bx_vgafont));
|
||||
|
||||
for (unsigned i=0;i< sizeof(bx_vgafont);i++) {
|
||||
vgafont[i] = reverse_byteorder(vgafont[i]);
|
||||
}
|
||||
}
|
||||
|
||||
bx_svga_gui_c::bx_svga_gui_c()
|
||||
{
|
||||
put("SVGA");
|
||||
}
|
||||
|
||||
void bx_svga_gui_c::specific_init(
|
||||
int argc,
|
||||
char **argv,
|
||||
unsigned x_tilesize,
|
||||
unsigned y_tilesize,
|
||||
unsigned header_bar_y)
|
||||
{
|
||||
tilewidth = x_tilesize;
|
||||
tileheight = y_tilesize;
|
||||
|
||||
if(vga_init() != 0)
|
||||
{
|
||||
LOG_THIS setonoff(LOGLEV_PANIC, ACT_FATAL);
|
||||
BX_PANIC (("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] = DEV_vga_get_actl_pal_idx(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 + tileheight) > res_y) {
|
||||
gl_putbox(x, y, tilewidth, (res_y - y), snapshot);
|
||||
} else {
|
||||
gl_putbox(x, y, tilewidth, tileheight, 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), buttons);
|
||||
}
|
||||
}
|
||||
|
||||
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(
|
||||
unsigned index,
|
||||
unsigned red,
|
||||
unsigned green,
|
||||
unsigned blue)
|
||||
{
|
||||
if(index > 255) return 0;
|
||||
|
||||
// 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));
|
||||
}
|
||||
if(fheight > 0)
|
||||
{
|
||||
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)
|
||||
{
|
||||
LOG_THIS setonoff(LOGLEV_PANIC, ACT_FATAL);
|
||||
BX_PANIC (("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 headerbar_click(int x)
|
||||
{
|
||||
}
|
||||
|
||||
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 */
|
||||
817
simulators/bochs/gui/term.cc
Normal file
817
simulators/bochs/gui/term.cc
Normal file
@ -0,0 +1,817 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2000-2009 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 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_TERM
|
||||
|
||||
extern "C" {
|
||||
#include <curses.h>
|
||||
#include <signal.h>
|
||||
};
|
||||
|
||||
class bx_term_gui_c : public bx_gui_c {
|
||||
public:
|
||||
bx_term_gui_c(void) {}
|
||||
DECLARE_GUI_VIRTUAL_METHODS()
|
||||
#if BX_USE_IDLE_HACK
|
||||
virtual void sim_is_idle(void);
|
||||
#endif
|
||||
|
||||
virtual Bit32u get_sighandler_mask();
|
||||
|
||||
// called when registered signal arrives
|
||||
virtual void sighandler(int sig);
|
||||
};
|
||||
|
||||
// declare one instance of the gui object and call macro to insert the
|
||||
// plugin code
|
||||
static bx_term_gui_c *theGui = NULL;
|
||||
IMPLEMENT_GUI_PLUGIN_CODE(term)
|
||||
|
||||
#define LOG_THIS theGui->
|
||||
|
||||
bx_bool initialized = 0;
|
||||
static unsigned int text_rows = 25, text_cols = 80;
|
||||
|
||||
static short curses_color[8] = {
|
||||
/* 0 */ COLOR_BLACK,
|
||||
/* 1 */ COLOR_BLUE,
|
||||
/* 2 */ COLOR_GREEN,
|
||||
/* 3 */ COLOR_CYAN,
|
||||
/* 4 */ COLOR_RED,
|
||||
/* 5 */ COLOR_MAGENTA,
|
||||
/* 6 */ COLOR_YELLOW,
|
||||
/* 7 */ COLOR_WHITE
|
||||
};
|
||||
|
||||
static chtype vga_to_term[128] = {
|
||||
0xc7, 0xfc, 0xe9, 0xe2, 0xe4, 0xe0, 0xe5, 0xe7,
|
||||
0xea, 0xeb, 0xe8, 0xef, 0xee, 0xec, 0xc4, 0xc5,
|
||||
0xc9, 0xe6, 0xc6, 0xf4, 0xf6, 0xf2, 0xfb, 0xf9,
|
||||
0xff, 0xd6, 0xdc, 0xe7, 0xa3, 0xa5, ' ', ' ',
|
||||
0xe1, 0xed, 0xf3, 0xfa, 0xf1, 0xd1, 0xaa, 0xba,
|
||||
0xbf, ' ', 0xac, ' ', ' ', 0xa1, 0xab, 0xbb,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, ' ', ' ', ' ', ' ',
|
||||
' ', ' ', ' ', ' ', ' ', ' ', 0xb5, ' ',
|
||||
' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ',
|
||||
' ', 0xb1, ' ', ' ', ' ', ' ', 0xf7, ' ',
|
||||
0xb0, ' ', ' ', ' ', ' ', 0xb2, ' ', ' '
|
||||
};
|
||||
|
||||
static void do_scan(int key_event, int shift, int ctrl, int alt)
|
||||
{
|
||||
/* At some point, cache alt/ctrl/shift so only when the state
|
||||
changes do we simulate a press or release, to cut down on
|
||||
keyboard input to the simulated machine */
|
||||
|
||||
BX_DEBUG(("key_event %d/0x%x %s%s%s", key_event, key_event,
|
||||
shift ? "(shift)" : "",
|
||||
ctrl ? "(ctrl)" : "",
|
||||
alt ? "(alt)" : ""));
|
||||
if(shift)
|
||||
DEV_kbd_gen_scancode(BX_KEY_SHIFT_L);
|
||||
if(ctrl)
|
||||
DEV_kbd_gen_scancode(BX_KEY_CTRL_L);
|
||||
if(alt)
|
||||
DEV_kbd_gen_scancode(BX_KEY_ALT_L);
|
||||
DEV_kbd_gen_scancode(key_event);
|
||||
key_event |= BX_KEY_RELEASED;
|
||||
|
||||
DEV_kbd_gen_scancode(key_event);
|
||||
if(alt)
|
||||
DEV_kbd_gen_scancode(BX_KEY_ALT_L|BX_KEY_RELEASED);
|
||||
if(ctrl)
|
||||
DEV_kbd_gen_scancode(BX_KEY_CTRL_L|BX_KEY_RELEASED);
|
||||
if(shift)
|
||||
DEV_kbd_gen_scancode(BX_KEY_SHIFT_L|BX_KEY_RELEASED);
|
||||
}
|
||||
|
||||
Bit32u bx_term_gui_c::get_sighandler_mask()
|
||||
{
|
||||
return 0
|
||||
#ifdef SIGHUP
|
||||
| (1<<SIGHUP)
|
||||
#endif
|
||||
| (1<<SIGINT)
|
||||
#ifdef SIGQUIT
|
||||
| (1<<SIGQUIT)
|
||||
#endif
|
||||
#ifdef SIGSTOP
|
||||
| (1<<SIGSTOP)
|
||||
#endif
|
||||
#ifdef SIGTSTP
|
||||
| (1<<SIGTSTP)
|
||||
#endif
|
||||
| (1<<SIGTERM);
|
||||
}
|
||||
|
||||
void bx_term_gui_c::sighandler(int signo)
|
||||
{
|
||||
switch(signo) {
|
||||
case SIGINT:
|
||||
do_scan(BX_KEY_C,0,1,0);
|
||||
break;
|
||||
#ifdef SIGSTOP
|
||||
case SIGSTOP:
|
||||
do_scan(BX_KEY_S,0,1,0);
|
||||
break;
|
||||
#endif
|
||||
#ifdef SIGTSTP
|
||||
case SIGTSTP:
|
||||
do_scan(BX_KEY_Z,0,1,0);
|
||||
break;
|
||||
#endif
|
||||
#ifdef SIGHUP
|
||||
case SIGHUP:
|
||||
BX_PANIC(("Received SIGHUP: quit simulation"));
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
BX_INFO(("sig %d caught",signo));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// ::SPECIFIC_INIT()
|
||||
//
|
||||
// Called from gui.cc, once upon program startup, to allow for the
|
||||
// specific GUI code (X11, BeOS, ...) to be initialized.
|
||||
//
|
||||
// argc, argv: not used right now, but the intention is to pass native GUI
|
||||
// specific options from the command line. (X11 options, BeOS options,...)
|
||||
//
|
||||
// tilewidth, tileheight: for optimization, graphics_tile_update() passes
|
||||
// only updated regions of the screen to the gui code to be redrawn.
|
||||
// These define the dimensions of a region (tile).
|
||||
// headerbar_y: A headerbar (toolbar) is display on the top of the
|
||||
// VGA window, showing floppy status, and other information. It
|
||||
// always assumes the width of the current VGA mode width, but
|
||||
// it's height is defined by this parameter.
|
||||
|
||||
void bx_term_gui_c::specific_init(int argc, char **argv, unsigned tilewidth, unsigned tileheight, unsigned headerbar_y)
|
||||
{
|
||||
put("TGUI");
|
||||
|
||||
// the ask menu causes trouble
|
||||
io->set_log_action(LOGLEV_PANIC, ACT_FATAL);
|
||||
// logfile should be different from stderr, otherwise terminal mode
|
||||
// really ends up having fun
|
||||
if (!strcmp(SIM->get_param_string(BXPN_LOG_FILENAME)->getptr(), "-"))
|
||||
BX_PANIC(("cannot log to stderr in term mode"));
|
||||
|
||||
initscr();
|
||||
start_color();
|
||||
cbreak();
|
||||
curs_set(2);
|
||||
keypad(stdscr,TRUE);
|
||||
nodelay(stdscr, TRUE);
|
||||
noecho();
|
||||
|
||||
#if BX_HAVE_COLOR_SET
|
||||
if (has_colors()) {
|
||||
for (int i=0; i<8; i++) {
|
||||
for (int j=0; j<8; j++) {
|
||||
if ((i!=0)||(j!=0)) init_pair(i * 8 + j, j, i);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (SIM->get_param_bool(BXPN_PRIVATE_COLORMAP)->get())
|
||||
BX_ERROR(("WARNING: private_colormap option ignored."));
|
||||
|
||||
initialized = 1;
|
||||
}
|
||||
|
||||
void do_char(int character, int alt)
|
||||
{
|
||||
switch (character) {
|
||||
// control keys
|
||||
case 0x9: do_scan(BX_KEY_TAB,0,0,alt); break;
|
||||
case 0xa: do_scan(BX_KEY_KP_ENTER,0,0,alt); break;
|
||||
case 0xd: do_scan(BX_KEY_KP_DELETE,0,0,alt); break;
|
||||
case 0x1: do_scan(BX_KEY_A,0,1,alt); break;
|
||||
case 0x2: do_scan(BX_KEY_B,0,1,alt); break;
|
||||
case 0x3: do_scan(BX_KEY_C,0,1,alt); break;
|
||||
case 0x4: do_scan(BX_KEY_D,0,1,alt); break;
|
||||
case 0x5: do_scan(BX_KEY_E,0,1,alt); break;
|
||||
case 0x6: do_scan(BX_KEY_F,0,1,alt); break;
|
||||
case 0x7: do_scan(BX_KEY_G,0,1,alt); break;
|
||||
case 0x8: do_scan(BX_KEY_H,0,1,alt); break;
|
||||
case 0xb: do_scan(BX_KEY_K,0,1,alt); break;
|
||||
case 0xc: do_scan(BX_KEY_L,0,1,alt); break;
|
||||
case 0xe: do_scan(BX_KEY_N,0,1,alt); break;
|
||||
case 0xf: do_scan(BX_KEY_O,0,1,alt); break;
|
||||
case 0x10: do_scan(BX_KEY_P,0,1,alt); break;
|
||||
case 0x11: do_scan(BX_KEY_Q,0,1,alt); break;
|
||||
case 0x12: do_scan(BX_KEY_R,0,1,alt); break;
|
||||
case 0x13: do_scan(BX_KEY_S,0,1,alt); break;
|
||||
case 0x14: do_scan(BX_KEY_T,0,1,alt); break;
|
||||
case 0x15: do_scan(BX_KEY_U,0,1,alt); break;
|
||||
case 0x16: do_scan(BX_KEY_V,0,1,alt); break;
|
||||
case 0x17: do_scan(BX_KEY_W,0,1,alt); break;
|
||||
case 0x18: do_scan(BX_KEY_X,0,1,alt); break;
|
||||
case 0x19: do_scan(BX_KEY_Y,0,1,alt); break;
|
||||
case 0x1a: do_scan(BX_KEY_Z,0,1,alt); break;
|
||||
case 0x20: do_scan(BX_KEY_SPACE,0,0,alt); break;
|
||||
case 0x107: do_scan(BX_KEY_BACKSPACE,0,0,alt); break;
|
||||
case 0x102: do_scan(BX_KEY_DOWN,0,0,alt); break;
|
||||
case 0x103: do_scan(BX_KEY_UP,0,0,alt); break;
|
||||
case 0x104: do_scan(BX_KEY_LEFT,0,0,alt); break;
|
||||
case 0x105: do_scan(BX_KEY_RIGHT,0,0,alt); break;
|
||||
case 0x152: do_scan(BX_KEY_PAGE_DOWN,0,0,alt); break;
|
||||
case 0x153: do_scan(BX_KEY_PAGE_UP,0,0,alt); break;
|
||||
case 0x106: do_scan(BX_KEY_HOME,0,0,alt); break;
|
||||
case 0x168: do_scan(BX_KEY_END,0,0,alt); break;
|
||||
case 0x14b: do_scan(BX_KEY_INSERT,0,0,alt); break;
|
||||
case 0x7f: do_scan(BX_KEY_DELETE,0,0,alt); break;
|
||||
case 0x1b: do_scan(BX_KEY_ESC,0,0,alt); break;
|
||||
case '!': do_scan(BX_KEY_1,1,0,alt); break;
|
||||
case '\'': do_scan(BX_KEY_SINGLE_QUOTE,0,0,alt); break;
|
||||
case '#': do_scan(BX_KEY_3,1,0,alt); break;
|
||||
case '$': do_scan(BX_KEY_4,1,0,alt); break;
|
||||
case '%': do_scan(BX_KEY_5,1,0,alt); break;
|
||||
case '^': do_scan(BX_KEY_6,1,0,alt); break;
|
||||
case '&': do_scan(BX_KEY_7,1,0,alt); break;
|
||||
case '"': do_scan(BX_KEY_SINGLE_QUOTE,1,0,alt); break;
|
||||
|
||||
// ()*+,-./
|
||||
case '(': do_scan(BX_KEY_9,1,0,alt); break;
|
||||
case ')': do_scan(BX_KEY_0,1,0,alt); break;
|
||||
case '*': do_scan(BX_KEY_8,1,0,alt); break;
|
||||
case '+': do_scan(BX_KEY_EQUALS,1,0,alt); break;
|
||||
case ',': do_scan(BX_KEY_COMMA,0,0,alt); break;
|
||||
case '-': do_scan(BX_KEY_MINUS,0,0,alt); break;
|
||||
case '.': do_scan(BX_KEY_PERIOD,0,0,alt); break;
|
||||
case '/': do_scan(BX_KEY_SLASH,0,0,alt); break;
|
||||
|
||||
// 01234567
|
||||
case '0': do_scan(BX_KEY_0,0,0,alt); break;
|
||||
case '1': do_scan(BX_KEY_1,0,0,alt); break;
|
||||
case '2': do_scan(BX_KEY_2,0,0,alt); break;
|
||||
case '3': do_scan(BX_KEY_3,0,0,alt); break;
|
||||
case '4': do_scan(BX_KEY_4,0,0,alt); break;
|
||||
case '5': do_scan(BX_KEY_5,0,0,alt); break;
|
||||
case '6': do_scan(BX_KEY_6,0,0,alt); break;
|
||||
case '7': do_scan(BX_KEY_7,0,0,alt); break;
|
||||
|
||||
// 89:;<=>?
|
||||
case '8': do_scan(BX_KEY_8,0,0,alt); break;
|
||||
case '9': do_scan(BX_KEY_9,0,0,alt); break;
|
||||
case ':': do_scan(BX_KEY_SEMICOLON,1,0,alt); break;
|
||||
case ';': do_scan(BX_KEY_SEMICOLON,0,0,alt); break;
|
||||
case '<': do_scan(BX_KEY_COMMA,1,0,alt); break;
|
||||
case '=': do_scan(BX_KEY_EQUALS,0,0,alt); break;
|
||||
case '>': do_scan(BX_KEY_PERIOD,1,0,alt); break;
|
||||
case '?': do_scan(BX_KEY_SLASH,1,0,alt); break;
|
||||
|
||||
// @ABCDEFG
|
||||
case '@': do_scan(BX_KEY_2,1,0,alt); break;
|
||||
case 'A': do_scan(BX_KEY_A,1,0,alt); break;
|
||||
case 'B': do_scan(BX_KEY_B,1,0,alt); break;
|
||||
case 'C': do_scan(BX_KEY_C,1,0,alt); break;
|
||||
case 'D': do_scan(BX_KEY_D,1,0,alt); break;
|
||||
case 'E': do_scan(BX_KEY_E,1,0,alt); break;
|
||||
case 'F': do_scan(BX_KEY_F,1,0,alt); break;
|
||||
case 'G': do_scan(BX_KEY_G,1,0,alt); break;
|
||||
|
||||
// HIJKLMNO
|
||||
case 'H': do_scan(BX_KEY_H,1,0,alt); break;
|
||||
case 'I': do_scan(BX_KEY_I,1,0,alt); break;
|
||||
case 'J': do_scan(BX_KEY_J,1,0,alt); break;
|
||||
case 'K': do_scan(BX_KEY_K,1,0,alt); break;
|
||||
case 'L': do_scan(BX_KEY_L,1,0,alt); break;
|
||||
case 'M': do_scan(BX_KEY_M,1,0,alt); break;
|
||||
case 'N': do_scan(BX_KEY_N,1,0,alt); break;
|
||||
case 'O': do_scan(BX_KEY_O,1,0,alt); break;
|
||||
|
||||
// PQRSTUVW
|
||||
case 'P': do_scan(BX_KEY_P,1,0,alt); break;
|
||||
case 'Q': do_scan(BX_KEY_Q,1,0,alt); break;
|
||||
case 'R': do_scan(BX_KEY_R,1,0,alt); break;
|
||||
case 'S': do_scan(BX_KEY_S,1,0,alt); break;
|
||||
case 'T': do_scan(BX_KEY_T,1,0,alt); break;
|
||||
case 'U': do_scan(BX_KEY_U,1,0,alt); break;
|
||||
case 'V': do_scan(BX_KEY_V,1,0,alt); break;
|
||||
case 'W': do_scan(BX_KEY_W,1,0,alt); break;
|
||||
|
||||
// XYZ[\]^_
|
||||
case 'X': do_scan(BX_KEY_X,1,0,alt); break;
|
||||
case 'Y': do_scan(BX_KEY_Y,1,0,alt); break;
|
||||
case 'Z': do_scan(BX_KEY_Z,1,0,alt); break;
|
||||
case '{': do_scan(BX_KEY_LEFT_BRACKET,1,0,alt); break;
|
||||
case '|': do_scan(BX_KEY_BACKSLASH,1,0,alt); break;
|
||||
case '}': do_scan(BX_KEY_RIGHT_BRACKET,1,0,alt); break;
|
||||
case '_': do_scan(BX_KEY_MINUS,1,0,alt); break;
|
||||
|
||||
// `abcdefg
|
||||
case '`': do_scan(BX_KEY_GRAVE,0,0,alt); break;
|
||||
case 'a': do_scan(BX_KEY_A,0,0,alt); break;
|
||||
case 'b': do_scan(BX_KEY_B,0,0,alt); break;
|
||||
case 'c': do_scan(BX_KEY_C,0,0,alt); break;
|
||||
case 'd': do_scan(BX_KEY_D,0,0,alt); break;
|
||||
case 'e': do_scan(BX_KEY_E,0,0,alt); break;
|
||||
case 'f': do_scan(BX_KEY_F,0,0,alt); break;
|
||||
case 'g': do_scan(BX_KEY_G,0,0,alt); break;
|
||||
|
||||
// hijklmno
|
||||
case 'h': do_scan(BX_KEY_H,0,0,alt); break;
|
||||
case 'i': do_scan(BX_KEY_I,0,0,alt); break;
|
||||
case 'j': do_scan(BX_KEY_J,0,0,alt); break;
|
||||
case 'k': do_scan(BX_KEY_K,0,0,alt); break;
|
||||
case 'l': do_scan(BX_KEY_L,0,0,alt); break;
|
||||
case 'm': do_scan(BX_KEY_M,0,0,alt); break;
|
||||
case 'n': do_scan(BX_KEY_N,0,0,alt); break;
|
||||
case 'o': do_scan(BX_KEY_O,0,0,alt); break;
|
||||
|
||||
// pqrstuvw
|
||||
case 'p': do_scan(BX_KEY_P,0,0,alt); break;
|
||||
case 'q': do_scan(BX_KEY_Q,0,0,alt); break;
|
||||
case 'r': do_scan(BX_KEY_R,0,0,alt); break;
|
||||
case 's': do_scan(BX_KEY_S,0,0,alt); break;
|
||||
case 't': do_scan(BX_KEY_T,0,0,alt); break;
|
||||
case 'u': do_scan(BX_KEY_U,0,0,alt); break;
|
||||
case 'v': do_scan(BX_KEY_V,0,0,alt); break;
|
||||
case 'w': do_scan(BX_KEY_W,0,0,alt); break;
|
||||
|
||||
// xyz{|}~
|
||||
case 'x': do_scan(BX_KEY_X,0,0,alt); break;
|
||||
case 'y': do_scan(BX_KEY_Y,0,0,alt); break;
|
||||
case 'z': do_scan(BX_KEY_Z,0,0,alt); break;
|
||||
case '[': do_scan(BX_KEY_LEFT_BRACKET,0,0,alt); break;
|
||||
case '\\': do_scan(BX_KEY_BACKSLASH,0,0,alt); break;
|
||||
case ']': do_scan(BX_KEY_RIGHT_BRACKET,0,0,alt); break;
|
||||
case '~': do_scan(BX_KEY_GRAVE,1,0,alt); break;
|
||||
|
||||
// function keys
|
||||
case KEY_F(1): do_scan(BX_KEY_F1,0,0,alt); break;
|
||||
case KEY_F(2): do_scan(BX_KEY_F2,0,0,alt); break;
|
||||
case KEY_F(3): do_scan(BX_KEY_F3,0,0,alt); break;
|
||||
case KEY_F(4): do_scan(BX_KEY_F4,0,0,alt); break;
|
||||
case KEY_F(5): do_scan(BX_KEY_F5,0,0,alt); break;
|
||||
case KEY_F(6): do_scan(BX_KEY_F6,0,0,alt); break;
|
||||
case KEY_F(7): do_scan(BX_KEY_F7,0,0,alt); break;
|
||||
case KEY_F(8): do_scan(BX_KEY_F8,0,0,alt); break;
|
||||
case KEY_F(9): do_scan(BX_KEY_F9,0,0,alt); break;
|
||||
case KEY_F(10): do_scan(BX_KEY_F10,0,0,alt); break;
|
||||
case KEY_F(11): do_scan(BX_KEY_F11,0,0,alt); break;
|
||||
case KEY_F(12): do_scan(BX_KEY_F12,0,0,alt); break;
|
||||
|
||||
// shifted function keys
|
||||
case KEY_F(13): do_scan(BX_KEY_F1,1,0,alt); break;
|
||||
case KEY_F(14): do_scan(BX_KEY_F2,1,0,alt); break;
|
||||
case KEY_F(15): do_scan(BX_KEY_F3,1,0,alt); break;
|
||||
case KEY_F(16): do_scan(BX_KEY_F4,1,0,alt); break;
|
||||
case KEY_F(17): do_scan(BX_KEY_F5,1,0,alt); break;
|
||||
case KEY_F(18): do_scan(BX_KEY_F6,1,0,alt); break;
|
||||
case KEY_F(19): do_scan(BX_KEY_F7,1,0,alt); break;
|
||||
case KEY_F(20): do_scan(BX_KEY_F8,1,0,alt); break;
|
||||
|
||||
default:
|
||||
if(character > 0x79) {
|
||||
do_char(character - 0x80,1);
|
||||
break;
|
||||
}
|
||||
|
||||
BX_INFO(("character unhandled: 0x%x",character));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// ::HANDLE_EVENTS()
|
||||
//
|
||||
// Called periodically (vga_update_interval in .bochsrc) so the
|
||||
// the gui code can poll for keyboard, mouse, and other
|
||||
// relevant events.
|
||||
|
||||
void bx_term_gui_c::handle_events(void)
|
||||
{
|
||||
int character;
|
||||
while((character = getch()) != ERR) {
|
||||
BX_DEBUG(("scancode(0x%x)",character));
|
||||
do_char(character,0);
|
||||
}
|
||||
}
|
||||
|
||||
// ::FLUSH()
|
||||
//
|
||||
// Called periodically, requesting that the gui code flush all pending
|
||||
// screen update requests.
|
||||
|
||||
void bx_term_gui_c::flush(void)
|
||||
{
|
||||
if (initialized) refresh();
|
||||
}
|
||||
|
||||
// ::CLEAR_SCREEN()
|
||||
//
|
||||
// Called to request that the VGA region is cleared. Don't
|
||||
// clear the area that defines the headerbar.
|
||||
|
||||
void bx_term_gui_c::clear_screen(void)
|
||||
{
|
||||
clear();
|
||||
#if BX_HAVE_COLOR_SET
|
||||
color_set(7, NULL);
|
||||
#endif
|
||||
#if BX_HAVE_MVHLINE
|
||||
if (LINES > (int)text_rows) {
|
||||
mvhline(text_rows, 0, ACS_HLINE, text_cols);
|
||||
}
|
||||
#endif
|
||||
#if BX_HAVE_MVVLINE
|
||||
if (COLS > (int)text_cols) {
|
||||
mvvline(0, text_cols, ACS_VLINE, text_rows);
|
||||
}
|
||||
#endif
|
||||
if ((LINES > (int)text_rows) && (COLS > (int)text_cols)) {
|
||||
mvaddch(text_rows, text_cols, ACS_LRCORNER);
|
||||
}
|
||||
}
|
||||
|
||||
int get_color_pair(Bit8u vga_attr)
|
||||
{
|
||||
int term_attr = curses_color[vga_attr & 0x07];
|
||||
term_attr |= (curses_color[(vga_attr & 0x70) >> 4] << 3);
|
||||
return term_attr;
|
||||
}
|
||||
|
||||
chtype get_term_char(Bit8u vga_char[])
|
||||
{
|
||||
int term_char;
|
||||
|
||||
if ((vga_char[1] & 0x0f) == ((vga_char[1] >> 4) & 0x0f)) {
|
||||
return ' ';
|
||||
}
|
||||
switch (vga_char[0]) {
|
||||
case 0x04: term_char = ACS_DIAMOND; break;
|
||||
case 0x18: term_char = ACS_UARROW; break;
|
||||
case 0x19: term_char = ACS_DARROW; break;
|
||||
case 0x1a: term_char = ACS_RARROW; break;
|
||||
case 0x1b: term_char = ACS_LARROW; break;
|
||||
case 0xc4:
|
||||
case 0xcd: term_char = ACS_HLINE; break;
|
||||
case 0xb3:
|
||||
case 0xba: term_char = ACS_VLINE; break;
|
||||
case 0xc9:
|
||||
case 0xd5:
|
||||
case 0xd6:
|
||||
case 0xda: term_char = ACS_ULCORNER; break;
|
||||
case 0xb7:
|
||||
case 0xb8:
|
||||
case 0xbb:
|
||||
case 0xbf: term_char = ACS_URCORNER; break;
|
||||
case 0xc0:
|
||||
case 0xc8:
|
||||
case 0xd3:
|
||||
case 0xd4: term_char = ACS_LLCORNER; break;
|
||||
case 0xbc:
|
||||
case 0xbd:
|
||||
case 0xbe:
|
||||
case 0xd9: term_char = ACS_LRCORNER; break;
|
||||
case 0xc3:
|
||||
case 0xc6:
|
||||
case 0xc7:
|
||||
case 0xcc: term_char = ACS_LTEE; break;
|
||||
case 0xb4:
|
||||
case 0xb5:
|
||||
case 0xb6:
|
||||
case 0xb9: term_char = ACS_RTEE; break;
|
||||
case 0xc2:
|
||||
case 0xcb:
|
||||
case 0xd1:
|
||||
case 0xd2: term_char = ACS_TTEE; break;
|
||||
case 0xc1:
|
||||
case 0xca:
|
||||
case 0xcf:
|
||||
case 0xd0: term_char = ACS_BTEE; break;
|
||||
case 0xc5:
|
||||
case 0xce:
|
||||
case 0xd7:
|
||||
case 0xd8: term_char = ACS_PLUS; break;
|
||||
case 0xb0:
|
||||
case 0xb1: term_char = ACS_CKBOARD; break;
|
||||
case 0xb2: term_char = ACS_BOARD; break;
|
||||
case 0xdb: term_char = ACS_BLOCK; break;
|
||||
default:
|
||||
if (vga_char[0] > 0x7f) {
|
||||
term_char = vga_to_term[vga_char[0]-0x80];
|
||||
} else if (vga_char[0] > 0x1f) {
|
||||
term_char = vga_char[0];
|
||||
} else {
|
||||
term_char = ' ';
|
||||
}
|
||||
}
|
||||
|
||||
return term_char;
|
||||
}
|
||||
|
||||
// ::TEXT_UPDATE()
|
||||
//
|
||||
// Called in a VGA text mode, to update the screen with
|
||||
// new content.
|
||||
//
|
||||
// old_text: array of character/attributes making up the contents
|
||||
// of the screen from the last call. See below
|
||||
// new_text: array of character/attributes making up the current
|
||||
// contents, which should now be displayed. See below
|
||||
//
|
||||
// format of old_text & new_text: each is tm_info.line_offset*text_rows
|
||||
// bytes long. Each character consists of 2 bytes. The first by is
|
||||
// the character value, the second is the attribute byte.
|
||||
//
|
||||
// cursor_x: new x location of cursor
|
||||
// cursor_y: new y location of cursor
|
||||
// tm_info: this structure contains information for additional
|
||||
// features in text mode (cursor shape, line offset,...)
|
||||
|
||||
void bx_term_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
|
||||
unsigned long cursor_x, unsigned long cursor_y,
|
||||
bx_vga_tminfo_t tm_info)
|
||||
{
|
||||
unsigned char *old_line, *new_line, *new_start;
|
||||
unsigned char cAttr;
|
||||
unsigned int hchars, rows, x, y;
|
||||
chtype ch;
|
||||
bx_bool force_update = 0;
|
||||
|
||||
if(charmap_updated) {
|
||||
force_update = 1;
|
||||
charmap_updated = 0;
|
||||
}
|
||||
|
||||
new_start = new_text;
|
||||
rows = text_rows;
|
||||
y = 0;
|
||||
do {
|
||||
hchars = text_cols;
|
||||
new_line = new_text;
|
||||
old_line = old_text;
|
||||
x = 0;
|
||||
do {
|
||||
if (force_update || (old_text[0] != new_text[0])
|
||||
|| (old_text[1] != new_text[1])) {
|
||||
#if BX_HAVE_COLOR_SET
|
||||
if (has_colors()) {
|
||||
color_set(get_color_pair(new_text[1]), NULL);
|
||||
}
|
||||
#endif
|
||||
ch = get_term_char(&new_text[0]);
|
||||
if ((new_text[1] & 0x08) > 0) ch |= A_BOLD;
|
||||
if ((new_text[1] & 0x80) > 0) ch |= A_BLINK;
|
||||
mvaddch(y, x, ch);
|
||||
}
|
||||
x++;
|
||||
new_text+=2;
|
||||
old_text+=2;
|
||||
} while (--hchars);
|
||||
y++;
|
||||
new_text = new_line + tm_info.line_offset;
|
||||
old_text = old_line + tm_info.line_offset;
|
||||
} while (--rows);
|
||||
|
||||
if ((cursor_x<text_cols) && (cursor_y<text_rows)
|
||||
&& (tm_info.cs_start <= tm_info.cs_end)) {
|
||||
if(cursor_x>0)
|
||||
cursor_x--;
|
||||
else {
|
||||
cursor_x=COLS-1;
|
||||
cursor_y--;
|
||||
}
|
||||
cAttr = new_start[cursor_y*tm_info.line_offset+cursor_x*2+1];
|
||||
#if BX_HAVE_COLOR_SET
|
||||
if (has_colors()) {
|
||||
color_set(get_color_pair(cAttr), NULL);
|
||||
}
|
||||
#endif
|
||||
ch = get_term_char(&new_start[cursor_y*tm_info.line_offset+cursor_x*2]);
|
||||
if ((cAttr & 0x08) > 0) ch |= A_BOLD;
|
||||
if ((cAttr & 0x80) > 0) ch |= A_REVERSE;
|
||||
mvaddch(cursor_y, cursor_x, ch);
|
||||
curs_set(2);
|
||||
} else {
|
||||
curs_set(0);
|
||||
}
|
||||
}
|
||||
|
||||
int bx_term_gui_c::get_clipboard_text(Bit8u **bytes, Bit32s *nbytes)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bx_term_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// ::PALETTE_CHANGE()
|
||||
//
|
||||
// Allocate a color in the native GUI, for this color, and put
|
||||
// it in the colormap location 'index'.
|
||||
// returns: 0=no screen update needed (color map change has direct effect)
|
||||
// 1=screen updated needed (redraw using current colormap)
|
||||
|
||||
bx_bool bx_term_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
|
||||
{
|
||||
BX_DEBUG(("color pallete request (%d,%d,%d,%d) ignored", index,red,green,blue));
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ::GRAPHICS_TILE_UPDATE()
|
||||
//
|
||||
// Called to request that a tile of graphics be drawn to the
|
||||
// screen, since info in this region has changed.
|
||||
//
|
||||
// tile: array of 8bit values representing a block of pixels with
|
||||
// dimension equal to the 'tilewidth' & 'tileheight' parameters to
|
||||
// ::specific_init(). Each value specifies an index into the
|
||||
// array of colors you allocated for ::palette_change()
|
||||
// x0: x origin of tile
|
||||
// y0: y origin of tile
|
||||
//
|
||||
// note: origin of tile and of window based on (0,0) being in the upper
|
||||
// left of the window.
|
||||
|
||||
void bx_term_gui_c::graphics_tile_update(Bit8u *tile, unsigned x0, unsigned y0)
|
||||
{
|
||||
}
|
||||
|
||||
// ::DIMENSION_UPDATE()
|
||||
//
|
||||
// Called when the VGA mode changes it's X,Y dimensions.
|
||||
// Resize the window to this size, but you need to add on
|
||||
// the height of the headerbar to the Y value.
|
||||
//
|
||||
// x: new VGA x size
|
||||
// y: new VGA y size (add headerbar_y parameter from ::specific_init().
|
||||
// fheight: new VGA character height in text mode
|
||||
// fwidth : new VGA character width in text mode
|
||||
// bpp : bits per pixel in graphics mode
|
||||
|
||||
void bx_term_gui_c::dimension_update(unsigned x, unsigned y, unsigned fheight, unsigned fwidth, unsigned bpp)
|
||||
{
|
||||
if (bpp > 8) {
|
||||
BX_PANIC(("%d bpp graphics mode not supported", bpp));
|
||||
}
|
||||
if (fheight > 0) {
|
||||
text_cols = x / fwidth;
|
||||
text_rows = y / fheight;
|
||||
#if BX_HAVE_COLOR_SET
|
||||
color_set(7, NULL);
|
||||
#endif
|
||||
#if BX_HAVE_MVHLINE
|
||||
if (LINES > (int)text_rows) {
|
||||
mvhline(text_rows, 0, ACS_HLINE, text_cols);
|
||||
}
|
||||
#endif
|
||||
#if BX_HAVE_MVVLINE
|
||||
if (COLS > (int)text_cols) {
|
||||
mvvline(0, text_cols, ACS_VLINE, text_rows);
|
||||
}
|
||||
#endif
|
||||
if ((LINES > (int)text_rows) && (COLS > (int)text_cols)) {
|
||||
mvaddch(text_rows, text_cols, ACS_LRCORNER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ::CREATE_BITMAP()
|
||||
//
|
||||
// Create a monochrome bitmap of size 'xdim' by 'ydim', which will
|
||||
// be drawn in the headerbar. Return an integer ID to the bitmap,
|
||||
// with which the bitmap can be referenced later.
|
||||
//
|
||||
// bmap: packed 8 pixels-per-byte bitmap. The pixel order is:
|
||||
// bit0 is the left most pixel, bit7 is the right most pixel.
|
||||
// xdim: x dimension of bitmap
|
||||
// ydim: y dimension of bitmap
|
||||
|
||||
unsigned bx_term_gui_c::create_bitmap(const unsigned char *bmap, unsigned xdim, unsigned ydim)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
// ::HEADERBAR_BITMAP()
|
||||
//
|
||||
// Called to install a bitmap in the bochs headerbar (toolbar).
|
||||
//
|
||||
// bmap_id: will correspond to an ID returned from
|
||||
// ::create_bitmap(). 'alignment' is either BX_GRAVITY_LEFT
|
||||
// or BX_GRAVITY_RIGHT, meaning install the bitmap in the next
|
||||
// available leftmost or rightmost space.
|
||||
// alignment: is either BX_GRAVITY_LEFT or BX_GRAVITY_RIGHT,
|
||||
// meaning install the bitmap in the next
|
||||
// available leftmost or rightmost space.
|
||||
// f: a 'C' function pointer to callback when the mouse is clicked in
|
||||
// the boundaries of this bitmap.
|
||||
|
||||
unsigned bx_term_gui_c::headerbar_bitmap(unsigned bmap_id, unsigned alignment, void (*f)(void))
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
|
||||
// ::SHOW_HEADERBAR()
|
||||
//
|
||||
// Show (redraw) the current headerbar, which is composed of
|
||||
// currently installed bitmaps.
|
||||
|
||||
void bx_term_gui_c::show_headerbar(void)
|
||||
{
|
||||
}
|
||||
|
||||
// ::REPLACE_BITMAP()
|
||||
//
|
||||
// Replace the bitmap installed in the headerbar ID slot 'hbar_id',
|
||||
// with the one specified by 'bmap_id'. 'bmap_id' will have
|
||||
// been generated by ::create_bitmap(). The old and new bitmap
|
||||
// must be of the same size. This allows the bitmap the user
|
||||
// sees to change, when some action occurs. For example when
|
||||
// the user presses on the floppy icon, it then displays
|
||||
// the ejected status.
|
||||
//
|
||||
// hbar_id: headerbar slot ID
|
||||
// bmap_id: bitmap ID
|
||||
|
||||
void bx_term_gui_c::replace_bitmap(unsigned hbar_id, unsigned bmap_id)
|
||||
{
|
||||
}
|
||||
|
||||
// ::EXIT()
|
||||
//
|
||||
// Called before bochs terminates, to allow for a graceful
|
||||
// exit from the native GUI mechanism.
|
||||
|
||||
void bx_term_gui_c::exit(void)
|
||||
{
|
||||
if (!initialized) return;
|
||||
clear();
|
||||
flush();
|
||||
endwin();
|
||||
BX_DEBUG(("exiting"));
|
||||
}
|
||||
|
||||
void bx_term_gui_c::mouse_enabled_changed_specific(bx_bool val)
|
||||
{
|
||||
}
|
||||
|
||||
#if BX_USE_IDLE_HACK
|
||||
void bx_term_gui_c::sim_is_idle()
|
||||
{
|
||||
int res;
|
||||
fd_set readfds;
|
||||
|
||||
struct timeval timeout;
|
||||
timeout.tv_sec = 0;
|
||||
timeout.tv_usec = 1000; /* 1/1000 s */
|
||||
|
||||
FD_ZERO(&readfds);
|
||||
FD_SET(0, &readfds); // Wait for input
|
||||
|
||||
res = select(1, &readfds, NULL, NULL, &timeout);
|
||||
|
||||
switch(res)
|
||||
{
|
||||
case -1: /* select() error - should not happen */
|
||||
// This can happen when we have a alarm running, lets return
|
||||
// perror("sim_is_idle: select() failure\n");
|
||||
//handle_events();
|
||||
return;
|
||||
case 0: /* timeout */
|
||||
//handle_events();
|
||||
return;
|
||||
}
|
||||
//handle_events();
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* if BX_WITH_TERM */
|
||||
1064
simulators/bochs/gui/textconfig.cc
Normal file
1064
simulators/bochs/gui/textconfig.cc
Normal file
File diff suppressed because it is too large
Load Diff
58
simulators/bochs/gui/textconfig.h
Normal file
58
simulators/bochs/gui/textconfig.h
Normal file
@ -0,0 +1,58 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 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
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if BX_USE_TEXTCONFIG
|
||||
|
||||
enum {
|
||||
BX_CI_INIT,
|
||||
BX_CI_START_MENU,
|
||||
BX_CI_START_OPTS,
|
||||
BX_CI_START_OPTS_MEM,
|
||||
BX_CI_START_OPTS_INTERFACE,
|
||||
BX_CI_START_OPTS_DISK,
|
||||
BX_CI_START_OPTS_SOUND,
|
||||
BX_CI_START_OPTS_MISC,
|
||||
BX_CI_START_SIMULATION,
|
||||
BX_CI_RUNTIME,
|
||||
BX_CI_N_MENUS
|
||||
};
|
||||
|
||||
enum {
|
||||
BX_CI_RT_FLOPPYA = 1,
|
||||
BX_CI_RT_FLOPPYB,
|
||||
BX_CI_RT_CDROM1,
|
||||
BX_CI_RT_CDROM2,
|
||||
BX_CI_RT_CDROM3,
|
||||
BX_CI_RT_CDROM4,
|
||||
BX_CI_RT_IPS,
|
||||
BX_CI_RT_LOGOPTS1,
|
||||
BX_CI_RT_LOGOPTS2,
|
||||
BX_CI_RT_INST_TR,
|
||||
BX_CI_RT_USB,
|
||||
BX_CI_RT_MISC,
|
||||
BX_CI_RT_CONT,
|
||||
BX_CI_RT_QUIT
|
||||
};
|
||||
|
||||
int init_text_config_interface();
|
||||
|
||||
#endif
|
||||
79
simulators/bochs/gui/wenhdbg_res.h
Executable file
79
simulators/bochs/gui/wenhdbg_res.h
Executable file
@ -0,0 +1,79 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// BOCHS ENHANCED DEBUGGER Ver 1.2
|
||||
// (C) Chourdakis Michael, 2008
|
||||
// http://www.turboirc.com
|
||||
//
|
||||
// Modified by Bruce Ewing
|
||||
//
|
||||
|
||||
#ifndef BX_ENH_DBG_RES_H
|
||||
#define BX_ENH_DBG_RES_H
|
||||
|
||||
// The menuIDs should not have big "gaps" -- so the switch works well.
|
||||
// A few small gaps is OK.
|
||||
#define CMD_CONT 101
|
||||
#define CMD_STEP1 102
|
||||
#define CMD_STEPN 103
|
||||
#define CMD_BREAK 104
|
||||
|
||||
#define CMD_BRKPT 107
|
||||
#define CMD_WPTWR 108
|
||||
#define CMD_WPTRD 109
|
||||
#define CMD_FIND 110
|
||||
#define CMD_RFRSH 111
|
||||
// View Menu:
|
||||
#define CMD_PHYDMP 113
|
||||
#define CMD_LINDMP 114
|
||||
#define CMD_STACK 115
|
||||
#define CMD_GDTV 116
|
||||
#define CMD_IDTV 117
|
||||
#define CMD_PAGEV 118
|
||||
#define CMD_VBRK 120
|
||||
#define CMD_CMEM 121
|
||||
#define CMD_PTREE 122
|
||||
#define CMD_DISASM 123
|
||||
// Options Menu:
|
||||
#define CMD_MODEB 125
|
||||
#define CMD_XCEPT 126
|
||||
#define CMD_ONECPU 127
|
||||
#define CMD_DADEF 128
|
||||
#define CMD_ATTI 129
|
||||
#define CMD_FONT 130
|
||||
#define CMD_UCASE 131
|
||||
#define CMD_IOWIN 132
|
||||
#define CMD_SBTN 133
|
||||
#define CMD_MHEX 134
|
||||
#define CMD_MASCII 135
|
||||
#define CMD_LEND 136
|
||||
|
||||
#define CMD_IGNSA 139
|
||||
#define CMD_IGNNT 140
|
||||
#define CMD_RCLR 141
|
||||
// The next 8 menuID's must be strictly "contiguous" and in-order
|
||||
#define CMD_EREG 142
|
||||
#define CMD_SREG 143
|
||||
#define CMD_SYSR 144
|
||||
#define CMD_CREG 145
|
||||
#define CMD_FPUR 146
|
||||
#define CMD_XMMR 147
|
||||
#define CMD_DREG 148
|
||||
#define CMD_TREG 149
|
||||
|
||||
#define CMD_ABOUT 150
|
||||
|
||||
// The CMD_WS popup menuID's must be strictly "contiguous" and in-order
|
||||
#define CMD_WS_1 160
|
||||
#define CMD_WS_2 161
|
||||
#define CMD_WS_4 162
|
||||
#define CMD_WS_8 163
|
||||
#define CMD_WS16 164
|
||||
|
||||
#define MI_FIRST_VIEWITEM CMD_PHYDMP
|
||||
#define MI_FIRST_OPTITEM CMD_MODEB
|
||||
#define CMD_IDX_HI CMD_WS16
|
||||
#define CMD_IDX_LO CMD_CONT
|
||||
|
||||
#endif
|
||||
2388
simulators/bochs/gui/win32.cc
Normal file
2388
simulators/bochs/gui/win32.cc
Normal file
File diff suppressed because it is too large
Load Diff
1877
simulators/bochs/gui/win32_enh_dbg_osdep.cc
Executable file
1877
simulators/bochs/gui/win32_enh_dbg_osdep.cc
Executable file
File diff suppressed because it is too large
Load Diff
791
simulators/bochs/gui/win32dialog.cc
Normal file
791
simulators/bochs/gui/win32dialog.cc
Normal file
@ -0,0 +1,791 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 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
|
||||
|
||||
#include "win32dialog.h"
|
||||
|
||||
#if BX_USE_TEXTCONFIG && defined(WIN32) && (BX_WITH_WIN32 || BX_WITH_SDL)
|
||||
|
||||
#include "bochs.h"
|
||||
#include "param_names.h"
|
||||
#include "win32res.h"
|
||||
#include "win32paramdlg.h"
|
||||
|
||||
const char log_choices[5][16] = {"ignore", "log", "ask user", "end simulation", "no change"};
|
||||
#if BX_DEBUGGER
|
||||
extern char *debug_cmd;
|
||||
extern bx_bool debug_cmd_ready;
|
||||
extern bx_bool vgaw_refresh;
|
||||
#endif
|
||||
|
||||
char *backslashes(char *s)
|
||||
{
|
||||
if (s != NULL) {
|
||||
while (*s != 0) {
|
||||
if (*s == '/') *s = '\\';
|
||||
s++;
|
||||
}
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
HWND GetBochsWindow()
|
||||
{
|
||||
HWND hwnd;
|
||||
|
||||
hwnd = FindWindow("Bochs for Windows", NULL);
|
||||
if (hwnd == NULL) {
|
||||
hwnd = GetForegroundWindow();
|
||||
}
|
||||
return hwnd;
|
||||
}
|
||||
|
||||
BOOL CreateImage(HWND hDlg, int sectors, const char *filename)
|
||||
{
|
||||
if (sectors < 1) {
|
||||
MessageBox(hDlg, "The disk size is invalid.", "Invalid size", MB_ICONERROR);
|
||||
return FALSE;
|
||||
}
|
||||
if (lstrlen(filename) < 1) {
|
||||
MessageBox(hDlg, "You must type a file name for the new disk image.", "Bad filename", MB_ICONERROR);
|
||||
return FALSE;
|
||||
}
|
||||
int ret = SIM->create_disk_image (filename, sectors, 0);
|
||||
if (ret == -1) { // already exists
|
||||
int answer = MessageBox(hDlg, "File exists. Do you want to overwrite it?",
|
||||
"File exists", MB_YESNO);
|
||||
if (answer == IDYES)
|
||||
ret = SIM->create_disk_image (filename, sectors, 1);
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
if (ret == -2) {
|
||||
MessageBox(hDlg, "I could not create the disk image. Check for permission problems or available disk space.", "Failed", MB_ICONERROR);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData)
|
||||
{
|
||||
char path[MAX_PATH];
|
||||
|
||||
if (uMsg == BFFM_INITIALIZED) {
|
||||
GetCurrentDirectory(MAX_PATH, path);
|
||||
SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)path);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef BIF_NEWDIALOGSTYLE
|
||||
#define BIF_NEWDIALOGSTYLE 0
|
||||
#endif
|
||||
|
||||
int BrowseDir(const char *Title, char *result)
|
||||
{
|
||||
BROWSEINFO browseInfo;
|
||||
LPITEMIDLIST ItemIDList;
|
||||
int r = -1;
|
||||
|
||||
memset(&browseInfo,0,sizeof(BROWSEINFO));
|
||||
browseInfo.hwndOwner = GetBochsWindow();
|
||||
browseInfo.pszDisplayName = result;
|
||||
browseInfo.lpszTitle = (LPCSTR)Title;
|
||||
browseInfo.ulFlags = BIF_NEWDIALOGSTYLE | BIF_RETURNONLYFSDIRS;
|
||||
browseInfo.lpfn = BrowseCallbackProc;
|
||||
ItemIDList = SHBrowseForFolder(&browseInfo);
|
||||
if (ItemIDList != NULL) {
|
||||
*result = 0;
|
||||
if (SHGetPathFromIDList(ItemIDList, result)) {
|
||||
if (result[0]) r = 0;
|
||||
}
|
||||
// free memory used
|
||||
IMalloc * imalloc = 0;
|
||||
if (SUCCEEDED(SHGetMalloc(&imalloc))) {
|
||||
imalloc->Free(ItemIDList);
|
||||
imalloc->Release();
|
||||
}
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
static BOOL CALLBACK LogAskProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
BxEvent *event;
|
||||
int level;
|
||||
|
||||
switch (msg) {
|
||||
case WM_INITDIALOG:
|
||||
event = (BxEvent*)lParam;
|
||||
level = event->u.logmsg.level;
|
||||
SetWindowText(hDlg, SIM->get_log_level_name(level));
|
||||
SetWindowText(GetDlgItem(hDlg, IDASKDEV), event->u.logmsg.prefix);
|
||||
SetWindowText(GetDlgItem(hDlg, IDASKMSG), event->u.logmsg.msg);
|
||||
SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Continue");
|
||||
SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Continue and don't ask again");
|
||||
SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Kill simulation");
|
||||
SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Abort (dump core)");
|
||||
#if BX_DEBUGGER
|
||||
SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_ADDSTRING, 0, (LPARAM)"Continue and return to debugger");
|
||||
#endif
|
||||
SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_SETCURSEL, 2, 0);
|
||||
SetFocus(GetDlgItem(hDlg, IDASKLIST));
|
||||
return FALSE;
|
||||
case WM_CLOSE:
|
||||
EndDialog(hDlg, BX_LOG_ASK_CHOICE_DIE);
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
EndDialog(hDlg, SendMessage(GetDlgItem(hDlg, IDASKLIST), LB_GETCURSEL, 0, 0));
|
||||
break;
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, BX_LOG_ASK_CHOICE_DIE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL CALLBACK StringParamProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static bx_param_string_c *param;
|
||||
char buffer[512];
|
||||
const char *title;
|
||||
|
||||
switch (msg) {
|
||||
case WM_INITDIALOG:
|
||||
param = (bx_param_string_c *)lParam;
|
||||
title = param->get_label();
|
||||
if ((title == NULL) || (strlen(title) == 0)) {
|
||||
title = param->get_name();
|
||||
}
|
||||
SetWindowText(hDlg, title);
|
||||
SetWindowText(GetDlgItem(hDlg, IDSTRING), param->getptr());
|
||||
SendMessage(GetDlgItem(hDlg, IDSTRING), EM_SETLIMITTEXT, param->get_maxsize(), 0);
|
||||
return TRUE;
|
||||
break;
|
||||
case WM_CLOSE:
|
||||
EndDialog(hDlg, -1);
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDOK:
|
||||
GetDlgItemText(hDlg, IDSTRING, buffer, param->get_maxsize() + 1);
|
||||
param->set(buffer);
|
||||
EndDialog(hDlg, 1);
|
||||
break;
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, -1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL CALLBACK FloppyDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static bx_param_filename_c *param;
|
||||
static bx_param_bool_c *status, *readonly;
|
||||
static bx_param_enum_c *devtype;
|
||||
static bx_param_enum_c *mediatype;
|
||||
char mesg[MAX_PATH];
|
||||
char path[MAX_PATH];
|
||||
char pname[80];
|
||||
const char *title;
|
||||
int i, cap;
|
||||
|
||||
switch (msg) {
|
||||
case WM_INITDIALOG:
|
||||
param = (bx_param_filename_c *)lParam;
|
||||
param->get_param_path(pname, 80);
|
||||
if (!strcmp(pname, BXPN_FLOPPYA_PATH)) {
|
||||
status = SIM->get_param_bool(BXPN_FLOPPYA_STATUS);
|
||||
readonly = SIM->get_param_bool(BXPN_FLOPPYA_READONLY);
|
||||
devtype = SIM->get_param_enum(BXPN_FLOPPYA_DEVTYPE);
|
||||
mediatype = SIM->get_param_enum(BXPN_FLOPPYA_TYPE);
|
||||
} else {
|
||||
status = SIM->get_param_bool(BXPN_FLOPPYB_STATUS);
|
||||
readonly = SIM->get_param_bool(BXPN_FLOPPYB_READONLY);
|
||||
devtype = SIM->get_param_enum(BXPN_FLOPPYB_DEVTYPE);
|
||||
mediatype = SIM->get_param_enum(BXPN_FLOPPYB_TYPE);
|
||||
}
|
||||
cap = devtype->get() - (int)devtype->get_min();
|
||||
SetWindowText(GetDlgItem(hDlg, IDDEVTYPE), floppy_devtype_names[cap]);
|
||||
i = 0;
|
||||
while (floppy_type_names[i] != NULL) {
|
||||
SendMessage(GetDlgItem(hDlg, IDMEDIATYPE), CB_ADDSTRING, 0, (LPARAM)floppy_type_names[i]);
|
||||
SendMessage(GetDlgItem(hDlg, IDMEDIATYPE), CB_SETITEMDATA, i, (LPARAM)(mediatype->get_min() + i));
|
||||
i++;
|
||||
}
|
||||
cap = mediatype->get() - (int)mediatype->get_min();
|
||||
SendMessage(GetDlgItem(hDlg, IDMEDIATYPE), CB_SETCURSEL, cap, 0);
|
||||
if (status->get()) {
|
||||
SendMessage(GetDlgItem(hDlg, IDSTATUS), BM_SETCHECK, BST_CHECKED, 0);
|
||||
}
|
||||
if (readonly->get()) {
|
||||
SendMessage(GetDlgItem(hDlg, IDREADONLY), BM_SETCHECK, BST_CHECKED, 0);
|
||||
}
|
||||
lstrcpy(path, param->getptr());
|
||||
title = param->get_label();
|
||||
if (!title) title = param->get_name();
|
||||
SetWindowText(hDlg, title);
|
||||
if (lstrlen(path) && lstrcmp(path, "none")) {
|
||||
SetWindowText(GetDlgItem(hDlg, IDPATH), path);
|
||||
}
|
||||
return TRUE;
|
||||
break;
|
||||
case WM_CLOSE:
|
||||
EndDialog(hDlg, -1);
|
||||
return TRUE;
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDBROWSE:
|
||||
GetDlgItemText(hDlg, IDPATH, path, MAX_PATH);
|
||||
if (AskFilename(hDlg, param, path) > 0) {
|
||||
SetWindowText(GetDlgItem(hDlg, IDPATH), path);
|
||||
SendMessage(GetDlgItem(hDlg, IDSTATUS), BM_SETCHECK, BST_CHECKED, 0);
|
||||
SendMessage(GetDlgItem(hDlg, IDMEDIATYPE), CB_SELECTSTRING, (WPARAM)-1, (LPARAM)"auto");
|
||||
EnableWindow(GetDlgItem(hDlg, IDCREATE), FALSE);
|
||||
}
|
||||
return TRUE;
|
||||
break;
|
||||
case IDOK:
|
||||
status->set(0);
|
||||
if (SendMessage(GetDlgItem(hDlg, IDSTATUS), BM_GETCHECK, 0, 0) == BST_CHECKED) {
|
||||
GetDlgItemText(hDlg, IDPATH, path, MAX_PATH);
|
||||
if (lstrlen(path) == 0) {
|
||||
lstrcpy(path, "none");
|
||||
}
|
||||
} else {
|
||||
lstrcpy(path, "none");
|
||||
}
|
||||
readonly->set(SendMessage(GetDlgItem(hDlg, IDREADONLY), BM_GETCHECK, 0, 0) == BST_CHECKED);
|
||||
param->set(path);
|
||||
i = SendMessage(GetDlgItem(hDlg, IDMEDIATYPE), CB_GETCURSEL, 0, 0);
|
||||
cap = SendMessage(GetDlgItem(hDlg, IDMEDIATYPE), CB_GETITEMDATA, i, 0);
|
||||
mediatype->set(cap);
|
||||
if (lstrcmp(path, "none")) {
|
||||
status->set(1);
|
||||
}
|
||||
EndDialog(hDlg, 1);
|
||||
return TRUE;
|
||||
break;
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, -1);
|
||||
return TRUE;
|
||||
break;
|
||||
case IDMEDIATYPE:
|
||||
if (HIWORD(wParam) == CBN_SELCHANGE) {
|
||||
i = SendMessage(GetDlgItem(hDlg, IDMEDIATYPE), CB_GETCURSEL, 0, 0);
|
||||
EnableWindow(GetDlgItem(hDlg, IDCREATE), (floppy_type_n_sectors[i] > 0));
|
||||
}
|
||||
break;
|
||||
case IDCREATE:
|
||||
GetDlgItemText(hDlg, IDPATH, path, MAX_PATH);
|
||||
backslashes(path);
|
||||
i = SendMessage(GetDlgItem(hDlg, IDMEDIATYPE), CB_GETCURSEL, 0, 0);
|
||||
if (CreateImage(hDlg, floppy_type_n_sectors[i], path)) {
|
||||
wsprintf(mesg, "Created a %s disk image called %s", floppy_type_names[i], path);
|
||||
MessageBox(hDlg, mesg, "Image created", MB_OK);
|
||||
}
|
||||
return TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void SetStandardLogOptions(HWND hDlg)
|
||||
{
|
||||
int level, idx;
|
||||
int defchoice[5];
|
||||
|
||||
for (level=0; level<5; level++) {
|
||||
int mod = 0;
|
||||
int first = SIM->get_log_action (mod, level);
|
||||
BOOL consensus = true;
|
||||
// now compare all others to first. If all match, then use "first" as
|
||||
// the initial value.
|
||||
for (mod=1; mod<SIM->get_n_log_modules(); mod++) {
|
||||
if (first != SIM->get_log_action (mod, level)) {
|
||||
consensus = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (consensus)
|
||||
defchoice[level] = first;
|
||||
else
|
||||
defchoice[level] = 4;
|
||||
}
|
||||
for (level=0; level<5; level++) {
|
||||
idx = 0;
|
||||
SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_RESETCONTENT, 0, 0);
|
||||
for (int action=0; action<5; action++) {
|
||||
if (((level > 1) && (action > 0)) || ((level < 2) && ((action < 2) || (action > 3)))) {
|
||||
SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_ADDSTRING, 0, (LPARAM)log_choices[action]);
|
||||
SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_SETITEMDATA, idx, action);
|
||||
if (action == defchoice[level]) {
|
||||
SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_SETCURSEL, idx, 0);
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
}
|
||||
EnableWindow(GetDlgItem(hDlg, IDDEVLIST), FALSE);
|
||||
}
|
||||
|
||||
void SetAdvancedLogOptions(HWND hDlg)
|
||||
{
|
||||
int idx, level, mod;
|
||||
|
||||
idx = SendMessage(GetDlgItem(hDlg, IDDEVLIST), LB_GETCURSEL, 0, 0);
|
||||
mod = SendMessage(GetDlgItem(hDlg, IDDEVLIST), LB_GETITEMDATA, idx, 0);
|
||||
for (level=0; level<5; level++) {
|
||||
idx = 0;
|
||||
SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_RESETCONTENT, 0, 0);
|
||||
for (int action=0; action<4; action++) {
|
||||
if (((level > 1) && (action > 0)) || ((level < 2) && (action < 2))) {
|
||||
SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_ADDSTRING, 0, (LPARAM)log_choices[action]);
|
||||
SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_SETITEMDATA, idx, action);
|
||||
if (action == SIM->get_log_action (mod, level)) {
|
||||
SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_SETCURSEL, idx, 0);
|
||||
}
|
||||
idx++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void InitLogOptionsDialog(HWND hDlg)
|
||||
{
|
||||
int idx, mod;
|
||||
char prefix[8];
|
||||
|
||||
for (mod=0; mod<SIM->get_n_log_modules(); mod++) {
|
||||
if (strcmp(SIM->get_prefix(mod), "[ ]")) {
|
||||
lstrcpyn(prefix, SIM->get_prefix(mod), sizeof(prefix));
|
||||
lstrcpy(prefix, prefix+1);
|
||||
prefix[5] = 0;
|
||||
idx = SendMessage(GetDlgItem(hDlg, IDDEVLIST), LB_ADDSTRING, 0, (LPARAM)prefix);
|
||||
SendMessage(GetDlgItem(hDlg, IDDEVLIST), LB_SETITEMDATA, idx, mod);
|
||||
}
|
||||
}
|
||||
SetStandardLogOptions(hDlg);
|
||||
}
|
||||
|
||||
void ApplyLogOptions(HWND hDlg, BOOL advanced)
|
||||
{
|
||||
int idx, level, mod, value;
|
||||
|
||||
if (advanced) {
|
||||
idx = SendMessage(GetDlgItem(hDlg, IDDEVLIST), LB_GETCURSEL, 0, 0);
|
||||
mod = SendMessage(GetDlgItem(hDlg, IDDEVLIST), LB_GETITEMDATA, idx, 0);
|
||||
for (level=0; level<5; level++) {
|
||||
idx = SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_GETCURSEL, 0, 0);
|
||||
value = SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_GETITEMDATA, idx, 0);
|
||||
SIM->set_log_action (mod, level, value);
|
||||
}
|
||||
EnableWindow(GetDlgItem(hDlg, IDDEVLIST), TRUE);
|
||||
} else {
|
||||
for (level=0; level<5; level++) {
|
||||
idx = SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_GETCURSEL, 0, 0);
|
||||
value = SendMessage(GetDlgItem(hDlg, IDLOGEVT1+level), CB_GETITEMDATA, idx, 0);
|
||||
if (value < 4) {
|
||||
// set new default
|
||||
SIM->set_default_log_action (level, value);
|
||||
// apply that action to all modules (devices)
|
||||
SIM->set_log_action (-1, level, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
EnableWindow(GetDlgItem(hDlg, IDADVLOGOPT), TRUE);
|
||||
}
|
||||
|
||||
static BOOL CALLBACK LogOptDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static BOOL advanced;
|
||||
static BOOL changed;
|
||||
long noticode;
|
||||
|
||||
switch (msg) {
|
||||
case WM_INITDIALOG:
|
||||
InitLogOptionsDialog(hDlg);
|
||||
advanced = FALSE;
|
||||
changed = FALSE;
|
||||
EnableWindow(GetDlgItem(hDlg, IDAPPLY), FALSE);
|
||||
return TRUE;
|
||||
case WM_CLOSE:
|
||||
EndDialog(hDlg, 0);
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
noticode = HIWORD(wParam);
|
||||
switch(noticode) {
|
||||
case CBN_SELCHANGE: /* LBN_SELCHANGE is the same value */
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDDEVLIST:
|
||||
SetAdvancedLogOptions(hDlg);
|
||||
break;
|
||||
case IDLOGEVT1:
|
||||
case IDLOGEVT2:
|
||||
case IDLOGEVT3:
|
||||
case IDLOGEVT4:
|
||||
case IDLOGEVT5:
|
||||
if (!changed) {
|
||||
EnableWindow(GetDlgItem(hDlg, IDADVLOGOPT), FALSE);
|
||||
if (advanced) {
|
||||
EnableWindow(GetDlgItem(hDlg, IDDEVLIST), FALSE);
|
||||
}
|
||||
changed = TRUE;
|
||||
EnableWindow(GetDlgItem(hDlg, IDAPPLY), TRUE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDADVLOGOPT:
|
||||
if (SendMessage(GetDlgItem(hDlg, IDADVLOGOPT), BM_GETCHECK, 0, 0) == BST_CHECKED) {
|
||||
EnableWindow(GetDlgItem(hDlg, IDDEVLIST), TRUE);
|
||||
SendMessage(GetDlgItem(hDlg, IDDEVLIST), LB_SETCURSEL, 0, 0);
|
||||
SetAdvancedLogOptions(hDlg);
|
||||
advanced = TRUE;
|
||||
} else {
|
||||
SendMessage(GetDlgItem(hDlg, IDDEVLIST), LB_SETCURSEL, (WPARAM)-1, 0);
|
||||
SetStandardLogOptions(hDlg);
|
||||
advanced = FALSE;
|
||||
}
|
||||
break;
|
||||
case IDAPPLY:
|
||||
ApplyLogOptions(hDlg, advanced);
|
||||
EnableWindow(GetDlgItem(hDlg, IDAPPLY), FALSE);
|
||||
changed = FALSE;
|
||||
break;
|
||||
case IDOK:
|
||||
if (changed) {
|
||||
ApplyLogOptions(hDlg, advanced);
|
||||
}
|
||||
EndDialog(hDlg, 1);
|
||||
break;
|
||||
case IDCANCEL:
|
||||
EndDialog(hDlg, 0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void LogOptionsDialog(HWND hwnd)
|
||||
{
|
||||
DialogBox(NULL, MAKEINTRESOURCE(LOGOPT_DLG), hwnd, (DLGPROC)LogOptDlgProc);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
const char *label;
|
||||
const char *param;
|
||||
} edit_opts_t;
|
||||
|
||||
edit_opts_t start_options[] = {
|
||||
{"Logfile", "log"},
|
||||
{"Log Options", "*"},
|
||||
{"CPU", "cpu"},
|
||||
{"CPUID", "cpuid"},
|
||||
{"Memory", "memory"},
|
||||
{"Clock & CMOS", "clock_cmos"},
|
||||
{"PCI", "pci"},
|
||||
{"Display & Interface", "display"},
|
||||
{"Keyboard & Mouse", "keyboard_mouse"},
|
||||
{"Disk & Boot", BXPN_MENU_DISK_WIN32},
|
||||
{"Serial / Parallel / USB", "ports"},
|
||||
{"Network card", "network"},
|
||||
{"Sound Blaster 16", BXPN_SB16},
|
||||
{"Other", "misc"},
|
||||
#if BX_PLUGINS
|
||||
{"User-defined Options", "user"},
|
||||
#endif
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
edit_opts_t runtime_options[] = {
|
||||
{"CD-ROM", BXPN_MENU_RUNTIME_CDROM},
|
||||
{"USB", BXPN_MENU_RUNTIME_USB},
|
||||
{"Misc", BXPN_MENU_RUNTIME_MISC},
|
||||
{"Log Options", "*"},
|
||||
{NULL, NULL}
|
||||
};
|
||||
static BOOL CALLBACK MainMenuDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static bx_bool runtime;
|
||||
int choice, code, i;
|
||||
bx_param_filename_c *rcfile;
|
||||
char path[BX_PATHNAME_LEN];
|
||||
const char *pname;
|
||||
|
||||
switch (msg) {
|
||||
case WM_INITDIALOG:
|
||||
runtime = (bx_bool)lParam;
|
||||
EnableWindow(GetDlgItem(hDlg, IDEDITCFG), FALSE);
|
||||
if (runtime) {
|
||||
SetWindowText(hDlg, "Bochs Runtime Menu");
|
||||
EnableWindow(GetDlgItem(hDlg, IDREADRC), FALSE);
|
||||
EnableWindow(GetDlgItem(hDlg, IDRESETCFG), FALSE);
|
||||
EnableWindow(GetDlgItem(hDlg, IDRESTORE), FALSE);
|
||||
SetWindowText(GetDlgItem(hDlg, IDOK), "&Continue");
|
||||
i = 0;
|
||||
while (runtime_options[i].label != NULL) {
|
||||
SendMessage(GetDlgItem(hDlg, IDEDITBOX), LB_ADDSTRING, 0, (LPARAM)runtime_options[i].label);
|
||||
i++;
|
||||
}
|
||||
choice = IDOK;
|
||||
} else {
|
||||
i = 0;
|
||||
while (start_options[i].label != NULL) {
|
||||
SendMessage(GetDlgItem(hDlg, IDEDITBOX), LB_ADDSTRING, 0, (LPARAM)start_options[i].label);
|
||||
i++;
|
||||
}
|
||||
if (SIM->get_param_enum(BXPN_BOCHS_START)->get() == BX_LOAD_START) {
|
||||
choice = IDREADRC;
|
||||
} else {
|
||||
choice = IDOK;
|
||||
}
|
||||
}
|
||||
SetFocus(GetDlgItem(hDlg, choice));
|
||||
return FALSE;
|
||||
case WM_CLOSE:
|
||||
EndDialog(hDlg, -1);
|
||||
break;
|
||||
case WM_COMMAND:
|
||||
code = HIWORD(wParam);
|
||||
switch (LOWORD(wParam)) {
|
||||
case IDREADRC:
|
||||
rcfile = new bx_param_filename_c(NULL, "rcfile", "Load Bochs Config File",
|
||||
"", "bochsrc.bxrc", BX_PATHNAME_LEN);
|
||||
rcfile->set_extension("bxrc");
|
||||
if (AskFilename(hDlg, rcfile, NULL) > 0) {
|
||||
SIM->reset_all_param();
|
||||
SIM->read_rc(rcfile->getptr());
|
||||
}
|
||||
delete rcfile;
|
||||
break;
|
||||
case IDWRITERC:
|
||||
rcfile = new bx_param_filename_c(NULL, "rcfile", "Save Bochs Config File",
|
||||
"", "bochsrc.bxrc", BX_PATHNAME_LEN);
|
||||
rcfile->set_extension("bxrc");
|
||||
rcfile->set_options(rcfile->SAVE_FILE_DIALOG);
|
||||
if (AskFilename(hDlg, rcfile, NULL) > 0) {
|
||||
SIM->write_rc(rcfile->getptr(), 1);
|
||||
}
|
||||
delete rcfile;
|
||||
break;
|
||||
case IDEDITBOX:
|
||||
if ((code == LBN_SELCHANGE) ||
|
||||
(code == LBN_DBLCLK)) {
|
||||
EnableWindow(GetDlgItem(hDlg, IDEDITCFG), TRUE);
|
||||
}
|
||||
if (code != LBN_DBLCLK) {
|
||||
break;
|
||||
}
|
||||
case IDEDITCFG:
|
||||
i = SendMessage(GetDlgItem(hDlg, IDEDITBOX), LB_GETCURSEL, 0, 0);
|
||||
if (runtime) {
|
||||
pname = runtime_options[i].param;
|
||||
} else {
|
||||
pname = start_options[i].param;
|
||||
}
|
||||
if (lstrcmp(pname, "*")) {
|
||||
if (((bx_list_c*)SIM->get_param(pname))->get_size() > 0) {
|
||||
win32ParamDialog(hDlg, pname);
|
||||
} else {
|
||||
MessageBox(hDlg, "Nothing to configure in this section", "Warning", MB_ICONEXCLAMATION);
|
||||
}
|
||||
} else {
|
||||
LogOptionsDialog(hDlg);
|
||||
}
|
||||
break;
|
||||
case IDRESETCFG:
|
||||
if (MessageBox(hDlg, "Reset all options back to their factory defaults ?",
|
||||
"Reset Configuration", MB_ICONEXCLAMATION | MB_YESNO) == IDYES) {
|
||||
SIM->reset_all_param();
|
||||
}
|
||||
break;
|
||||
case IDRESTORE:
|
||||
path[0] = 0;
|
||||
if (BrowseDir("Restore Bochs state from...", path) >= 0) {
|
||||
SIM->get_param_bool(BXPN_RESTORE_FLAG)->set(1);
|
||||
SIM->get_param_string(BXPN_RESTORE_PATH)->set(path);
|
||||
EndDialog(hDlg, 1);
|
||||
}
|
||||
break;
|
||||
case IDOK:
|
||||
EndDialog(hDlg, 1);
|
||||
break;
|
||||
case IDCANCEL:
|
||||
bx_user_quit = 1;
|
||||
EndDialog(hDlg, -1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void LogAskDialog(BxEvent *event)
|
||||
{
|
||||
event->retcode = DialogBoxParam(NULL, MAKEINTRESOURCE(ASK_DLG), GetBochsWindow(),
|
||||
(DLGPROC)LogAskProc, (LPARAM)event);
|
||||
}
|
||||
|
||||
int AskString(bx_param_string_c *param)
|
||||
{
|
||||
return DialogBoxParam(NULL, MAKEINTRESOURCE(STRING_DLG), GetBochsWindow(),
|
||||
(DLGPROC)StringParamProc, (LPARAM)param);
|
||||
}
|
||||
|
||||
int FloppyDialog(bx_param_filename_c *param)
|
||||
{
|
||||
return DialogBoxParam(NULL, MAKEINTRESOURCE(FLOPPY_DLG), GetBochsWindow(),
|
||||
(DLGPROC)FloppyDlgProc, (LPARAM)param);
|
||||
}
|
||||
|
||||
int MainMenuDialog(HWND hwnd, bx_bool runtime)
|
||||
{
|
||||
return DialogBoxParam(NULL, MAKEINTRESOURCE(MAINMENU_DLG), hwnd,
|
||||
(DLGPROC)MainMenuDlgProc, (LPARAM)runtime);
|
||||
}
|
||||
|
||||
BxEvent* win32_notify_callback(void *unused, BxEvent *event)
|
||||
{
|
||||
int opts;
|
||||
bx_param_c *param;
|
||||
bx_param_string_c *sparam;
|
||||
char pname[BX_PATHNAME_LEN];
|
||||
|
||||
event->retcode = -1;
|
||||
switch (event->type)
|
||||
{
|
||||
case BX_SYNC_EVT_LOG_ASK:
|
||||
LogAskDialog(event);
|
||||
return event;
|
||||
#if BX_DEBUGGER && BX_DEBUGGER_GUI
|
||||
case BX_SYNC_EVT_GET_DBG_COMMAND:
|
||||
{
|
||||
// sim is at a "break" -- internal debugger is ready for a command
|
||||
debug_cmd = new char[512];
|
||||
debug_cmd_ready = FALSE;
|
||||
HitBreak();
|
||||
while (debug_cmd_ready == FALSE && bx_user_quit == 0)
|
||||
{
|
||||
if (vgaw_refresh != FALSE) // is the GUI frontend requesting a VGAW refresh?
|
||||
SIM->refresh_vga();
|
||||
vgaw_refresh = FALSE;
|
||||
Sleep(10);
|
||||
}
|
||||
if (bx_user_quit != 0)
|
||||
BX_EXIT(0);
|
||||
event->u.debugcmd.command = debug_cmd;
|
||||
event->retcode = 1;
|
||||
return event;
|
||||
}
|
||||
case BX_ASYNC_EVT_DBG_MSG:
|
||||
ParseIDText (event->u.logmsg.msg);
|
||||
return event;
|
||||
#endif
|
||||
case BX_SYNC_EVT_ASK_PARAM:
|
||||
param = event->u.param.param;
|
||||
if (param->get_type() == BXT_PARAM_STRING) {
|
||||
sparam = (bx_param_string_c *)param;
|
||||
opts = sparam->get_options();
|
||||
if (opts & sparam->IS_FILENAME) {
|
||||
if (opts & sparam->SELECT_FOLDER_DLG) {
|
||||
event->retcode = BrowseDir(sparam->get_label(), sparam->getptr());
|
||||
} else if (param->get_parent() == NULL) {
|
||||
event->retcode = AskFilename(GetBochsWindow(), (bx_param_filename_c *)sparam, NULL);
|
||||
} else {
|
||||
event->retcode = FloppyDialog((bx_param_filename_c *)sparam);
|
||||
}
|
||||
return event;
|
||||
} else {
|
||||
event->retcode = AskString(sparam);
|
||||
return event;
|
||||
}
|
||||
} else if (param->get_type() == BXT_LIST) {
|
||||
SIM->get_first_cdrom()->get_param_path(pname, BX_PATHNAME_LEN);
|
||||
event->retcode = win32ParamDialog(GetBochsWindow(), pname);
|
||||
return event;
|
||||
} else if (param->get_type() == BXT_PARAM_BOOL) {
|
||||
UINT flag = MB_YESNO | MB_SETFOREGROUND;
|
||||
if (((bx_param_bool_c *)param)->get() == 0) {
|
||||
flag |= MB_DEFBUTTON2;
|
||||
}
|
||||
((bx_param_bool_c *)param)->set(MessageBox(GetActiveWindow(), param->get_description(), param->get_label(), flag) == IDYES);
|
||||
event->retcode = 0;
|
||||
return event;
|
||||
}
|
||||
case BX_SYNC_EVT_TICK: // called periodically by siminterface.
|
||||
event->retcode = 0;
|
||||
// fall into default case
|
||||
default:
|
||||
return event;
|
||||
}
|
||||
}
|
||||
|
||||
static int win32_ci_callback(void *userdata, ci_command_t command)
|
||||
{
|
||||
switch (command)
|
||||
{
|
||||
case CI_START:
|
||||
SIM->set_notify_callback(win32_notify_callback, NULL);
|
||||
if (SIM->get_param_enum(BXPN_BOCHS_START)->get() == BX_QUICK_START) {
|
||||
SIM->begin_simulation(bx_startup_flags.argc, bx_startup_flags.argv);
|
||||
// we don't expect it to return, but if it does, quit
|
||||
SIM->quit_sim(1);
|
||||
} else {
|
||||
if (MainMenuDialog(GetActiveWindow(), 0) == 1) {
|
||||
SIM->begin_simulation(bx_startup_flags.argc, bx_startup_flags.argv);
|
||||
}
|
||||
SIM->quit_sim(1);
|
||||
}
|
||||
break;
|
||||
case CI_RUNTIME_CONFIG:
|
||||
if (MainMenuDialog(GetBochsWindow(), 1) < 0) {
|
||||
bx_user_quit = 1;
|
||||
#if !BX_DEBUGGER
|
||||
bx_atexit();
|
||||
SIM->quit_sim(1);
|
||||
#else
|
||||
bx_dbg_exit(1);
|
||||
#endif
|
||||
return -1;
|
||||
}
|
||||
break;
|
||||
case CI_SHUTDOWN:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int init_win32_config_interface()
|
||||
{
|
||||
SIM->register_configuration_interface("win32config", win32_ci_callback, NULL);
|
||||
return 0; // success
|
||||
}
|
||||
|
||||
#endif // BX_USE_TEXTCONFIG && defined(WIN32)
|
||||
60
simulators/bochs/gui/win32dialog.h
Normal file
60
simulators/bochs/gui/win32dialog.h
Normal file
@ -0,0 +1,60 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 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
|
||||
|
||||
#ifndef BX_WIN32_DIALOGS_H
|
||||
#define BX_WIN32_DIALOGS_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
// Compilation for WIN64 native require minimum 0x0500
|
||||
#ifndef _WIN32_IE
|
||||
#define _WIN32_IE 0x0500 /* Force a minimum "OS level" for commctrl.h */
|
||||
#endif
|
||||
#if _WIN32_IE < 0x0500
|
||||
#undef _WIN32_IE
|
||||
#define _WIN32_IE 0x0500
|
||||
#endif
|
||||
|
||||
extern "C" {
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
#include <shlobj.h>
|
||||
#include <ctype.h>
|
||||
}
|
||||
|
||||
// 64-bit windows env misses this define
|
||||
#ifndef GWL_WNDPROC
|
||||
#define GWL_WNDPROC (-4)
|
||||
#endif
|
||||
|
||||
#if BX_USE_TEXTCONFIG && defined(WIN32)
|
||||
|
||||
#if BX_DEBUGGER && BX_DEBUGGER_GUI
|
||||
void InitDebugDialog();
|
||||
void ParseIDText(const char *p);
|
||||
void HitBreak();
|
||||
#endif
|
||||
int init_win32_config_interface();
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BX_WIN32_DIALOGS_H
|
||||
846
simulators/bochs/gui/win32paramdlg.cc
Normal file
846
simulators/bochs/gui/win32paramdlg.cc
Normal file
@ -0,0 +1,846 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Volker Ruppert
|
||||
//
|
||||
// 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
|
||||
|
||||
#include "win32dialog.h"
|
||||
|
||||
#if BX_USE_TEXTCONFIG && defined(WIN32) && (BX_WITH_WIN32 || BX_WITH_SDL)
|
||||
|
||||
#include "bochs.h"
|
||||
#include "win32res.h"
|
||||
|
||||
#define ID_LABEL 100
|
||||
#define ID_PARAM 1000
|
||||
#define ID_BROWSE 2000
|
||||
#define ID_UPDOWN 3000
|
||||
|
||||
typedef struct _dlg_list_t {
|
||||
bx_list_c *list;
|
||||
UINT dlg_list_id;
|
||||
UINT dlg_base_id;
|
||||
struct _dlg_list_t *next;
|
||||
} dlg_list_t;
|
||||
|
||||
HFONT DlgFont;
|
||||
WNDPROC DefEditWndProc;
|
||||
UINT nextDlgID;
|
||||
dlg_list_t *dlg_lists = NULL;
|
||||
|
||||
|
||||
bx_bool registerDlgList(UINT lid, bx_list_c *list)
|
||||
{
|
||||
dlg_list_t *dlg_list;
|
||||
int items;
|
||||
|
||||
dlg_list = (dlg_list_t *)malloc(sizeof(dlg_list_t));
|
||||
if (dlg_list == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
dlg_list->list = list;
|
||||
dlg_list->dlg_list_id = lid;
|
||||
dlg_list->dlg_base_id = nextDlgID;
|
||||
items = list->get_size();
|
||||
nextDlgID += items;
|
||||
dlg_list->next = NULL;
|
||||
|
||||
if (dlg_lists == NULL) {
|
||||
dlg_lists = dlg_list;
|
||||
} else {
|
||||
dlg_list_t *temp = dlg_lists;
|
||||
|
||||
while (temp->next) {
|
||||
if (temp->list == dlg_list->list) {
|
||||
free(dlg_list);
|
||||
return 0;
|
||||
}
|
||||
temp = temp->next;
|
||||
}
|
||||
temp->next = dlg_list;
|
||||
}
|
||||
return dlg_list->dlg_base_id;
|
||||
}
|
||||
|
||||
UINT findDlgListBaseID(bx_list_c *list)
|
||||
{
|
||||
dlg_list_t *dlg_list;
|
||||
|
||||
for (dlg_list = dlg_lists; dlg_list; dlg_list = dlg_list->next) {
|
||||
if (list == dlg_list->list) {
|
||||
return dlg_list->dlg_base_id;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
bx_param_c *findParamFromDlgID(UINT cid)
|
||||
{
|
||||
dlg_list_t *dlg_list;
|
||||
int i;
|
||||
|
||||
for (dlg_list = dlg_lists; dlg_list; dlg_list = dlg_list->next) {
|
||||
if ((cid >= dlg_list->dlg_base_id) && (cid < (dlg_list->dlg_base_id + dlg_list->list->get_size()))) {
|
||||
i = cid - dlg_list->dlg_base_id;
|
||||
return dlg_list->list->get(i);
|
||||
}
|
||||
if (cid == dlg_list->dlg_list_id) {
|
||||
return dlg_list->list;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
UINT findDlgIDFromParam(bx_param_c *param)
|
||||
{
|
||||
dlg_list_t *dlg_list;
|
||||
bx_list_c *list;
|
||||
UINT cid;
|
||||
int i;
|
||||
|
||||
list = (bx_list_c*)param->get_parent();
|
||||
for (dlg_list = dlg_lists; dlg_list; dlg_list = dlg_list->next) {
|
||||
if (list == dlg_list->list) {
|
||||
cid = dlg_list->dlg_base_id;
|
||||
for (i = 0; i < list->get_size(); i++) {
|
||||
if (param == list->get(i)) {
|
||||
return (cid + i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cleanupDlgLists()
|
||||
{
|
||||
dlg_list_t *d, *next;
|
||||
|
||||
if (dlg_lists) {
|
||||
d = dlg_lists;
|
||||
while (d != NULL) {
|
||||
next = d->next;
|
||||
free(d);
|
||||
d = next;
|
||||
}
|
||||
dlg_lists = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int AskFilename(HWND hwnd, bx_param_filename_c *param, char *buffer)
|
||||
{
|
||||
OPENFILENAME ofn;
|
||||
int ret;
|
||||
DWORD errcode;
|
||||
char filename[BX_PATHNAME_LEN];
|
||||
const char *title, *ext;
|
||||
char errtext[80];
|
||||
|
||||
if (buffer != NULL) {
|
||||
lstrcpyn(filename, buffer, BX_PATHNAME_LEN);
|
||||
} else {
|
||||
param->get(filename, BX_PATHNAME_LEN);
|
||||
}
|
||||
// common file dialogs don't accept raw device names
|
||||
if ((isalpha(filename[0])) && (filename[1] == ':') && (strlen(filename) == 2)) {
|
||||
filename[0] = 0;
|
||||
}
|
||||
title = param->get_label();
|
||||
ext = param->get_extension();
|
||||
if (!title) title = param->get_name();
|
||||
memset(&ofn, 0, sizeof(OPENFILENAME));
|
||||
ofn.lStructSize = sizeof(OPENFILENAME);
|
||||
ofn.hwndOwner = hwnd;
|
||||
ofn.lpstrFile = filename;
|
||||
ofn.nMaxFile = MAX_PATH;
|
||||
ofn.lpstrInitialDir = bx_startup_flags.initial_dir;
|
||||
ofn.lpstrTitle = title;
|
||||
ofn.Flags = OFN_EXPLORER | OFN_HIDEREADONLY;
|
||||
ofn.lpstrDefExt = ext;
|
||||
if (!lstrcmp(ext, "bxrc")) {
|
||||
ofn.lpstrFilter = "Bochs config files (*.bxrc)\0*.bxrc\0All files (*.*)\0*.*\0";
|
||||
} else if (!lstrcmp(ext, "img")) {
|
||||
ofn.lpstrFilter = "Disk image files (*.img)\0*.img\0All files (*.*)\0*.*\0";
|
||||
} else if (!lstrcmp(ext, "iso")) {
|
||||
ofn.lpstrFilter = "CD-ROM image files (*.iso)\0*.iso\0All files (*.*)\0*.*\0";
|
||||
} else if (!lstrcmp(ext, "log")) {
|
||||
ofn.lpstrFilter = "Log files (*.log)\0*.log\0All files (*.*)\0*.*\0";
|
||||
} else if (!lstrcmp(ext, "map")) {
|
||||
ofn.lpstrFilter = "Keymap files (*.map)\0*.map\0All files (*.*)\0*.*\0";
|
||||
} else if (!lstrcmp(ext, "txt")) {
|
||||
ofn.lpstrFilter = "Text files (*.txt)\0*.txt\0All files (*.*)\0*.*\0";
|
||||
} else {
|
||||
ofn.lpstrFilter = "All files (*.*)\0*.*\0";
|
||||
}
|
||||
if (param->get_options() & param->SAVE_FILE_DIALOG) {
|
||||
ofn.Flags |= OFN_OVERWRITEPROMPT;
|
||||
ret = GetSaveFileName(&ofn);
|
||||
} else {
|
||||
ofn.Flags |= OFN_FILEMUSTEXIST;
|
||||
ret = GetOpenFileName(&ofn);
|
||||
}
|
||||
if (buffer != NULL) {
|
||||
lstrcpyn(buffer, filename, BX_PATHNAME_LEN);
|
||||
} else {
|
||||
param->set(filename);
|
||||
}
|
||||
if (ret == 0) {
|
||||
errcode = CommDlgExtendedError();
|
||||
if (errcode == 0) {
|
||||
ret = -1;
|
||||
} else {
|
||||
if (errcode == 0x3002) {
|
||||
wsprintf(errtext, "CommDlgExtendedError: invalid filename");
|
||||
} else {
|
||||
wsprintf(errtext, "CommDlgExtendedError returns 0x%04x", errcode);
|
||||
}
|
||||
MessageBox(hwnd, errtext, "Error", MB_ICONERROR);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
void InitDlgFont(void)
|
||||
{
|
||||
LOGFONT LFont;
|
||||
|
||||
LFont.lfHeight = 8; // Default logical height of font
|
||||
LFont.lfWidth = 0; // Default logical average character width
|
||||
LFont.lfEscapement = 0; // angle of escapement
|
||||
LFont.lfOrientation = 0; // base-line orientation angle
|
||||
LFont.lfWeight = FW_NORMAL; // font weight
|
||||
LFont.lfItalic = 0; // italic attribute flag
|
||||
LFont.lfUnderline = 0; // underline attribute flag
|
||||
LFont.lfStrikeOut = 0; // strikeout attribute flag
|
||||
LFont.lfCharSet = DEFAULT_CHARSET; // character set identifier
|
||||
LFont.lfOutPrecision = OUT_DEFAULT_PRECIS; // output precision
|
||||
LFont.lfClipPrecision = CLIP_DEFAULT_PRECIS; // clipping precision
|
||||
LFont.lfQuality = DEFAULT_QUALITY; // output quality
|
||||
LFont.lfPitchAndFamily = DEFAULT_PITCH; // pitch and family
|
||||
lstrcpy(LFont.lfFaceName, "Helv"); // pointer to typeface name string
|
||||
DlgFont = CreateFontIndirect(&LFont);
|
||||
}
|
||||
|
||||
LRESULT CALLBACK EditHexWndProc(HWND Window, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (msg == WM_CHAR) {
|
||||
switch (wParam) {
|
||||
case 0x08:
|
||||
break;
|
||||
case 'x':
|
||||
break;
|
||||
default:
|
||||
if ((wParam < '0') || ((wParam > '9') && (wParam < 'A')) ||
|
||||
((wParam > 'F') && (wParam < 'a')) || (wParam > 'f')) {
|
||||
MessageBeep(MB_OK);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
return CallWindowProc(DefEditWndProc, Window, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
HWND CreateLabel(HWND hDlg, UINT cid, UINT xpos, UINT ypos, BOOL hide, const char *text)
|
||||
{
|
||||
HWND Label;
|
||||
RECT r;
|
||||
int code;
|
||||
|
||||
code = ID_LABEL + cid;
|
||||
r.left = xpos;
|
||||
r.top = ypos + 2;
|
||||
r.right = r.left + 78;
|
||||
r.bottom = r.top + 15;
|
||||
MapDialogRect(hDlg, &r);
|
||||
Label = CreateWindow("STATIC", text, WS_CHILD, r.left, r.top, r.right-r.left+1, r.bottom-r.top+1, hDlg, (HMENU)code, NULL, NULL);
|
||||
SendMessage(Label, WM_SETFONT, (WPARAM)DlgFont, TRUE);
|
||||
ShowWindow(Label, hide ? SW_HIDE : SW_SHOW);
|
||||
return Label;
|
||||
}
|
||||
|
||||
HWND CreateGroupbox(HWND hDlg, UINT cid, UINT xpos, UINT ypos, SIZE size, BOOL hide, bx_list_c *list)
|
||||
{
|
||||
HWND Groupbox;
|
||||
RECT r;
|
||||
int code;
|
||||
const char *title = NULL;
|
||||
|
||||
code = ID_PARAM + cid;
|
||||
r.left = xpos;
|
||||
r.top = ypos;
|
||||
r.right = r.left + size.cx;
|
||||
r.bottom = r.top + size.cy;
|
||||
MapDialogRect(hDlg, &r);
|
||||
if (list->get_options() & list->USE_BOX_TITLE) {
|
||||
title = list->get_title()->getptr();
|
||||
}
|
||||
Groupbox = CreateWindow("BUTTON", title, BS_GROUPBOX | WS_CHILD, r.left, r.top,
|
||||
r.right-r.left+1, r.bottom-r.top+1, hDlg, (HMENU)code, NULL, NULL);
|
||||
SendMessage(Groupbox, WM_SETFONT, (WPARAM)DlgFont, TRUE);
|
||||
ShowWindow(Groupbox, hide ? SW_HIDE : SW_SHOW);
|
||||
return Groupbox;
|
||||
}
|
||||
|
||||
HWND CreateTabControl(HWND hDlg, UINT cid, UINT xpos, UINT ypos, SIZE size, BOOL hide, bx_list_c *list)
|
||||
{
|
||||
HWND TabControl;
|
||||
TC_ITEM tie;
|
||||
RECT r;
|
||||
int code, i;
|
||||
bx_param_c *item;
|
||||
|
||||
code = ID_PARAM + cid;
|
||||
r.left = xpos;
|
||||
r.top = ypos;
|
||||
r.right = r.left + size.cx;
|
||||
r.bottom = r.top + size.cy;
|
||||
MapDialogRect(hDlg, &r);
|
||||
TabControl = CreateWindow(WC_TABCONTROL, "", WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE,
|
||||
r.left, r.top, r.right-r.left+1, r.bottom-r.top+1, hDlg, (HMENU)code, NULL, NULL);
|
||||
for (i = 0; i < list->get_size(); i++) {
|
||||
item = list->get(i);
|
||||
if (item->get_type() == BXT_LIST) {
|
||||
tie.mask = TCIF_TEXT;
|
||||
tie.pszText = ((bx_list_c*)item)->get_title()->getptr();
|
||||
TabCtrl_InsertItem(TabControl, i, &tie);
|
||||
}
|
||||
}
|
||||
TabCtrl_SetCurSel(TabControl, 0);
|
||||
SendMessage(TabControl, WM_SETFONT, (WPARAM)DlgFont, TRUE);
|
||||
ShowWindow(TabControl, hide ? SW_HIDE : SW_SHOW);
|
||||
return TabControl;
|
||||
}
|
||||
|
||||
|
||||
HWND CreateBrowseButton(HWND hDlg, UINT cid, UINT xpos, UINT ypos, BOOL hide)
|
||||
{
|
||||
HWND Button;
|
||||
RECT r;
|
||||
int code;
|
||||
|
||||
code = ID_BROWSE + cid;
|
||||
r.left = xpos + 190;
|
||||
r.top = ypos;
|
||||
r.right = r.left + 50;
|
||||
r.bottom = r.top + 14;
|
||||
MapDialogRect(hDlg, &r);
|
||||
Button = CreateWindow("BUTTON", "Browse...", WS_CHILD, r.left, r.top, r.right-r.left+1, r.bottom-r.top+1, hDlg, (HMENU)code, NULL, NULL);
|
||||
SendMessage(Button, WM_SETFONT, (WPARAM)DlgFont, TRUE);
|
||||
ShowWindow(Button, hide ? SW_HIDE : SW_SHOW);
|
||||
return Button;
|
||||
}
|
||||
|
||||
HWND CreateCheckbox(HWND hDlg, UINT cid, UINT xpos, UINT ypos, BOOL hide, bx_param_bool_c *bparam)
|
||||
{
|
||||
HWND Checkbox;
|
||||
RECT r;
|
||||
int code, val;
|
||||
|
||||
code = ID_PARAM + cid;
|
||||
r.left = xpos + 80;
|
||||
r.top = ypos;
|
||||
r.right = r.left + 20;
|
||||
r.bottom = r.top + 14;
|
||||
MapDialogRect(hDlg, &r);
|
||||
Checkbox = CreateWindow("BUTTON", "", BS_AUTOCHECKBOX | WS_CHILD | WS_TABSTOP,
|
||||
r.left, r.top, r.right-r.left+1, r.bottom-r.top+1,
|
||||
hDlg, (HMENU)code, NULL, NULL);
|
||||
val = bparam->get();
|
||||
SendMessage(Checkbox, BM_SETCHECK, val ? BST_CHECKED : BST_UNCHECKED, 0);
|
||||
SendMessage(Checkbox, WM_SETFONT, (WPARAM)DlgFont, TRUE);
|
||||
ShowWindow(Checkbox, hide ? SW_HIDE : SW_SHOW);
|
||||
return Checkbox;
|
||||
}
|
||||
|
||||
HWND CreateInput(HWND hDlg, UINT cid, UINT xpos, UINT ypos, BOOL hide, bx_param_c *param)
|
||||
{
|
||||
HWND Input, Updown;
|
||||
RECT r;
|
||||
int code, i, style;
|
||||
bx_param_num_c *nparam = NULL;
|
||||
bx_param_string_c *sparam;
|
||||
char buffer[512];
|
||||
char eachbyte[16];
|
||||
char sep_string[2];
|
||||
char *val;
|
||||
BOOL spinctrl = FALSE, hexedit = FALSE;
|
||||
|
||||
code = ID_PARAM + cid;
|
||||
style = WS_CHILD | WS_TABSTOP;
|
||||
if (param->get_type() == BXT_PARAM_STRING) {
|
||||
sparam = (bx_param_string_c*)param;
|
||||
val = sparam->getptr();
|
||||
if (sparam->get_options() & sparam->RAW_BYTES) {
|
||||
buffer[0] = 0;
|
||||
sep_string[0] = sparam->get_separator();
|
||||
sep_string[1] = 0;
|
||||
for (i = 0; i < sparam->get_maxsize(); i++) {
|
||||
wsprintf(eachbyte, "%s%02x", (i>0)?sep_string : "", (Bit8u)0xff&val[i]);
|
||||
strncat(buffer, eachbyte, sizeof(buffer));
|
||||
}
|
||||
} else {
|
||||
lstrcpyn(buffer, val, 512);
|
||||
style |= ES_AUTOHSCROLL;
|
||||
}
|
||||
} else {
|
||||
nparam = (bx_param_num_c*)param;
|
||||
if (nparam->get_base() == BASE_HEX) {
|
||||
wsprintf(buffer, "0x%x", nparam->get());
|
||||
hexedit = TRUE;
|
||||
} else {
|
||||
wsprintf(buffer, "%d", nparam->get());
|
||||
style |= ES_NUMBER;
|
||||
}
|
||||
if (nparam->get_options() & nparam->USE_SPIN_CONTROL) {
|
||||
spinctrl = TRUE;
|
||||
}
|
||||
}
|
||||
r.left = xpos + 80;
|
||||
r.top = ypos;
|
||||
r.right = r.left + 100;
|
||||
r.bottom = r.top + 14;
|
||||
MapDialogRect(hDlg, &r);
|
||||
Input = CreateWindowEx(WS_EX_CLIENTEDGE | WS_EX_NOPARENTNOTIFY, "EDIT", buffer,
|
||||
style, r.left, r.top, r.right-r.left+1,
|
||||
r.bottom-r.top+1, hDlg, (HMENU)code, NULL, NULL);
|
||||
if (hexedit) {
|
||||
#ifndef _WIN64
|
||||
DefEditWndProc = (WNDPROC)SetWindowLong(Input, GWL_WNDPROC, (long)EditHexWndProc);
|
||||
#else
|
||||
DefEditWndProc = (WNDPROC)SetWindowLongPtr(Input, GWLP_WNDPROC, (LONG_PTR)EditHexWndProc);
|
||||
#endif
|
||||
}
|
||||
if (spinctrl) {
|
||||
style = WS_CHILD | WS_BORDER | WS_VISIBLE | UDS_NOTHOUSANDS | UDS_ARROWKEYS |
|
||||
UDS_ALIGNRIGHT | UDS_SETBUDDYINT;
|
||||
Updown = CreateUpDownControl(style, 0, 0, 0, 0, hDlg, ID_UPDOWN + cid, NULL, Input,
|
||||
(int)nparam->get_max(), (int)nparam->get_min(), (int)nparam->get());
|
||||
ShowWindow(Updown, hide ? SW_HIDE : SW_SHOW);
|
||||
}
|
||||
SendMessage(Input, WM_SETFONT, (WPARAM)DlgFont, TRUE);
|
||||
ShowWindow(Input, hide ? SW_HIDE : SW_SHOW);
|
||||
return Input;
|
||||
}
|
||||
|
||||
HWND CreateCombobox(HWND hDlg, UINT cid, UINT xpos, UINT ypos, BOOL hide, bx_param_enum_c *eparam)
|
||||
{
|
||||
HWND Combo;
|
||||
RECT r;
|
||||
int code, j;
|
||||
const char *choice;
|
||||
|
||||
code = ID_PARAM + cid;
|
||||
r.left = xpos + 80;
|
||||
r.top = ypos;
|
||||
r.right = r.left + 100;
|
||||
r.bottom = r.top + 14;
|
||||
MapDialogRect(hDlg, &r);
|
||||
Combo = CreateWindow("COMBOBOX", "", WS_CHILD | WS_TABSTOP | WS_VSCROLL | CBS_DROPDOWNLIST,
|
||||
r.left, r.top, r.right-r.left+1, r.bottom-r.top+1, hDlg, (HMENU)code, NULL, NULL);
|
||||
j = 0;
|
||||
do {
|
||||
choice = eparam->get_choice(j);
|
||||
SendMessage(Combo, CB_ADDSTRING, 0, (LPARAM)choice);
|
||||
j++;
|
||||
} while (choice != NULL);
|
||||
SendMessage(Combo, CB_SETCURSEL, (WPARAM)(eparam->get()-eparam->get_min()), 0);
|
||||
SendMessage(Combo, WM_SETFONT, (WPARAM)DlgFont, TRUE);
|
||||
ShowWindow(Combo, hide ? SW_HIDE : SW_SHOW);
|
||||
return Combo;
|
||||
}
|
||||
|
||||
void EnableParam(HWND hDlg, UINT cid, bx_param_c *param, BOOL val)
|
||||
{
|
||||
HWND Button, Updown;
|
||||
|
||||
if (cid == 0) {
|
||||
cid = findDlgIDFromParam(param);
|
||||
}
|
||||
if (param->get_type() != BXT_LIST) {
|
||||
EnableWindow(GetDlgItem(hDlg, ID_LABEL + cid), val);
|
||||
EnableWindow(GetDlgItem(hDlg, ID_PARAM + cid), val);
|
||||
Button = GetDlgItem(hDlg, ID_BROWSE + cid);
|
||||
if (Button != NULL) {
|
||||
EnableWindow(Button, val);
|
||||
}
|
||||
Updown = GetDlgItem(hDlg, ID_UPDOWN + cid);
|
||||
if (Updown != NULL) {
|
||||
EnableWindow(Updown, val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SIZE CreateParamList(HWND hDlg, UINT lid, UINT xpos, UINT ypos, BOOL hide, bx_list_c *list)
|
||||
{
|
||||
HWND ltext, control = NULL, browse;
|
||||
SIZE size, lsize;
|
||||
bx_param_c *param;
|
||||
bx_param_string_c *sparam;
|
||||
const char *label;
|
||||
char buffer[512];
|
||||
int options;
|
||||
UINT cid, i, items, x, y;
|
||||
BOOL ihide;
|
||||
|
||||
items = list->get_size();
|
||||
options = list->get_options();
|
||||
cid = registerDlgList(lid, list);
|
||||
x = xpos + 5;
|
||||
size.cx = 195;
|
||||
if (options & list->USE_TAB_WINDOW) {
|
||||
y = ypos + 15;
|
||||
size.cy = 18;
|
||||
} else {
|
||||
y = ypos + 10;
|
||||
size.cy = 13;
|
||||
}
|
||||
for (i = 0; i < items; i++) {
|
||||
param = list->get(i);
|
||||
if (!SIM->get_init_done() || (param->get_enabled() && param->get_runtime_param())) {
|
||||
ltext = NULL;
|
||||
browse = NULL;
|
||||
ihide = hide || ((i != 0) && (options & list->USE_TAB_WINDOW));
|
||||
if (param->get_type() == BXT_LIST) {
|
||||
lsize = CreateParamList(hDlg, cid, x + 4, y + 1, ihide, (bx_list_c*)param);
|
||||
if ((lsize.cx + 18) > size.cx) {
|
||||
size.cx = lsize.cx + 18;
|
||||
}
|
||||
if (!(options & list->USE_TAB_WINDOW)) {
|
||||
y += (lsize.cy + 6);
|
||||
size.cy += (lsize.cy + 6);
|
||||
} else {
|
||||
if ((lsize.cy + 24) > size.cy) {
|
||||
size.cy = lsize.cy + 24;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
label = param->get_label();
|
||||
if (label == NULL) {
|
||||
label = param->get_name();
|
||||
}
|
||||
if ((options & list->SHOW_GROUP_NAME) && (param->get_group() != NULL)) {
|
||||
wsprintf(buffer, "%s %s", param->get_group(), label);
|
||||
} else {
|
||||
lstrcpyn(buffer, label, 512);
|
||||
}
|
||||
ltext = CreateLabel(hDlg, cid, x, y, hide, buffer);
|
||||
if (param->get_type() == BXT_PARAM_BOOL) {
|
||||
control = CreateCheckbox(hDlg, cid, x, y, hide, (bx_param_bool_c*)param);
|
||||
} else if (param->get_type() == BXT_PARAM_ENUM) {
|
||||
control = CreateCombobox(hDlg, cid, x, y, hide, (bx_param_enum_c*)param);
|
||||
} else if (param->get_type() == BXT_PARAM_NUM) {
|
||||
control = CreateInput(hDlg, cid, x, y, hide, param);
|
||||
} else if (param->get_type() == BXT_PARAM_STRING) {
|
||||
control = CreateInput(hDlg, cid, x, y, hide, param);
|
||||
sparam = (bx_param_string_c*)param;
|
||||
if (sparam->get_options() & sparam->IS_FILENAME) {
|
||||
browse = CreateBrowseButton(hDlg, cid, x, y, hide);
|
||||
if (size.cx < 255) size.cx = 255;
|
||||
}
|
||||
}
|
||||
if (!param->get_enabled()) {
|
||||
EnableParam(hDlg, cid, param, FALSE);
|
||||
}
|
||||
y += 20;
|
||||
size.cy += 20;
|
||||
}
|
||||
}
|
||||
cid++;
|
||||
}
|
||||
if (options & list->USE_TAB_WINDOW) {
|
||||
CreateTabControl(hDlg, lid, xpos, ypos, size, hide, list);
|
||||
} else {
|
||||
CreateGroupbox(hDlg, lid, xpos, ypos, size, hide, list);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
|
||||
void SetParamList(HWND hDlg, bx_list_c *list)
|
||||
{
|
||||
bx_param_c *param;
|
||||
bx_param_num_c *nparam;
|
||||
bx_param_enum_c *eparam;
|
||||
bx_param_string_c *sparam;
|
||||
int j;
|
||||
LRESULT val;
|
||||
const char *src;
|
||||
char buffer[512], rawbuf[512];
|
||||
UINT cid, i, items, lid;
|
||||
|
||||
lid = findDlgListBaseID(list);
|
||||
items = list->get_size();
|
||||
for (i = 0; i < items; i++) {
|
||||
cid = lid + i;
|
||||
param = list->get(i);
|
||||
if (param->get_enabled() && (!SIM->get_init_done() || (SIM->get_init_done() && param->get_runtime_param()))) {
|
||||
if (param->get_type() == BXT_LIST) {
|
||||
SetParamList(hDlg, (bx_list_c*)param);
|
||||
} else if (param->get_type() == BXT_PARAM_BOOL) {
|
||||
val = SendMessage(GetDlgItem(hDlg, ID_PARAM + cid), BM_GETCHECK, 0, 0);
|
||||
((bx_param_bool_c*)param)->set(val == BST_CHECKED);
|
||||
} else if (param->get_type() == BXT_PARAM_ENUM) {
|
||||
val = SendMessage(GetDlgItem(hDlg, ID_PARAM + cid), CB_GETCURSEL, 0, 0);
|
||||
eparam = (bx_param_enum_c*)param;
|
||||
eparam->set(val + eparam->get_min());
|
||||
} else {
|
||||
if (SendMessage(GetDlgItem(hDlg, ID_PARAM + cid), EM_GETMODIFY, 0, 0)) {
|
||||
if (param->get_type() == BXT_PARAM_NUM) {
|
||||
nparam = (bx_param_num_c*)param;
|
||||
if (nparam->get_base() == BASE_HEX) {
|
||||
GetWindowText(GetDlgItem(hDlg, ID_PARAM + cid), buffer, 511);
|
||||
sscanf(buffer, "%x", &val);
|
||||
} else {
|
||||
val = GetDlgItemInt(hDlg, ID_PARAM + cid, NULL, FALSE);
|
||||
}
|
||||
nparam->set(val);
|
||||
} else if (param->get_type() == BXT_PARAM_STRING) {
|
||||
GetWindowText(GetDlgItem(hDlg, ID_PARAM + cid), buffer, 511);
|
||||
sparam = (bx_param_string_c*)param;
|
||||
if (sparam->get_options() & sparam->RAW_BYTES) {
|
||||
src = &buffer[0];
|
||||
memset(rawbuf, 0, sparam->get_maxsize());
|
||||
for (j = 0; j < sparam->get_maxsize(); j++) {
|
||||
while (*src == sparam->get_separator())
|
||||
src++;
|
||||
if (*src == 0) break;
|
||||
if (sscanf(src, "%02x", &val)) {
|
||||
rawbuf[j] = (char) val;
|
||||
src += 2;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
sparam->set(rawbuf);
|
||||
} else {
|
||||
sparam->set(buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((i + 1) >= (UINT)list->get_size()) break;
|
||||
}
|
||||
}
|
||||
|
||||
void ShowParamList(HWND hDlg, UINT lid, BOOL show, bx_list_c *list)
|
||||
{
|
||||
UINT cid;
|
||||
int i;
|
||||
HWND Button, Updown;
|
||||
BOOL ishow;
|
||||
|
||||
ShowWindow(GetDlgItem(hDlg, ID_PARAM + lid), show ? SW_SHOW : SW_HIDE);
|
||||
cid = findDlgListBaseID(list);
|
||||
for (i = 0; i < list->get_size(); i++) {
|
||||
if (list->get(i)->get_type() == BXT_LIST) {
|
||||
ishow = show;
|
||||
if (list->get_options() & list->USE_TAB_WINDOW) {
|
||||
ishow &= (i == 0);
|
||||
}
|
||||
ShowParamList(hDlg, cid + i, ishow, (bx_list_c*)list->get(i));
|
||||
} else {
|
||||
ShowWindow(GetDlgItem(hDlg, ID_LABEL + cid + i), show ? SW_SHOW : SW_HIDE);
|
||||
ShowWindow(GetDlgItem(hDlg, ID_PARAM + cid + i), show ? SW_SHOW : SW_HIDE);
|
||||
Button = GetDlgItem(hDlg, ID_BROWSE + cid + i);
|
||||
if (Button != NULL) {
|
||||
ShowWindow(Button, show ? SW_SHOW : SW_HIDE);
|
||||
}
|
||||
Updown = GetDlgItem(hDlg, ID_UPDOWN + cid + i);
|
||||
if (Updown != NULL) {
|
||||
ShowWindow(Updown, show ? SW_SHOW : SW_HIDE);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void ProcessDependentList(HWND hDlg, bx_param_c *param, BOOL enabled)
|
||||
{
|
||||
UINT cid;
|
||||
bx_list_c *deplist;
|
||||
bx_param_c *dparam;
|
||||
bx_param_enum_c *eparam;
|
||||
Bit64s value;
|
||||
Bit64u enable_bitmap, mask;
|
||||
char buffer[BX_PATHNAME_LEN];
|
||||
int i;
|
||||
BOOL en;
|
||||
|
||||
deplist = param->get_dependent_list();
|
||||
if (deplist != NULL) {
|
||||
cid = findDlgIDFromParam(param);
|
||||
if (param->get_type() == BXT_PARAM_ENUM) {
|
||||
eparam = (bx_param_enum_c*)param;
|
||||
value = SendMessage(GetDlgItem(hDlg, ID_PARAM + cid), CB_GETCURSEL, 0, 0);
|
||||
enable_bitmap = eparam->get_dependent_bitmap(value + eparam->get_min());
|
||||
mask = 0x1;
|
||||
for (i = 0; i < deplist->get_size(); i++) {
|
||||
dparam = deplist->get(i);
|
||||
if (dparam != param) {
|
||||
en = (enable_bitmap & mask) && enabled;
|
||||
cid = findDlgIDFromParam(dparam);
|
||||
if (en != IsWindowEnabled(GetDlgItem(hDlg, ID_PARAM + cid))) {
|
||||
ProcessDependentList(hDlg, dparam, en);
|
||||
EnableParam(hDlg, 0, dparam, en);
|
||||
}
|
||||
}
|
||||
mask <<= 1;
|
||||
}
|
||||
} else if ((param->get_type() == BXT_PARAM_BOOL) ||
|
||||
(param->get_type() == BXT_PARAM_NUM) ||
|
||||
(param->get_type() == BXT_PARAM_STRING)) {
|
||||
if (param->get_type() == BXT_PARAM_BOOL) {
|
||||
value = SendMessage(GetDlgItem(hDlg, ID_PARAM + cid), BM_GETCHECK, 0, 0);
|
||||
} else if (param->get_type() == BXT_PARAM_NUM) {
|
||||
value = GetDlgItemInt(hDlg, ID_PARAM + cid, NULL, FALSE);
|
||||
} else {
|
||||
GetWindowText(GetDlgItem(hDlg, ID_PARAM + cid), buffer, BX_PATHNAME_LEN);
|
||||
value = (lstrlen(buffer) > 0) && (strcmp(buffer, "none"));
|
||||
}
|
||||
for (i = 0; i < deplist->get_size(); i++) {
|
||||
dparam = deplist->get(i);
|
||||
if (dparam != param) {
|
||||
en = (value && enabled);
|
||||
cid = findDlgIDFromParam(dparam);
|
||||
if (en != IsWindowEnabled(GetDlgItem(hDlg, ID_PARAM + cid))) {
|
||||
ProcessDependentList(hDlg, dparam, en);
|
||||
EnableParam(hDlg, 0, dparam, en);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static INT_PTR CALLBACK ParamDlgProc(HWND Window, UINT AMessage, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static bx_list_c *list = NULL;
|
||||
static int items = 0;
|
||||
bx_param_c *param;
|
||||
bx_param_string_c *sparam;
|
||||
bx_list_c *tmplist;
|
||||
int cid;
|
||||
UINT_PTR code, id;
|
||||
UINT i, j, k;
|
||||
RECT r, r2;
|
||||
SIZE size;
|
||||
NMHDR nmhdr;
|
||||
char fname[BX_PATHNAME_LEN];
|
||||
|
||||
switch (AMessage) {
|
||||
case WM_CLOSE:
|
||||
cleanupDlgLists();
|
||||
EndDialog(Window, -1);
|
||||
break;
|
||||
case WM_INITDIALOG:
|
||||
list = (bx_list_c*)SIM->get_param((const char*)lParam);
|
||||
items = list->get_size();
|
||||
SetWindowText(Window, list->get_title()->getptr());
|
||||
nextDlgID = 1;
|
||||
size = CreateParamList(Window, 0, 6, 6, FALSE, list);
|
||||
r.left = size.cx / 2 - 50;
|
||||
r.top = size.cy + 12;
|
||||
r.right = r.left + 50;
|
||||
r.bottom = r.top + 14;
|
||||
MapDialogRect(Window, &r);
|
||||
MoveWindow(GetDlgItem(Window, IDOK), r.left, r.top, r.right-r.left+1, r.bottom-r.top+1, FALSE);
|
||||
r.left = size.cx / 2 + 10;
|
||||
r.top = size.cy + 12;
|
||||
r.right = r.left + 50;
|
||||
r.bottom = r.top + 14;
|
||||
MapDialogRect(Window, &r);
|
||||
MoveWindow(GetDlgItem(Window, IDCANCEL), r.left, r.top, r.right-r.left+1, r.bottom-r.top+1, FALSE);
|
||||
GetWindowRect(Window, &r2);
|
||||
r.left = 0;
|
||||
r.top = 0;
|
||||
r.right = size.cx + 18;
|
||||
r.bottom = size.cy + 52;
|
||||
MapDialogRect(Window, &r);
|
||||
MoveWindow(Window, r2.left, r2.top, r.right, r.bottom, TRUE);
|
||||
return TRUE;
|
||||
case WM_COMMAND:
|
||||
code = LOWORD(wParam);
|
||||
switch (code) {
|
||||
case IDCANCEL:
|
||||
cleanupDlgLists();
|
||||
EndDialog(Window, -1);
|
||||
break;
|
||||
case IDOK:
|
||||
SetParamList(Window, list);
|
||||
cleanupDlgLists();
|
||||
EndDialog(Window, 1);
|
||||
break;
|
||||
default:
|
||||
if ((code >= ID_BROWSE) && (code < (int)(ID_BROWSE + nextDlgID))) {
|
||||
i = (UINT)(code - ID_BROWSE);
|
||||
sparam = (bx_param_string_c *)findParamFromDlgID(i);
|
||||
if (sparam != NULL) {
|
||||
GetDlgItemText(Window, ID_PARAM + i, fname, BX_PATHNAME_LEN);
|
||||
if (AskFilename(Window, (bx_param_filename_c *)sparam, fname) > 0) {
|
||||
SetWindowText(GetDlgItem(Window, ID_PARAM + i), fname);
|
||||
SendMessage(GetDlgItem(Window, ID_PARAM + i), EM_SETMODIFY, 1, 0);
|
||||
SetFocus(GetDlgItem(Window, ID_PARAM + i));
|
||||
}
|
||||
}
|
||||
} else if ((code >= ID_PARAM) && (code < (int)(ID_PARAM + nextDlgID))) {
|
||||
i = (UINT)(code - ID_PARAM);
|
||||
param = findParamFromDlgID(i);
|
||||
if (param != NULL) {
|
||||
ProcessDependentList(Window, param, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_NOTIFY:
|
||||
nmhdr = *(LPNMHDR)lParam;
|
||||
code = nmhdr.code;
|
||||
id = nmhdr.idFrom;
|
||||
if (code == (UINT)TCN_SELCHANGE) {
|
||||
j = (UINT)(id - ID_PARAM);
|
||||
tmplist = (bx_list_c *)findParamFromDlgID(j);
|
||||
if (tmplist != NULL) {
|
||||
k = (UINT)TabCtrl_GetCurSel(GetDlgItem(Window, id));
|
||||
cid = findDlgListBaseID(tmplist);
|
||||
for (i = 0; i < (UINT)tmplist->get_size(); i++) {
|
||||
ShowParamList(Window, cid + i, (i == k), (bx_list_c*)tmplist->get(i));
|
||||
}
|
||||
}
|
||||
} else if (code == (UINT)UDN_DELTAPOS) {
|
||||
if (id >= ID_UPDOWN) {
|
||||
PostMessage(GetDlgItem(Window, ID_PARAM + (id - ID_UPDOWN)), EM_SETMODIFY, TRUE, 0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case WM_CTLCOLOREDIT:
|
||||
SetTextColor((HDC)wParam, GetSysColor(COLOR_WINDOWTEXT));
|
||||
return (INT_PTR)GetSysColorBrush(COLOR_WINDOW);
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int win32ParamDialog(HWND parent, const char *menu)
|
||||
{
|
||||
INT_PTR ret;
|
||||
|
||||
InitDlgFont();
|
||||
ret = DialogBoxParam(NULL, MAKEINTRESOURCE(PARAM_DLG), parent, (DLGPROC)ParamDlgProc, (LPARAM)menu);
|
||||
DeleteObject(DlgFont);
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif // BX_USE_TEXTCONFIG && defined(WIN32)
|
||||
33
simulators/bochs/gui/win32paramdlg.h
Normal file
33
simulators/bochs/gui/win32paramdlg.h
Normal file
@ -0,0 +1,33 @@
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2009 Volker Ruppert
|
||||
//
|
||||
// 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
|
||||
|
||||
#ifndef BX_WIN32_PARAMDLG_H
|
||||
#define BX_WIN32_PARAMDLG_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if BX_USE_TEXTCONFIG && defined(WIN32)
|
||||
|
||||
int AskFilename(HWND hwnd, bx_param_filename_c *param, char *buffer);
|
||||
int win32ParamDialog(HWND parent, const char *menu);
|
||||
|
||||
#endif
|
||||
|
||||
#endif // BX_WIN32_PARAMDLG_H
|
||||
47
simulators/bochs/gui/win32res.h
Normal file
47
simulators/bochs/gui/win32res.h
Normal file
@ -0,0 +1,47 @@
|
||||
#define ICON_BOCHS 1000
|
||||
|
||||
#define MAINMENU_DLG 1100
|
||||
#define IDCONFIG 1110
|
||||
#define IDREADRC 1120
|
||||
#define IDWRITERC 1130
|
||||
#define IDEDITCFG 1140
|
||||
#define IDRESETCFG 1150
|
||||
#define IDEDITGRP 1160
|
||||
#define IDEDITBOX 1170
|
||||
#define IDSIMU 1180
|
||||
#define IDRESTORE 1190
|
||||
#define LOGOPT_DLG 1200
|
||||
#define IDDEVLIST 1210
|
||||
#define IDLOGLBL1 1221
|
||||
#define IDLOGLBL2 1222
|
||||
#define IDLOGLBL3 1223
|
||||
#define IDLOGLBL4 1224
|
||||
#define IDLOGLBL5 1225
|
||||
#define IDLOGEVT1 1231
|
||||
#define IDLOGEVT2 1232
|
||||
#define IDLOGEVT3 1233
|
||||
#define IDLOGEVT4 1234
|
||||
#define IDLOGEVT5 1235
|
||||
#define IDADVLOGOPT 1240
|
||||
#define IDAPPLY 1250
|
||||
#define ASK_DLG 2000
|
||||
#define IDASKTX1 2010
|
||||
#define IDASKDEV 2020
|
||||
#define IDASKTX2 2030
|
||||
#define IDASKMSG 2040
|
||||
#define IDASKLIST 2050
|
||||
#define STRING_DLG 2100
|
||||
#define IDSTRING 2110
|
||||
#define FLOPPY_DLG 2200
|
||||
#define IDDEVTX 2205
|
||||
#define IDDEVTYPE 2210
|
||||
#define IDPATHTX 2215
|
||||
#define IDPATH 2220
|
||||
#define IDBROWSE 2230
|
||||
#define IDMEDIATX 2235
|
||||
#define IDMEDIATYPE 2240
|
||||
#define IDSTATUS 2250
|
||||
#define IDREADONLY 2255
|
||||
#define IDCREATE 2260
|
||||
#define IDCHANGETX 2265
|
||||
#define PARAM_DLG 2800
|
||||
1708
simulators/bochs/gui/wx.cc
Normal file
1708
simulators/bochs/gui/wx.cc
Normal file
File diff suppressed because it is too large
Load Diff
1667
simulators/bochs/gui/wxdialog.cc
Normal file
1667
simulators/bochs/gui/wxdialog.cc
Normal file
File diff suppressed because it is too large
Load Diff
896
simulators/bochs/gui/wxdialog.h
Normal file
896
simulators/bochs/gui/wxdialog.h
Normal file
@ -0,0 +1,896 @@
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
// wxWidgets dialogs for Bochs
|
||||
|
||||
#include <wx/spinctrl.h>
|
||||
#include <wx/notebook.h>
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// text messages used in several places
|
||||
////////////////////////////////////////////////////////////////////
|
||||
#define MSG_NO_HELP wxT("No help is available yet.")
|
||||
#define MSG_NO_HELP_CAPTION wxT("No help")
|
||||
#define MSG_ENABLED wxT("Enabled")
|
||||
#define BTNLABEL_HELP wxT("Help")
|
||||
#define BTNLABEL_CANCEL wxT("Cancel")
|
||||
#define BTNLABEL_OK wxT("Ok")
|
||||
#define BTNLABEL_CREATE_IMG wxT("Create Image")
|
||||
#define BTNLABEL_BROWSE wxT("<--Browse")
|
||||
#define BTNLABEL_DEBUG_CONTINUE wxT("Continue")
|
||||
#define BTNLABEL_DEBUG_STOP wxT("Stop")
|
||||
#define BTNLABEL_DEBUG_STEP wxT("Step")
|
||||
#define BTNLABEL_DEBUG_COMMIT wxT("Commit")
|
||||
#define BTNLABEL_CLOSE wxT("Close")
|
||||
#define BTNLABEL_EXECUTE wxT("Execute")
|
||||
|
||||
#if defined(WIN32)
|
||||
// On win32, apparantly the spinctrl depends on a native control which only
|
||||
// has a 16bit signed value. If you try to set the max above 32767, it
|
||||
// overflows and does stupid things.
|
||||
#define SPINCTRL_FIX_MAX(x) ((x)>32767 ? 32767 : (x))
|
||||
#else
|
||||
#define SPINCTRL_FIX_MAX(x) x
|
||||
#endif
|
||||
|
||||
// utility function prototype
|
||||
void ChangeStaticText(wxSizer *sizer, wxStaticText *win, wxString newtext);
|
||||
bool CreateImage(int harddisk, int sectors, const char *filename);
|
||||
void SetTextCtrl(wxTextCtrl *text, const char *format, int val);
|
||||
int GetTextCtrlInt(wxTextCtrl *text, bool *valid = NULL, bool complain=false, wxString complaint = wxT("Invalid integer!"));
|
||||
bool BrowseTextCtrl(wxTextCtrl *text,
|
||||
wxString prompt= wxT("Choose a file"),
|
||||
long style=wxOPEN);
|
||||
wxChoice *makeLogOptionChoiceBox(wxWindow *parent, wxWindowID id, int evtype, bool includeNoChange = false);
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// LogMsgAskDialog is a modal dialog box that shows the user a
|
||||
// simulation error message and asks if they want to continue or
|
||||
// not. It looks something like this:
|
||||
//
|
||||
// +----- PANIC ---------------------------------------------------+
|
||||
// | |
|
||||
// | Context: Hard Drive |
|
||||
// | Message: could not open hard drive image file '30M.sample' |
|
||||
// | |
|
||||
// | [ ] Don't ask about future messages like this |
|
||||
// | |
|
||||
// | [Continue] [Die] [Dump Core] [Debugger] [Help] |
|
||||
// +---------------------------------------------------------------+
|
||||
//
|
||||
// To use this dialog:
|
||||
// After constructor, use SetContext, SetMessage, EnableButton to
|
||||
// determine what will be displayed. Then call n = ShowModal(). The return
|
||||
// value tells which button was pressed (button_t types). Call GetDontAsk()
|
||||
// to see if they checked "Don't ask about..." or not.
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
class LogMsgAskDialog: public wxDialog
|
||||
{
|
||||
public:
|
||||
enum button_t {
|
||||
CONT=0, DIE, DUMP, DEBUG, HELP,
|
||||
N_BUTTONS /* number of entries in enum */
|
||||
};
|
||||
#define LOG_MSG_ASK_IDS \
|
||||
{ ID_Continue, ID_Die, ID_DumpCore, ID_Debugger, wxHELP }
|
||||
#define LOG_MSG_ASK_NAMES \
|
||||
{ wxT("Continue"), wxT("Kill Sim"), wxT("Dump Core"), wxT("Debugger"), wxT("Help") }
|
||||
#define LOG_MSG_DONT_ASK_STRING \
|
||||
wxT("Don't ask about future messages like this")
|
||||
#define LOG_MSG_CONTEXT wxT("Context: ")
|
||||
#define LOG_MSG_MSG wxT("Message: ")
|
||||
private:
|
||||
wxStaticText *context, *message;
|
||||
wxCheckBox *dontAsk;
|
||||
bool enabled[N_BUTTONS];
|
||||
wxBoxSizer *btnSizer, *vertSizer;
|
||||
void Init(); // called automatically by ShowModal()
|
||||
void ShowHelp();
|
||||
public:
|
||||
LogMsgAskDialog(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxString& title);
|
||||
void EnableButton(button_t btn, bool en) { enabled[(int)btn] = en; }
|
||||
void SetContext(wxString s);
|
||||
void SetMessage(wxString s);
|
||||
bool GetDontAsk() { return dontAsk->GetValue(); }
|
||||
void OnEvent(wxCommandEvent& event);
|
||||
int ShowModal() { Init(); return wxDialog::ShowModal(); }
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// AdvancedLogOptionsDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// +---- Advanced event configuration -----------------------+
|
||||
// | |
|
||||
// | Log file is [_____________________________] [ Browse ] |
|
||||
// | |
|
||||
// | This table determines how Bochs will respond to each |
|
||||
// | kind of event coming from a particular source. For |
|
||||
// | example if you are having problems with the keyboard, |
|
||||
// | you could ask for debug and info events from the |
|
||||
// | keyboard to be reported. |
|
||||
// | |
|
||||
// | [Use defaults for all devices] |
|
||||
// | |
|
||||
// | +---------------------------------------------------+-+ |
|
||||
// | |Device Debug Info Error Panic |^| |
|
||||
// | |-------- -------- ------- -------- --------- ||| |
|
||||
// | |Keyboard [ignore] [ignore] [report] [report] ||| |
|
||||
// | |VGA [ignore] [ignore] [report] [report] ||| |
|
||||
// | |NE2000 [ignore] [ignore] [report] [report] ||| |
|
||||
// | |Sound [ignore] [ignore] [report] [report] |v| |
|
||||
// | +-----------------------------------------------------+ |
|
||||
// | |
|
||||
// | [ Help ] [ Cancel ] [ Ok ] |
|
||||
// +-------------------------------------------------------+-+
|
||||
//
|
||||
class AdvancedLogOptionsDialog: public wxDialog
|
||||
{
|
||||
private:
|
||||
#define ADVLOG_OPTS_TITLE wxT("Configure Log Events")
|
||||
#define ADVLOG_OPTS_LOGFILE wxT("Log file")
|
||||
#define ADVLOG_OPTS_PROMPT wxT( \
|
||||
"This table determines how Bochs will respond to each kind of event coming\n" \
|
||||
"from a particular source. For example if you are having problems with\n" \
|
||||
"the keyboard, you could ask for debug and info events from the keyboard\n" \
|
||||
"to be reported.")
|
||||
#define ADVLOG_OPTS_TYPE_NAMES { wxT("Debug"), wxT("Info"), wxT("Error"), wxT("Panic"), wxT("Pass") }
|
||||
#define ADVLOG_OPTS_N_TYPES 5
|
||||
#define ADVLOG_DEFAULTS wxT("Use defaults for all devices")
|
||||
void Init(); // called automatically by ShowModal()
|
||||
void ShowHelp();
|
||||
wxBoxSizer *vertSizer, *logfileSizer, *buttonSizer;
|
||||
wxScrolledWindow *scrollWin;
|
||||
wxPanel *scrollPanel;
|
||||
wxGridSizer *headerSizer, *gridSizer;
|
||||
wxTextCtrl *logfile;
|
||||
wxButton *applyDefault;
|
||||
// 2d array of wxChoice pointers. Each wxChoice* is action[dev][type].
|
||||
wxChoice* **action;
|
||||
public:
|
||||
AdvancedLogOptionsDialog(wxWindow* parent, wxWindowID id);
|
||||
~AdvancedLogOptionsDialog();
|
||||
void OnEvent(wxCommandEvent& event);
|
||||
int ShowModal() { Init(); return wxDialog::ShowModal(); }
|
||||
void SetLogfile(wxString f) { logfile->SetValue(f); }
|
||||
wxString GetLogfile() { return logfile->GetValue(); }
|
||||
void CopyParamToGui();
|
||||
void CopyGuiToParam();
|
||||
void SetAction(int dev, int evtype, int act);
|
||||
int GetAction(int dev, int evtype);
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
#if BX_DEBUGGER
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// DebugLogDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// DebugLogDialog allows the user to decide how Bochs will
|
||||
// behave for each type of log event.
|
||||
//
|
||||
// +---- Debugger log ---------------------------------------+
|
||||
// | |
|
||||
// | +--------------------------------------------------+ |
|
||||
// | |(0) f000:fff0: ea5be000f0: jmp f000:e05b | |
|
||||
// | |(0) 0010:00001868: 83fb10: cmp EBX, #10 | |
|
||||
// | | | |
|
||||
// | | | |
|
||||
// | | | |
|
||||
// | | | |
|
||||
// | +--------------------------------------------------+ |
|
||||
// | Type a debugger command: |
|
||||
// | +----------------------------------------+ +-------+ |
|
||||
// | | step 1000 | |Execute| |
|
||||
// | +----------------------------------------+ +-------+ |
|
||||
// | |
|
||||
// | [ Close ] |
|
||||
// +---------------------------------------------------------+
|
||||
class DebugLogDialog: public wxDialog
|
||||
{
|
||||
private:
|
||||
#define DEBUG_LOG_TITLE wxT("Debugger log")
|
||||
#define DEBUG_CMD_PROMPT wxT("Type a debugger command:")
|
||||
wxBoxSizer *mainSizer, *commandSizer, *buttonSizer;
|
||||
wxTextCtrl *log, *command;
|
||||
Bit32u lengthMax;
|
||||
Bit32u lengthTolerance;
|
||||
#define DEBUG_LOG_DEFAULT_LENGTH_MAX (400*80)
|
||||
#define DEBUG_LOG_DEFAULT_TOLERANCE (200*80)
|
||||
public:
|
||||
DebugLogDialog(wxWindow* parent, wxWindowID id);
|
||||
void Init(); // called automatically by ShowModal()
|
||||
void OnEvent(wxCommandEvent& event);
|
||||
void OnEnterEvent(wxCommandEvent& event) { Execute(true); }
|
||||
void OnKeyEvent(wxKeyEvent& event);
|
||||
int ShowModal() { Init(); return wxDialog::ShowModal(); }
|
||||
void Execute(bool clearCommand);
|
||||
void CheckLogLength();
|
||||
void AppendCommand(const char *);
|
||||
void AppendText(wxString text);
|
||||
void CopyParamToGui() { /* empty for now */ }
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// ParamDialog is a general purpose dialog box that displays and edits
|
||||
// any combination of parameters. It's always made up of a
|
||||
// wxFlexGridSizer with three columns. Each parameter takes up one row.
|
||||
// Column 1 shows the name of the parameter, column 2 shows the value of
|
||||
// the parameter in some sort of control that can be edited. Column 3
|
||||
// is used for anything that needs to appear to the right of the data, for
|
||||
// example a Browse button on a filename control. Several buttons including
|
||||
// Cancel and Ok will appear at the bottom.
|
||||
//
|
||||
// This will allow editing of all the miscellaneous parameters which do
|
||||
// not need to be laid out by hand.
|
||||
//
|
||||
// NOTES:
|
||||
// Right now, there is always one wxFlexGridSizer with three columns
|
||||
// where the fields go. It is possible to create a new wxFlexGridSizer
|
||||
// and make that one the default. This is used when handling a bx_list_c
|
||||
// parameter.
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
struct ParamStruct : public wxObject {
|
||||
bx_param_c *param;
|
||||
int id;
|
||||
wxStaticText *label;
|
||||
union _u_tag {
|
||||
void *ptr;
|
||||
wxWindow *window;
|
||||
wxChoice *choice;
|
||||
wxTextCtrl *text;
|
||||
wxSpinCtrl *spin;
|
||||
wxCheckBox *checkbox;
|
||||
wxStaticBox *staticbox;
|
||||
wxNotebook *notebook;
|
||||
} u;
|
||||
int browseButtonId; // only for filename params
|
||||
wxButton *browseButton; // only for filename params
|
||||
ParamStruct() { param = NULL; u.window = NULL; browseButton = NULL; }
|
||||
};
|
||||
|
||||
// This context structure is used by AddParam to keep track of where the
|
||||
// next parameter's controls should be added. When AddParam is called on
|
||||
// a list of parameters (bx_list_c), it calls itself recursively to add
|
||||
// the child parameters, which in turn could be lists as well. When it
|
||||
// calls itself recursively, it will create a new AddParamContext so that
|
||||
// the various children can be added in the right place.
|
||||
struct AddParamContext {
|
||||
int depth;
|
||||
wxWindow *parent;
|
||||
wxBoxSizer *vertSizer;
|
||||
wxFlexGridSizer *gridSizer;
|
||||
};
|
||||
|
||||
|
||||
class ParamDialog: public wxDialog
|
||||
{
|
||||
private:
|
||||
void ShowHelp();
|
||||
wxChoice *type;
|
||||
wxTextCtrl *serialDelay, *pasteDelay, *mappingFile;
|
||||
wxCheckBox *enableKeymap;
|
||||
int genId();
|
||||
bool isShowing;
|
||||
int nbuttons;
|
||||
bool runtime;
|
||||
protected:
|
||||
wxBoxSizer *mainSizer, *buttonSizer;
|
||||
// hash table that maps the ID of a wxWidgets control (e.g. wxChoice,
|
||||
// wxTextCtrl) to the associated ParamStruct object. Data in the hash table
|
||||
// is of ParamStruct*.
|
||||
wxHashTable *idHash;
|
||||
// map parameter ID onto ParamStruct.
|
||||
wxHashTable *paramHash;
|
||||
virtual void EnableChanged();
|
||||
void EnableChanged(ParamStruct *pstr);
|
||||
void EnableParam(int param_id, bool enabled);
|
||||
void ProcessDependentList(ParamStruct *pstrChanged, bool enabled);
|
||||
bool CopyGuiToParam();
|
||||
bool CopyGuiToParam(bx_param_c *param);
|
||||
bool isGeneratedId(int id);
|
||||
public:
|
||||
ParamDialog(wxWindow* parent, wxWindowID id);
|
||||
virtual ~ParamDialog();
|
||||
void OnEvent(wxCommandEvent& event);
|
||||
wxButton* AddButton(int id, wxString label);
|
||||
virtual void AddDefaultButtons();
|
||||
virtual void Init(); // called automatically by ShowModal()
|
||||
int ShowModal() {
|
||||
Init();
|
||||
isShowing = true;
|
||||
int ret = wxDialog::ShowModal();
|
||||
isShowing = false;
|
||||
return ret;
|
||||
}
|
||||
bool Show(bool val) { isShowing = val; return wxDialog::Show(val); }
|
||||
void AddParam(bx_param_c *param, wxFlexGridSizer *sizer, bool plain = false);
|
||||
void AddParam(bx_param_c *param, bool plain = false, AddParamContext *context = NULL);
|
||||
void AddParamList(const char *nameList[], bx_param_c *base, wxFlexGridSizer *sizer = NULL, bool plain = false);
|
||||
virtual void CopyParamToGui();
|
||||
bool IsShowing() { return isShowing; }
|
||||
void SetRuntimeFlag(bool val) { runtime = val; }
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// FloppyConfigDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// the new FloppyConfigDialog is based on ParamDialog. It allows the user to
|
||||
// configure the floppy settings and to create a floppy image if necessary.
|
||||
class FloppyConfigDialog : public ParamDialog
|
||||
{
|
||||
private:
|
||||
wxButton *createButton;
|
||||
ParamStruct *pstrDevice, *pstrPath, *pstrMedia, *pstrStatus, *pstrReadonly;
|
||||
public:
|
||||
FloppyConfigDialog(wxWindow* parent, wxWindowID id);
|
||||
void Setup(bx_list_c *list);
|
||||
void OnEvent(wxCommandEvent& event);
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// LogOptionsDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// the new LogOptionsDialog is based on ParamDialog. It allows the user to
|
||||
// configure the log file settings and to decide how Bochs will behave for
|
||||
// each type of log event.
|
||||
class LogOptionsDialog : public ParamDialog
|
||||
{
|
||||
private:
|
||||
#define LOG_OPTS_TITLE wxT("Configure Log Events")
|
||||
#define LOG_OPTS_PROMPT wxT("How should Bochs respond to each type of event?")
|
||||
#define LOG_OPTS_TYPE_NAMES { wxT("Debug events: "), wxT("Info events: "), wxT("Error events: "), wxT("Panic events: "), wxT("Pass events: ") }
|
||||
#define LOG_OPTS_N_TYPES 5
|
||||
#define LOG_OPTS_CHOICES { wxT("ignore"), wxT("log"), wxT("ask user"), wxT("end simulation"), wxT("no change") }
|
||||
#define LOG_OPTS_N_CHOICES_NORMAL 4
|
||||
#define LOG_OPTS_N_CHOICES 5 // number of choices, including "no change"
|
||||
#define LOG_OPTS_NO_CHANGE 4 // index of "no change"
|
||||
// normally all choices are available for all event types. The exclude
|
||||
// expression allows some choices to be eliminated if they don't make any
|
||||
// sense. For example, it would be stupid to ignore a panic.
|
||||
#define LOG_OPTS_EXCLUDE(type,choice) ( \
|
||||
/* can't die or ask, on debug or info events */ \
|
||||
(type <= 1 && (choice==2 || choice==3)) \
|
||||
/* can't ignore panics or errors */ \
|
||||
|| (type >= 2 && choice==0) \
|
||||
)
|
||||
#define LOG_OPTS_ADV wxT("For additional control over how each device responds to events, use the menu option \"Log ... By Device\".")
|
||||
wxFlexGridSizer *gridSizer;
|
||||
wxChoice *action[LOG_OPTS_N_TYPES];
|
||||
public:
|
||||
LogOptionsDialog(wxWindow* parent, wxWindowID id);
|
||||
int GetAction(int evtype);
|
||||
void SetAction(int evtype, int action);
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// CpuRegistersDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// this would display the current values of all CPU registers, possibly you can
|
||||
// enable different groups like debug, FPU, MMX registers. Certainly if you
|
||||
// interrupt the simulation, these would be updated. we could update
|
||||
// periodically during simulation if it was useful. If we get the debugger
|
||||
// integrated with wxwidgets, you could single step and update the cpu
|
||||
// registers, with regs that change marked in a different color. Modeless
|
||||
// dialog.
|
||||
//
|
||||
// +--- CPU Registers ---------------------------------------+
|
||||
// | |
|
||||
// | EAX 0x00000000 EIP 0xffff LDTR 0x00000000 |
|
||||
// | EBX 0x00000000 CS 0x0018 TR 0x00000000 |
|
||||
// | ECX 0x00000000 SS 0x0018 GDTR 0x00000000 |
|
||||
// | EDX 0x00000000 DS 0x0018 lim 0x00000000 |
|
||||
// | EBP 0x00000000 ES 0x0018 IDTR 0x00000000 |
|
||||
// | ESI 0x00000000 FS 0x0018 lim 0x00000000 |
|
||||
// | EDI 0x00000000 GS 0x0018 |
|
||||
// | ESP 0x00000000 EFLAGS 0x0012 |
|
||||
// | |
|
||||
// | ID AC VM RF NT IOPL CF PF AF ZF SF TF IF DF OF |
|
||||
// | [] [] [] [] [] [0] [] [] [] [] [] [] [] [] [] |
|
||||
// | |
|
||||
// | DR0 0x00000000 TR3 0x00000000 CR0 0x00000000 |
|
||||
// | DR1 0x00000000 TR4 0x00000000 CR1 0x00000000 |
|
||||
// | DR2 0x00000000 TR5 0x00000000 CR2 0x00000000 |
|
||||
// | DR3 0x00000000 TR6 0x00000000 CR3 0x00000000 |
|
||||
// | DR6 0x00000000 TR7 0x00000000 CR4 0x00000000 |
|
||||
// | DR7 0x00000000 |
|
||||
// | |
|
||||
// | [Go] [Stop] [Step] [Step N] N=[____] |
|
||||
// +---------------------------------------------------------+
|
||||
//
|
||||
// +--- CPU Extended Registers ------------------------------+
|
||||
// | |
|
||||
// | |
|
||||
// | [Go] [Stop] [Step] [Step N] N=[____] |
|
||||
// +---------------------------------------------------------+
|
||||
//
|
||||
class CpuRegistersDialog : public ParamDialog
|
||||
{
|
||||
|
||||
#define CPU_REGS_MAIN_REGS1 \
|
||||
{ "EAX", "EBX", "ECX", "EDX", \
|
||||
"EBP", "ESI", "EDI", "ESP", \
|
||||
NULL }
|
||||
#define CPU_REGS_MAIN_REGS2 \
|
||||
{ "EIP", "CS", "SS", "DS", \
|
||||
"ES", "FS", "GS", "EFLAGS", \
|
||||
NULL }
|
||||
#define CPU_REGS_MAIN_REGS3 \
|
||||
{ "LDTR", "TR", \
|
||||
"GDTR_base", "IDTR_limit", \
|
||||
"IDTR_base", "GDTR_limit", \
|
||||
NULL }
|
||||
#define CPU_REGS_FLAGS \
|
||||
{ "ID", "VIP", "VIF", \
|
||||
"AC", "VM", "RF", \
|
||||
"NT", "IOPL", "OF", \
|
||||
"DF", "IF", "TF", \
|
||||
"SF", "ZF", "AF", \
|
||||
"PF", "CF", \
|
||||
NULL }
|
||||
#define CPU_REGS_DEBUG_REGS \
|
||||
{ "DR0", "DR1", "DR2", \
|
||||
"DR3", "DR6", "DR7", \
|
||||
NULL }
|
||||
#define CPU_REGS_TEST_REGS \
|
||||
{ "TR3", "TR4", "TR5", "TR6", "TR7", \
|
||||
NULL }
|
||||
#define CPU_REGS_CONTROL_REGS \
|
||||
{ "CR0", "CR2", "CR3", "CR4", \
|
||||
NULL }
|
||||
|
||||
void Init(); // called automatically by ShowModal()
|
||||
wxFlexGridSizer *mainRegsSizer, *flagsSizer, *extRegsSizer;
|
||||
#define CPU_REGS_MAX_FLAGS 17
|
||||
bx_param_c *flagptr[CPU_REGS_MAX_FLAGS];
|
||||
int nflags;
|
||||
#if BX_DEBUGGER
|
||||
wxButton *contButton, *stopButton, *stepButton, *commitButton;
|
||||
#endif
|
||||
void stateChanged(bool simRunning);
|
||||
public:
|
||||
CpuRegistersDialog(wxWindow* parent, wxWindowID id);
|
||||
int ShowModal() { Init(); return wxDialog::ShowModal(); }
|
||||
void AddFlag(bx_param_c *param);
|
||||
void OnEvent(wxCommandEvent& event);
|
||||
virtual void CopyParamToGui();
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Everything else in here is a comment!
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// proposed dialogs, not implemented
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Here are some quick sketches of what different parts of the interface
|
||||
could look like. None of these is implemented yet, and everything is
|
||||
open for debate. Whoever writes the wxwidgets code for any of these
|
||||
screens gets several thousand votes!
|
||||
|
||||
|
||||
|
||||
Idea for large configuration dialog, based on Netscape's Edit:Preferences
|
||||
dialog box. Here's a sketch of a dialog with all the components that can be
|
||||
configured in a list on the left, and the details of the selected component
|
||||
on the right. This is a pretty familiar structure that's used in a lot of
|
||||
applications these days. In the first sketch, "IDE Interface" is selected on
|
||||
the left, and the details of the IDE devices are shown on the right.
|
||||
|
||||
+-----Configure Bochs-------------------------------------------------------+
|
||||
| |
|
||||
| +--------------------+ +-- IDE Controller ---------------------------+ |
|
||||
| | |-CPU | | | |
|
||||
| | | | | Master device: | |
|
||||
| | |-Memory | | [X] Enable Hard Disk 0 | |
|
||||
| | | | | | |
|
||||
| | |-Video | | Slave device (choose one): | |
|
||||
| | | | | [ ] No slave device | |
|
||||
| | |-Floppy disks | | [ ] Hard Disk 1 | |
|
||||
| | | |-Drive 0 | | [X] CD-ROM | |
|
||||
| | | |-Drive 1 | | | |
|
||||
| | | | +---------------------------------------------+ |
|
||||
| |***IDE controller***| |
|
||||
| | | |-Hard Drive 0 | |
|
||||
| | | |-CD-ROM drive | |
|
||||
| | | | |
|
||||
| | |-Keyboard | |
|
||||
| | | | |
|
||||
| | |-Networking | |
|
||||
| | | | |
|
||||
| | |-Sound | |
|
||||
| | | |
|
||||
| +--------------------+ |
|
||||
| [Help] [Cancel] [Ok] |
|
||||
+---------------------------------------------------------------------------+
|
||||
|
||||
If you click on Hard Drive 0 in the component list (left), then the
|
||||
whole right panel changes to show the details of the hard drive.
|
||||
|
||||
+-----Configure Bochs-------------------------------------------------------+
|
||||
| |
|
||||
| +--------------------+ +---- Configure Hard Drive 0 ----------------+ |
|
||||
| | |-CPU | | | |
|
||||
| | | | | [X] Enabled | |
|
||||
| | |-Memory | | | |
|
||||
| | | | +--------------------------------------------+ |
|
||||
| | |-Video | |
|
||||
| | | | +---- Disk Image ----------------------------+ |
|
||||
| | |-Floppy disks | | | |
|
||||
| | | |-Drive 0 | | File name: [___________________] [Browse] | |
|
||||
| | | |-Drive 1 | | Geometry: cylinders [____] | |
|
||||
| | | | | heads [____] | |
|
||||
| | |-IDE controller | | sectors/track [____] | |
|
||||
| | |***Hard Drive 0***| | | |
|
||||
| | | |-CD-ROM drive | | Size in Megabytes: 38.2 | |
|
||||
| | | | | [Enter size/Compute Geometry] | |
|
||||
| | |-Keyboard | | | |
|
||||
| | | | | [Create Image] | |
|
||||
| | |-Networking | +--------------------------------------------+ |
|
||||
| | | | |
|
||||
| | |-Sound | |
|
||||
| | | |
|
||||
| +--------------------+ |
|
||||
| [Help] [Cancel] [Ok] |
|
||||
+---------------------------------------------------------------------------+
|
||||
|
||||
Or if you choose the CD-ROM, you get to edit the settings for it.
|
||||
|
||||
+---- Configure Bochs ------------------------------------------------------+
|
||||
| |
|
||||
| +--------------------+ +-- CD-ROM Device ----------------------------+ |
|
||||
| | |-CPU | | | |
|
||||
| | | | | [ ] Enable Emulated CD-ROM | |
|
||||
| | |-Memory | | | |
|
||||
| | | | +---------------------------------------------+ |
|
||||
| | |-Video | |
|
||||
| | | | +-- CD-ROM Media -----------------------------+ |
|
||||
| | |-Floppy disks | | | |
|
||||
| | | |-Drive 0 | | Bochs can use a physical CD-ROM drive as | |
|
||||
| | | |-Drive 1 | | the data source, or use an image file. | |
|
||||
| | | | | | |
|
||||
| | |-IDE controller | | [X] Ejected | |
|
||||
| | | |-Hard Drive 0 | | [ ] Physical CD-ROM drive /dev/cdrom | |
|
||||
| |*****CD-ROM drive***| | [ ] Disk image: [_____________] [Browse] | |
|
||||
| | | | | | |
|
||||
| | |-Keyboard | +---------------------------------------------+ |
|
||||
| | | | |
|
||||
| | |-Networking | |
|
||||
| | | | |
|
||||
| | |-Sound | |
|
||||
| | | |
|
||||
| +--------------------+ |
|
||||
| [Help] [Cancel] [Ok] |
|
||||
+---------------------------------------------------------------------------+
|
||||
|
||||
The CD-ROM media can still be configured during the simulation. In this
|
||||
context we can just show the Media section. The same code can be written to
|
||||
serve both purposes. This is the dialog that would appear when you click the
|
||||
CD-ROM button on the toolbar at runtime.
|
||||
|
||||
+-- CD-ROM Media -----------------------------+
|
||||
| |
|
||||
| Bochs can use a physical CD-ROM drive as |
|
||||
| the data source, or use an image file. |
|
||||
| |
|
||||
| [X] Ejected |
|
||||
| [ ] Physical CD-ROM drive /dev/cdrom |
|
||||
| [ ] Disk image: [_____________] [Browse] |
|
||||
| |
|
||||
| |
|
||||
| [Help] [Cancel] [Ok] |
|
||||
+---------------------------------------------+
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// ChooseConfigDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
The idea is that you could choose from a set of configurations
|
||||
(individual bochsrc files, basically). When you first install
|
||||
Bochs, it would just have DLX Linux Demo, and Create New.
|
||||
As you create new configurations and save them, the list
|
||||
could grow.
|
||||
+--------------------------------------------------------+
|
||||
| |
|
||||
| Choose a configuration for the Bochs simulator: |
|
||||
| |
|
||||
| +---+ |
|
||||
| | O | DLX Linux Demo |
|
||||
| | | | Boot 10MB Hard Disk |
|
||||
| +---+ |
|
||||
| |
|
||||
| +---+ |
|
||||
| | O | Redhat Linux Image |
|
||||
| | | | Boot 10MB Hard Disk |
|
||||
| +---+ |
|
||||
| |
|
||||
| +---+ |
|
||||
| | O | FreeDOS |
|
||||
| | | | Boot 40MB Hard Disk |
|
||||
| +---+ |
|
||||
| |
|
||||
| ?? Create new configuration |
|
||||
| |
|
||||
+--------------------------------------------------------+
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// ChooseBootDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
This dialog basically lets you choose which disk you want to boot: floppy A,
|
||||
disk c, or cdrom. The boot selection could be as simple as
|
||||
+-------------------------------------------+
|
||||
| Choose boot drive |
|
||||
| [ ] Floppy A |
|
||||
| [X] Hard Disk C |
|
||||
| [ ] CD-ROM |
|
||||
| [ Help ] [ Cancel ] [ Ok ] |
|
||||
+-------------------------------------------+
|
||||
or fancier with icons for the device types, and Edit buttons that
|
||||
let you go right to the configure screen for that disk drive.
|
||||
+---------------------------------------------------------------+
|
||||
| |
|
||||
| /----+ |
|
||||
| |= =| A Drive +----+ |
|
||||
| [ ] | __ | Raw Floppy Drive |Edit| |
|
||||
| || || A: +----+ |
|
||||
| ++--++ |
|
||||
| |
|
||||
| /----+ |
|
||||
| |= =| B Drive +----+ |
|
||||
| [ ] | __ | Floppy Disk Image |Edit| |
|
||||
| || || C:\Bochs\Images\A.img +----+ |
|
||||
| ++--++ |
|
||||
| |
|
||||
| +-----+ C Drive |
|
||||
| |=====| Hard Disk Image +----+ |
|
||||
| [BOOT] | o| C:\Bochs\Images\HD30meg.img |Edit| |
|
||||
| +-----+ +----+ |
|
||||
| |
|
||||
| ___ |
|
||||
| / \ D Drive +----+ |
|
||||
| [ ] | O | ISO CD Image |Edit| |
|
||||
| \___/ C:\Bochs\Images\BootCD.img +----+ |
|
||||
| |
|
||||
| [ Help ] [ Cancel ] [ Ok ] |
|
||||
+---------------------------------------------------------------+
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// KeymappingDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
more ambitious: create a button for each key on a standard keyboard, so that
|
||||
you can view/edit/load/save key mappings, produce any combination of keys
|
||||
(esp. ones that your OS or window manager won't allow)
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// ConfigTimeDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
choose IPS
|
||||
select starting time for CMOS clock
|
||||
turn on real time PIT or not (?)
|
||||
VGA update interval
|
||||
|
||||
This dialog can easily allow people to tune the IPS setting, or
|
||||
various other speed-related values, at runtime. If you're running
|
||||
some time-sensitive program you could adjust IPS until it's the right
|
||||
speed, or if Bochs is wasting all of your CPU's cycles you could turn
|
||||
a dial to some periodic delays to allow other processes a chance to
|
||||
complete.
|
||||
|
||||
Suggestions from Greg Alexander:
|
||||
> I'm using O for radio buttons and [ ] for check boxes.
|
||||
>
|
||||
> ---------Basic Configure Timing Dialog--------
|
||||
>
|
||||
> Instructions per second: [_________] (maybe have some default options
|
||||
> and an "other")
|
||||
>
|
||||
> Select timing behavior desired:
|
||||
>
|
||||
> O Full Speed, Real Time
|
||||
> (NOT Reproducible)
|
||||
> O Minimize CPU Use, Real Time
|
||||
> O Full speed, NOT Real Time
|
||||
>
|
||||
> [Advanced]
|
||||
>
|
||||
> -----------------------------------------------
|
||||
> The logic for the above would look like this:
|
||||
> All options get the New PIT.
|
||||
> Option 1 Gets you the Realtime PIT.
|
||||
> Option 2 Gets you the Slowdown Timer.
|
||||
> Option 3 Gets you neither.
|
||||
>
|
||||
> -------Advanced Configure Timing Dialog--------
|
||||
>
|
||||
> Instructions per second: [_________]
|
||||
>
|
||||
> Select PIT Model:
|
||||
> O Old Model
|
||||
> O New Model
|
||||
> O Realtime PIT (not reproducible)
|
||||
>
|
||||
> Select Optional Realtime Hacks:
|
||||
> [ ] Slowdown Timer Maxmult setting [_________]
|
||||
> [ ] Idle Hack (X Windows Only)
|
||||
>
|
||||
> ----------------------------------------------
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// OtherOptionsDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
everything in the bochsrc that doesn't fit into some other category,
|
||||
or that is used so rarely (e.g. floppy command delay) that it's not worth
|
||||
laying out manually in a dialog box. This will probably be done in
|
||||
sort of a grid with parameter name, and value(editable) in different columns
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// LogOptionsDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
lets you choose which events you want to write to the log, which you
|
||||
want to ignore, etc. You can do this at a high level, like
|
||||
|
||||
+---- Configure events -----------------------------------+
|
||||
| |
|
||||
| How should Bochs respond to each type of event? |
|
||||
| |
|
||||
| Debug events: [ignore] |
|
||||
| Info events: [ignore] |
|
||||
| Error events: [report] |
|
||||
| Panic events: [ask ] |
|
||||
| |
|
||||
| For additional control over how each device responds |
|
||||
| to events, press the "Advanced" button. |
|
||||
| |
|
||||
| [ Advanced ] [ Help ] [ Cancel ] [ Ok ] |
|
||||
+---------------------------------------------------------+
|
||||
This sets up the default actions for all devices. The advanced
|
||||
dialog lets you set different actions per device. I have two
|
||||
attempts at the advanced dialog. The first creates a large
|
||||
grid of wxChoice controls which choose between
|
||||
ignore/report/ask/die. There will be enough rows in this
|
||||
table that a scrolling subwindow will be needed to fit
|
||||
all the devices.
|
||||
|
||||
+---- Advanced event configuration -----------------------+
|
||||
| |
|
||||
| This table determines how Bochs will respond to each |
|
||||
| kind of event coming from a particular source. For |
|
||||
| example if you are having problems with the keyboard, |
|
||||
| you could ask for debug and info events from the |
|
||||
| keyboard to be reported. |
|
||||
| |
|
||||
| [Use defaults for all devices] |
|
||||
+-------------------------------------------------------+-+
|
||||
| Device Debug Info Error Panic |^|
|
||||
| -------- -------- ------- -------- --------- |||
|
||||
| Keyboard [ignore] [ignore] [report] [report] |||
|
||||
| VGA [ignore] [ignore] [report] [report] |||
|
||||
| NE2000 [ignore] [ignore] [report] [report] |||
|
||||
| Sound [ignore] [ignore] [report] [report] |v|
|
||||
+---------------------------------------------------------+
|
||||
| [ Help ] [ Cancel ] [ Ok ] |
|
||||
+-------------------------------------------------------+-+
|
||||
|
||||
Try #2 for the advanced event configuration dialog.
|
||||
It shows the selection of the default actions again
|
||||
at the top, with some explanation. Then at bottom, you
|
||||
can select a device in the list box and edit the settings
|
||||
for that device individually. It would be possible to
|
||||
allow selection of multiple devices and then edit several
|
||||
devices at once.
|
||||
|
||||
+---- Advanced event configuration ---------------------+-+
|
||||
| |
|
||||
| +--- Default Actions -------------+ |
|
||||
| First choose the | | |
|
||||
| default actions | Debug events: [ignore] | |
|
||||
| that apply to all | Info events: [ignore] | |
|
||||
| event sources. | Error events: [report] | |
|
||||
| | Panic events: [ask ] | |
|
||||
| | | |
|
||||
| | [Copy to All Devices] | |
|
||||
| +---------------------------------+ |
|
||||
| |
|
||||
| Then, if you want you can edit the actions for |
|
||||
| individual devices. For example if you are having |
|
||||
| problems with the keyboard, you could ask for debug |
|
||||
| and info events from the keyboard to be reported. |
|
||||
| |
|
||||
| Select Device: |
|
||||
| +-------------+-+ +--- Actions for VGA -------------+ |
|
||||
| | CPU |^| | | |
|
||||
| | Interrupts ||| | Debug events: [ignore] | |
|
||||
| |*VGA*********||| | Info events: [ignore] | |
|
||||
| | Keyboard ||| | Error events: [report] | |
|
||||
| | Mouse ||| | Panic events: [ask ] | |
|
||||
| | Floppy Disk |v| | | |
|
||||
| +-------------+-+ +---------------------------------+ |
|
||||
| |
|
||||
| [ Help ] [ Cancel ] [ Ok ] |
|
||||
+---------------------------------------------------------+
|
||||
|
||||
+---- Configure events -------------------------------------+
|
||||
| __________ ____________ |
|
||||
| | Default \ | Per Device \ |
|
||||
| | \------------------------------------------+ |
|
||||
| | | |
|
||||
| | Event log file [_______________________] [Browse] | |
|
||||
| | | |
|
||||
| | How should Bochs respond to each type of event? | |
|
||||
| | | |
|
||||
| | Debug events: [ignore] | |
|
||||
| | Info events: [ignore] | |
|
||||
| | Error events: [report] | |
|
||||
| | Panic events: [ask ] | |
|
||||
| | | |
|
||||
| | For additional control over how each device responds | |
|
||||
| | to events, click the "Per Device" tab above. | |
|
||||
| | | |
|
||||
| +------------------------------------------------------+ |
|
||||
| [ Help ] [ Cancel ] [ Ok ] |
|
||||
+-----------------------------------------------------------+
|
||||
|
||||
+---- Configure events -------------------------------------+
|
||||
| __________ ____________ |
|
||||
| | Default \ | Per Device \ |
|
||||
| +-------------| \--------------------------+ |
|
||||
| | | |
|
||||
| | This table determines how Bochs will respond to each | |
|
||||
| | kind of event coming from a particular source. For | |
|
||||
| | example if you are having problems with the keyboard,| |
|
||||
| | you could ask for debug and info events from the | |
|
||||
| | keyboard to be reported. | |
|
||||
| | | |
|
||||
| | +------------------------------------------------+-+ | |
|
||||
| | |Device Debug Info Error Panic |^| | |
|
||||
| | |-------- -------- ------- -------- --------- ||| | |
|
||||
| | |Keyboard [ignore] [ignore] [report] [report] ||| | |
|
||||
| | |VGA [ignore] [ignore] [report] [report] ||| | |
|
||||
| | |NE2000 [ignore] [ignore] [report] [report] ||| | |
|
||||
| | |Sound [ignore] [ignore] [report] [report] |v| | |
|
||||
| | +--------------------------------------------------+ | |
|
||||
| | [Set defaults for all devices] | |
|
||||
| +------------------------------------------------------+ |
|
||||
| [ Help ] [ Cancel ] [ Ok ] |
|
||||
+-----------------------------------------------------------+
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// ViewMemoryDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
shows portions of memory, in hex or hex+ASCII or disassembled. updates
|
||||
whenever simulation stops (after single steps for example), or we could
|
||||
update periodically. Modeless dialog, and there could be many
|
||||
of them at once, showing different regions of memory.
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// DebugControlDialog
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
has buttons for most common debugger commands such as step, breakpoint,
|
||||
display registers, or whatever.
|
||||
|
||||
*****************************************************************/
|
||||
1553
simulators/bochs/gui/wxmain.cc
Normal file
1553
simulators/bochs/gui/wxmain.cc
Normal file
File diff suppressed because it is too large
Load Diff
226
simulators/bochs/gui/wxmain.h
Normal file
226
simulators/bochs/gui/wxmain.h
Normal file
@ -0,0 +1,226 @@
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// $Id$
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file defines variables and classes that the wxWidgets .cc files
|
||||
// share. It should be included only by wx.cc and wxmain.cc.
|
||||
|
||||
// forward class declaration so that each class can have a pointer to
|
||||
// the others.
|
||||
class MyFrame;
|
||||
class MyPanel;
|
||||
class SimThread;
|
||||
class ParamDialog;
|
||||
#if BX_DEBUGGER
|
||||
class DebugLogDialog;
|
||||
#endif
|
||||
|
||||
//hack alert; yuck; FIXME
|
||||
extern MyFrame *theFrame;
|
||||
extern MyPanel *thePanel;
|
||||
|
||||
// wxBochsClosing flag, see comments in wxmain.h
|
||||
extern bool wxBochsClosing;
|
||||
|
||||
#define MAX_EVENTS 256
|
||||
extern unsigned long num_events;
|
||||
extern BxEvent event_queue[MAX_EVENTS];
|
||||
|
||||
enum
|
||||
{
|
||||
ID_Quit = 1,
|
||||
ID_Config_New,
|
||||
ID_Config_Read,
|
||||
ID_Config_Save,
|
||||
ID_State_Restore,
|
||||
ID_Edit_FD_0,
|
||||
ID_Edit_FD_1,
|
||||
ID_Edit_ATA0,
|
||||
ID_Edit_ATA1,
|
||||
ID_Edit_ATA2,
|
||||
ID_Edit_ATA3,
|
||||
ID_Edit_Cdrom, // for toolbar. FIXME: toolbar can't handle >1 cdrom
|
||||
ID_Edit_CPU,
|
||||
ID_Edit_Memory,
|
||||
ID_Edit_Clock_Cmos,
|
||||
ID_Edit_PCI,
|
||||
ID_Edit_Display,
|
||||
ID_Edit_Keyboard,
|
||||
ID_Edit_Boot,
|
||||
ID_Edit_Serial_Parallel,
|
||||
ID_Edit_Network,
|
||||
ID_Edit_Sound,
|
||||
ID_Edit_Other,
|
||||
ID_Simulate_Start,
|
||||
ID_Simulate_PauseResume,
|
||||
ID_Simulate_Stop,
|
||||
ID_Debug_ShowCpu,
|
||||
ID_Debug_ShowKeyboard,
|
||||
ID_Debug_Console,
|
||||
ID_Debug_ShowMemory,
|
||||
ID_Log_View,
|
||||
ID_Log_Prefs,
|
||||
ID_Log_PrefsDevice,
|
||||
ID_Help_About,
|
||||
ID_Sim2CI_Event,
|
||||
// ids for Bochs toolbar
|
||||
ID_Toolbar_FloppyA,
|
||||
ID_Toolbar_FloppyB,
|
||||
ID_Toolbar_CdromD,
|
||||
ID_Toolbar_Reset,
|
||||
ID_Toolbar_Power,
|
||||
ID_Toolbar_Copy,
|
||||
ID_Toolbar_Paste,
|
||||
ID_Toolbar_Snapshot,
|
||||
ID_Toolbar_Config,
|
||||
ID_Toolbar_Mouse_en,
|
||||
ID_Toolbar_User,
|
||||
ID_Toolbar_SaveRestore,
|
||||
// dialog box: LogMsgAskDialog
|
||||
ID_Continue,
|
||||
ID_Die,
|
||||
ID_DumpCore,
|
||||
ID_Debugger,
|
||||
ID_Help,
|
||||
// dialog box: FloppyConfigDialog
|
||||
ID_Create,
|
||||
// dialog box: LogOptions
|
||||
ID_Browse,
|
||||
// dialog box: CpuRegistersDialog
|
||||
ID_Debug_Continue,
|
||||
ID_Debug_Stop,
|
||||
ID_Debug_Step,
|
||||
ID_Debug_Commit,
|
||||
ID_Close,
|
||||
ID_Execute,
|
||||
ID_DebugCommand,
|
||||
// advanced log options
|
||||
ID_ApplyDefault,
|
||||
// that's all
|
||||
ID_LAST_USER_DEFINED
|
||||
};
|
||||
|
||||
|
||||
// to compile in debug messages, change these defines to x. To remove them,
|
||||
// change the defines to return nothing.
|
||||
#define IFDBG_VGA(x) /* nothing */
|
||||
//#define IFDBG_VGA(x) x
|
||||
|
||||
#define IFDBG_KEY(x) /* nothing */
|
||||
//#define IFDBG_KEY(x) x
|
||||
|
||||
#define IFDBG_MOUSE(x) /* nothing */
|
||||
//#define IFDBG_MOUSE(x) x
|
||||
|
||||
#define IFDBG_EVENT(x) /* nothing */
|
||||
//#define IFDBG_EVENT(x) x
|
||||
|
||||
#define IFDBG_DLG(x) /* nothing */
|
||||
//#define IFDBG_DLG(x) x
|
||||
|
||||
|
||||
// defined in wxmain.cc
|
||||
void safeWxStrcpy(char *dest, wxString src, int destlen);
|
||||
|
||||
/// the MyPanel methods are defined in wx.cc
|
||||
class MyPanel: public wxPanel
|
||||
{
|
||||
bx_bool fillBxKeyEvent(wxKeyEvent& event, BxKeyEvent& bxev, bx_bool release); // for all platforms
|
||||
bx_bool fillBxKeyEvent_MSW(wxKeyEvent& event, BxKeyEvent& bxev, bx_bool release);
|
||||
bx_bool fillBxKeyEvent_GTK(wxKeyEvent& event, BxKeyEvent& bxev, bx_bool release);
|
||||
public:
|
||||
MyPanel(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = wxT("panel"));
|
||||
~MyPanel();
|
||||
void OnKeyDown(wxKeyEvent& event);
|
||||
void OnKeyUp(wxKeyEvent& event);
|
||||
void OnTimer(wxTimerEvent& event);
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
void OnMouse(wxMouseEvent& event);
|
||||
void MyRefresh();
|
||||
static void OnPluginInit();
|
||||
void ToggleMouse(bool fromToolbar);
|
||||
private:
|
||||
wxCursor *blankCursor;
|
||||
bool needRefresh;
|
||||
wxTimer refreshTimer;
|
||||
Bit16s mouseSavedX, mouseSavedY;
|
||||
Bit32u centerX, centerY;
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
/// the MyFrame methods are defined in wxmain.cc
|
||||
class MyFrame: public wxFrame
|
||||
{
|
||||
MyPanel *panel;
|
||||
public:
|
||||
MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
|
||||
~MyFrame();
|
||||
enum StatusChange { Start, Stop, Pause, Resume };
|
||||
void simStatusChanged(StatusChange change, bx_bool popupNotify=false);
|
||||
void OnConfigNew(wxCommandEvent& event);
|
||||
void OnConfigRead(wxCommandEvent& event);
|
||||
void OnConfigSave(wxCommandEvent& event);
|
||||
void OnStateRestore(wxCommandEvent& event);
|
||||
void OnQuit(wxCommandEvent& event);
|
||||
void OnAbout(wxCommandEvent& event);
|
||||
void OnStartSim(wxCommandEvent& event);
|
||||
void OnPauseResumeSim(wxCommandEvent& event);
|
||||
void OnKillSim(wxCommandEvent& event);
|
||||
void OnSim2CIEvent(wxCommandEvent& event);
|
||||
void OnLogMsg(BxEvent *logMsgEvent);
|
||||
void OnEditCPU(wxCommandEvent& event);
|
||||
void OnEditMemory(wxCommandEvent& event);
|
||||
void OnEditClockCmos(wxCommandEvent& event);
|
||||
void OnEditPCI(wxCommandEvent& event);
|
||||
void OnEditDisplay(wxCommandEvent& event);
|
||||
void OnEditKeyboard(wxCommandEvent& event);
|
||||
void OnEditBoot(wxCommandEvent& event);
|
||||
void OnEditSerialParallel(wxCommandEvent& event);
|
||||
void OnEditNet(wxCommandEvent& event);
|
||||
void OnEditSound(wxCommandEvent& event);
|
||||
void OnEditOther(wxCommandEvent& event);
|
||||
void OnLogPrefs(wxCommandEvent& event);
|
||||
void OnLogPrefsDevice(wxCommandEvent& event);
|
||||
void OnEditATA(wxCommandEvent& event);
|
||||
void OnShowCpu(wxCommandEvent& event);
|
||||
void OnShowKeyboard(wxCommandEvent& event);
|
||||
#if BX_DEBUGGER
|
||||
void OnDebugLog(wxCommandEvent& event);
|
||||
void DebugBreak();
|
||||
void DebugCommand(wxString string);
|
||||
void DebugCommand(const char *cmd);
|
||||
#endif
|
||||
void editFloppyConfig(int drive);
|
||||
void editFirstCdrom();
|
||||
void OnToolbarClick(wxCommandEvent& event);
|
||||
int HandleAskParam(BxEvent *event);
|
||||
int HandleAskParamString(bx_param_string_c *param);
|
||||
|
||||
// called from the sim thread's OnExit() method.
|
||||
void OnSimThreadExit();
|
||||
SimThread *GetSimThread() { return sim_thread; }
|
||||
|
||||
private:
|
||||
wxCriticalSection sim_thread_lock;
|
||||
SimThread *sim_thread; // get the lock before accessing sim_thread
|
||||
int start_bochs_times;
|
||||
wxMenu *menuConfiguration;
|
||||
wxMenu *menuEdit;
|
||||
wxMenu *menuSimulate;
|
||||
wxMenu *menuDebug;
|
||||
wxMenu *menuLog;
|
||||
wxMenu *menuHelp;
|
||||
wxToolBar *bxToolBar;
|
||||
ParamDialog *showCpu, *showKbd;
|
||||
#if BX_DEBUGGER
|
||||
DebugLogDialog *showDebugLog;
|
||||
#endif
|
||||
void RefreshDialogs();
|
||||
char *debugCommand; // maybe need lock on this
|
||||
BxEvent *debugCommandEvent; // maybe need lock on this
|
||||
public:
|
||||
bool WantRefresh();
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
2626
simulators/bochs/gui/x.cc
Normal file
2626
simulators/bochs/gui/x.cc
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user