- fix interface menu

This commit is contained in:
Bryce Denney 2001-06-09 21:29:07 +00:00
parent 8e7c2e42f3
commit dffe013ff8
3 changed files with 43 additions and 20 deletions

View File

@ -1,6 +1,6 @@
/*
* gui/control.cc
* $Id: control.cc,v 1.5 2001-06-09 21:19:58 bdenney Exp $
* $Id: control.cc,v 1.6 2001-06-09 21:29:07 bdenney Exp $
*
* This is code for a text-mode control panel. Note that this file
* does NOT include bochs.h. Instead, it does all of its contact with
@ -78,6 +78,7 @@ void bx_edit_cdrom ();
void bx_edit_rom_path (int vga);
void bx_edit_rom_addr ();
void bx_newhd_support ();
void bx_private_colormap ();
void bx_boot_from ();
void bx_ips_change ();
int bx_read_rc (char *rc);
@ -476,32 +477,26 @@ int bx_control_panel (int menu)
}
}
break;
#if 0
case BX_CPANEL_START_OPTS_INTERFACE:
{
char prompt[1024];
int interval;
SIM->get_vga_update_interval (&interval);
int interval = SIM->get_vga_update_interval ();
sprintf (prompt, startup_interface_options,
interval,
SIM->get_mouse_enabled (),
SIM->getips ());
build_disk_options_prompt (startup_disk_options_prompt, prompt, 1024);
if (ask_int (prompt, 0, 7, 0, &choice) < 0) return -1;
SIM->get_mouse_enabled () ? "enabled" : "disabled",
SIM->getips (),
SIM->get_private_colormap () ? "enabled" : "disabled");
if (ask_int (prompt, 0, 4, 0, &choice) < 0) return -1;
switch (choice) {
case 0: return 0;
case 1: bx_edit_floppy (0); break;
case 2: bx_edit_floppy (1); break;
case 3: bx_edit_hard_disk (0); break;
case 4: bx_edit_hard_disk (1); break;
case 5: bx_edit_cdrom (); break;
case 6: bx_newhd_support (); break;
case 7: bx_boot_from (); break;
case 1: bx_vga_update_interval (); break;
case 2: bx_mouse_enable (); break;
case 3: bx_ips_change (); break;
case 4: bx_private_colormap (); break;
default: BAD_OPTION(menu, choice);
}
}
break;
#endif
case BX_CPANEL_RUNTIME:
if (ask_int (runtime_menu_prompt, 1, 9, 8, &choice) < 0) return -1;
switch (choice) {
@ -614,6 +609,15 @@ void bx_newhd_support ()
SIM->set_newhd_support (newval);
}
void bx_private_colormap ()
{
int newval, oldval = SIM->get_private_colormap ();
if (ask_yn ("Use private colormap? [%s] ", oldval, &newval) < 0) return;
if (newval == oldval) return;
SIM->set_private_colormap (newval);
}
void bx_boot_from ()
{
int newval, oldval = SIM->get_boot_hard_disk ();

View File

@ -1,6 +1,6 @@
/*
* gui/siminterface.cc
* $Id: siminterface.cc,v 1.6 2001-06-09 21:19:58 bdenney Exp $
* $Id: siminterface.cc,v 1.7 2001-06-09 21:29:07 bdenney Exp $
*
* Defines the actual link between bx_simulator_interface_c methods
* and the simulator. This file includes bochs.h because it needs
@ -62,6 +62,8 @@ class bx_real_sim_c : public bx_simulator_interface_c {
virtual int set_vga_path (char *path);
virtual int get_rom_address ();
virtual int set_rom_address (int addr);
virtual int get_private_colormap ();
virtual void set_private_colormap (int en);
};
void init_siminterface ()
@ -147,7 +149,9 @@ bx_real_sim_c::get_vga_update_interval () {
void
bx_real_sim_c::set_vga_update_interval (unsigned interval) {
bx_vga.set_update_interval (interval);
bx_options.vga_update_interval = interval;
if (get_init_done ())
bx_vga.set_update_interval (interval);
}
int bx_real_sim_c::get_mouse_enabled () {
@ -155,7 +159,9 @@ int bx_real_sim_c::get_mouse_enabled () {
}
void bx_real_sim_c::set_mouse_enabled (int en) {
bx_gui.gui_set_mouse_enable (en!=0);
bx_options.mouse_enabled = en;
if (get_init_done ())
bx_gui.gui_set_mouse_enable (en!=0);
}
int
@ -340,3 +346,14 @@ bx_real_sim_c::set_rom_address (int addr)
return 0;
}
int
bx_real_sim_c::get_private_colormap ()
{
return bx_options.private_colormap;
}
void
bx_real_sim_c::set_private_colormap (int en)
{
bx_options.private_colormap = en;
}

View File

@ -1,6 +1,6 @@
/*
* gui/siminterface.h
* $Id: siminterface.h,v 1.3 2001-06-09 21:12:16 bdenney Exp $
* $Id: siminterface.h,v 1.4 2001-06-09 21:29:07 bdenney Exp $
*
* Interface to the simulator, currently only used by control.cc.
* The base class bx_simulator_interface_c, contains only virtual functions
@ -95,6 +95,8 @@ public:
virtual int set_vga_path (char *path) {return -1;}
virtual int get_rom_address () {return -1;}
virtual int set_rom_address (int addr) {return -1;}
virtual int get_private_colormap () { return -1; }
virtual void set_private_colormap (int en) {}
};
extern bx_simulator_interface_c *SIM;