Bochs/bochs/gui/sdl.cc

1632 lines
45 KiB
C++
Raw Normal View History

2002-03-06 23:39:23 +03:00
/////////////////////////////////////////////////////////////////////////
// $Id: sdl.cc,v 1.89 2010-02-26 14:18:18 sshwarts Exp $
2002-03-06 23:39:23 +03:00
/////////////////////////////////////////////////////////////////////////
//
2009-12-04 23:02:12 +03:00
// Copyright (C) 2002-2009 The Bochs Project
2002-03-06 23:39:23 +03:00
//
// 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
/////////////////////////////////////////////////////////////////////////
2002-03-06 23:39:23 +03:00
2002-02-05 08:51:38 +03:00
#define _MULTI_THREAD
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
// Define BX_PLUGGABLE in files that can be compiled into plugins. For
// platforms that require a special tag on exported symbols, BX_PLUGGABLE
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
// is used to know when we are exporting symbols and when we are importing.
#define BX_PLUGGABLE
- apply patch.ifdef-disabled-options. Comments from that patch are below: For a whole lot of configure options, I put #if...#endif around code that is specific to the option, even in files which are normally only compiled when the option is on. This allows me to create a MS Visual C++ 6.0 workspace that supports many of these options. The workspace will basically compile every file all the time, but the code for disabled options will be commented out by the #if...#endif. This may one day lead to simplification of the Makefiles and configure scripts, but for the moment I'm leaving Makefiles and configure scripts alone. Affected options: BX_SUPPORT_APIC (cpu/apic.cc) BX_SUPPORT_X86_64 (cpu/*64.cc) BX_DEBUGGER (debug/*) BX_DISASM (disasm/*) BX_WITH_nameofgui (gui/*) BX_SUPPORT_CDROM (iodev/cdrom.cc) BX_NE2K_SUPPORT (iodev/eth*.cc, iodev/ne2k.cc) BX_SUPPORT_APIC (iodev/ioapic.cc) BX_IODEBUG_SUPPORT (iodev/iodebug.cc) BX_PCI_SUPPORT (iodev/pci*.cc) BX_SUPPORT_SB16 (iodev/sb*.cc) Modified Files: cpu/apic.cc cpu/arith64.cc cpu/ctrl_xfer64.cc cpu/data_xfer64.cc cpu/fetchdecode64.cc cpu/logical64.cc cpu/mult64.cc cpu/resolve64.cc cpu/shift64.cc cpu/stack64.cc debug/Makefile.in debug/crc.cc debug/dbg_main.cc debug/lexer.l debug/linux.cc debug/parser.c debug/parser.y disasm/dis_decode.cc disasm/dis_groups.cc gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/macintosh.cc gui/rfb.cc gui/sdl.cc gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxmain.cc gui/x.cc iodev/cdrom.cc iodev/eth.cc iodev/eth_arpback.cc iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_packetmaker.cc iodev/eth_tap.cc iodev/eth_tuntap.cc iodev/eth_win32.cc iodev/ioapic.cc iodev/iodebug.cc iodev/ne2k.cc iodev/pci.cc iodev/pci2isa.cc iodev/sb16.cc iodev/soundlnx.cc iodev/soundwin.cc
2002-11-19 08:47:45 +03:00
#include "bochs.h"
#include "param_names.h"
#include "keymap.h"
#include "iodev.h"
- apply patch.ifdef-disabled-options. Comments from that patch are below: For a whole lot of configure options, I put #if...#endif around code that is specific to the option, even in files which are normally only compiled when the option is on. This allows me to create a MS Visual C++ 6.0 workspace that supports many of these options. The workspace will basically compile every file all the time, but the code for disabled options will be commented out by the #if...#endif. This may one day lead to simplification of the Makefiles and configure scripts, but for the moment I'm leaving Makefiles and configure scripts alone. Affected options: BX_SUPPORT_APIC (cpu/apic.cc) BX_SUPPORT_X86_64 (cpu/*64.cc) BX_DEBUGGER (debug/*) BX_DISASM (disasm/*) BX_WITH_nameofgui (gui/*) BX_SUPPORT_CDROM (iodev/cdrom.cc) BX_NE2K_SUPPORT (iodev/eth*.cc, iodev/ne2k.cc) BX_SUPPORT_APIC (iodev/ioapic.cc) BX_IODEBUG_SUPPORT (iodev/iodebug.cc) BX_PCI_SUPPORT (iodev/pci*.cc) BX_SUPPORT_SB16 (iodev/sb*.cc) Modified Files: cpu/apic.cc cpu/arith64.cc cpu/ctrl_xfer64.cc cpu/data_xfer64.cc cpu/fetchdecode64.cc cpu/logical64.cc cpu/mult64.cc cpu/resolve64.cc cpu/shift64.cc cpu/stack64.cc debug/Makefile.in debug/crc.cc debug/dbg_main.cc debug/lexer.l debug/linux.cc debug/parser.c debug/parser.y disasm/dis_decode.cc disasm/dis_groups.cc gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/macintosh.cc gui/rfb.cc gui/sdl.cc gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxmain.cc gui/x.cc iodev/cdrom.cc iodev/eth.cc iodev/eth_arpback.cc iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_packetmaker.cc iodev/eth_tap.cc iodev/eth_tuntap.cc iodev/eth_win32.cc iodev/ioapic.cc iodev/iodebug.cc iodev/ne2k.cc iodev/pci.cc iodev/pci2isa.cc iodev/sb16.cc iodev/soundlnx.cc iodev/soundwin.cc
2002-11-19 08:47:45 +03:00
#if BX_WITH_SDL
2002-02-05 08:51:38 +03:00
#include <stdlib.h>
#include <SDL.h>
#include <SDL_endian.h>
#include <SDL_thread.h>
2002-02-05 08:51:38 +03:00
#include "icon_bochs.h"
#include "sdl.h"
#ifdef WIN32
#include "win32dialog.h"
#endif
2002-02-05 08:51:38 +03:00
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
class bx_sdl_gui_c : public bx_gui_c {
public:
2009-10-24 17:17:33 +04:00
bx_sdl_gui_c() {}
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
DECLARE_GUI_VIRTUAL_METHODS()
DECLARE_GUI_NEW_VIRTUAL_METHODS()
2008-03-07 00:15:40 +03:00
virtual void set_display_mode(disp_mode_t newmode);
virtual void statusbar_setitem(int element, bx_bool active, bx_bool w = 0);
#if BX_SHOW_IPS
virtual void show_ips(Bit32u ips_count);
#endif
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
};
void sdl_set_status_text(int element, const char *text, bx_bool active, bx_bool w = 0);
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
// declare one instance of the gui object and call macro to insert the
// plugin code
static bx_sdl_gui_c *theGui = NULL;
IMPLEMENT_GUI_PLUGIN_CODE(sdl)
#define LOG_THIS theGui->
2002-02-05 08:51:38 +03:00
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
const Uint32 status_led_green = 0x00ff0000;
const Uint32 status_gray_text = 0x80808000;
const Uint32 status_led_red = 0x0040ff00;
#else
const Uint32 status_led_green = 0x0000ff00;
const Uint32 status_gray_text = 0x00808080;
const Uint32 status_led_red = 0x00ff4000;
#endif
static unsigned prev_cursor_x=0;
static unsigned prev_cursor_y=0;
static Bit32u convertStringToSDLKey (const char *string);
#define MAX_SDL_BITMAPS 32
struct bitmaps {
SDL_Surface *surface;
SDL_Rect src,dst;
void (*cb)(void);
};
static struct {
unsigned bmp_id;
unsigned alignment;
void (*f)(void);
} hb_entry[BX_MAX_HEADERBAR_ENTRIES];
unsigned bx_headerbar_entries = 0;
2002-02-05 08:51:38 +03:00
SDL_Thread *sdl_thread;
SDL_Surface *sdl_screen, *sdl_fullscreen;
2002-02-05 08:51:38 +03:00
SDL_Event sdl_event;
int sdl_fullscreen_toggle;
int sdl_grab;
unsigned res_x, res_y;
unsigned half_res_x, half_res_y;
int headerbar_height;
static unsigned bx_bitmap_left_xorigin = 0; // pixels from left
static unsigned bx_bitmap_right_xorigin = 0; // pixels from right
static unsigned int text_rows = 25, text_cols = 80;
Bit8u h_panning = 0, v_panning = 0;
Bit16u line_compare = 1023;
2002-02-05 08:51:38 +03:00
int fontwidth = 8, fontheight = 16;
static unsigned vga_bpp=8;
2002-02-05 08:51:38 +03:00
unsigned tilewidth, tileheight;
unsigned char menufont[256][8];
Uint32 palette[256];
Uint32 headerbar_fg, headerbar_bg;
Bit8u old_mousebuttons=0, new_mousebuttons=0;
int old_mousex=0, new_mousex=0;
int old_mousey=0, new_mousey=0;
- Apply patch.replace-Boolean rev 1.3. Every "Boolean" is now changed to a "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
2002-10-25 15:44:41 +04:00
bx_bool just_warped = false;
bitmaps *sdl_bitmaps[MAX_SDL_BITMAPS];
int n_sdl_bitmaps = 0;
int statusbar_height = 18;
static unsigned statusitem_pos[12] = {
0, 170, 210, 250, 290, 330, 370, 410, 450, 490, 530, 570
};
static bx_bool statusitem_active[12];
#if BX_SHOW_IPS
static bx_bool sdl_ips_update = 0;
static char sdl_ips_text[20];
#endif
2002-02-05 08:51:38 +03:00
#if SDL_BYTEORDER == SDL_LIL_ENDIAN
#define SWAP16(X) (X)
#define SWAP32(X) (X)
#else
#define SWAP16(X) SDL_Swap16(X)
#define SWAP32(X) SDL_Swap32(X)
#endif
static void headerbar_click(int x);
2002-02-05 08:51:38 +03:00
#if !defined(WIN32) && BX_DEBUGGER && BX_DEBUGGER_GUI
BxEvent *sdl_notify_callback (void *unused, BxEvent *event);
static bxevent_handler old_callback = NULL;
static void *old_callback_arg = NULL;
#endif
#if BX_SHOW_IPS
#if defined(__MINGW32__) || defined(_MSC_VER)
void bx_signal_handler(int);
#endif
#endif
void switch_to_windowed(void)
{
SDL_Surface *tmp;
SDL_Rect src, dst;
src.x = 0; src.y = 0;
src.w = res_x; src.h = res_y;
dst.x = 0; dst.y = 0;
tmp = SDL_CreateRGBSurface(
SDL_SWSURFACE,
res_x,
res_y,
32,
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
0xff000000,
0x00ff0000,
0x0000ff00,
0x000000ff
#else
0x000000ff,
0x0000ff00,
0x00ff0000,
0xff000000
#endif
);
SDL_BlitSurface(sdl_fullscreen,&src,tmp,&dst);
SDL_UpdateRect(tmp,0,0,res_x,res_y);
SDL_FreeSurface(sdl_fullscreen);
sdl_fullscreen = NULL;
sdl_screen = SDL_SetVideoMode(res_x,res_y+headerbar_height+statusbar_height,32, SDL_SWSURFACE);
dst.y = headerbar_height;
SDL_BlitSurface(tmp,&src,sdl_screen,&dst);
SDL_UpdateRect(tmp,0,0,res_x,res_y+headerbar_height+statusbar_height);
SDL_FreeSurface(tmp);
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
bx_gui->show_headerbar();
SDL_ShowCursor(1);
if (sdl_grab==1) {
SDL_WM_GrabInput(SDL_GRAB_OFF);
sdl_grab = 0;
bx_gui->toggle_mouse_enable();
}
bx_gui->flush();
}
void switch_to_fullscreen(void)
{
SDL_Surface *tmp;
SDL_Rect src, dst;
src.x = 0; src.y = headerbar_height;
src.w = res_x; src.h = res_y;
dst.x = 0; dst.y = 0;
tmp = SDL_CreateRGBSurface(
SDL_SWSURFACE,
res_x,
res_y,
32,
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
0xff000000,
0x00ff0000,
0x0000ff00,
0x000000ff
#else
0x000000ff,
0x0000ff00,
0x00ff0000,
0xff000000
#endif
);
SDL_BlitSurface(sdl_screen,&src,tmp,&dst);
SDL_UpdateRect(tmp,0,0,res_x,res_y);
SDL_FreeSurface(sdl_screen);
sdl_screen = NULL;
sdl_fullscreen = SDL_SetVideoMode(res_x,res_y,32, SDL_HWSURFACE|SDL_FULLSCREEN);
src.y = 0;
SDL_BlitSurface(tmp,&src,sdl_fullscreen,&dst);
SDL_UpdateRect(tmp,0,0,res_x,res_y);
SDL_FreeSurface(tmp);
SDL_ShowCursor(0);
if (sdl_grab==0) {
SDL_WM_GrabInput(SDL_GRAB_ON);
sdl_grab = 1;
bx_gui->toggle_mouse_enable();
}
bx_gui->flush();
}
#if BX_SHOW_IPS
#if defined(__MINGW32__) || defined(_MSC_VER)
Uint32 SDLCALL sdlTimer(Uint32 interval)
{
bx_signal_handler(SIGALRM);
return interval;
}
#endif
#endif
#ifdef __MORPHOS__
void bx_sdl_morphos_exit(void)
{
SDL_Quit();
if (PowerSDLBase) CloseLibrary(PowerSDLBase);
}
#endif
void bx_sdl_gui_c::specific_init(int argc, char **argv,
2002-02-05 08:51:38 +03:00
unsigned x_tilesize,
unsigned y_tilesize,
unsigned header_bar_y)
{
int i,j;
Uint32 flags;
bx_bool gui_ci;
2002-02-05 08:51:38 +03:00
gui_ci = !strcmp(SIM->get_param_enum(BXPN_SEL_CONFIG_INTERFACE)->get_selected(), "win32config");
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
put("SDL");
UNUSED(bochs_icon_bits);
2002-02-05 08:51:38 +03:00
tilewidth = x_tilesize;
tileheight = y_tilesize;
headerbar_height = header_bar_y;
for(i=0;i<256;i++)
for(j=0;j<16;j++)
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
vga_charmap[i*32+j] = sdl_font8x16[i][j];
2002-02-05 08:51:38 +03:00
for(i=0;i<256;i++)
for(j=0;j<8;j++)
menufont[i][j] = sdl_font8x8[i][j];
#ifdef __MORPHOS__
if (!(PowerSDLBase=OpenLibrary("powersdl.library",0)))
{
LOG_THIS setonoff(LOGLEVEL_PANIC, ACT_FATAL);
BX_PANIC(("Unable to open SDL libraries"));
return;
}
#endif
flags = SDL_INIT_VIDEO;
#if BX_SHOW_IPS
#if defined(__MINGW32__) || defined(_MSC_VER)
flags |= SDL_INIT_TIMER;
#endif
#endif
if (SDL_Init(flags) < 0) {
2002-02-05 08:51:38 +03:00
LOG_THIS setonoff(LOGLEV_PANIC, ACT_FATAL);
BX_PANIC(("Unable to initialize SDL libraries"));
2002-02-05 08:51:38 +03:00
return;
}
#ifdef __MORPHOS__
atexit(bx_sdl_morphos_exit);
#else
2002-02-05 08:51:38 +03:00
atexit(SDL_Quit);
#endif
2002-02-05 08:51:38 +03:00
sdl_screen = NULL;
sdl_fullscreen_toggle = 0;
dimension_update(640,480);
2002-02-05 08:51:38 +03:00
SDL_EnableKeyRepeat(250,50);
SDL_WM_SetCaption(BOCHS_WINDOW_NAME, "Bochs");
SDL_WarpMouse(half_res_x, half_res_y);
// load keymap for sdl
if (SIM->get_param_bool(BXPN_KBD_USEMAPPING)->get()) {
bx_keymap.loadKeymap(convertStringToSDLKey);
}
// parse sdl specific options
if (argc > 1) {
for (i = 1; i < argc; i++) {
if (!strcmp(argv[i], "fullscreen")) {
sdl_fullscreen_toggle = 1;
switch_to_fullscreen();
#if !defined(WIN32) && BX_DEBUGGER && BX_DEBUGGER_GUI
} else if (!strcmp(argv[i], "gui_debug")) {
extern void InitDebugDialog();
SIM->set_debug_gui(1);
// redirect notify callback to sdl specific code
SIM->get_notify_callback (&old_callback, &old_callback_arg);
assert (old_callback != NULL);
SIM->set_notify_callback (sdl_notify_callback, NULL);
InitDebugDialog();
#endif
} else {
BX_PANIC(("Unknown sdl option '%s'", argv[i]));
}
}
}
new_gfx_api = 1;
#ifdef WIN32
if (gui_ci) {
dialog_caps = BX_GUI_DLG_ALL;
}
#if BX_SHOW_IPS
SDL_SetTimer(1000, sdlTimer);
#endif
#endif
2002-02-05 08:51:38 +03:00
}
void sdl_set_status_text(int element, const char *text, bx_bool active, bx_bool w)
{
Uint32 *buf, *buf_row;
Uint32 disp, fgcolor, bgcolor;
unsigned char *pfont_row, font_row;
int rowsleft = statusbar_height - 2;
int colsleft, textlen;
int x, xleft, xsize;
statusitem_active[element] = active;
if(!sdl_screen) return;
disp = sdl_screen->pitch/4;
xleft = statusitem_pos[element] + 2;
xsize = statusitem_pos[element+1] - xleft - 1;
buf = (Uint32 *)sdl_screen->pixels + (res_y + headerbar_height + 1) * disp + xleft;
rowsleft = statusbar_height - 2;
fgcolor = active?headerbar_fg:status_gray_text;
if (element > 0) {
bgcolor = active?(w?status_led_red:status_led_green):headerbar_bg;
} else {
bgcolor = headerbar_bg;
}
do {
colsleft = xsize;
buf_row = buf;
do
{
*buf++ = bgcolor;
} while(--colsleft);
buf = buf_row + disp;
} while(--rowsleft);
if ((element > 0) && (strlen(text) > 4)) {
textlen = 4;
} else {
textlen = strlen(text);
}
buf = (Uint32 *)sdl_screen->pixels + (res_y + headerbar_height + 5) * disp + xleft;
x = 0;
do
{
pfont_row = &menufont[(unsigned)text[x]][0];
buf_row = buf;
rowsleft = 8;
do
{
font_row = *pfont_row++;
colsleft = 8;
do
{
if((font_row & 0x80) != 0x00)
*buf++ = fgcolor;
else
buf++;
font_row <<= 1;
} while(--colsleft);
buf += (disp - 8);
} while(--rowsleft);
buf = buf_row + 8;
x++;
} while (--textlen);
SDL_UpdateRect(sdl_screen, xleft,res_y+headerbar_height+1,xsize,statusbar_height-2);
}
void bx_sdl_gui_c::statusbar_setitem(int element, bx_bool active, bx_bool w)
{
if (element < 0) {
for (unsigned i = 0; i < statusitem_count; i++) {
sdl_set_status_text(i+1, statusitem_text[i], active, w);
}
} else if ((unsigned)element < statusitem_count) {
sdl_set_status_text(element+1, statusitem_text[element], active, w);
}
}
2009-10-24 17:17:33 +04:00
void bx_sdl_gui_c::text_update(Bit8u *old_text, Bit8u *new_text,
2002-02-05 08:51:38 +03:00
unsigned long cursor_x,
unsigned long cursor_y,
bx_vga_tminfo_t tm_info)
2002-02-05 08:51:38 +03:00
{
Bit8u *pfont_row, *old_line, *new_line, *text_base;
unsigned int cs_y, i, x, y;
unsigned int curs, hchars, offset;
Bit8u fontline, fontpixels, fontrows;
int rows;
Uint32 fgcolor, bgcolor;
2002-02-05 08:51:38 +03:00
Uint32 *buf, *buf_row, *buf_char;
Uint32 disp;
Bit16u font_row, mask;
Bit8u cfstart, cfwidth, cfheight, split_fontrows, split_textrow;
bx_bool cursor_visible, gfxcharw9, invert, forceUpdate, split_screen;
bx_bool blink_mode, blink_state;
Uint32 text_palette[16];
forceUpdate = 0;
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)
forceUpdate = 1;
}
if (charmap_updated) {
forceUpdate = 1;
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
charmap_updated = 0;
}
for (i=0; i<16; i++) {
text_palette[i] = palette[DEV_vga_get_actl_pal_idx(i)];
}
if ((tm_info.h_panning != h_panning) || (tm_info.v_panning != v_panning)) {
forceUpdate = 1;
h_panning = tm_info.h_panning;
v_panning = tm_info.v_panning;
}
if (tm_info.line_compare != line_compare) {
forceUpdate = 1;
line_compare = tm_info.line_compare;
}
if (sdl_screen) {
disp = sdl_screen->pitch/4;
buf_row = (Uint32 *)sdl_screen->pixels + headerbar_height*disp;
} else {
disp = sdl_fullscreen->pitch/4;
buf_row = (Uint32 *)sdl_fullscreen->pixels;
}
// first 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];
}
cursor_visible = ((tm_info.cs_start <= tm_info.cs_end) && (tm_info.cs_start < fontheight));
if((cursor_visible) && (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;
if (v_panning) rows++;
y = 0;
cs_y = 0;
text_base = new_text - tm_info.start_address;
if (line_compare < res_y) {
split_textrow = (line_compare + v_panning) / fontheight;
split_fontrows = ((line_compare + v_panning) % fontheight) + 1;
} else {
split_textrow = rows + 1;
split_fontrows = 0;
}
split_screen = 0;
do {
2002-02-05 08:51:38 +03:00
buf = buf_row;
hchars = text_cols;
if (h_panning) hchars++;
cfheight = fontheight;
cfstart = 0;
if (split_screen)
{
if (rows == 1)
{
cfheight = (res_y - line_compare - 1) % fontheight;
if (cfheight == 0) cfheight = fontheight;
}
}
else if (v_panning)
{
if (y == 0)
{
cfheight -= v_panning;
cfstart = v_panning;
}
else if (rows == 1)
{
cfheight = v_panning;
}
}
if (!split_screen && (y == split_textrow))
{
if ((split_fontrows - cfstart) < cfheight)
{
cfheight = split_fontrows - cfstart;
}
}
new_line = new_text;
old_line = old_text;
x = 0;
offset = cs_y * tm_info.line_offset;
2002-02-05 08:51:38 +03:00
do
{
cfwidth = fontwidth;
if (h_panning)
{
if (hchars > text_cols)
{
cfwidth -= h_panning;
}
else if (hchars == 1)
{
cfwidth = h_panning;
}
}
2002-02-05 08:51:38 +03:00
// check if char needs to be updated
if(forceUpdate || (old_text[0] != new_text[0])
|| (old_text[1] != new_text[1]))
2002-02-05 08:51:38 +03:00
{
// Get Foreground/Background pixel colors
fgcolor = text_palette[new_text[1] & 0x0F];
if (blink_mode) {
bgcolor = text_palette[(new_text[1] >> 4) & 0x07];
if (!blink_state && (new_text[1] & 0x80))
fgcolor = bgcolor;
} else {
bgcolor = text_palette[(new_text[1] >> 4) & 0x0F];
}
invert = ((offset == curs) && (cursor_visible));
gfxcharw9 = ((tm_info.line_graphics) && ((new_text[0] & 0xE0) == 0xC0));
2002-02-05 08:51:38 +03:00
// Display this one char
fontrows = cfheight;
fontline = cfstart;
if (y > 0)
{
pfont_row = &vga_charmap[(new_text[0] << 5)];
}
else
{
pfont_row = &vga_charmap[(new_text[0] << 5) + cfstart];
}
2002-02-05 08:51:38 +03:00
buf_char = buf;
do
{
font_row = *pfont_row++;
if (gfxcharw9)
{
font_row = (font_row << 1) | (font_row & 0x01);
}
else
{
font_row <<= 1;
}
if (hchars > text_cols)
{
font_row <<= h_panning;
}
fontpixels = cfwidth;
if ((invert) && (fontline >= tm_info.cs_start) && (fontline <= tm_info.cs_end))
mask = 0x100;
else
mask = 0x00;
2002-02-05 08:51:38 +03:00
do
{
if ((font_row & 0x100) == mask)
2002-02-05 08:51:38 +03:00
*buf = bgcolor;
else
*buf = fgcolor;
buf++;
font_row <<= 1;
} while(--fontpixels);
buf -= cfwidth;
buf += disp;
fontline++;
} while(--fontrows);
2002-02-05 08:51:38 +03:00
// restore output buffer ptr to start of this char
buf = buf_char;
}
// move to next char location on screen
buf += cfwidth;
2002-02-05 08:51:38 +03:00
// select next char in old/new text
new_text+=2;
old_text+=2;
offset+=2;
x++;
2002-02-05 08:51:38 +03:00
// process one entire horizontal row
} while(--hchars);
2002-02-05 08:51:38 +03:00
// go to next character row location
buf_row += disp * cfheight;
if (!split_screen && (y == split_textrow))
{
new_text = text_base;
forceUpdate = 1;
cs_y = 0;
if (tm_info.split_hpanning) h_panning = 0;
rows = ((res_y - line_compare + fontheight - 2) / fontheight) + 1;
split_screen = 1;
}
else
{
new_text = new_line + tm_info.line_offset;
old_text = old_line + tm_info.line_offset;
cs_y++;
y++;
}
} while(--rows);
h_panning = tm_info.h_panning;
prev_cursor_x = cursor_x;
prev_cursor_y = cursor_y;
2002-02-05 08:51:38 +03:00
}
int bx_sdl_gui_c::get_clipboard_text(Bit8u **bytes, Bit32s *nbytes)
{
return 0;
}
int bx_sdl_gui_c::set_clipboard_text(char *text_snapshot, Bit32u len)
{
return 0;
}
void bx_sdl_gui_c::graphics_tile_update(Bit8u *snapshot, unsigned x, unsigned y)
2002-02-05 08:51:38 +03:00
{
Uint32 *buf, disp;
Uint32 *buf_row;
2002-02-05 08:51:38 +03:00
int i,j;
if(sdl_screen)
{
disp = sdl_screen->pitch/4;
buf = (Uint32 *)sdl_screen->pixels + (headerbar_height+y)*disp + x;
}
else
{
disp = sdl_fullscreen->pitch/4;
buf = (Uint32 *)sdl_fullscreen->pixels + y*disp + x;
}
i = tileheight;
if(i + y > res_y) i = res_y - y;
// FIXME
if(i<=0) return;
switch (vga_bpp)
2002-02-05 08:51:38 +03:00
{
case 8: /* 8 bpp */
do
{
buf_row = buf;
j = tilewidth;
do
{
*buf++ = palette[*snapshot++];
} while(--j);
buf = buf_row + disp;
} while(--i);
break;
default:
BX_PANIC(("%u bpp modes handled by new graphics API", vga_bpp));
return;
}
2002-02-05 08:51:38 +03:00
}
2008-03-07 00:15:40 +03:00
bx_svga_tileinfo_t *bx_sdl_gui_c::graphics_tile_info(bx_svga_tileinfo_t *info)
{
if (!info) {
info = (bx_svga_tileinfo_t *)malloc(sizeof(bx_svga_tileinfo_t));
2009-10-24 17:17:33 +04:00
if (!info) return NULL;
}
if (sdl_screen) {
info->bpp = sdl_screen->format->BitsPerPixel;
info->pitch = sdl_screen->pitch;
info->red_shift = sdl_screen->format->Rshift + 8 - sdl_screen->format->Rloss;
info->green_shift = sdl_screen->format->Gshift + 8 - sdl_screen->format->Gloss;
info->blue_shift = sdl_screen->format->Bshift + 8 - sdl_screen->format->Bloss;
info->red_mask = sdl_screen->format->Rmask;
info->green_mask = sdl_screen->format->Gmask;
info->blue_mask = sdl_screen->format->Bmask;
info->is_indexed = (sdl_screen->format->palette != NULL);
}
else {
info->bpp = sdl_fullscreen->format->BitsPerPixel;
info->pitch = sdl_fullscreen->pitch;
info->red_shift = sdl_fullscreen->format->Rshift + 8 - sdl_fullscreen->format->Rloss;
info->green_shift = sdl_fullscreen->format->Gshift + 8 - sdl_fullscreen->format->Gloss;
info->blue_shift = sdl_fullscreen->format->Bshift + 8 - sdl_fullscreen->format->Bloss;
info->red_mask = sdl_fullscreen->format->Rmask;
info->green_mask = sdl_fullscreen->format->Gmask;
info->blue_mask = sdl_fullscreen->format->Bmask;
info->is_indexed = (sdl_fullscreen->format->palette != NULL);
}
#ifdef BX_LITTLE_ENDIAN
info->is_little_endian = 1;
#else
info->is_little_endian = 0;
#endif
return info;
}
2009-10-24 17:17:33 +04:00
Bit8u *bx_sdl_gui_c::graphics_tile_get(unsigned x0, unsigned y0, unsigned *w, unsigned *h)
{
if (x0+tilewidth > res_x) {
*w = res_x - x0;
}
else {
*w = tilewidth;
}
if (y0+tileheight > res_y) {
*h = res_y - y0;
}
else {
*h = tileheight;
}
if (sdl_screen) {
return (Bit8u *)sdl_screen->pixels +
sdl_screen->pitch*(headerbar_height+y0) +
sdl_screen->format->BytesPerPixel*x0;
}
else {
return (Bit8u *)sdl_fullscreen->pixels +
sdl_fullscreen->pitch*(y0) +
sdl_fullscreen->format->BytesPerPixel*x0;
}
}
2008-03-07 00:15:40 +03:00
void bx_sdl_gui_c::graphics_tile_update_in_place(unsigned x0, unsigned y0,
unsigned w, unsigned h)
{
}
static Bit32u sdl_sym_to_bx_key (SDLKey sym)
{
switch (sym)
{
// case SDLK_UNKNOWN: return BX_KEY_UNKNOWN;
// case SDLK_FIRST: return BX_KEY_FIRST;
case SDLK_BACKSPACE: return BX_KEY_BACKSPACE;
case SDLK_TAB: return BX_KEY_TAB;
// case SDLK_CLEAR: return BX_KEY_CLEAR;
case SDLK_RETURN: return BX_KEY_ENTER;
case SDLK_PAUSE: return BX_KEY_PAUSE;
case SDLK_ESCAPE: return BX_KEY_ESC;
case SDLK_SPACE: return BX_KEY_SPACE;
// case SDLK_EXCLAIM: return BX_KEY_EXCLAIM;
// case SDLK_QUOTEDBL: return BX_KEY_QUOTEDBL;
// case SDLK_HASH: return BX_KEY_HASH;
// case SDLK_DOLLAR: return BX_KEY_DOLLAR;
// case SDLK_AMPERSAND: return BX_KEY_AMPERSAND;
case SDLK_QUOTE: return BX_KEY_SINGLE_QUOTE;
// case SDLK_LEFTPAREN: return BX_KEY_LEFTPAREN;
// case SDLK_RIGHTPAREN: return BX_KEY_RIGHTPAREN;
// case SDLK_ASTERISK: return BX_KEY_ASTERISK;
// case SDLK_PLUS: return BX_KEY_PLUS;
case SDLK_COMMA: return BX_KEY_COMMA;
case SDLK_MINUS: return BX_KEY_MINUS;
case SDLK_PERIOD: return BX_KEY_PERIOD;
case SDLK_SLASH: return BX_KEY_SLASH;
case SDLK_0: return BX_KEY_0;
case SDLK_1: return BX_KEY_1;
case SDLK_2: return BX_KEY_2;
case SDLK_3: return BX_KEY_3;
case SDLK_4: return BX_KEY_4;
case SDLK_5: return BX_KEY_5;
case SDLK_6: return BX_KEY_6;
case SDLK_7: return BX_KEY_7;
case SDLK_8: return BX_KEY_8;
case SDLK_9: return BX_KEY_9;
// case SDLK_COLON: return BX_KEY_COLON;
case SDLK_SEMICOLON: return BX_KEY_SEMICOLON;
// case SDLK_LESS: return BX_KEY_LESS;
case SDLK_EQUALS: return BX_KEY_EQUALS;
// case SDLK_GREATER: return BX_KEY_GREATER;
// case SDLK_QUESTION: return BX_KEY_QUESTION;
// case SDLK_AT: return BX_KEY_AT;
/*
Skip uppercase letters
*/
case SDLK_LEFTBRACKET: return BX_KEY_LEFT_BRACKET;
case SDLK_BACKSLASH: return BX_KEY_BACKSLASH;
case SDLK_RIGHTBRACKET: return BX_KEY_RIGHT_BRACKET;
// case SDLK_CARET: return BX_KEY_CARET;
// case SDLK_UNDERSCORE: return BX_KEY_UNDERSCORE;
case SDLK_BACKQUOTE: return BX_KEY_GRAVE;
case SDLK_a: return BX_KEY_A;
case SDLK_b: return BX_KEY_B;
case SDLK_c: return BX_KEY_C;
case SDLK_d: return BX_KEY_D;
case SDLK_e: return BX_KEY_E;
case SDLK_f: return BX_KEY_F;
case SDLK_g: return BX_KEY_G;
case SDLK_h: return BX_KEY_H;
case SDLK_i: return BX_KEY_I;
case SDLK_j: return BX_KEY_J;
case SDLK_k: return BX_KEY_K;
case SDLK_l: return BX_KEY_L;
case SDLK_m: return BX_KEY_M;
case SDLK_n: return BX_KEY_N;
case SDLK_o: return BX_KEY_O;
case SDLK_p: return BX_KEY_P;
case SDLK_q: return BX_KEY_Q;
case SDLK_r: return BX_KEY_R;
case SDLK_s: return BX_KEY_S;
case SDLK_t: return BX_KEY_T;
case SDLK_u: return BX_KEY_U;
case SDLK_v: return BX_KEY_V;
case SDLK_w: return BX_KEY_W;
case SDLK_x: return BX_KEY_X;
case SDLK_y: return BX_KEY_Y;
case SDLK_z: return BX_KEY_Z;
case SDLK_DELETE: return BX_KEY_DELETE;
/* End of ASCII mapped keysyms */
/* Numeric keypad */
case SDLK_KP0: return BX_KEY_KP_INSERT;
case SDLK_KP1: return BX_KEY_KP_END;
case SDLK_KP2: return BX_KEY_KP_DOWN;
case SDLK_KP3: return BX_KEY_KP_PAGE_DOWN;
case SDLK_KP4: return BX_KEY_KP_LEFT;
case SDLK_KP5: return BX_KEY_KP_5;
case SDLK_KP6: return BX_KEY_KP_RIGHT;
case SDLK_KP7: return BX_KEY_KP_HOME;
case SDLK_KP8: return BX_KEY_KP_UP;
case SDLK_KP9: return BX_KEY_KP_PAGE_UP;
case SDLK_KP_PERIOD: return BX_KEY_KP_DELETE;
case SDLK_KP_DIVIDE: return BX_KEY_KP_DIVIDE;
case SDLK_KP_MULTIPLY: return BX_KEY_KP_MULTIPLY;
case SDLK_KP_MINUS: return BX_KEY_KP_SUBTRACT;
case SDLK_KP_PLUS: return BX_KEY_KP_ADD;
case SDLK_KP_ENTER: return BX_KEY_KP_ENTER;
// case SDLK_KP_EQUALS: return BX_KEY_KP_EQUALS;
/* Arrows + Home/End pad */
case SDLK_UP: return BX_KEY_UP;
case SDLK_DOWN: return BX_KEY_DOWN;
case SDLK_RIGHT: return BX_KEY_RIGHT;
case SDLK_LEFT: return BX_KEY_LEFT;
case SDLK_INSERT: return BX_KEY_INSERT;
case SDLK_HOME: return BX_KEY_HOME;
case SDLK_END: return BX_KEY_END;
case SDLK_PAGEUP: return BX_KEY_PAGE_UP;
case SDLK_PAGEDOWN: return BX_KEY_PAGE_DOWN;
/* Function keys */
case SDLK_F1: return BX_KEY_F1;
case SDLK_F2: return BX_KEY_F2;
case SDLK_F3: return BX_KEY_F3;
case SDLK_F4: return BX_KEY_F4;
case SDLK_F5: return BX_KEY_F5;
case SDLK_F6: return BX_KEY_F6;
case SDLK_F7: return BX_KEY_F7;
case SDLK_F8: return BX_KEY_F8;
case SDLK_F9: return BX_KEY_F9;
case SDLK_F10: return BX_KEY_F10;
case SDLK_F11: return BX_KEY_F11;
case SDLK_F12: return BX_KEY_F12;
// case SDLK_F13: return BX_KEY_F13;
// case SDLK_F14: return BX_KEY_F14;
// case SDLK_F15: return BX_KEY_F15;
/* Key state modifier keys */
case SDLK_NUMLOCK: return BX_KEY_NUM_LOCK;
case SDLK_CAPSLOCK: return BX_KEY_CAPS_LOCK;
case SDLK_SCROLLOCK: return BX_KEY_SCRL_LOCK;
case SDLK_RSHIFT: return BX_KEY_SHIFT_R;
case SDLK_LSHIFT: return BX_KEY_SHIFT_L;
case SDLK_RCTRL: return BX_KEY_CTRL_R;
case SDLK_LCTRL: return BX_KEY_CTRL_L;
case SDLK_RALT: return BX_KEY_ALT_R;
case SDLK_LALT: return BX_KEY_ALT_L;
case SDLK_RMETA: return BX_KEY_ALT_R;
case SDLK_LMETA: return BX_KEY_WIN_L;
case SDLK_LSUPER: return BX_KEY_WIN_L;
case SDLK_RSUPER: return BX_KEY_WIN_R;
// case SDLK_MODE: return BX_KEY_MODE;
// case SDLK_COMPOSE: return BX_KEY_COMPOSE;
/* Miscellaneous function keys */
case SDLK_PRINT: return BX_KEY_PRINT;
case SDLK_BREAK: return BX_KEY_PAUSE;
case SDLK_MENU: return BX_KEY_MENU;
#if 0
case SDLK_HELP: return BX_KEY_HELP;
case SDLK_SYSREQ: return BX_KEY_SYSREQ;
case SDLK_POWER: return BX_KEY_POWER;
case SDLK_EURO: return BX_KEY_EURO;
case SDLK_UNDO: return BX_KEY_UNDO;
#endif
default:
BX_ERROR(("sdl keysym %d not mapped", (int)sym));
return BX_KEY_UNHANDLED;
}
}
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
void bx_sdl_gui_c::handle_events(void)
2002-02-05 08:51:38 +03:00
{
Bit32u key_event;
Bit8u mouse_state;
2004-12-10 18:57:46 +03:00
int wheel_status;
2002-02-05 08:51:38 +03:00
while(SDL_PollEvent(&sdl_event))
2002-02-05 08:51:38 +03:00
{
2004-12-10 18:57:46 +03:00
wheel_status = 0;
switch(sdl_event.type)
2002-02-05 08:51:38 +03:00
{
case SDL_VIDEOEXPOSE:
if(sdl_fullscreen_toggle == 0)
SDL_UpdateRect(sdl_screen, 0,0, res_x, res_y+headerbar_height+statusbar_height);
else
SDL_UpdateRect(sdl_fullscreen, 0, headerbar_height, res_x, res_y);
2002-02-05 08:51:38 +03:00
break;
case SDL_MOUSEMOTION:
//fprintf (stderr, "mouse event to (%d,%d), relative (%d,%d)\n", (int)(sdl_event.motion.x), (int)(sdl_event.motion.y), (int)sdl_event.motion.xrel, (int)sdl_event.motion.yrel);
if (!sdl_grab) {
//fprintf (stderr, "ignore mouse event because sdl_grab is off\n");
break;
}
if (just_warped
&& sdl_event.motion.x == half_res_x
&& sdl_event.motion.y == half_res_y) {
// This event was generated as a side effect of the WarpMouse,
// and it must be ignored.
//fprintf (stderr, "ignore mouse event because it is a side effect of SDL_WarpMouse\n");
just_warped = false;
break;
}
//fprintf (stderr, "processing relative mouse event\n");
new_mousebuttons = ((sdl_event.motion.state & 0x01)|((sdl_event.motion.state>>1)&0x02)
|((sdl_event.motion.state<<1)&0x04));
2004-12-10 18:57:46 +03:00
DEV_mouse_motion_ext(
sdl_event.motion.xrel,
-sdl_event.motion.yrel,
wheel_status,
new_mousebuttons);
old_mousebuttons = new_mousebuttons;
old_mousex = (int)(sdl_event.motion.x);
old_mousey = (int)(sdl_event.motion.y);
//fprintf (stderr, "warping mouse to center\n");
SDL_WarpMouse(half_res_x, half_res_y);
just_warped = 1;
break;
case SDL_MOUSEBUTTONDOWN:
if((sdl_event.button.button == SDL_BUTTON_MIDDLE)
&& ((SDL_GetModState() & KMOD_CTRL) > 0)
&& (sdl_fullscreen_toggle == 0))
{
if(sdl_grab == 0)
{
SDL_ShowCursor(0);
SDL_WM_GrabInput(SDL_GRAB_ON);
}
else
{
SDL_ShowCursor(1);
SDL_WM_GrabInput(SDL_GRAB_OFF);
}
sdl_grab = ~sdl_grab;
toggle_mouse_enable();
break;
} else if (sdl_event.button.y < headerbar_height) {
headerbar_click(sdl_event.button.x);
break;
}
#ifdef SDL_BUTTON_WHEELUP
2004-12-10 18:57:46 +03:00
// get the wheel status
if (sdl_event.button.button == SDL_BUTTON_WHEELUP) {
wheel_status = 1;
}
if (sdl_event.button.button == SDL_BUTTON_WHEELDOWN) {
wheel_status = -1;
}
#endif
case SDL_MOUSEBUTTONUP:
// figure out mouse state
new_mousex = (int)(sdl_event.button.x);
new_mousey = (int)(sdl_event.button.y);
// SDL_GetMouseState() returns the state of all buttons
mouse_state = SDL_GetMouseState(NULL, NULL);
new_mousebuttons =
(mouse_state & 0x01) |
((mouse_state>>1)&0x02) |
((mouse_state<<1)&0x04);
// filter out middle button if not fullscreen
if(sdl_fullscreen_toggle == 0)
new_mousebuttons &= 0x07;
2004-12-10 18:57:46 +03:00
// send motion information
DEV_mouse_motion_ext(
new_mousex - old_mousex,
-(new_mousey - old_mousey),
wheel_status,
new_mousebuttons);
// mark current state to diff with next packet
old_mousebuttons = new_mousebuttons;
old_mousex = new_mousex;
old_mousey = new_mousey;
break;
2002-02-05 08:51:38 +03:00
case SDL_KEYDOWN:
// Windows/Fullscreen toggle-check
if(sdl_event.key.keysym.sym == SDLK_SCROLLOCK)
2002-02-05 08:51:38 +03:00
{
// SDL_WM_ToggleFullScreen(sdl_screen);
sdl_fullscreen_toggle = ~sdl_fullscreen_toggle;
if(sdl_fullscreen_toggle == 0)
switch_to_windowed();
else
switch_to_fullscreen();
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
bx_gui->show_headerbar();
bx_gui->flush();
2002-02-05 08:51:38 +03:00
break;
}
// convert sym->bochs code
if (sdl_event.key.keysym.sym > SDLK_LAST) break;
if (!SIM->get_param_bool(BXPN_KBD_USEMAPPING)->get()) {
key_event = sdl_sym_to_bx_key (sdl_event.key.keysym.sym);
BX_DEBUG(("keypress scancode=%d, sym=%d, bx_key = %d", sdl_event.key.keysym.scancode, sdl_event.key.keysym.sym, key_event));
} else {
/* use mapping */
BXKeyEntry *entry = bx_keymap.findHostKey (sdl_event.key.keysym.sym);
if (!entry) {
BX_ERROR(("host key %d (0x%x) not mapped!",
(unsigned) sdl_event.key.keysym.sym,
(unsigned) sdl_event.key.keysym.sym));
break;
}
key_event = entry->baseKey;
}
if (key_event == BX_KEY_UNHANDLED) break;
DEV_kbd_gen_scancode( key_event);
if ((key_event == BX_KEY_NUM_LOCK) || (key_event == BX_KEY_CAPS_LOCK)) {
DEV_kbd_gen_scancode(key_event | BX_KEY_RELEASED);
}
2002-02-05 08:51:38 +03:00
break;
2002-02-05 08:51:38 +03:00
case SDL_KEYUP:
// filter out release of Windows/Fullscreen toggle and unsupported keys
if ((sdl_event.key.keysym.sym != SDLK_SCROLLOCK)
&& (sdl_event.key.keysym.sym < SDLK_LAST))
{
// convert sym->bochs code
if (!SIM->get_param_bool(BXPN_KBD_USEMAPPING)->get()) {
key_event = sdl_sym_to_bx_key (sdl_event.key.keysym.sym);
} else {
/* use mapping */
BXKeyEntry *entry = bx_keymap.findHostKey (sdl_event.key.keysym.sym);
if (!entry) {
BX_ERROR(("host key %d (0x%x) not mapped!",
(unsigned) sdl_event.key.keysym.sym,
(unsigned) sdl_event.key.keysym.sym));
break;
}
key_event = entry->baseKey;
}
if (key_event == BX_KEY_UNHANDLED) break;
if ((key_event == BX_KEY_NUM_LOCK) || (key_event == BX_KEY_CAPS_LOCK)) {
DEV_kbd_gen_scancode(key_event);
}
DEV_kbd_gen_scancode(key_event | BX_KEY_RELEASED);
}
2002-02-05 08:51:38 +03:00
break;
2002-02-05 08:51:38 +03:00
case SDL_QUIT:
LOG_THIS setonoff(LOGLEV_PANIC, ACT_FATAL);
BX_PANIC(("User requested shutdown."));
2002-02-05 08:51:38 +03:00
}
}
#if BX_SHOW_IPS
if (sdl_ips_update) {
sdl_ips_update = 0;
sdl_set_status_text(0, sdl_ips_text, 1);
}
#endif
2002-02-05 08:51:38 +03:00
}
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
void bx_sdl_gui_c::flush(void)
2002-02-05 08:51:38 +03:00
{
if(sdl_screen)
SDL_UpdateRect(sdl_screen,0,0,res_x,res_y+headerbar_height);
else
SDL_UpdateRect(sdl_fullscreen,0,0,res_x,res_y);
2002-02-05 08:51:38 +03:00
}
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
void bx_sdl_gui_c::clear_screen(void)
2002-02-05 08:51:38 +03:00
{
int i = res_y, j;
Uint32 color;
Uint32 *buf, *buf_row;
Uint32 disp;
2002-02-05 08:51:38 +03:00
if(sdl_screen)
2002-02-05 08:51:38 +03:00
{
color = SDL_MapRGB(sdl_screen->format, 0,0,0);
disp = sdl_screen->pitch/4;
buf = (Uint32 *)sdl_screen->pixels + headerbar_height*disp;
}
else if(sdl_fullscreen)
{
color = SDL_MapRGB(sdl_fullscreen->format, 0,0, 0);
disp = sdl_fullscreen->pitch/4;
buf = (Uint32 *)sdl_fullscreen->pixels;
2002-02-05 08:51:38 +03:00
}
else return;
do
{
buf_row = buf;
j = res_x;
while(j--) *buf++ = color;
buf = buf_row + disp;
} while(--i);
if(sdl_screen)
SDL_UpdateRect(sdl_screen,0,0,res_x,res_y+headerbar_height);
else
SDL_UpdateRect(sdl_fullscreen,0,0,res_x,res_y);
2002-02-05 08:51:38 +03:00
}
bx_bool bx_sdl_gui_c::palette_change(unsigned index, unsigned red, unsigned green, unsigned blue)
2002-02-05 08:51:38 +03:00
{
unsigned char palred = red & 0xFF;
unsigned char palgreen = green & 0xFF;
unsigned char palblue = blue & 0xFF;
if(index > 255) return 0;
2002-02-05 08:51:38 +03:00
if(sdl_screen)
palette[index] = SDL_MapRGB(sdl_screen->format, palred, palgreen, palblue);
else if(sdl_fullscreen)
palette[index] = SDL_MapRGB(sdl_fullscreen->format, palred, palgreen, palblue);
2002-02-05 08:51:38 +03:00
return 1;
}
2009-10-24 17:17:33 +04:00
void bx_sdl_gui_c::dimension_update(unsigned x, unsigned y,
unsigned fheight, unsigned fwidth, unsigned bpp)
2002-02-05 08:51:38 +03:00
{
2009-10-24 17:17:33 +04:00
if (bpp == 8 || bpp == 15 || bpp == 16 || bpp == 24 || bpp == 32) {
vga_bpp = bpp;
}
else
{
BX_PANIC(("%d bpp graphics mode not supported", bpp));
}
if(fheight > 0)
{
fontheight = fheight;
fontwidth = fwidth;
text_cols = x / fontwidth;
text_rows = y / fontheight;
}
if((x == res_x) && (y == res_y)) return;
2002-02-05 08:51:38 +03:00
if(sdl_screen)
{
SDL_FreeSurface(sdl_screen);
sdl_screen = NULL;
}
if(sdl_fullscreen)
2002-02-05 08:51:38 +03:00
{
SDL_FreeSurface(sdl_fullscreen);
sdl_fullscreen = NULL;
}
if(sdl_fullscreen_toggle == 0)
{
sdl_screen = SDL_SetVideoMode(x, y+headerbar_height+statusbar_height, 32, SDL_SWSURFACE);
if(!sdl_screen)
{
LOG_THIS setonoff(LOGLEV_PANIC, ACT_FATAL);
BX_PANIC(("Unable to set requested videomode: %ix%i: %s",x,y,SDL_GetError()));
}
headerbar_fg = SDL_MapRGB(
sdl_screen->format,
BX_HEADERBAR_FG_RED,
BX_HEADERBAR_FG_GREEN,
BX_HEADERBAR_FG_BLUE);
headerbar_bg = SDL_MapRGB(
sdl_screen->format,
BX_HEADERBAR_BG_RED,
BX_HEADERBAR_BG_GREEN,
BX_HEADERBAR_BG_BLUE);
}
else
{
sdl_fullscreen = SDL_SetVideoMode(x, y, 32, SDL_HWSURFACE|SDL_FULLSCREEN);
if(!sdl_fullscreen)
{
LOG_THIS setonoff(LOGLEV_PANIC, ACT_FATAL);
BX_PANIC(("Unable to set requested videomode: %ix%i: %s",x,y,SDL_GetError()));
}
2002-02-05 08:51:38 +03:00
}
res_x = x;
res_y = y;
half_res_x = x/2;
half_res_y = y/2;
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
bx_gui->show_headerbar();
2002-02-05 08:51:38 +03:00
}
2009-10-24 17:17:33 +04:00
unsigned bx_sdl_gui_c::create_bitmap(const unsigned char *bmap, unsigned xdim, unsigned ydim)
2002-02-05 08:51:38 +03:00
{
Uint32 *buf, *buf_row;
Uint32 disp;
unsigned char pixels;
if (n_sdl_bitmaps >= MAX_SDL_BITMAPS) {
BX_PANIC(("too many SDL bitmaps. To fix, increase MAX_SDL_BITMAPS"));
return 0;
}
2009-10-24 17:17:33 +04:00
bitmaps *tmp = new bitmaps;
tmp->surface = SDL_CreateRGBSurface(
SDL_SWSURFACE,
xdim,
ydim,
32,
#if SDL_BYTEORDER == SDL_BIG_ENDIAN
0xff000000,
0x00ff0000,
0x0000ff00,
0x00000000
#else
0x000000ff,
0x0000ff00,
0x00ff0000,
0x00000000
#endif
);
2009-10-24 17:17:33 +04:00
if(!tmp->surface)
{
delete tmp;
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
bx_gui->exit();
LOG_THIS setonoff(LOGLEV_PANIC, ACT_FATAL);
BX_PANIC(("Unable to create requested bitmap"));
}
2009-10-24 17:17:33 +04:00
tmp->src.w = xdim;
tmp->src.h = ydim;
tmp->src.x = 0;
tmp->src.y = 0;
tmp->dst.x = -1;
tmp->dst.y = 0;
tmp->dst.w = xdim;
tmp->dst.h = ydim;
tmp->cb = NULL;
buf = (Uint32 *)tmp->surface->pixels;
disp = tmp->surface->pitch/4;
2009-10-24 17:17:33 +04:00
do
{
buf_row = buf;
xdim = tmp->src.w / 8;
do
{
pixels = *bmap++;
for(unsigned i=0;i<8;i++)
{
if((pixels & 0x01) == 0)
*buf++ = headerbar_bg;
else
*buf++ = headerbar_fg;
pixels = pixels >> 1;
}
} while(--xdim);
buf = buf_row + disp;
} while(--ydim);
2009-10-24 17:17:33 +04:00
SDL_UpdateRect(tmp->surface, 0, 0, tmp->src.w, tmp->src.h);
sdl_bitmaps[n_sdl_bitmaps] = tmp;
2009-10-24 17:17:33 +04:00
return n_sdl_bitmaps++;
2002-02-05 08:51:38 +03:00
}
2009-10-24 17:17:33 +04:00
unsigned bx_sdl_gui_c::headerbar_bitmap(unsigned bmap_id, unsigned alignment,
2002-02-05 08:51:38 +03:00
void (*f)(void))
{
unsigned hb_index;
if(bmap_id >= (unsigned)n_sdl_bitmaps) return 0;
if ((bx_headerbar_entries+1) > BX_MAX_HEADERBAR_ENTRIES)
BX_PANIC(("too many headerbar entries, increase BX_MAX_HEADERBAR_ENTRIES"));
bx_headerbar_entries++;
hb_index = bx_headerbar_entries - 1;
hb_entry[hb_index].bmp_id = bmap_id;
hb_entry[hb_index].alignment = alignment;
hb_entry[hb_index].f = f;
2009-10-24 17:17:33 +04:00
if (alignment == BX_GRAVITY_LEFT) {
sdl_bitmaps[bmap_id]->dst.x = bx_bitmap_left_xorigin;
bx_bitmap_left_xorigin += sdl_bitmaps[bmap_id]->src.w;
} else {
bx_bitmap_right_xorigin += sdl_bitmaps[bmap_id]->src.w;
sdl_bitmaps[bmap_id]->dst.x = bx_bitmap_right_xorigin;
}
2009-10-24 17:17:33 +04:00
return hb_index;
2002-02-05 08:51:38 +03:00
}
2009-10-24 17:17:33 +04:00
void bx_sdl_gui_c::replace_bitmap(unsigned hbar_id, unsigned bmap_id)
2002-02-05 08:51:38 +03:00
{
SDL_Rect hb_dst;
unsigned old_id;
if (!sdl_screen) return;
old_id = hb_entry[hbar_id].bmp_id;
hb_dst = sdl_bitmaps[old_id]->dst;
sdl_bitmaps[old_id]->dst.x = -1;
hb_entry[hbar_id].bmp_id = bmap_id;
sdl_bitmaps[bmap_id]->dst.x = hb_dst.x;
if(sdl_bitmaps[bmap_id]->dst.x != -1)
{
if (hb_entry[hbar_id].alignment == BX_GRAVITY_RIGHT) {
hb_dst.x = res_x - hb_dst.x;
}
SDL_BlitSurface(
sdl_bitmaps[bmap_id]->surface,
&sdl_bitmaps[bmap_id]->src,
sdl_screen,
&hb_dst);
SDL_UpdateRect(
sdl_screen,
hb_dst.x,
sdl_bitmaps[bmap_id]->dst.y,
sdl_bitmaps[bmap_id]->src.w,
sdl_bitmaps[bmap_id]->src.h);
}
2002-02-05 08:51:38 +03:00
}
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
void bx_sdl_gui_c::show_headerbar(void)
2002-02-05 08:51:38 +03:00
{
Uint32 *buf;
Uint32 *buf_row;
Uint32 disp;
int rowsleft = headerbar_height;
int colsleft, sb_item;
int bitmapscount = bx_headerbar_entries;
unsigned current_bmp, pos_x;
SDL_Rect hb_dst;
if(!sdl_screen) return;
disp = sdl_screen->pitch/4;
buf = (Uint32 *)sdl_screen->pixels;
// draw headerbar background
do
{
colsleft = res_x;
buf_row = buf;
do
{
*buf++ = headerbar_bg;
} while(--colsleft);
buf = buf_row + disp;
} while(--rowsleft);
SDL_UpdateRect( sdl_screen, 0,0,res_x,headerbar_height);
2002-02-05 08:51:38 +03:00
// go thru the bitmaps and display the active ones
while(bitmapscount--)
{
current_bmp = hb_entry[bitmapscount].bmp_id;
if(sdl_bitmaps[current_bmp]->dst.x != -1)
{
hb_dst = sdl_bitmaps[current_bmp]->dst;
if (hb_entry[bitmapscount].alignment == BX_GRAVITY_RIGHT) {
hb_dst.x = res_x - hb_dst.x;
}
SDL_BlitSurface(
sdl_bitmaps[current_bmp]->surface,
&sdl_bitmaps[current_bmp]->src,
sdl_screen,
&hb_dst);
SDL_UpdateRect(
sdl_screen,
hb_dst.x,
sdl_bitmaps[current_bmp]->dst.y,
sdl_bitmaps[current_bmp]->src.w,
sdl_bitmaps[current_bmp]->src.h);
}
}
// draw statusbar background
rowsleft = statusbar_height;
buf = (Uint32 *)sdl_screen->pixels + (res_y + headerbar_height) * disp;
do
{
colsleft = res_x;
buf_row = buf;
sb_item = 1;
pos_x = 0;
do
{
if (pos_x == statusitem_pos[sb_item])
{
*buf++ = headerbar_fg;
if (sb_item < 11) sb_item++;
}
else
{
*buf++ = headerbar_bg;
}
pos_x++;
} while(--colsleft);
buf = buf_row + disp;
} while(--rowsleft);
SDL_UpdateRect( sdl_screen, 0,res_y+headerbar_height,res_x,statusbar_height);
for (unsigned i=0; i<statusitem_count; i++) {
sdl_set_status_text(i+1, statusitem_text[i], statusitem_active[i+1]);
}
2002-02-05 08:51:38 +03:00
}
- Apply patch.replace-Boolean rev 1.3. Every "Boolean" is now changed to a "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
2002-10-25 15:44:41 +04:00
void bx_sdl_gui_c::mouse_enabled_changed_specific (bx_bool val)
2002-02-05 08:51:38 +03:00
{
if(val == 1)
{
SDL_ShowCursor(0);
SDL_WM_GrabInput(SDL_GRAB_ON);
}
else
{
SDL_ShowCursor(1);
SDL_WM_GrabInput(SDL_GRAB_OFF);
}
sdl_grab = val;
2002-02-05 08:51:38 +03:00
}
void headerbar_click(int x)
{
int xdim,xorigin;
for (unsigned i=0; i<bx_headerbar_entries; i++) {
xdim = sdl_bitmaps[hb_entry[i].bmp_id]->src.w;
if (hb_entry[i].alignment == BX_GRAVITY_LEFT)
xorigin = sdl_bitmaps[hb_entry[i].bmp_id]->dst.x;
else
xorigin = res_x - sdl_bitmaps[hb_entry[i].bmp_id]->dst.x;
if ((x>=xorigin) && (x<(xorigin+xdim))) {
hb_entry[i].f();
return;
}
}
}
Add plugin support to Bochs by merging all the changes from the BRANCH_PLUGINS branch! Authors: Bryce Denney Christophe Bothamy Kevin Lawton (we grabbed a lot of plugin code from plex86) Testing help from: Volker Ruppert Don Becker (Psyon) Jeremy Parsons (Br'fin) The change log is too long to paste in here. To read the change log, do cvs log patches/patch.final-from-BRANCH_PLUGINS.gz All the changes and a detailed description are contained in a patch called patch.final-from-BRANCH_PLUGINS.gz. To look at the complete patch, do cvs upd -r1.1 patches/patch.final-from-BRANCH_PLUGINS.gz Then you will have a local copy of the patch, which you can gunzip and play with however you want. Modified Files: .bochsrc Makefile.in aclocal.m4 bochs.h config.h.in configure configure.in gdbstub.cc logio.cc main.cc pc_system.cc pc_system.h state_file.h bios/Makefile.in bios/rombios.c cpu/Makefile.in cpu/access.cc cpu/apic.cc cpu/arith16.cc cpu/arith32.cc cpu/arith8.cc cpu/cpu.cc cpu/cpu.h cpu/ctrl_xfer32.cc cpu/exception.cc cpu/fetchdecode.cc cpu/fetchdecode64.cc cpu/flag_ctrl.cc cpu/flag_ctrl_pro.cc cpu/init.cc cpu/io.cc cpu/logical16.cc cpu/logical32.cc cpu/logical8.cc cpu/paging.cc cpu/proc_ctrl.cc cpu/protect_ctrl.cc cpu/segment_ctrl_pro.cc cpu/shift16.cc cpu/shift32.cc cpu/stack64.cc cpu/string.cc cpu/tasking.cc debug/Makefile.in debug/dbg_main.cc disasm/Makefile.in doc/docbook/user/user.dbk dynamic/Makefile.in fpu/Makefile.in gui/Makefile.in gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/control.cc gui/control.h 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/sdlkeys.h gui/siminterface.cc gui/siminterface.h gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc gui/wxmain.h gui/x.cc gui/keymaps/sdl-pc-de.map gui/keymaps/sdl-pc-us.map gui/keymaps/x11-pc-de.map instrument/example0/instrument.h instrument/example1/instrument.h instrument/stubs/instrument.cc instrument/stubs/instrument.h iodev/Makefile.in iodev/biosdev.cc iodev/biosdev.h iodev/cdrom.cc iodev/cmos.cc iodev/cmos.h iodev/devices.cc iodev/dma.cc iodev/dma.h iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_tap.cc iodev/floppy.cc iodev/floppy.h iodev/guest2host.cc iodev/guest2host.h iodev/harddrv.cc iodev/harddrv.h iodev/iodebug.cc iodev/iodebug.h iodev/iodev.h iodev/keyboard.cc iodev/keyboard.h iodev/ne2k.cc iodev/ne2k.h iodev/parallel.cc iodev/parallel.h iodev/pci.cc iodev/pci.h iodev/pci2isa.cc iodev/pci2isa.h iodev/pic.cc iodev/pic.h iodev/pit.cc iodev/pit.h iodev/pit_wrap.cc iodev/pit_wrap.h iodev/sb16.cc iodev/sb16.h iodev/scancodes.cc iodev/scancodes.h iodev/serial.cc iodev/serial.h iodev/slowdown_timer.cc iodev/slowdown_timer.h iodev/unmapped.cc iodev/unmapped.h iodev/vga.cc iodev/vga.h memory/Makefile.in memory/memory.cc memory/memory.h memory/misc_mem.cc misc/bximage.c misc/niclist.c Added Files: README-plugins extplugin.h ltdl.c ltdl.h ltdlconf.h.in ltmain.sh plugin.cc plugin.h
2002-10-25 01:07:56 +04:00
void bx_sdl_gui_c::exit(void)
2002-02-05 08:51:38 +03:00
{
if(sdl_screen)
2002-02-05 08:51:38 +03:00
SDL_FreeSurface(sdl_screen);
if(sdl_fullscreen)
SDL_FreeSurface(sdl_fullscreen);
while(n_sdl_bitmaps)
{
SDL_FreeSurface(sdl_bitmaps[n_sdl_bitmaps-1]->surface);
n_sdl_bitmaps--;
}
2002-02-05 08:51:38 +03:00
}
/// key mapping for SDL
typedef struct {
const char *name;
Bit32u value;
} keyTableEntry;
#define DEF_SDL_KEY(key) \
{ #key, key },
keyTableEntry keytable[] = {
// this include provides all the entries.
#include "sdlkeys.h"
// one final entry to mark the end
{ NULL, 0 }
};
// function to convert key names into SDLKey values.
// This first try will be horribly inefficient, but it only has
// to be done while loading a keymap. Once the simulation starts,
// this function won't be called.
static Bit32u convertStringToSDLKey (const char *string)
{
keyTableEntry *ptr;
for (ptr = &keytable[0]; ptr->name != NULL; ptr++) {
//BX_DEBUG (("comparing string '%s' to SDL key '%s'", string, ptr->name));
if (!strcmp(string, ptr->name))
return ptr->value;
}
return BX_KEYMAP_UNKNOWN;
}
- apply patch.ifdef-disabled-options. Comments from that patch are below: For a whole lot of configure options, I put #if...#endif around code that is specific to the option, even in files which are normally only compiled when the option is on. This allows me to create a MS Visual C++ 6.0 workspace that supports many of these options. The workspace will basically compile every file all the time, but the code for disabled options will be commented out by the #if...#endif. This may one day lead to simplification of the Makefiles and configure scripts, but for the moment I'm leaving Makefiles and configure scripts alone. Affected options: BX_SUPPORT_APIC (cpu/apic.cc) BX_SUPPORT_X86_64 (cpu/*64.cc) BX_DEBUGGER (debug/*) BX_DISASM (disasm/*) BX_WITH_nameofgui (gui/*) BX_SUPPORT_CDROM (iodev/cdrom.cc) BX_NE2K_SUPPORT (iodev/eth*.cc, iodev/ne2k.cc) BX_SUPPORT_APIC (iodev/ioapic.cc) BX_IODEBUG_SUPPORT (iodev/iodebug.cc) BX_PCI_SUPPORT (iodev/pci*.cc) BX_SUPPORT_SB16 (iodev/sb*.cc) Modified Files: cpu/apic.cc cpu/arith64.cc cpu/ctrl_xfer64.cc cpu/data_xfer64.cc cpu/fetchdecode64.cc cpu/logical64.cc cpu/mult64.cc cpu/resolve64.cc cpu/shift64.cc cpu/stack64.cc debug/Makefile.in debug/crc.cc debug/dbg_main.cc debug/lexer.l debug/linux.cc debug/parser.c debug/parser.y disasm/dis_decode.cc disasm/dis_groups.cc gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/macintosh.cc gui/rfb.cc gui/sdl.cc gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxmain.cc gui/x.cc iodev/cdrom.cc iodev/eth.cc iodev/eth_arpback.cc iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_packetmaker.cc iodev/eth_tap.cc iodev/eth_tuntap.cc iodev/eth_win32.cc iodev/ioapic.cc iodev/iodebug.cc iodev/ne2k.cc iodev/pci.cc iodev/pci2isa.cc iodev/sb16.cc iodev/soundlnx.cc iodev/soundwin.cc
2002-11-19 08:47:45 +03:00
2008-03-07 00:15:40 +03:00
void bx_sdl_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;
// If fullscreen mode is on, we must switch back to windowed mode if
// the user needs to see the text console.
if (sdl_fullscreen_toggle) {
switch (newmode) {
case DISP_MODE_CONFIG:
2008-10-15 19:26:15 +04:00
BX_DEBUG(("switch to configuration mode (windowed)"));
switch_to_windowed();
break;
case DISP_MODE_SIM:
BX_DEBUG(("switch to simulation mode (fullscreen)"));
2008-10-15 19:26:15 +04:00
switch_to_fullscreen();
break;
}
}
}
#if BX_SHOW_IPS
void bx_sdl_gui_c::show_ips(Bit32u ips_count)
{
if (!sdl_ips_update) {
sprintf(sdl_ips_text, "IPS: %9u", ips_count);
sdl_ips_update = 1;
}
}
#endif
#if !defined(WIN32) && BX_DEBUGGER && BX_DEBUGGER_GUI
#include "enh_dbg.h"
2009-10-24 17:17:33 +04:00
BxEvent *sdl_notify_callback(void *unused, BxEvent *event)
{
switch (event->type)
{
case BX_SYNC_EVT_GET_DBG_COMMAND:
{
debug_cmd = new char[512];
debug_cmd_ready = 0;
HitBreak();
while (debug_cmd_ready == 0 && bx_user_quit == 0)
{
if (vgaw_refresh != 0) // is the GUI frontend requesting a VGAW refresh?
DEV_vga_refresh();
vgaw_refresh = 0;
#ifdef WIN32
Sleep(100);
#else
sleep(1);
#endif
}
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;
}
default:
return (*old_callback)(old_callback_arg, event);
}
}
2009-10-24 17:17:33 +04:00
#endif /* if BX_DEBUGGER && BX_DEBUGGER_GUI */
- apply patch.ifdef-disabled-options. Comments from that patch are below: For a whole lot of configure options, I put #if...#endif around code that is specific to the option, even in files which are normally only compiled when the option is on. This allows me to create a MS Visual C++ 6.0 workspace that supports many of these options. The workspace will basically compile every file all the time, but the code for disabled options will be commented out by the #if...#endif. This may one day lead to simplification of the Makefiles and configure scripts, but for the moment I'm leaving Makefiles and configure scripts alone. Affected options: BX_SUPPORT_APIC (cpu/apic.cc) BX_SUPPORT_X86_64 (cpu/*64.cc) BX_DEBUGGER (debug/*) BX_DISASM (disasm/*) BX_WITH_nameofgui (gui/*) BX_SUPPORT_CDROM (iodev/cdrom.cc) BX_NE2K_SUPPORT (iodev/eth*.cc, iodev/ne2k.cc) BX_SUPPORT_APIC (iodev/ioapic.cc) BX_IODEBUG_SUPPORT (iodev/iodebug.cc) BX_PCI_SUPPORT (iodev/pci*.cc) BX_SUPPORT_SB16 (iodev/sb*.cc) Modified Files: cpu/apic.cc cpu/arith64.cc cpu/ctrl_xfer64.cc cpu/data_xfer64.cc cpu/fetchdecode64.cc cpu/logical64.cc cpu/mult64.cc cpu/resolve64.cc cpu/shift64.cc cpu/stack64.cc debug/Makefile.in debug/crc.cc debug/dbg_main.cc debug/lexer.l debug/linux.cc debug/parser.c debug/parser.y disasm/dis_decode.cc disasm/dis_groups.cc gui/amigaos.cc gui/beos.cc gui/carbon.cc gui/macintosh.cc gui/rfb.cc gui/sdl.cc gui/term.cc gui/win32.cc gui/wx.cc gui/wxdialog.cc gui/wxmain.cc gui/x.cc iodev/cdrom.cc iodev/eth.cc iodev/eth_arpback.cc iodev/eth_fbsd.cc iodev/eth_linux.cc iodev/eth_null.cc iodev/eth_packetmaker.cc iodev/eth_tap.cc iodev/eth_tuntap.cc iodev/eth_win32.cc iodev/ioapic.cc iodev/iodebug.cc iodev/ne2k.cc iodev/pci.cc iodev/pci2isa.cc iodev/sb16.cc iodev/soundlnx.cc iodev/soundwin.cc
2002-11-19 08:47:45 +03:00
#endif /* if BX_WITH_SDL */