Commit Graph

500 Commits

Author SHA1 Message Date
Bryce Denney
73c234b351 - add makefile rule for building SDL dll. It links the plugin with
the SDL library.
2002-10-28 08:20:12 +00:00
Bryce Denney
883442544c - we've been compiling a few extraneous plugins: wxdialog and wxmain.
These files are part of the wx plugin, and they should not be linked
  into a separate plugin.  I have changed gui/Makefile.in and configure.in
  to correct this.
- This fixes bug [ 628667 ] don't build plugin for wxdialog, wxmain
- modified: gui/Makefile.in configure.in configure
2002-10-28 05:49:42 +00:00
Bryce Denney
db750f8234 - to make the "idle hack" compile again, add virtual function sim_is_idle
to bx_gui_c and to bx_x_gui_c.
2002-10-27 23:33:13 +00:00
Christophe Bothamy
814d8b69ef - add "none", "lba", "rechs", "large", "auto" translation
- if translation=auto :
  . translation=none if cylinders <=1024 and heads <=16
  . translation=large if cylinders * heads <= 131072
  . transaltion=lba otherwise
- changes default translation value to "auto"
- add example in .bochsrc
2002-10-27 21:25:33 +00:00
Bryce Denney
954b737dda - apply MacOSX "About Box Patch" from Jeremy Parsons (Br'fin). This fixes
bug [ 626261 ] About Box is awkwardly outdated
2002-10-26 22:06:37 +00:00
Bryce Denney
dd7ad0449d - add missing LOG_THIS to fix compile problem reported by Timothy Schepens 2002-10-26 21:03:21 +00:00
Bryce Denney
99aa099b67 - we renamed the term 'VGA library' to 'display library' a while ago. I
fixed some lingering references to vga library.
2002-10-26 13:22:47 +00:00
Bryce Denney
48acd53db4 - all #warnings are now inside #ifdef __GNUC__ ... #endif
Modified Files:
    ltdl.c main.cc plugin.cc cpu/cpu.cc cpu/debugstuff.cc
    cpu/exception.cc cpu/fetchdecode64.cc cpu/init.cc
    cpu/paging.cc gui/siminterface.cc gui/wxmain.cc
    iodev/harddrv.cc
2002-10-25 12:36:44 +00:00
Bryce Denney
cec9135e9f - 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 11:44:41 +00:00
Bryce Denney
5e520261db 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-24 21:07:56 +00:00
Volker Ruppert
c43564368a - remove trailing spaces from text snapshot
- incrementing variable txt_addr simplified
2002-10-22 17:30:54 +00:00
Bryce Denney
cd4d17a363 - min and max in shadow params were broken recently when I changed the
constructors around.  The min,max that were being passed to the parent
  class constructor had junk in them.  In config.h.in, I defined the minimum
  and maximum values for each integer datatype so now we pass correct
  min and max values to the parent class.  These replace the BX_MAX_[U]INT
  and BX_MIN_[U]INT values.
- modified: main.cc config.h.in gui/siminterface.cc
2002-10-21 11:13:54 +00:00
Bryce Denney
8047b68ba2 - in a recent revision, I made bx_param_num_c::get() return a 64 bit
value instead of a 32 bit value.  Unfortunately there were many uses
  of bx_param_num_c::get() which depended on its size, and they were
  all broken by this change.  So in this rev I am changing get() to
  return a 32bit unsigned again.  If you really want a 64bit value (which
  is quite rare) you should call get64() instead.
- modified: gui/siminterface.h gui/siminterface.cc
2002-10-21 01:05:53 +00:00
Bryce Denney
1f44d32cff ----------------------------------------------------------------------
Patch name: patch.macosx-ui-polishing
Author: Jeremy Parsons <brefin@mac.com>
Date: Wed Oct 16 2002

Detailed description:

A number of changes to the Carbon Code to improve how well it meshes with the
MacOS X user experience as well as to make sure that all of more recently added
toolbar buttons actually work.

Specific changes include:

    Added partial keymap support. (Keymaps don't yet affect what the user types
        but an X11 keymap can be used to enable pasting)
    Copying of text screens added
    Pasting of text as keyboard input added
    Copy, Paste, Reset, and Snapshot menu items now work the same as the
        corresponding toolbar elements
    Revamped icon handling to use Control Manager IconControls,
        thus removing icon display code and greatly simplifying icon click handling code
        while adding better behaviours (icons that darken when clicked, track mouse movement,
        and only do something if the mouse is released atop of them as well as gaining
        the ability to be disabled)
    Tweaked Paste toolbar and menu items to only be enabled if key mapping is in use AND the
        clipboard contains text
    Tweaked Copy and Snapshot toolbar and menu elements to only be enabled if
        the screen mode is text.
    Tweaked User Keys toolbar element to only be enabled if there are user keys
        defined to be sent
    Tweaked Configure toolbar element to only be enabled if a tty is available
        (as in the emulator was started from a terminal)
    Respaced toolbar icons to match Aqua Toolbars
    Disabled menu items that are not currently handled (undo, clear, cut, disk eject)
    Full screen backdrop resettled all across the screen
    Fixed the callback interface so that when a Panic needs to ask the user about continuing
    	it actually works appropriately.
----------------------------------------------------------------------
2002-10-18 11:46:19 +00:00
Bryce Denney
d401c8e23b - fix incorrect use of delete ptr in text mode debugger. It should
say "delete [] text" since it is an array of chars.
2002-10-16 21:37:06 +00:00
Bryce Denney
4fc294ce2b - I was having compile problems because when BX_DEBUGGER==0 the declaration
of the DebugLogDialog class was turned off by an #if.  Now the methods are
  turned off by the same condition.
2002-10-16 20:39:43 +00:00
Volker Ruppert
21b8955a4e - userbutton shortcut feature improved. The shortcut string can be a combination
of these key names: "alt", "ctrl", "del", "esc", "f1", "f4", "tab", "win".
  Up to 3 keys can be pressed at a time.
2002-10-16 19:50:27 +00:00
Bryce Denney
f6c637aa8a - upgrade bx_param_num to use 64 bit values, so that I could make
bx_shadow_num_c able to handle pointers to 64 bit values.  This
  allows x86-64 and wxWindows to coexist.
- I had a number of duplicate constructors for bx_shadow_num_c,
  with an without the description arg.  I eliminated the ones
  that had no description, and also removed the min/max arg from
  all.  I still need a bunch of constructors though, for
  Bit64u*, Bit64s*, Bit32u*, Bit32s*, Bit16u*, Bit16s*, Bit8u*, Bit8s*.
  Having all these constructors allows us to write
    new bx_shadow_num (bxid, name, description, &value)
  for basically any integer variable.  They are all handled by the same class.
- these changes led to minor touchups in cpu/init.cc and iodev/keyboard.cc
- modified:
    configure main.cc cpu/init.cc iodev/keyboard.cc
    gui/siminterface.cc gui/siminterface.h
2002-10-16 19:39:27 +00:00
Bryce Denney
ac9f370975 - shouldn't have default values for method parameters in the .cc! oops.
Thanks to sandos for pointing this out.
2002-10-16 19:27:17 +00:00
Volker Ruppert
35225ed64d - the keyboard mapping feature for wxbochs (wxGTK version) now works with the
X11 keymap files. This okay since the keysym values are identical. The "AltGr"
  key on European keyboards doesn't work with wxGTK 2.3.3 because the keysym
  GDK_Mode_switch is not handled in wxGTK.
- German keymap table for wx and wxgtkkeys.h are no longer needed
2002-10-16 16:32:55 +00:00
Volker Ruppert
5e2cbe04bf - implementation of the keyboard mapping feature for wxbochs (wxGTK version)
- German keymap table for wxbochs (wxGTK version)
2002-10-15 16:48:10 +00:00
Bryce Denney
d1196d1996 - clean up the command line argument parsing. Before, we had two slightly
different versions of the code for wxWindows and non-wxWindows and the GDB
  stub did not accept any command line options at all.
- IMPORTANT CHANGE: the quick start option used to cause two things:
  1) read the bochsrc immediately, 2) start simulation immediately without
  going into the config interface.  This has changed in a subtle way.
  Now, we always try to read the bochsrc immediately.  Then if the quick
  start option is on, we start the simulation immediately.
- add "Restore Factory Default Configuration" in text config menu.  It was
  already there in wx.  Now the default choice is always "5. Begin simulation"
  and because the bochsrc is always read now, this works.
- When the user chooses "Read configuration file" from either text mode
  or wx interfaces, reset all bochs parameters first, then read in the
  new file.  This means that every time you read a configuration file
  you are starting from a consistent "blank slate".
- move much of the code from bx_do_text_config_interface into bx_init_main
  so that wxWindows and non-wxWindows code uses the same logic.  There was
  only a tiny bit left in bx_do_text_config_interface so I eliminated it.
- move the "help" message into a separate function print_usage()
- detect all flags (cmdline args that start with -) in a loop, instead of
  a big if/else.  This makes it easy to add others.
- fix problem with Carbon gui, so that -psn arg gets ignored
- print usage if you type -h, --help, or if flags are not recognized
- code that called io->set_log_action (that sets the log action for all
  devices) was only called if the configuration interface was on; I'm not
  sure why.  Now it is called all the time.
- the wxWindows equivalent of main() is called MyApp::OnInit.  Now OnInit
  and main() are very similar.  They both call bx_init_siminterface, then
  bx_init_main (and quit if it fails), then show the config interface if
  quickstart is off, and then simulate.
- modified: main.cc gui/control.cc gui/wxmain.cc
2002-10-14 13:37:20 +00:00
Bryce Denney
bb9fd8ae22 - strncpy not guaranteed to null terminate, so do it. 2002-10-14 13:31:25 +00:00
Volker Ruppert
90e861cf97 - 3 missing GDK keysyms added 2002-10-13 11:07:44 +00:00
Volker Ruppert
53ceefc3c7 - keysym for the "AltGr" key added (SDLK_RMETA = BX_KEY_ALT_R) 2002-10-12 13:10:09 +00:00
Volker Ruppert
fb6fe521a2 - the "AltGr" key on European keyboards works now (wxbochs on win32 only) 2002-10-12 09:04:50 +00:00
Volker Ruppert
445638e312 - new German keymap for SDL on X11 2002-10-10 18:30:16 +00:00
Volker Ruppert
a68e648853 - use keyboard mapping for keyup messages too 2002-10-10 18:02:08 +00:00
Bryce Denney
af6299e1d4 - make menu text more clear: now it says "Debug Console" instead of "Show Log"
- modified: gui/wxmain.cc gui/wxmain.h
2002-10-10 15:44:34 +00:00
Volker Ruppert
45720388bf - fixed some keymap entries 2002-10-09 18:08:42 +00:00
Volker Ruppert
e6f50cfabb - ascii chars are always Bit8u values (Bit32s has generated negative values for
codes > 0x7f)
2002-10-09 17:49:44 +00:00
Bryce Denney
f133c6d1d0 - avoid a potential deadlock: if waiting for a sync response, stop waiting
if the gui wants to close.
2002-10-08 18:28:58 +00:00
Bryce Denney
c74b8c55fc - add key mapping for SDL gui, to demonstrate/verify that key mapping is not
specific to X windows.  I changed a few names of variables and methods to
  sound less X windows specific, for example in the BXKeyEntry struct
  the "xwinKey" field is now called "hostKey".
- remove the hacks in bx_keymap_c::loadKeymap that checked that every
  keysym started with "XK_".  Now I can still make that check, but it
  is done in x.cc's convertStringToXKeysym() instead.
- in sdl.cc, load the keymap in specific_init function.  I had to
  create a conversion function from SDL key names to SDLkey values.
  I created a table of key names and associated values, and I just
  do a strcmp on each name.  It's not a fast algorithm obviously but this
  conversion only has to be done for maybe 200 keys at startup time.
- added a key map file for SDL called sdl-pc-us.map.  Since this has
  basically all the SDLK_* symbols defined, it is a good starting point
  if you need to make any other keymaps.
- modified: gui/keymap.cc gui/keymap.h gui/sdl.cc gui/x.cc iodev/keyboard.cc
- added: gui/sdlkeys.h gui/keymaps/sdl-pc-us.map
2002-10-08 06:14:53 +00:00
Bryce Denney
0dd8da13d5 - Always enable the line that does
wxLog::SetActiveTarget (new wxLogStderr ());
  which used to be inside #ifdef __WXDEBUG__ ... #endif.  This fixes the
  problem of tons of little debug message dialogs appearing in wxwindows
  libraries built without debug support.
- This reverts revision 1.61.  I cannot figure out why I had trouble back on
  Sept 27, because now both my debug and release libraries work ok with the
  SetActiveTarget line.
2002-10-07 17:18:04 +00:00
Bryce Denney
77a2d3fc89 - fix bug 619320 "wx: clicking mouse enable btn different". Now both
the toolbar button and the mouse capture shortcuts (F12 and middle button)
  call ToggleMouse().  The only difference is that the first time you
  press the toolbar button it gives a little message about mouse capture
  and how to turn it off.
- modified: gui/wx.cc gui/wxmain.cc gui/wxmain.h
2002-10-07 04:49:50 +00:00
Bryce Denney
84c33ec824 - I was getting occasional thread bugs and crashes when I click on
Quit while the simulation was running.  I used to just do
  wxFrame::Close(TRUE) in the wxwindows thread, but the simulation
  thread would keep on running even after the window had disappeared.
  If the simulation thread sent any messages to the gui, it could
  segfault.  Now, when you click on Quit it asks the simulator to
  quit, but does not close the gui.  When the simulator thread finally
  quits, THEN it calls wxFrame::Close(TRUE) from the sim_thread (with
  appropriate gui mutex).  Such tricks are only needed when the
  simulation is running.  I hope this will fix bug #616142: "wx: crash
  from events after gui shutdown".
- move MyFrame::closing flag out into a global variable wxBochsClosing
  so that it will be valid even when the MyFrame is deleted.  See
  comments on in wxmain.h.
- when wxBochsClosing is set, don't create any new windows.  If any
  errors appear, just print them to stderr because the gui is just
  about to be closed.
- fix comment in SimThread::Entry to talk about longjmp instead of
  kill_bochs_request
- (minor) move contents of DefaultCallback2 into DefaultCallback.  It
  doesn't refer to the wxApp at all.  This is a bit safer in case it
  gets called when the wxApp is in the process of being deleted.
- modified: gui/wxmain.cc gui/wxmain.h
2002-10-07 04:01:00 +00:00
Bryce Denney
555e1d03e1 - set the quit context to NULL after it is no longer usable. I don't want
anybody jumping back because the pointer was still lying around.
- modified: gui/wxmain.cc main.cc
2002-10-06 19:21:05 +00:00
Bryce Denney
8ebc11df90 - use SDL_WarpPointer to keep the mouse from going outside the window.
This must be done carefully though, because the call to SDL_WarpPointer
  generates a mouse motion event of its own.  To work around this, I have
  added code that should ignore motion events generated by SDL_WarpPointer.
  This should fix bug [ 619283 ] SDL: os mouse pointer leaves the window.
  On Linux, SDL 1.2.3 it works fine.
2002-10-06 17:17:14 +00:00
Bryce Denney
346e2747d3 - fixed up ParamDialog to correctly handle "trees" of parameters. A
bx_list_c can now be displayed as either a wxStaticBox with the
  child parameters inside, or as a wxNotebook with each child
  parameter in a separate tab.  (The children can also be lists of
  course.)  The default display is the wxStaticBox type, but if you
  set the option bit bx_list_c::USE_TAB_WINDOW in the list,
  ParamDialog will use the wxNotebook display instead.
- to get the param trees working, I created a new struct
  AddParamContext, which is passed to AddParam().  This struct is
  critical when AddParam calls itself recursively to display lists
  within lists.
- use the wxNotebook display feature for the ATA0,1,2,3 controller
  dialog box.  Now instead of being hundreds of pixels tall, it is
  reasonable height with three different tabs.  This fixed bug
  #619074: "wx: ATA interface editor too tall" and was the whole
  reason I started messing with this at all.

plus some minor cleanups
- when I added the enum constant bx_list_c::USE_TAB_WINDOW, I also
  removed the BX_ prefix from all the other enum constants that are
  used in parameter options in siminterface.cc.  Since these constants
  are enums within a class, there is no possibility of namespace
  conflicts so the prefix is not needed.
- added wxADJUST_MINSIZE to all wxChoice controls, since that tells
  wxWindows to adjust its size to the length of the longest string.
- instead of calling SetSize or SetSizeHints on every textcontrol with
  a hardcoded width, I am using just two wxSize specifications for
  everything: either normalTextSize or longTextSize.
- edit names of a few menus and params.  For example now instead of
  the tab saying "Master ATA device on channel 0" it will say
  "First HD/CD on channel 0".

Modified Files:
  main.cc gui/control.cc gui/gui.cc gui/siminterface.cc gui/siminterface.h
  gui/wxdialog.cc gui/wxdialog.h gui/wxmain.cc
2002-10-06 02:37:28 +00:00
Bryce Denney
fdadda0ba8 - remove tabs 2002-10-05 23:11:59 +00:00
Bryce Denney
78b179d97c - if we're going to print "dimension update", might as well say what the
new values are
2002-10-05 18:27:24 +00:00
Bryce Denney
f5e351f12d - fix serious color bug in UpdateScreen. Because it considered newBits
to be signed instead of unsigned, it was looking up color values
  like wxBochsPalette[-126] instead of wxBochsPalette[130].  This affected
  any colors in the palette between 128 and 255.  I simply hanged newBits
  to signed, and it fixed bug #618462: wx: 256 color modes not working properly
- I am still not satisfied with the way that wxWindows maps colors on an
  8-bit display, but that is a different issue.
2002-10-05 18:15:00 +00:00
Bryce Denney
b147067051 - palette_change must return 1 to indicate that a screen update is needed
after the palette changes.  This makes the iodev/vga.cc code do the
  right thing.  This also fixes the toolstar splash screen, but at a
  fraction of the cost of the solution in rev 1.37.
2002-10-05 17:45:48 +00:00
Bryce Denney
7f8482cc93 - revert previous revision 1.37. There is a really easy solution which
I will check in instead.
2002-10-05 17:42:51 +00:00
Bryce Denney
494d0784ac - when the colormap changes, any existing pixels on the screen of that color
need to be updated.  This was impossible before, because we only stored the
  RGB values in wxScreen.  I added a new array called wxPixel that stores the
  8-bit color index that should be displayed.  Now if the VGA palette changes,
  I use wxPixel data to reconstruct wxScreen using the new palette.
- this fixes the display of the splash screen of the Toolstar disk, since
  it relied on drawing the picture and then fading the colormap from back
  up to the normal values.  I was hoping it would fix the splash screen of
  win95 too, but it does not.
2002-10-05 17:24:20 +00:00
Bryce Denney
89cf45ec2d - remove tabs 2002-10-05 12:40:34 +00:00
Volker Ruppert
757823f1ab - force a text screen update after a charmap change 2002-10-04 10:52:44 +00:00
Bryce Denney
f54551717e - include <windows.h> in bochs.h whenever WIN32 is defined. This is required
so that windows types can be used in fields, for example in cdrom.h:
    #ifdef WIN32
      HANDLE cdrom_interface::hFile;
    #endif
- since every file includes bochs.h, I removed includes of <windows.h>
  everywhere else
- modified: bochs.h cpu/extdb.cc gui/win32.cc gui/wx.cc iodev/cdrom.cc
  iodev/eth_win32.cc iodev/floppy.cc
2002-10-03 21:07:04 +00:00
Volker Ruppert
171038a28a - stop drawing if the y position is outside of the visible screen. Some graphics
modes have caused a segmentation fault in that case (e.g. CGA 320x300x4)
2002-10-03 13:12:20 +00:00
Bryce Denney
c901d60d00 - only XFlush if display has been opened already 2002-10-02 02:52:24 +00:00
Bryce Denney
4c9776fb96 - add -lwinmm to the link lines anytime you use --enable-sb16=win. Now
instead of winmm being a part of GUI_LINK_OPTS_WIN32 only, it is
  placed in @DEVICE_LINE_OPTS@ so that it will be used for sdl, rfb, wx,
  etc.
- solve compile problems when building bximage, niclist, and any other
  console based program.  The compile flags returned by wx-config and
  sdl-config did strange things to these console programs, for example
  redefining main to SDL_main.  Because I wanted to use the
  configure-generated CFLAGS to compile the programs, but I wanted to
  avoid including GUI specific compile options, I split up the configure's
  @CFLAGS@ variable into @CFLAGS@ and @GUI_CFLAGS@, and split
  @CXXFLAGS@ into @CXXFLAGS@ and @GUI_CXXFLAGS@.  All programs in the
  Bochs binary will use both, but the console programs will just use
  @CFLAGS@ or @CXXFLAGS@.
- gui/Makefile.in, I no longer use the gui specific CFLAGS variables,
  SDL_CFLAGS and WX_CXXFLAGS.  These values are included in CFLAGS and
  CXXFLAGS now.
- modified: configure.in, configure, all Makefile.in's
2002-10-01 23:37:50 +00:00
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