mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-26 10:49:21 +00:00
Merge in dsp, mixer, ignoresegv prefs items from Basilisk II. Audio output
does not work with NewWorld ROMs yet.
This commit is contained in:
parent
a27aa7dc26
commit
b9b0b5248b
@ -546,6 +546,8 @@ static void create_jit_pane(GtkWidget *top)
|
||||
|
||||
static GtkWidget *w_frameskip;
|
||||
|
||||
static GtkWidget *w_dspdevice_file, *w_mixerdevice_file;
|
||||
|
||||
// "5 Hz".."60Hz" selected
|
||||
static void mn_5hz(...) {PrefsReplaceInt32("frameskip", 12);}
|
||||
static void mn_7hz(...) {PrefsReplaceInt32("frameskip", 8);}
|
||||
@ -619,15 +621,26 @@ static void tb_fs1600x1200(GtkWidget *widget)
|
||||
PrefsReplaceInt32("screenmodes", PrefsFindInt32("screenmodes") & ~32);
|
||||
}
|
||||
|
||||
// Set sensitivity of widgets
|
||||
static void set_graphics_sensitive(void)
|
||||
{
|
||||
const bool sound_enabled = !PrefsFindBool("nosound");
|
||||
gtk_widget_set_sensitive(w_dspdevice_file, sound_enabled);
|
||||
gtk_widget_set_sensitive(w_mixerdevice_file, sound_enabled);
|
||||
}
|
||||
|
||||
// "Disable Sound Output" button toggled
|
||||
static void tb_nosound(GtkWidget *widget)
|
||||
{
|
||||
PrefsReplaceBool("nosound", GTK_TOGGLE_BUTTON(widget)->active);
|
||||
set_graphics_sensitive();
|
||||
}
|
||||
|
||||
// Read settings from widgets and set preferences
|
||||
static void read_graphics_settings(void)
|
||||
{
|
||||
PrefsReplaceString("dsp", get_file_entry_path(w_dspdevice_file));
|
||||
PrefsReplaceString("mixer", get_file_entry_path(w_mixerdevice_file));
|
||||
}
|
||||
|
||||
// Create "Graphics/Sound" pane
|
||||
@ -675,7 +688,12 @@ static void create_graphics_pane(GtkWidget *top)
|
||||
make_checkbox(vbox, STR_1280x1024_CTRL, PrefsFindInt32("screenmodes") & 16, GTK_SIGNAL_FUNC(tb_fs1280x1024));
|
||||
make_checkbox(vbox, STR_1600x1200_CTRL, PrefsFindInt32("screenmodes") & 32, GTK_SIGNAL_FUNC(tb_fs1600x1200));
|
||||
|
||||
make_separator(box);
|
||||
make_checkbox(box, STR_NOSOUND_CTRL, "nosound", GTK_SIGNAL_FUNC(tb_nosound));
|
||||
w_dspdevice_file = make_entry(box, STR_DSPDEVICE_FILE_CTRL, "dsp");
|
||||
w_mixerdevice_file = make_entry(box, STR_MIXERDEVICE_FILE_CTRL, "mixer");
|
||||
|
||||
set_graphics_sensitive();
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,9 +29,14 @@
|
||||
|
||||
// Platform-specific preferences items
|
||||
prefs_desc platform_prefs_items[] = {
|
||||
{"ether", TYPE_STRING, false, "device name of Mac ethernet adapter"},
|
||||
{"keycodes", TYPE_BOOLEAN, false, "use keycodes rather than keysyms to decode keyboard"},
|
||||
{"keycodefile", TYPE_STRING, false, "path of keycode translation file"},
|
||||
{"ether", TYPE_STRING, false, "device name of Mac ethernet adapter"},
|
||||
{"keycodes", TYPE_BOOLEAN, false, "use keycodes rather than keysyms to decode keyboard"},
|
||||
{"keycodefile", TYPE_STRING, false, "path of keycode translation file"},
|
||||
{"dsp", TYPE_STRING, false, "audio output (dsp) device name"},
|
||||
{"mixer", TYPE_STRING, false, "audio mixer device name"},
|
||||
#ifdef HAVE_SIGSEGV_SKIP_INSTRUCTION
|
||||
{"ignoresegv", TYPE_BOOLEAN, false, "ignore illegal memory accesses"},
|
||||
#endif
|
||||
{NULL, TYPE_END, false, NULL} // End of list
|
||||
};
|
||||
|
||||
@ -97,4 +102,19 @@ void AddPlatformPrefsDefaults(void)
|
||||
PrefsReplaceString("extfs", "/");
|
||||
PrefsAddInt32("windowmodes", 3);
|
||||
PrefsAddInt32("screenmodes", 0x3f);
|
||||
#ifdef __linux__
|
||||
if (access("/dev/.devfsd", F_OK) < 0) {
|
||||
PrefsReplaceString("dsp", "/dev/dsp");
|
||||
PrefsReplaceString("mixer", "/dev/mixer");
|
||||
} else {
|
||||
PrefsReplaceString("dsp", "/dev/sound/dsp");
|
||||
PrefsReplaceString("mixer", "/dev/sound/mixer");
|
||||
}
|
||||
#else
|
||||
PrefsReplaceString("dsp", "/dev/dsp");
|
||||
PrefsReplaceString("mixer", "/dev/mixer");
|
||||
#endif
|
||||
#ifdef HAVE_SIGSEGV_SKIP_INSTRUCTION
|
||||
PrefsAddBool("ignoresegv", false);
|
||||
#endif
|
||||
}
|
||||
|
@ -64,6 +64,8 @@ user_string_def platform_strings[] = {
|
||||
{STR_PREFS_ITEM_QUIT_GTK, "/File/_Quit SheepShaver"},
|
||||
{STR_HELP_MENU_GTK, "/_Help"},
|
||||
{STR_HELP_ITEM_ABOUT_GTK, "/Help/_About SheepShaver"},
|
||||
{STR_DSPDEVICE_FILE_CTRL, "Audio Output Device"},
|
||||
{STR_MIXERDEVICE_FILE_CTRL, "Audio Mixer Device"},
|
||||
{STR_INPUT_PANE_TITLE, "Keyboard"},
|
||||
{STR_KEYCODES_CTRL, "Use Raw Keycodes"},
|
||||
{STR_KEYCODE_FILE_CTRL, "Keycode Translation File"},
|
||||
|
@ -59,6 +59,8 @@ enum {
|
||||
STR_HELP_MENU_GTK,
|
||||
STR_HELP_ITEM_ABOUT_GTK,
|
||||
STR_SUSPEND_WINDOW_TITLE,
|
||||
STR_DSPDEVICE_FILE_CTRL,
|
||||
STR_MIXERDEVICE_FILE_CTRL,
|
||||
STR_INPUT_PANE_TITLE,
|
||||
STR_KEYCODES_CTRL,
|
||||
STR_KEYCODE_FILE_CTRL
|
||||
|
Loading…
Reference in New Issue
Block a user