Commit Graph

399 Commits

Author SHA1 Message Date
Bryce Denney
85ca569ef4 - fix a very stupid memory leak that I added to the the text mode debugger
recently.  oops.
2002-10-01 13:40:05 +00:00
Bryce Denney
3f9e3ee12d - comment out a few very frequent debug messages
- in CopyParamToGui and CopyGuiToParam, ignore list parameters instead of
  printing a warning
2002-09-30 22:15:20 +00:00
Bryce Denney
169332660a - apply patch.carbon-jusansai from Chris Thomas. This is associated with
patch [ 549248 ] Fix Carbon key & menu handling at
  http://sourceforge.net/tracker/index.php?func=detail&group_id=12580&atid=312580&aid=549248
2002-09-30 14:03:20 +00:00
Bryce Denney
84080d26f1 - disable debug specific wxwindows calls, when wxwindows library is not
compiled with debug support
2002-09-27 19:12:56 +00:00
Bryce Denney
79cd346575 - fix previous rev. It would probably help to put the #include before
the first time that this function is used!
2002-09-26 19:34:44 +00:00
Bryce Denney
5c6d434929 - the raw keycodes code for wxMSW refers to HIWORD, so I made it
conditionally include <windows.h>.  This may seem like a drastic step
  for just one little type, but I expect before long we may want to use
  other symbols like VK_F12 which are also in windows.h.  In a cygwin
  compile this is required.
2002-09-26 19:24:53 +00:00
Bryce Denney
a50f374a28 - fix typo: "event-type" to "event->type" 2002-09-26 03:01:13 +00:00
Bryce Denney
bbc43ba25b - avoid segfaults by checking if the term gui has already been initialized
or not, before calling curses functions.
2002-09-26 02:53:58 +00:00
Bryce Denney
d7251f8693 - move comment on bx_gui_c::specific_init down so that it's next to the
method it describes
2002-09-26 02:46:39 +00:00
Bryce Denney
73681b3a53 - for term compile, search for a function called "color_set" and compile it
away if color_set doesn't exist on that platform.  On Solaris this was
  the only thing keeping term from compiling.  See this bug
  [ 613393 ] solaris: term compile missing color_set
  http://sourceforge.net/tracker/index.php?func=detail&aid=613393&group_id=12580&atid=112580
2002-09-26 02:36:04 +00:00
Bryce Denney
87835fd841 - fix memory leaks in the text mode interface that I introduced while working
on the wxWindows interface.  There are many more changes here than
  absolutely required to fix the memory leaks.  Instead, I've tried to
  clean things up so that it does the right thing, and is easier to
  read and maintain.
- For events that the text mode interface is going to ignore anyway, I #ifdefed
  the event creation code instead of calling new and then delete.
- now all synchronous events in siminterface.cc are created as local variables
  on the stack.  Some of them were allocated with new before, and yes some of
  them leaked.
- now I ignore the result of sim_to_ci_event (&event).  It was always
  returning a pointer to the input event anyway.  This makes the event
  sending code simpler.
- wxmain.cc:
  - in the BxEvent handling functions, now all cases "break" down to common
    code at the end which deletes async events.  This is easier to read than
    having each case handle the delete individually.
  - in OnLogMsg, do not delete the event here because it is now handled
    in the common code of OnSim2CIEvent instead.
- thanks to Christophe for pointing out the location of the worst
  memory leak.
2002-09-25 22:54:23 +00:00
Bryce Denney
56b58e6226 - remove "Create Image" button for cdrom from the sketch 2002-09-25 21:28:49 +00:00
Bryce Denney
e6e2c08809 - make parse_bochsrc return -1 if any parse errors occur.
- make bx_init_main return -1 if any parse errors occur.
- wxWindows: if bx_init_main returns -1, don't even show the application
  window.  You'll get an error dialog and then it exits.  So far this
  only happens if you run with -q and the parse fails.
- non-wxWindows: if bx_init_main returns -1, just exit.  So far this
  only happens if you run with -q and the parse fails.
- with these changes, handling of bochsrc parse errors seems to work
  as you would expect.  And it certainly doesn't go into an infinite
  recursive loop, as it used to!
- a little more testing and I can close
  bug 614175: infinite panic loop if bochsrc buggy
- modified: main.cc gui/siminterface.h gui/wxmain.cc
2002-09-25 19:05:01 +00:00
Bryce Denney
a4f0c5b53e - move read configuration and save configuration behavior out of wx.cc
and into wxmain.cc, like other actions.
- set a default siminterface callback for the whole application, which is used
  whenever the simulator is not running.  This is important when the wx code
  calls simulator or param code and triggers a BX_PANIC or something.
  The default callback is responsible for displaying error messages which
  appear while reading the bochsrc, for example.
- move the implementation of BX_SYNC_EVT_LOG_ASK and BX_ASYNC_EVT_LOG_MSG
  into a separate function OnLogMsg().  In the future, OnLogMsg() may be called
  from the application default callback on errors.
- modified: gui/wx.cc gui/wxmain.cc gui/wxmain.h
2002-09-25 18:40:15 +00:00
Bryce Denney
fd2566023a - add enums for the LOG_ASK choices: continue, die, etc. 2002-09-25 18:32:36 +00:00
Bryce Denney
610d7f00d0 - make the parser a little more informative when things go wrong. 2002-09-25 13:01:30 +00:00
Bryce Denney
3889b9339c - add missing right alt keycode XK_Alt_R to all keymaps 2002-09-25 08:00:25 +00:00
Bryce Denney
a66f903731 - add a few more missing keys: left&right windows keys, pause
- clean up remainder of the old scancode-fixing hack
- change the BX_INFO on each keypress to a BX_DEBUG
2002-09-25 07:24:41 +00:00
Bryce Denney
ae1ac3e266 - add cases in switch statement for keys: Right CTRL, Right ALT, Scroll Lock,
Print Screen, Pause.
2002-09-25 07:21:38 +00:00
Bryce Denney
2107fb3af9 - in the keycode conversion switch statement, rename bx_key to key_event so
that it is as close as possible to the x.cc version.  I've made some
  improvements in x.cc and I want to apply them to wxWindows as well.
2002-09-25 05:35:36 +00:00
Bryce Denney
c111260872 - default initializer (=NULL) does not belong on the function definition, only
the declaration in the class.
2002-09-24 17:57:48 +00:00
Bryce Denney
7ba1d2d96f - replace SDL key handling, which used hardware-dependent scancodes, with
hardware-independent SDL keysyms.
2002-09-24 08:50:51 +00:00
Bryce Denney
fb08f28c8b - add Danish keymap from Andreas Ott 2002-09-23 19:16:54 +00:00
Bryce Denney
8c3fb9dd1a - add methods to force update of the VGA screen and to force a call
to handle_events.  These are primarily so that when a debugger is
  single stepping, the screen updates immediately instead of after
  thousands of cycles.
2002-09-23 17:41:42 +00:00
Bryce Denney
93311561aa - add get_notify_callback method 2002-09-23 16:57:45 +00:00
Bryce Denney
97f3350daf - only call XCloseDisplay if display has been opened 2002-09-23 16:30:27 +00:00
Christophe Bothamy
440dffc803 - applied patch.4ata-channels and patch.4ata-channels.bbd
- Features :
 . number of active channels defined at boot-time config
 . new options in bochsrc
 . up to 8 devices support (disks or cdroms)
 . up to 4 cdrom devices can be changed at runtime config
 . wxwindows config interface
2002-09-22 20:56:12 +00:00
Bryce Denney
c382348cbf - add CopyParamToGui() to DebugLogDialog, which is empty for now. 2002-09-22 04:52:55 +00:00
Bryce Denney
adeb5331f6 - I used to have a method called ParamDialog::Refresh() that reread all the
parameter values associated with the dialog and updated the wxWindows
  controls.  At the time I didn't realize that I was overriding
  wxWindow::Refresh() which repaints the window.  Later, I renamed the method
  to CopyParamToGui() to make it more clear, but many of the callers in
  wxmain.cc continued to call Refresh(), which now reverted to the parent class
  wxWindow::Refresh().  Since there was no compile error I didn't notice for a
  while, but it caused the ParamDialogs to repaint themselves constantly but
  never actually change their values.  This is now fixed by changing those
  method calls to CopyParamToGui().
2002-09-22 04:36:09 +00:00
Bryce Denney
85a7d1dad8 - on win32, the wxWindows interface was never redrawing the screen since I
started using a wxTimer to trigger the redraws.  Now instead of calling
  MyPanel::OnPaint directly, I call Refresh() instead.  This makes the Windows
  display work correctly.
2002-09-22 04:04:40 +00:00
Bryce Denney
d4bf3598f0 - fix some types in printf format strings 2002-09-22 02:44:31 +00:00
Bryce Denney
de67199921 - call SetFocus() on the panel so that it is certain to get key events.
I'm not sure why this wasn't needed before, but after switching to
  wxWindows 2.3.3 it seems to be important.
- in a wxLogDebug() call I was trying to pass a struct instead of a string.
  Fixed that.
2002-09-22 02:43:37 +00:00
Bryce Denney
38ad31fd4b - add Greg's suggestions for dialog box to configure time options, from an
email
2002-09-22 02:42:07 +00:00
Bryce Denney
bed405dad0 - revert 1.30. The change I made caused VPATH builds to fail, like when
you run configure from another directory.  We'll have to try some other
  way to make nmake happy.
2002-09-22 01:35:12 +00:00
Bryce Denney
cddddb96d9 - avoid using $< syntax because nmake can't handle it 2002-09-22 01:19:19 +00:00
Volker Ruppert
4c4294cc6f - new variable 'charmap_updated', 'charmap_changed' array renamed to
'char_changed'. These variables are currently only used by the win32 gui for
  the update of the font bitmaps. SDL and wxWindows do not use the variables
  since they are using the charmap data directly
- free text snapshot memory when the user has cancelled the dialog
- write text snapshot file in binary mode (disables the LF -> CRLF conversion
  in cygwin)
2002-09-21 19:38:47 +00:00
Bryce Denney
375fcf648b - plug up some memory leaks in wxWindows code, with help from Valgrind
- MyPanel::blankCursor
  - MyFrame::panel
  - AdvancedLogOptions::action (2d array of wxChoice *'s)
  - ParamDialog::idHash, ParamDialog::paramHash, and ParamStructs
  - file dialog in BrowseTextCtrl
- fix illegal use of a wxObject.  I had been clearing the ParamStruct
  with memset(), but I forgot that ParamStruct was a subclass of wxObject
  so I was trashing the wxObject fields too!  Instead I created a
  ParamStruct constructor that clears the pointers to NULL.
- comment out debug output from AdvancedLogOptionsDialog::SetAction
- modified files: gui/wx.cc gui/wxdialog.cc gui/wxdialog.h
  gui/wxmain.cc gui/wxmain.h
2002-09-20 21:25:09 +00:00
Bryce Denney
ed36bc11f0 - sync up control.cc (text mode config interface) with wxmain.cc (wxWindows
interface) by using get/set_default_log_action.  This has very minimal effect
  on the behavior of the text config interface.
- modified: main.cc gui/control.cc
2002-09-20 18:14:27 +00:00
Bryce Denney
eca3ef17dc - How to handle default log options has been somewhat confused for a long
time, so I've tried to improve it.  Now the logfunctions class has a
  static field default_onoff[] which represents the default actions for
  each kind of log message.  Default_onoff[] is initialized with static
  data so it should be valid by the time it's used.  This can be reached by
  static accesors logfunctions::set_default_action and
  logfunctions::get_default_action.  It seemed appropriate to put the defaults
  inside the logfunctions class, rather than in bx_options or siminterface.
  However, to make them accessible to the config interface, I added similar
  methods in siminterface that map to the accessors in logfunctions.
- logio.cc had two different definitions of LOG_THIS for different halves
  of the file, which was ugly and confusing.  (LOG_THIS is needed for BX_INFO,
  BX_DEBUG, etc.)  I removed the first definition and fixed the minor compile
  problems that ensued.  In the initializers for iofunctions, everything
  is complicated because of the unpredictable order that constructors get
  called.  They must use this->log to print things, because genlog hasn't
  been initialized yet.
- now if SIM->set_log_action(int mod, int level, int action) is called
  with mod<0, it sets the action for all modules/devices instead of just one.
- modified: bochs.h logio.cc main.cc gui/siminterface.cc gui/siminterface.h
2002-09-20 17:56:22 +00:00
Bryce Denney
a33f144f6c - implement behavior of the AdvancedLogOptionsDialog
- LogOptionsDialog: show the "no change" option.  When options other than
  "no change" are selected, set both the default log action and the
  specific log action for all devices.
- AdvancedLogOptionsDialog: store the wxChoice*'s in a 2d array since I
  have to refer to them later.
- since both the log options and advanced log options dialogs needed to
  create many wxChoices using similar rules, I moved the creation code
  into a utility function makeLogOptionChoiceBox.
- I finally discovered the wxADJUST_MINSIZE option to wxSizer::Add(),
  which solves some layout problems that I was having with wxChoices.
  With this setting, the wxChoice will automatically grow to the size of
  the largest string that can be selected.
- improve sizing of the scrollWin according to the desired size of the panel
  that contains all the wxChoices.
- add sketches for proposed dialog that combines both LogOptionsDialog and
  AdvancedLogOptionsDialog using tabs
2002-09-20 17:53:14 +00:00
Bryce Denney
f9a1de5a58 - I remembered the real reason why I made an abstract class
bx_simulator_interface_c, so I included that in the comments.
2002-09-20 17:39:07 +00:00
Bryce Denney
452f65235b - rename Refresh to CopyParamToGui
- rename CommitChanges to CopyGuiToParam
2002-09-20 12:40:13 +00:00
Volker Ruppert
721f89b77b - forward changes of the active charmap to the gui with the new function
set_text_charbyte()
- vga: store the address of the active charmap in the new variable
  charmap_address
- vga: text mode hack removed. The write modes, operations and masks must be
  used in text mode too.
- sdl: clear_screen() is not necessary when the charmap has changed
- win32: update only the changed font bitmaps before drawing the text
2002-09-19 18:59:50 +00:00
Bryce Denney
d8c27b4f83 - add AdvancedLogOptionsDialog. It's not connected to actual parameters
yet, since I've been just working on the layout at first.  The main
  challenge has been getting the scrollbar set up right.
2002-09-19 04:52:03 +00:00
Bryce Denney
c278349cdf - in wxWindows, hide mouse cursor when mouse is captured, to avoid the
confusion of having two cursors showing at once.  Actually implemented by
  changing to a blank cursor when cursor should be hidden.
2002-09-19 00:43:32 +00:00
Bryce Denney
a9ad06ec00 - mouse event should have signed deltas: dx and dy 2002-09-18 23:17:47 +00:00
Bryce Denney
24d88d2d28 - implement mouse in wxWindows interface
- All mouse events in the VGA window go to MyPanel::OnMouse.  Middle mouse
  button and F12 both toggle mouse capture.  OnMouse queues an event
  for the simulation thread to process.  The simulation thread calls
  bx_devices.keyboard->mouse_motion() when it sees the event on the queue.
- add IFDBG_VGA around some display debug code.  All wx mouse debug code
  is controlled by IFDBG_MOUSE.
- modified: gui/wx.cc gui/wxmain.cc gui/wxmain.h
2002-09-18 22:44:02 +00:00
Bryce Denney
cfd549d7c0 - align the EFLAGS parameters left instead of center 2002-09-18 21:01:58 +00:00
Bryce Denney
0a5ce87b15 - now instead of having the simulation thread send repaint messages to
the wxwindows thread, it just sets a boolean flag needRefresh.  Meanwhile, a
  wxTimer running in wall clock time (as opposed to sim time) triggers a
  repaint only if the the boolean is true.
- now MyRefresh is implemented by just setting needRefresh=true.
- make graphics_tile_update call MyRefresh.
- make dimension_update call MyRefresh.
2002-09-18 20:59:35 +00:00
Bryce Denney
4694ac5c04 - clean up
pollution
2002-09-18 20:59:05 +00:00