mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-22 06:30:16 +00:00
Handle "screen fbdev/WIDTH/HEIGHT" to force use of FBDev DGA instead of XF86
DGA mode. In other words, root user can now use FBDev DGA though it's always recommended to run SheepShaver with a normal user. Increase "ramsize" bounds in the GUI and fully migrate to new "screen" modes. Remove "windowmodes" and "screenmodes" defaults.
This commit is contained in:
parent
5810c6a764
commit
0f4440f99f
@ -569,6 +569,7 @@ static GtkWidget *w_frameskip, *w_display_x, *w_display_y;
|
||||
static GtkWidget *l_frameskip, *l_display_x, *l_display_y;
|
||||
static int display_type;
|
||||
static int dis_width, dis_height;
|
||||
static bool is_fbdev_dga_mode = false;
|
||||
|
||||
static GtkWidget *w_dspdevice_file, *w_mixerdevice_file;
|
||||
|
||||
@ -641,6 +642,12 @@ static void parse_graphics_prefs(void)
|
||||
display_type = DISPLAY_WINDOW;
|
||||
else if (sscanf(str, "dga/%d/%d", &dis_width, &dis_height) == 2)
|
||||
display_type = DISPLAY_SCREEN;
|
||||
#ifdef ENABLE_FBDEV_DGA
|
||||
else if (sscanf(str, "fbdev/%d/%d", &dis_width, &dis_height) == 2) {
|
||||
is_fbdev_dga_mode = true;
|
||||
display_type = DISPLAY_SCREEN;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
uint32 window_modes = PrefsFindInt32("windowmodes");
|
||||
@ -697,6 +704,7 @@ static void read_graphics_settings(void)
|
||||
dis_height = atoi(str);
|
||||
|
||||
char pref[256];
|
||||
bool use_screen_mode = true;
|
||||
switch (display_type) {
|
||||
case DISPLAY_WINDOW:
|
||||
sprintf(pref, "win/%d/%d", dis_width, dis_height);
|
||||
@ -705,10 +713,16 @@ static void read_graphics_settings(void)
|
||||
sprintf(pref, "dga/%d/%d", dis_width, dis_height);
|
||||
break;
|
||||
default:
|
||||
use_screen_mode = false;
|
||||
PrefsRemoveItem("screen");
|
||||
return;
|
||||
}
|
||||
PrefsReplaceString("screen", pref);
|
||||
if (use_screen_mode) {
|
||||
PrefsReplaceString("screen", pref);
|
||||
// Old prefs are now migrated
|
||||
PrefsRemoveItem("windowmodes");
|
||||
PrefsRemoveItem("screenmodes");
|
||||
}
|
||||
|
||||
PrefsReplaceString("dsp", get_file_entry_path(w_dspdevice_file));
|
||||
PrefsReplaceString("mixer", get_file_entry_path(w_mixerdevice_file));
|
||||
@ -1113,8 +1127,8 @@ static void create_memory_pane(GtkWidget *top)
|
||||
gtk_widget_show(vbox);
|
||||
|
||||
gfloat min, max;
|
||||
min = 1;
|
||||
max = 256;
|
||||
min = 4;
|
||||
max = 512;
|
||||
w_ramsize_adj = gtk_adjustment_new(min, min, max, 1, 16, 0);
|
||||
gtk_adjustment_set_value(GTK_ADJUSTMENT(w_ramsize_adj), PrefsFindInt32("ramsize") >> 20);
|
||||
|
||||
|
@ -106,8 +106,6 @@ void AddPlatformPrefsDefaults(void)
|
||||
PrefsReplaceString("extfs", "/");
|
||||
PrefsReplaceInt32("mousewheelmode", 1);
|
||||
PrefsReplaceInt32("mousewheellines", 3);
|
||||
PrefsAddInt32("windowmodes", 3);
|
||||
PrefsAddInt32("screenmodes", 0x3f);
|
||||
#ifdef __linux__
|
||||
if (access("/dev/.devfsd", F_OK) < 0) {
|
||||
PrefsReplaceString("dsp", "/dev/dsp");
|
||||
|
@ -1359,13 +1359,18 @@ bool VideoInit(void)
|
||||
|
||||
#ifdef ENABLE_FBDEV_DGA
|
||||
// FBDev available?
|
||||
if (!has_dga && local_X11) {
|
||||
bool has_fbdev_dga = false;
|
||||
if (local_X11) {
|
||||
if ((fb_dev_fd = open("/dev/fb0", O_RDWR)) > 0) {
|
||||
if (ioctl(fb_dev_fd, FBIOGET_VSCREENINFO, &fb_vinfo) != 0)
|
||||
close(fb_dev_fd);
|
||||
else {
|
||||
has_dga = true;
|
||||
is_fbdev_dga_mode = true;
|
||||
has_fbdev_dga = true;
|
||||
if (!has_dga) {
|
||||
// Fallback to FBDev DGA mode if XF86 DGA is not possible
|
||||
has_dga = true;
|
||||
is_fbdev_dga_mode = true;
|
||||
}
|
||||
fb_orig_vinfo = fb_vinfo;
|
||||
D(bug("Frame buffer device initial resolution: %dx%dx%d\n", fb_vinfo.xres, fb_vinfo.yres, fb_vinfo.bits_per_pixel));
|
||||
}
|
||||
@ -1408,6 +1413,12 @@ bool VideoInit(void)
|
||||
#ifdef ENABLE_XF86_DGA
|
||||
else if (has_dga && sscanf(mode_str, "dga/%d/%d", &default_width, &default_height) == 2)
|
||||
display_type = DIS_SCREEN;
|
||||
#endif
|
||||
#ifdef ENABLE_FBDEV_DGA
|
||||
else if (has_fbdev_dga && sscanf(mode_str, "fbdev/%d/%d", &default_width, &default_height) == 2) {
|
||||
is_fbdev_dga_mode = true;
|
||||
display_type = DIS_SCREEN;
|
||||
}
|
||||
#endif
|
||||
if (display_type == DIS_INVALID) {
|
||||
D(bug("Invalid screen mode specified, defaulting to old modes selection\n"));
|
||||
@ -1676,8 +1687,6 @@ static void resume_emul(void)
|
||||
free(fb_save);
|
||||
fb_save = NULL;
|
||||
}
|
||||
if (depth == 8)
|
||||
palette_changed = true;
|
||||
|
||||
// Unlock frame buffer (and continue MacOS thread)
|
||||
UNLOCK_FRAME_BUFFER;
|
||||
|
Loading…
x
Reference in New Issue
Block a user