and implemented in SDL
* sequencer controller register 0x01 bit 0 controls the width of the characters.
This value is used to calculate the screen width.
* attribute controller register 0x10 bit 2 controls the appearance of graphics
characters (ASCII 0xC0 - 0cDF). A change of this value forces a charmap update
to rebuild the font bitmaps.
* the SDL display library uses the new feature described above
* the other display libraries recalculate the screen width, since they are using
a fixed font width of 8 for now.
- VGA: attribute controller register 0x10 bit 2 (enable_line_graphics) does not
switch the palatte in CGA mode
This fixes bug #614724: SDL can get stuck in full-screen mode, and provides
a framework for fixing the problem on other full-screen display libraries
such as term, svga, etc.
- add virtual method bx_gui::set_display_mode(mode) which can be overridden
by each display library class, if appropriate. This method is primarily
used when you run Bochs full screen, to tell the gui to switch from full
screen back to a mode where you can use the text console.
- There are two display modes: config and simulation. The mode is changed to
config mode during logfunctions::ask, during the runtime configuration menu,
and before displaying a debugger prompt. It is changed back to simulation
mode whenever instructions are running.
- Instead of being called directly through the global bx_gui pointer, the
bx_gui_c::set_display_mode() method is almost always accessed through
siminterface, like this:
SIM->set_display_mode (DISP_MODE_CONFIG);
SIM->set_display_mode (DISP_MODE_SIM);
Of course siminterface just passes the call on to bx_gui::set_display_mode().
I added it to siminterface so that the config interfaces could call it.
(They don't #include bochs.h so they can't access bx_gui.)
Modified Files:
logio.cc main.cc debug/dbg_main.cc gui/gui.h gui/sdl.cc
gui/siminterface.cc gui/siminterface.h
"bx_bool" which is always defined as Bit32u on all platforms. In Carbon
specific code, Boolean is still used because the Carbon header files
define it to unsigned char.
- this fixes bug [ 623152 ] MacOSX: Triple Exception Booting win95.
The bug was that some code in Bochs depends on Boolean to be a
32 bit value. (This should be fixed, but I don't know all the places
where it needs to be fixed yet.) Because Carbon defined Boolean as
an unsigned char, Bochs just followed along and used the unsigned char
definition to avoid compile problems. This exposed the dependency
on 32 bit Boolean on MacOS X only and led to major simulation problems,
that could only be reproduced and debugged on that platform.
- On the mailing list we debated whether to make all Booleans into "bool" or
our own type. I chose bx_bool for several reasons.
1. Unlike C++'s bool, we can guarantee that bx_bool is the same size on all
platforms, which makes it much less likely to have more platform-specific
simulation differences in the future. (I spent hours on a borrowed
MacOSX machine chasing bug 618388 before discovering that different sized
Booleans were the problem, and I don't want to repeat that.)
2. We still have at least one dependency on 32 bit Booleans which must be
fixed some time, but I don't want to risk introducing new bugs into the
simulation just before the 2.0 release.
Modified Files:
bochs.h config.h.in gdbstub.cc logio.cc main.cc pc_system.cc
pc_system.h plugin.cc plugin.h bios/rombios.c cpu/apic.cc
cpu/arith16.cc cpu/arith32.cc cpu/arith64.cc cpu/arith8.cc
cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer16.cc cpu/ctrl_xfer32.cc
cpu/ctrl_xfer64.cc cpu/data_xfer16.cc cpu/data_xfer32.cc
cpu/data_xfer64.cc cpu/debugstuff.cc cpu/exception.cc
cpu/fetchdecode.cc cpu/flag_ctrl_pro.cc cpu/init.cc
cpu/io_pro.cc cpu/lazy_flags.cc cpu/lazy_flags.h cpu/mult16.cc
cpu/mult32.cc cpu/mult64.cc cpu/mult8.cc cpu/paging.cc
cpu/proc_ctrl.cc cpu/segment_ctrl_pro.cc cpu/stack_pro.cc
cpu/tasking.cc debug/dbg_main.cc debug/debug.h debug/sim2.cc
disasm/dis_decode.cc disasm/disasm.h doc/docbook/Makefile
docs-html/cosimulation.html fpu/wmFPUemu_glue.cc
gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/gui.cc gui/gui.h
gui/keymap.cc gui/keymap.h gui/macintosh.cc gui/nogui.cc
gui/rfb.cc gui/sdl.cc gui/siminterface.cc gui/siminterface.h
gui/term.cc gui/win32.cc gui/wx.cc gui/wxmain.cc gui/wxmain.h
gui/x.cc instrument/example0/instrument.cc
instrument/example0/instrument.h
instrument/example1/instrument.cc
instrument/example1/instrument.h
instrument/stubs/instrument.cc instrument/stubs/instrument.h
iodev/cdrom.cc iodev/cdrom.h iodev/cdrom_osx.cc iodev/cmos.cc
iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_arpback.cc
iodev/eth_packetmaker.cc iodev/eth_packetmaker.h
iodev/floppy.cc iodev/floppy.h iodev/guest2host.h
iodev/harddrv.cc iodev/harddrv.h iodev/ioapic.cc
iodev/ioapic.h iodev/iodebug.cc iodev/iodev.h
iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.h
iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pic.h
iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h
iodev/sb16.cc iodev/sb16.h iodev/serial.cc iodev/serial.h
iodev/vga.cc iodev/vga.h memory/memory.h memory/misc_mem.cc
'char_changed'. These variables are currently only used by the win32 gui for
the update of the font bitmaps. SDL and wxWindows do not use the variables
since they are using the charmap data directly
- free text snapshot memory when the user has cancelled the dialog
- write text snapshot file in binary mode (disables the LF -> CRLF conversion
in cygwin)
set_text_charbyte()
- vga: store the address of the active charmap in the new variable
charmap_address
- vga: text mode hack removed. The write modes, operations and masks must be
used in text mode too.
- sdl: clear_screen() is not necessary when the charmap has changed
- win32: update only the changed font bitmaps before drawing the text
vga_charmap
- the SDL gui uses the charmap data for the vga text display
* TODO: implement this feature for other guis
- removed unused variables in sdl.cc and gui.cc
- fixed a warning in vga.cc
the guest OS. The shortcut can be defined in the bochsrc or in the config
interface. It is possible to change it at runtime.
These shortcuts are currently recognized:
ctrlaltdel, ctrlaltesc, ctrlaltf1, alttab
Here is the list of changes:
* userbutton.h and userbutton.xpm added in gui/bitmaps
* config options for the userbutton shortcut added
* initialize the new button in the gui.cc
* the new userbutton handler generates keypresses and relaeses depending on
the shortcut keyword
* the gui stops adding buttons to the headerbar if not enough space is left.
This can happen when the screen width is 320 pixels (done for X11 only).
* TODO: build a dialog box for the wxWindows gui
- The emulated vga card issues a dimension_update() using the real
screen dimensions and the real font height.
- The gui selects a font with the requested height or it recalculates
the screen height if the font height is not available.
- The text_update() function uses a new variable 'ncols' instead of the
fixed value of 80 for the number of text columns.
I have tested the changes with X11/Linux, SDL, wxGTK and win32. The changes
in the other guis are not tested yet.
GUI specific paste functions for X11 and WIN32 in paste_handler() moved to
the new function
- get_clipboard_text() prepared for other GUIs
- set_clipboard_text() has now a return value (0 = failed or not implemented)
- use portable code in copy_handler() if set_clipboard_text() fails
- snapshot_handler() prepared for adding a file dialog call
- writing snapshot file in binary mode (LF->CRLF conversion already done)
GUI specific copy functions for X11 and WIN32 in copy_handler() moved to
the new function
- set_clipboard_text() prepared for other GUIs
- value of text mode cursor variables fixed (and renamed in x.cc)
- BX_ERROR message in snapshot_handler() fixed
X servers that I've seen, however on other X servers it makes all
key mappings into absolute junk. We need to continue to work on this
patch to support all X servers and all key maps.
<dieter.mittelmaier@freenet.de> which fixes X11 keyboard mapping
on German keyboards using Keycodes instead of Keysyms.
His comments are:
> I mapped your BX_KEY-defines in gui.h to values from XFree
> ../keycodes/Xfree86. Keysyms in x.cc would now translated
> to keycodes. Now I can use german or us keyboard-layout in
> win95 and all works well.
> Note: Changing keyboard layout in win95 to en works too
> Also you must change keyboard setup in win95 to AT-Enhanced 101/102 keyboard
which notifies them that the mouse_enabled bit has changed. Now that
mouse_enabled can be initialized or modified by parameter events in
addition to GUI events, the guis must be prepared for it. I have pasted
empty method definitions into mouse_enabled_changed_specific for all
guis except for X11, which I did the right way. The implementation
of this function must use the argument "val" rather than reading the
parameter.
declared as bx_param_c * types in the bx_options structure. They are
initialized in main.cc (bx_init_options) with default values.
Access to parameters of this type should always be like this:
bx_options.mouse_enabled->get ();
bx_options.mouse_enabled->set (newval);
Eventually I will be transferring all options to this format.
To see the commit logs for this use either cvsweb or
cvs update -r BRANCH-io-cleanup and then 'cvs log' the various files.
In general this provides a generic interface for logging.
logfunctions:: is a class that is inherited by some classes, and also
. allocated as a standalone global called 'genlog'. All logging uses
. one of the ::info(), ::error(), ::ldebug(), ::panic() methods of this
. class through 'BX_INFO(), BX_ERROR(), BX_DEBUG(), BX_PANIC()' macros
. respectively.
.
. An example usage:
. BX_INFO(("Hello, World!\n"));
iofunctions:: is a class that is allocated once by default, and assigned
as the iofunction of each logfunctions instance. It is this class that
maintains the file descriptor and other output related code, at this
point using vfprintf(). At some future point, someone may choose to
write a gui 'console' for bochs to which messages would be redirected
simply by assigning a different iofunction class to the various logfunctions
objects.
More cleanup is coming, but this works for now. If you want to see alot
of debugging output, in main.cc, change onoff[LOGLEV_DEBUG]=0 to =1.
Comments, bugs, flames, to me: todd@fries.net
signal. First, selection of the GUI should cause BX_GUI_SIGHANDLER to
be defined in config.h.in. Then, the GUI should define member functions
Bit32u get_sighandler_mask ();
void sighandler (int sig);
The mask function returns a bitfield where one bit corresponds to each
signal. For any signal whose bit is set to 1 in the return value of
get_sighandler_mask, the gui will control that signal. When the signal
arrives, bx_gui.sighandler(sig) will be called by bx_signal_handler,
instead of the default behavior of that signal.