SheepShaver GUI, remove extraneous "slirp" currently inexistent for Windows

This commit is contained in:
gbeauche 2005-11-27 23:51:47 +00:00
parent 37da272071
commit 434ad38a1f

View File

@ -51,6 +51,24 @@ static void create_jit_pane(GtkWidget *top);
static void read_settings(void); static void read_settings(void);
/*
* SheepShaver glue
*/
#ifdef SHEEPSHAVER
#define DISABLE_SCSI 1
#define PROGRAM_NAME "SheepShaver"
enum {
STR_WINDOW_LAB = STR_WINDOW_CTRL,
STR_FULLSCREEN_LAB = STR_FULLSCREEN_CTRL,
STR_SERIALA_CTRL = STR_SERPORTA_CTRL,
STR_SERIALB_CTRL = STR_SERPORTB_CTRL,
};
#else
#define PROGRAM_NAME "BasiliskII"
#endif
/* /*
* Utility functions * Utility functions
*/ */
@ -390,11 +408,15 @@ static void cb_about(...)
char str[512]; char str[512];
sprintf(str, sprintf(str,
"Basilisk II\nVersion %d.%d\n\n" PROGRAM_NAME "\nVersion %d.%d\n\n"
"Copyright (C) 1997-2005 Christian Bauer et al.\n" "Copyright (C) 1997-2005 Christian Bauer et al.\n"
"E-mail: Christian.Bauer@uni-mainz.de\n" "E-mail: cb@cebix.net\n"
"http://www.uni-mainz.de/~bauec002/B2Main.html\n\n" #ifdef SHEEPSHAVER
"Basilisk II comes with ABSOLUTELY NO\n" "http://sheepshaver.cebix.net/\n\n"
#else
"http://basilisk.cebix.net/\n\n"
#endif
PROGRAM_NAME " comes with ABSOLUTELY NO\n"
"WARRANTY. This is free software, and\n" "WARRANTY. This is free software, and\n"
"you are welcome to redistribute it\n" "you are welcome to redistribute it\n"
"under the terms of the GNU General\n" "under the terms of the GNU General\n"
@ -673,20 +695,24 @@ static void create_volumes_pane(GtkWidget *top)
* "JIT Compiler" pane * "JIT Compiler" pane
*/ */
#ifndef SHEEPSHAVER
static GtkWidget *w_jit_fpu; static GtkWidget *w_jit_fpu;
static GtkWidget *w_jit_atraps; static GtkWidget *w_jit_atraps;
static GtkWidget *w_jit_cache_size; static GtkWidget *w_jit_cache_size;
static GtkWidget *w_jit_lazy_flush; static GtkWidget *w_jit_lazy_flush;
static GtkWidget *w_jit_follow_const_jumps; static GtkWidget *w_jit_follow_const_jumps;
#endif
// Set sensitivity of widgets // Set sensitivity of widgets
static void set_jit_sensitive(void) static void set_jit_sensitive(void)
{ {
#ifndef SHEEPSHAVER
const bool jit_enabled = PrefsFindBool("jit"); const bool jit_enabled = PrefsFindBool("jit");
gtk_widget_set_sensitive(w_jit_fpu, jit_enabled); gtk_widget_set_sensitive(w_jit_fpu, jit_enabled);
gtk_widget_set_sensitive(w_jit_cache_size, jit_enabled); gtk_widget_set_sensitive(w_jit_cache_size, jit_enabled);
gtk_widget_set_sensitive(w_jit_lazy_flush, jit_enabled); gtk_widget_set_sensitive(w_jit_lazy_flush, jit_enabled);
gtk_widget_set_sensitive(w_jit_follow_const_jumps, jit_enabled); gtk_widget_set_sensitive(w_jit_follow_const_jumps, jit_enabled);
#endif
} }
// "Use JIT Compiler" button toggled // "Use JIT Compiler" button toggled
@ -697,22 +723,28 @@ static void tb_jit(GtkWidget *widget)
} }
// "Compile FPU Instructions" button toggled // "Compile FPU Instructions" button toggled
#ifndef SHEEPSHAVER
static void tb_jit_fpu(GtkWidget *widget) static void tb_jit_fpu(GtkWidget *widget)
{ {
PrefsReplaceBool("jitfpu", GTK_TOGGLE_BUTTON(widget)->active); PrefsReplaceBool("jitfpu", GTK_TOGGLE_BUTTON(widget)->active);
} }
#endif
// "Lazy translation cache invalidation" button toggled // "Lazy translation cache invalidation" button toggled
#ifndef SHEEPSHAVER
static void tb_jit_lazy_flush(GtkWidget *widget) static void tb_jit_lazy_flush(GtkWidget *widget)
{ {
PrefsReplaceBool("jitlazyflush", GTK_TOGGLE_BUTTON(widget)->active); PrefsReplaceBool("jitlazyflush", GTK_TOGGLE_BUTTON(widget)->active);
} }
#endif
// "Translate through constant jumps (inline blocks)" button toggled // "Translate through constant jumps (inline blocks)" button toggled
#ifndef SHEEPSHAVER
static void tb_jit_follow_const_jumps(GtkWidget *widget) static void tb_jit_follow_const_jumps(GtkWidget *widget)
{ {
PrefsReplaceBool("jitinline", GTK_TOGGLE_BUTTON(widget)->active); PrefsReplaceBool("jitinline", GTK_TOGGLE_BUTTON(widget)->active);
} }
#endif
// Read settings from widgets and set preferences // Read settings from widgets and set preferences
static void read_jit_settings(void) static void read_jit_settings(void)
@ -720,12 +752,22 @@ static void read_jit_settings(void)
#if USE_JIT #if USE_JIT
bool jit_enabled = PrefsFindBool("jit"); bool jit_enabled = PrefsFindBool("jit");
if (jit_enabled) { if (jit_enabled) {
#ifndef SHEEPSHAVER
const char *str = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(w_jit_cache_size)->entry)); const char *str = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(w_jit_cache_size)->entry));
PrefsReplaceInt32("jitcachesize", atoi(str)); PrefsReplaceInt32("jitcachesize", atoi(str));
#endif
} }
#endif #endif
} }
// "Use built-in 68k DR emulator" button toggled
#ifdef SHEEPSHAVER
static void tb_jit_68k(GtkWidget *widget)
{
PrefsReplaceBool("jit68k", GTK_TOGGLE_BUTTON(widget)->active);
}
#endif
// Create "JIT Compiler" pane // Create "JIT Compiler" pane
static void create_jit_pane(GtkWidget *top) static void create_jit_pane(GtkWidget *top)
{ {
@ -736,6 +778,7 @@ static void create_jit_pane(GtkWidget *top)
box = make_pane(top, STR_JIT_PANE_TITLE); box = make_pane(top, STR_JIT_PANE_TITLE);
make_checkbox(box, STR_JIT_CTRL, "jit", GTK_SIGNAL_FUNC(tb_jit)); make_checkbox(box, STR_JIT_CTRL, "jit", GTK_SIGNAL_FUNC(tb_jit));
#ifndef SHEEPSHAVER
w_jit_fpu = make_checkbox(box, STR_JIT_FPU_CTRL, "jitfpu", GTK_SIGNAL_FUNC(tb_jit_fpu)); w_jit_fpu = make_checkbox(box, STR_JIT_FPU_CTRL, "jitfpu", GTK_SIGNAL_FUNC(tb_jit_fpu));
// Translation cache size // Translation cache size
@ -753,9 +796,14 @@ static void create_jit_pane(GtkWidget *top)
// Follow constant jumps (inline basic blocks) // Follow constant jumps (inline basic blocks)
w_jit_follow_const_jumps = make_checkbox(box, STR_JIT_FOLLOW_CONST_JUMPS, "jitinline", GTK_SIGNAL_FUNC(tb_jit_follow_const_jumps)); w_jit_follow_const_jumps = make_checkbox(box, STR_JIT_FOLLOW_CONST_JUMPS, "jitinline", GTK_SIGNAL_FUNC(tb_jit_follow_const_jumps));
#endif
set_jit_sensitive(); set_jit_sensitive();
#endif #endif
#ifdef SHEEPSHAVER
make_checkbox(box, STR_JIT_68K_CTRL, "jit68k", GTK_SIGNAL_FUNC(tb_jit_68k));
#endif
} }
/* /*
@ -767,6 +815,7 @@ static GtkWidget *w_scsi[7];
// Read settings from widgets and set preferences // Read settings from widgets and set preferences
static void read_scsi_settings(void) static void read_scsi_settings(void)
{ {
#ifndef DISABLE_SCSI
for (int id=0; id<7; id++) { for (int id=0; id<7; id++) {
char prefs_name[32]; char prefs_name[32];
sprintf(prefs_name, "scsi%d", id); sprintf(prefs_name, "scsi%d", id);
@ -776,11 +825,13 @@ static void read_scsi_settings(void)
else else
PrefsRemoveItem(prefs_name); PrefsRemoveItem(prefs_name);
} }
#endif
} }
// Create "SCSI" pane // Create "SCSI" pane
static void create_scsi_pane(GtkWidget *top) static void create_scsi_pane(GtkWidget *top)
{ {
#ifndef DISABLE_SCSI
GtkWidget *box; GtkWidget *box;
box = make_pane(top, STR_SCSI_PANE_TITLE); box = make_pane(top, STR_SCSI_PANE_TITLE);
@ -790,6 +841,7 @@ static void create_scsi_pane(GtkWidget *top)
sprintf(prefs_name, "scsi%d", id); sprintf(prefs_name, "scsi%d", id);
w_scsi[id] = make_file_entry(box, STR_SCSI_ID_0 + id, prefs_name); w_scsi[id] = make_file_entry(box, STR_SCSI_ID_0 + id, prefs_name);
} }
#endif
} }
@ -845,6 +897,14 @@ static void mn_30hz(...) {PrefsReplaceInt32("frameskip", 2);}
static void mn_60hz(...) {PrefsReplaceInt32("frameskip", 1);} static void mn_60hz(...) {PrefsReplaceInt32("frameskip", 1);}
static void mn_dynamic(...) {PrefsReplaceInt32("frameskip", 0);} static void mn_dynamic(...) {PrefsReplaceInt32("frameskip", 0);}
// QuickDraw acceleration
#ifdef SHEEPSHAVER
static void tb_gfxaccel(GtkWidget *widget)
{
PrefsReplaceBool("gfxaccel", GTK_TOGGLE_BUTTON(widget)->active);
}
#endif
// Set sensitivity of widgets // Set sensitivity of widgets
static void set_graphics_sensitive(void) static void set_graphics_sensitive(void)
{ {
@ -862,8 +922,13 @@ static void tb_nosound(GtkWidget *widget)
static void parse_graphics_prefs(void) static void parse_graphics_prefs(void)
{ {
display_type = DISPLAY_WINDOW; display_type = DISPLAY_WINDOW;
#ifdef SHEEPSHAVER
dis_width = 640;
dis_height = 480;
#else
dis_width = 512; dis_width = 512;
dis_height = 384; dis_height = 384;
#endif
const char *str = PrefsFindString("screen"); const char *str = PrefsFindString("screen");
if (str) { if (str) {
@ -1003,6 +1068,10 @@ static void create_graphics_pane(GtkWidget *top)
gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 3, 4, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4); gtk_table_attach(GTK_TABLE(table), combo, 1, 2, 3, 4, (GtkAttachOptions)GTK_FILL, (GtkAttachOptions)0, 4, 4);
w_display_y = GTK_COMBO(combo)->entry; w_display_y = GTK_COMBO(combo)->entry;
#ifdef SHEEPSHAVER
make_checkbox(box, STR_GFXACCEL_CTRL, "gfxaccel", GTK_SIGNAL_FUNC(tb_gfxaccel));
#endif
make_separator(box); make_separator(box);
make_checkbox(box, STR_NOSOUND_CTRL, "nosound", GTK_SIGNAL_FUNC(tb_nosound)); make_checkbox(box, STR_NOSOUND_CTRL, "nosound", GTK_SIGNAL_FUNC(tb_nosound));
@ -1260,10 +1329,6 @@ static GList *add_ether_names(void)
GList *glist = NULL; GList *glist = NULL;
// TODO: Get list of all Ethernet interfaces // TODO: Get list of all Ethernet interfaces
#ifdef HAVE_SLIRP
static const char s_slirp[] = "slirp";
glist = g_list_append(glist, (void *)s_slirp);
#endif
glist = g_list_append(glist, (void *)s_nat_router); glist = g_list_append(glist, (void *)s_nat_router);
glist = g_list_append(glist, (void *)GetString(STR_NONE_LAB)); glist = g_list_append(glist, (void *)GetString(STR_NONE_LAB));
return glist; return glist;
@ -1339,6 +1404,14 @@ static void create_ethernet_pane(GtkWidget *top)
static GtkWidget *w_ramsize; static GtkWidget *w_ramsize;
static GtkWidget *w_rom_file; static GtkWidget *w_rom_file;
// Don't use CPU when idle?
#ifdef SHEEPSHAVER
static void tb_idlewait(GtkWidget *widget)
{
PrefsReplaceBool("idlewait", GTK_TOGGLE_BUTTON(widget)->active);
}
#endif
// "Ignore SEGV" button toggled // "Ignore SEGV" button toggled
#ifdef HAVE_SIGSEGV_SKIP_INSTRUCTION #ifdef HAVE_SIGSEGV_SKIP_INSTRUCTION
static void tb_ignoresegv(GtkWidget *widget) static void tb_ignoresegv(GtkWidget *widget)
@ -1381,7 +1454,9 @@ static void create_memory_pane(GtkWidget *top)
table = make_table(box, 2, 5); table = make_table(box, 2, 5);
static const combo_desc options[] = { static const combo_desc options[] = {
#ifndef SHEEPSHAVER
STR_RAMSIZE_2MB_LAB, STR_RAMSIZE_2MB_LAB,
#endif
STR_RAMSIZE_4MB_LAB, STR_RAMSIZE_4MB_LAB,
STR_RAMSIZE_8MB_LAB, STR_RAMSIZE_8MB_LAB,
STR_RAMSIZE_16MB_LAB, STR_RAMSIZE_16MB_LAB,
@ -1390,13 +1465,16 @@ static void create_memory_pane(GtkWidget *top)
STR_RAMSIZE_128MB_LAB, STR_RAMSIZE_128MB_LAB,
STR_RAMSIZE_256MB_LAB, STR_RAMSIZE_256MB_LAB,
STR_RAMSIZE_512MB_LAB, STR_RAMSIZE_512MB_LAB,
#ifndef SHEEPSHAVER
STR_RAMSIZE_1024MB_LAB, STR_RAMSIZE_1024MB_LAB,
#endif
0 0
}; };
char default_ramsize[10]; char default_ramsize[10];
sprintf(default_ramsize, "%d", PrefsFindInt32("ramsize") >> 20); sprintf(default_ramsize, "%d", PrefsFindInt32("ramsize") >> 20);
w_ramsize = table_make_combobox(table, 0, STR_RAMSIZE_CTRL, default_ramsize, options); w_ramsize = table_make_combobox(table, 0, STR_RAMSIZE_CTRL, default_ramsize, options);
#ifndef SHEEPSHAVER
static const opt_desc model_options[] = { static const opt_desc model_options[] = {
{STR_MODELID_5_LAB, GTK_SIGNAL_FUNC(mn_modelid_5)}, {STR_MODELID_5_LAB, GTK_SIGNAL_FUNC(mn_modelid_5)},
{STR_MODELID_14_LAB, GTK_SIGNAL_FUNC(mn_modelid_14)}, {STR_MODELID_14_LAB, GTK_SIGNAL_FUNC(mn_modelid_14)},
@ -1408,6 +1486,7 @@ static void create_memory_pane(GtkWidget *top)
case 14: active = 1; break; case 14: active = 1; break;
} }
table_make_option_menu(table, 2, STR_MODELID_CTRL, model_options, active); table_make_option_menu(table, 2, STR_MODELID_CTRL, model_options, active);
#endif
#if EMULATED_68K #if EMULATED_68K
static const opt_desc cpu_options[] = { static const opt_desc cpu_options[] = {
@ -1434,6 +1513,10 @@ static void create_memory_pane(GtkWidget *top)
#ifdef HAVE_SIGSEGV_SKIP_INSTRUCTION #ifdef HAVE_SIGSEGV_SKIP_INSTRUCTION
make_checkbox(box, STR_IGNORESEGV_CTRL, "ignoresegv", GTK_SIGNAL_FUNC(tb_ignoresegv)); make_checkbox(box, STR_IGNORESEGV_CTRL, "ignoresegv", GTK_SIGNAL_FUNC(tb_ignoresegv));
#endif #endif
#ifdef SHEEPSHAVER
make_checkbox(box, STR_IDLEWAIT_CTRL, "idlewait", GTK_SIGNAL_FUNC(tb_idlewait));
#endif
} }
@ -1509,7 +1592,7 @@ int main(int argc, char *argv[])
// Exit preferences // Exit preferences
PrefsExit(); PrefsExit();
// Transfer control to the Basilisk II executable // Transfer control to the executable
if (start) { if (start) {
char path[_MAX_PATH]; char path[_MAX_PATH];
bool ok = GetModuleFileName(NULL, path, sizeof(path)) != 0; bool ok = GetModuleFileName(NULL, path, sizeof(path)) != 0;
@ -1519,14 +1602,15 @@ int main(int argc, char *argv[])
*++p = '\0'; *++p = '\0';
SetCurrentDirectory(path); SetCurrentDirectory(path);
strcpy(b2_path, path); strcpy(b2_path, path);
strcat(b2_path, "BasiliskII.exe"); strcat(b2_path, PROGRAM_NAME);
strcat(b2_path, ".exe");
HINSTANCE h = ShellExecute(GetDesktopWindow(), "open", HINSTANCE h = ShellExecute(GetDesktopWindow(), "open",
b2_path, "", path, SW_SHOWNORMAL); b2_path, "", path, SW_SHOWNORMAL);
if ((int)h <= 32) if ((int)h <= 32)
ok = false; ok = false;
} }
if (!ok) { if (!ok) {
ErrorAlert("Coult not start BasiliskII executable"); ErrorAlert("Coult not start " PROGRAM_NAME " executable");
return 1; return 1;
} }
} }