- this has been applied in cvs. removing
This commit is contained in:
parent
87f1f3a2e0
commit
26e07e1ac4
@ -1,256 +0,0 @@
|
||||
----------------------------------------------------------------------
|
||||
Patch name: patch.safe-fullscreen
|
||||
Author: Bryce Denney
|
||||
Date: Thu Dec 5 18:07:22 EST 2002
|
||||
|
||||
This fixes bug #614724: SDL can get stuck in full-screen mode, and provides
|
||||
a framework for fixing the problem on other full-screen display libraries
|
||||
such as term, svga, etc.
|
||||
|
||||
- add virtual method bx_gui::set_display_mode(mode) which can be overridden
|
||||
by each display library class, if appropriate. This method is primarily used
|
||||
when you run Bochs full screen, to tell the gui to switch from full screen
|
||||
back to a mode where you can use the text console.
|
||||
- There are two display modes: config and simulation. The mode is changed to
|
||||
config mode during logfunctions::ask, during the runtime configuration menu,
|
||||
and before displaying a debugger prompt. It is changed back to simulation
|
||||
mode whenever instructions are running.
|
||||
- Instead of being called directly through the global bx_gui pointer, the
|
||||
bx_gui_c::set_display_mode() method is almost always accessed through
|
||||
siminterface, like this:
|
||||
SIM->set_display_mode (DISP_MODE_CONFIG);
|
||||
SIM->set_display_mode (DISP_MODE_SIM);
|
||||
Of course siminterface just passes the call on to bx_gui::set_display_mode().
|
||||
I added it to siminterface so that the config interfaces could call it.
|
||||
(They don't #include bochs.h so they can't access bx_gui.)
|
||||
|
||||
Patch was created with:
|
||||
cvs diff -u
|
||||
Apply patch to what version:
|
||||
cvs checked out on DATE, release version VER
|
||||
Instructions:
|
||||
To patch, go to main bochs directory.
|
||||
Type "patch -p0 < THIS_PATCH_FILE".
|
||||
----------------------------------------------------------------------
|
||||
|
||||
Index: logio.cc
|
||||
===================================================================
|
||||
RCS file: /cvsroot/bochs/bochs/logio.cc,v
|
||||
retrieving revision 1.37
|
||||
diff -u -r1.37 logio.cc
|
||||
--- logio.cc 2 Dec 2002 21:19:09 -0000 1.37
|
||||
+++ logio.cc 5 Dec 2002 23:05:31 -0000
|
||||
@@ -442,6 +442,8 @@
|
||||
if (SIM->get_init_done()) DEV_vga_refresh();
|
||||
|
||||
#if !BX_EXTERNAL_DEBUGGER
|
||||
+ // ensure the text screen is showing
|
||||
+ SIM->set_display_mode (DISP_MODE_CONFIG);
|
||||
int val = SIM->log_msg (prefix, level, buf1);
|
||||
switch (val)
|
||||
{
|
||||
@@ -487,6 +489,8 @@
|
||||
#else
|
||||
// external debugger ask code goes here
|
||||
#endif
|
||||
+ // return to simulation mode
|
||||
+ SIM->set_display_mode (DISP_MODE_SIM);
|
||||
in_ask_already = 0;
|
||||
}
|
||||
|
||||
Index: main.cc
|
||||
===================================================================
|
||||
RCS file: /cvsroot/bochs/bochs/main.cc,v
|
||||
retrieving revision 1.202
|
||||
diff -u -r1.202 main.cc
|
||||
--- main.cc 3 Dec 2002 18:55:23 -0000 1.202
|
||||
+++ main.cc 5 Dec 2002 23:05:35 -0000
|
||||
@@ -2215,6 +2215,9 @@
|
||||
if (been_here) return 1; // protect from reentry
|
||||
been_here = 1;
|
||||
|
||||
+ // in case we ended up in simulation mode, change back to config mode
|
||||
+ // so that the user can see any messages left behind on the console.
|
||||
+ SIM->set_display_mode (DISP_MODE_CONFIG);
|
||||
|
||||
#if BX_PROVIDE_DEVICE_MODELS==1
|
||||
bx_pc_system.exit();
|
||||
Index: debug/dbg_main.cc
|
||||
===================================================================
|
||||
RCS file: /cvsroot/bochs/bochs/debug/dbg_main.cc,v
|
||||
retrieving revision 1.94
|
||||
diff -u -r1.94 dbg_main.cc
|
||||
--- debug/dbg_main.cc 2 Dec 2002 21:26:04 -0000 1.94
|
||||
+++ debug/dbg_main.cc 5 Dec 2002 23:05:39 -0000
|
||||
@@ -473,6 +473,7 @@
|
||||
|
||||
while ( 1 ) {
|
||||
SIM->refresh_ci ();
|
||||
+ SIM->set_display_mode (DISP_MODE_CONFIG);
|
||||
bx_get_command();
|
||||
if ( (*tmp_buf_ptr == '\n') || (*tmp_buf_ptr == 0) ) {
|
||||
if (bx_infile_stack_index == 0)
|
||||
@@ -1634,6 +1635,10 @@
|
||||
sim_running->set (1);
|
||||
SIM->refresh_ci ();
|
||||
|
||||
+ // use simulation mode while executing instructions. When the prompt
|
||||
+ // is printed, we will return to config mode.
|
||||
+ SIM->set_display_mode (DISP_MODE_SIM);
|
||||
+
|
||||
bx_guard.interrupt_requested = 0;
|
||||
bx_guard.special_unwind_stack = 0;
|
||||
int stop = 0;
|
||||
@@ -1717,6 +1722,10 @@
|
||||
dbg_printf ( "Error: stepN: count=0\n");
|
||||
return;
|
||||
}
|
||||
+
|
||||
+ // use simulation mode while executing instructions. When the prompt
|
||||
+ // is printed, we will return to config mode.
|
||||
+ SIM->set_display_mode (DISP_MODE_SIM);
|
||||
|
||||
#if BX_NUM_SIMULATORS >= 2
|
||||
bx_guard.interrupt_requested = 0;
|
||||
Index: gui/gui.h
|
||||
===================================================================
|
||||
RCS file: /cvsroot/bochs/bochs/gui/gui.h,v
|
||||
retrieving revision 1.34
|
||||
diff -u -r1.34 gui.h
|
||||
--- gui/gui.h 27 Oct 2002 23:33:13 -0000 1.34
|
||||
+++ gui/gui.h 5 Dec 2002 23:05:40 -0000
|
||||
@@ -54,6 +54,14 @@
|
||||
virtual int set_clipboard_text(char *snapshot, Bit32u len) = 0;
|
||||
virtual void mouse_enabled_changed_specific (bx_bool val) = 0;
|
||||
virtual void exit(void) = 0;
|
||||
+ // set_display_mode() changes the mode between the configuration interface
|
||||
+ // and the simulation. This is primarily intended for display libraries
|
||||
+ // which have a full-screen mode such as SDL, term, and svgalib. The display
|
||||
+ // mode is set to DISP_MODE_CONFIG before displaying any configuration menus,
|
||||
+ // for panics that requires user input, when entering the debugger, etc. It
|
||||
+ // is set to DISP_MODE_SIM when the Bochs simulation resumes. The
|
||||
+ // enum is defined in gui/siminterface.h.
|
||||
+ virtual void set_display_mode (disp_mode_t newmode) { /* default=no action*/ }
|
||||
// These are only needed for the term gui. For all other guis they will
|
||||
// have no effect.
|
||||
// returns 32-bit bitmask in which 1 means the GUI should handle that signal
|
||||
@@ -111,6 +119,7 @@
|
||||
unsigned char vga_charmap[0x2000];
|
||||
bx_bool charmap_updated;
|
||||
bx_bool char_changed[256];
|
||||
+ disp_mode_t disp_mode;
|
||||
};
|
||||
|
||||
|
||||
Index: gui/sdl.cc
|
||||
===================================================================
|
||||
RCS file: /cvsroot/bochs/bochs/gui/sdl.cc,v
|
||||
retrieving revision 1.30
|
||||
diff -u -r1.30 sdl.cc
|
||||
--- gui/sdl.cc 19 Nov 2002 05:47:44 -0000 1.30
|
||||
+++ gui/sdl.cc 5 Dec 2002 23:05:41 -0000
|
||||
@@ -46,6 +46,7 @@
|
||||
public:
|
||||
bx_sdl_gui_c (void);
|
||||
DECLARE_GUI_VIRTUAL_METHODS()
|
||||
+ virtual void set_display_mode (disp_mode_t newmode);
|
||||
};
|
||||
|
||||
// declare one instance of the gui object and call macro to insert the
|
||||
@@ -1151,6 +1152,29 @@
|
||||
return ptr->value;
|
||||
}
|
||||
return BX_KEYMAP_UNKNOWN;
|
||||
+}
|
||||
+
|
||||
+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:
|
||||
+ BX_DEBUG (("switch to configuration mode (windowed)"));
|
||||
+ switch_to_windowed ();
|
||||
+ break;
|
||||
+ case DISP_MODE_SIM:
|
||||
+ BX_DEBUG (("switch to simulation mode (fullscreen)"));
|
||||
+ switch_to_fullscreen ();
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
#endif /* if BX_WITH_SDL */
|
||||
Index: gui/siminterface.cc
|
||||
===================================================================
|
||||
RCS file: /cvsroot/bochs/bochs/gui/siminterface.cc,v
|
||||
retrieving revision 1.87
|
||||
diff -u -r1.87 siminterface.cc
|
||||
--- gui/siminterface.cc 2 Dec 2002 21:26:05 -0000 1.87
|
||||
+++ gui/siminterface.cc 5 Dec 2002 23:05:42 -0000
|
||||
@@ -116,6 +116,12 @@
|
||||
virtual bool is_sim_thread ();
|
||||
bool wxsel;
|
||||
virtual bool is_wx_selected () { return wxsel; }
|
||||
+ // provide interface to bx_gui->set_display_mode() method for config
|
||||
+ // interfaces to use.
|
||||
+ virtual void set_display_mode (disp_mode_t newmode) {
|
||||
+ if (bx_gui != NULL)
|
||||
+ bx_gui->set_display_mode (newmode);
|
||||
+ }
|
||||
};
|
||||
|
||||
bx_param_c *
|
||||
@@ -712,7 +718,11 @@
|
||||
wxsel = true;
|
||||
else
|
||||
wxsel = false;
|
||||
- return (*ci_callback)(ci_callback_data, command);
|
||||
+ // enter configuration mode, just while running the configuration interface
|
||||
+ set_display_mode (DISP_MODE_CONFIG);
|
||||
+ int retval = (*ci_callback)(ci_callback_data, command);
|
||||
+ set_display_mode (DISP_MODE_SIM);
|
||||
+ return retval;
|
||||
}
|
||||
|
||||
int
|
||||
Index: gui/siminterface.h
|
||||
===================================================================
|
||||
RCS file: /cvsroot/bochs/bochs/gui/siminterface.h,v
|
||||
retrieving revision 1.90
|
||||
diff -u -r1.90 siminterface.h
|
||||
--- gui/siminterface.h 2 Dec 2002 21:26:05 -0000 1.90
|
||||
+++ gui/siminterface.h 5 Dec 2002 23:05:43 -0000
|
||||
@@ -1156,6 +1156,16 @@
|
||||
enum ci_command_t { CI_START, CI_RUNTIME_CONFIG, CI_SHUTDOWN };
|
||||
typedef int (*config_interface_callback_t)(void *userdata, ci_command_t command);
|
||||
|
||||
+// bx_gui->set_display_mode() changes the mode between the configuration
|
||||
+// interface and the simulation. This is primarily intended for display
|
||||
+// libraries which have a full-screen mode such as SDL, term, and svgalib. The
|
||||
+// display mode is set to DISP_MODE_CONFIG before displaying any configuration
|
||||
+// menus, for panics that requires user input, when entering the debugger, etc.
|
||||
+// It is set to DISP_MODE_SIM when the Bochs simulation resumes. The constants
|
||||
+// are defined here so that configuration interfaces can use them with the
|
||||
+// bx_simulator_interface_c::set_display_mode() method.
|
||||
+enum disp_mode_t { DISP_MODE_CONFIG=100, DISP_MODE_SIM };
|
||||
+
|
||||
class BOCHSAPI bx_simulator_interface_c {
|
||||
public:
|
||||
bx_simulator_interface_c ();
|
||||
@@ -1264,6 +1274,9 @@
|
||||
}
|
||||
virtual bool is_sim_thread () {return true;}
|
||||
virtual bool is_wx_selected () {return false;}
|
||||
+ // provide interface to bx_gui->set_display_mode() method for config
|
||||
+ // interfaces to use.
|
||||
+ virtual void set_display_mode (disp_mode_t newmode) {}
|
||||
};
|
||||
|
||||
BOCHSAPI extern bx_simulator_interface_c *SIM;
|
Loading…
Reference in New Issue
Block a user