- some fixes to avoid segfaults after early panics

- fixed gameport log type
- wx: store mouse capture mode in the gui code (only access the mouse parameter
  when the capture mode changes)
- wx: don't initialize wxScreen if already done and clear screen on exit
This commit is contained in:
Volker Ruppert 2006-09-12 13:05:07 +00:00
parent 190b9391cf
commit 4cf2f745d1
6 changed files with 24 additions and 19 deletions

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: bochs.h,v 1.196 2006-09-09 11:28:52 vruppert Exp $ // $Id: bochs.h,v 1.197 2006-09-12 13:05:07 vruppert Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002 MandrakeSoft S.A. // Copyright (C) 2002 MandrakeSoft S.A.
@ -294,7 +294,7 @@ enum {
CPU10LOG, CPU11LOG, CPU12LOG, CPU13LOG, CPU14LOG, CPU15LOG, CTRLLOG, CPU10LOG, CPU11LOG, CPU12LOG, CPU13LOG, CPU14LOG, CPU15LOG, CTRLLOG,
UNMAPLOG, SERRLOG, BIOSLOG, PIT81LOG, PIT82LOG, IODEBUGLOG, PCI2ISALOG, UNMAPLOG, SERRLOG, BIOSLOG, PIT81LOG, PIT82LOG, IODEBUGLOG, PCI2ISALOG,
PLUGINLOG, EXTFPUIRQLOG , PCIVGALOG, PCIUSBLOG, VTIMERLOG, STIMERLOG, PLUGINLOG, EXTFPUIRQLOG , PCIVGALOG, PCIUSBLOG, VTIMERLOG, STIMERLOG,
PCIIDELOG, PCIDEVLOG, PCIPNICLOG, SPEAKERLOG, BUSMLOG PCIIDELOG, PCIDEVLOG, PCIPNICLOG, SPEAKERLOG, BUSMLOG, GAMELOG
}; };
class BOCHSAPI iofunctions { class BOCHSAPI iofunctions {

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// $Id: wx.cc,v 1.86 2006-09-03 05:52:52 vruppert Exp $ // $Id: wx.cc,v 1.87 2006-09-12 13:05:07 vruppert Exp $
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// //
// wxWidgets VGA display for Bochs. wx.cc implements a custom // wxWidgets VGA display for Bochs. wx.cc implements a custom
@ -112,6 +112,7 @@ static struct {
wxCriticalSection event_thread_lock; wxCriticalSection event_thread_lock;
BxEvent event_queue[MAX_EVENTS]; BxEvent event_queue[MAX_EVENTS];
unsigned long num_events = 0; unsigned long num_events = 0;
static bx_bool mouse_captured = 0;
#if defined (wxHAS_RAW_KEY_CODES) && defined(__WXGTK__) #if defined (wxHAS_RAW_KEY_CODES) && defined(__WXGTK__)
static Bit32u convertStringToGDKKey (const char *string); static Bit32u convertStringToGDKKey (const char *string);
#endif #endif
@ -233,7 +234,7 @@ void MyPanel::OnMouse(wxMouseEvent& event)
return; return;
} }
if (!SIM->get_param_bool(BXPN_MOUSE_ENABLED)->get()) if (!mouse_captured)
return; // mouse disabled, ignore the event return; // mouse disabled, ignore the event
// process buttons and motion together // process buttons and motion together
@ -902,8 +903,10 @@ bx_wx_gui_c::specific_init(int argc, char **argv, unsigned tilewidth, unsigned t
IFDBG_VGA(wxLogDebug (wxT ("MyPanel::specific_init trying to get lock. wxScreen=%p", wxScreen))); IFDBG_VGA(wxLogDebug (wxT ("MyPanel::specific_init trying to get lock. wxScreen=%p", wxScreen)));
wxCriticalSectionLocker lock(wxScreen_lock); wxCriticalSectionLocker lock(wxScreen_lock);
IFDBG_VGA(wxLogDebug (wxT ("MyPanel::specific_init got lock. wxScreen=%p", wxScreen))); IFDBG_VGA(wxLogDebug (wxT ("MyPanel::specific_init got lock. wxScreen=%p", wxScreen)));
wxScreen = (char *)malloc(wxScreenX * wxScreenY * 3); if (wxScreen == NULL) {
memset(wxScreen, 0, wxScreenX * wxScreenY * 3); wxScreen = (char *)malloc(wxScreenX * wxScreenY * 3);
memset(wxScreen, 0, wxScreenX * wxScreenY * 3);
}
wxTileX = tilewidth; wxTileX = tilewidth;
wxTileY = tileheight; wxTileY = tileheight;
@ -1581,15 +1584,14 @@ bx_wx_gui_c::replace_bitmap(unsigned hbar_id, unsigned bmap_id)
// Called before bochs terminates, to allow for a graceful // Called before bochs terminates, to allow for a graceful
// exit from the native GUI mechanism. // exit from the native GUI mechanism.
void void bx_wx_gui_c::exit(void)
bx_wx_gui_c::exit(void)
{ {
BX_INFO(("bx_wx_gui_c::exit() not implemented yet.")); clear_screen();
} }
void void bx_wx_gui_c::mouse_enabled_changed_specific(bx_bool val)
bx_wx_gui_c::mouse_enabled_changed_specific (bx_bool val)
{ {
mouse_captured = val;
} }

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: gameport.cc,v 1.11 2006-09-10 17:18:44 vruppert Exp $ // $Id: gameport.cc,v 1.12 2006-09-12 13:05:07 vruppert Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2003 MandrakeSoft S.A. // Copyright (C) 2003 MandrakeSoft S.A.
@ -75,7 +75,8 @@ void libgameport_LTX_plugin_fini(void)
bx_gameport_c::bx_gameport_c() bx_gameport_c::bx_gameport_c()
{ {
put("GAME"); put("GAME");
settype(EXTFPUIRQLOG); settype(GAMELOG);
joyfd = -1;
} }
bx_gameport_c::~bx_gameport_c() bx_gameport_c::~bx_gameport_c()

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: keyboard.cc,v 1.123 2006-09-10 17:18:44 vruppert Exp $ // $Id: keyboard.cc,v 1.124 2006-09-12 13:05:07 vruppert Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2002 MandrakeSoft S.A. // Copyright (C) 2002 MandrakeSoft S.A.
@ -84,6 +84,7 @@ bx_keyb_c::bx_keyb_c()
{ {
put("KBD"); put("KBD");
settype(KBDLOG); settype(KBDLOG);
pastebuf = NULL;
} }
bx_keyb_c::~bx_keyb_c() bx_keyb_c::~bx_keyb_c()
@ -114,7 +115,7 @@ void bx_keyb_c::resetinternals(bx_bool powerup)
void bx_keyb_c::init(void) void bx_keyb_c::init(void)
{ {
BX_DEBUG(("Init $Id: keyboard.cc,v 1.123 2006-09-10 17:18:44 vruppert Exp $")); BX_DEBUG(("Init $Id: keyboard.cc,v 1.124 2006-09-12 13:05:07 vruppert Exp $"));
Bit32u i; Bit32u i;
DEV_register_irq(1, "8042 Keyboard controller"); DEV_register_irq(1, "8042 Keyboard controller");

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: serial.cc,v 1.73 2006-09-10 17:18:44 vruppert Exp $ // $Id: serial.cc,v 1.74 2006-09-12 13:05:07 vruppert Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// Copyright (C) 2004 MandrakeSoft S.A. // Copyright (C) 2004 MandrakeSoft S.A.
@ -70,6 +70,7 @@ bx_serial_c::bx_serial_c(void)
put("SER"); put("SER");
settype(SERLOG); settype(SERLOG);
for (int i=0; i<BX_SERIAL_MAXDEV; i++) { for (int i=0; i<BX_SERIAL_MAXDEV; i++) {
s[i].io_mode = BX_SER_MODE_NULL;
s[i].tty_id = -1; s[i].tty_id = -1;
s[i].tx_timer_index = BX_NULL_TIMER_HANDLE; s[i].tx_timer_index = BX_NULL_TIMER_HANDLE;
s[i].rx_timer_index = BX_NULL_TIMER_HANDLE; s[i].rx_timer_index = BX_NULL_TIMER_HANDLE;

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// $Id: plugin.cc,v 1.19 2006-09-10 09:13:47 vruppert Exp $ // $Id: plugin.cc,v 1.20 2006-09-12 13:05:07 vruppert Exp $
///////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////
// //
// This file defines the plugin and plugin-device registration functions and // This file defines the plugin and plugin-device registration functions and
@ -631,7 +631,7 @@ void bx_unload_plugins()
device_t *device, *next; device_t *device, *next;
device = devices; device = devices;
do { while (device != NULL) {
if (device->plugin != NULL) { if (device->plugin != NULL) {
#if BX_PLUGINS #if BX_PLUGINS
bx_unload_plugin(device->name); bx_unload_plugin(device->name);
@ -642,7 +642,7 @@ void bx_unload_plugins()
next = device->next; next = device->next;
free(device); free(device);
device = next; device = next;
} while (device != NULL); };
devices = NULL; devices = NULL;
} }