mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-02-16 14:30:34 +00:00
Improve video mode handling
Instead of using a generic list and then filtering 512x384 in SheepShaver, start with the correct list right away. This avoids SS unexpectedly refusing to run at 512x384.
This commit is contained in:
parent
ab0948d02e
commit
f91d6d9622
@ -457,15 +457,9 @@ static inline int sdl_display_height(void)
|
|||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check wether specified mode is available
|
// Check whether specified mode is available
|
||||||
static bool has_mode(int type, int width, int height, int depth)
|
static bool has_mode(int type, int width, int height, int depth)
|
||||||
{
|
{
|
||||||
#ifdef SHEEPSHAVER
|
|
||||||
// Filter out Classic resolutions
|
|
||||||
if (width == 512 && height == 384)
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Filter out out-of-bounds resolutions
|
// Filter out out-of-bounds resolutions
|
||||||
if (width > sdl_display_width() || height > sdl_display_height())
|
if (width > sdl_display_width() || height > sdl_display_height())
|
||||||
return false;
|
return false;
|
||||||
@ -1054,6 +1048,19 @@ bool VideoInit(bool classic)
|
|||||||
int h;
|
int h;
|
||||||
int resolution_id;
|
int resolution_id;
|
||||||
}
|
}
|
||||||
|
#ifdef SHEEPSHAVER
|
||||||
|
// Omit Classic resolutions
|
||||||
|
video_modes[] = {
|
||||||
|
{ -1, -1, 0x80 },
|
||||||
|
{ 640, 480, 0x81 },
|
||||||
|
{ 800, 600, 0x82 },
|
||||||
|
{ 1024, 768, 0x83 },
|
||||||
|
{ 1152, 870, 0x84 },
|
||||||
|
{ 1280, 1024, 0x85 },
|
||||||
|
{ 1600, 1200, 0x86 },
|
||||||
|
{ 0, }
|
||||||
|
};
|
||||||
|
#else
|
||||||
video_modes[] = {
|
video_modes[] = {
|
||||||
{ -1, -1, 0x80 },
|
{ -1, -1, 0x80 },
|
||||||
{ 512, 384, 0x80 },
|
{ 512, 384, 0x80 },
|
||||||
@ -1065,6 +1072,7 @@ bool VideoInit(bool classic)
|
|||||||
{ 1600, 1200, 0x86 },
|
{ 1600, 1200, 0x86 },
|
||||||
{ 0, }
|
{ 0, }
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
video_modes[0].w = default_width;
|
video_modes[0].w = default_width;
|
||||||
video_modes[0].h = default_height;
|
video_modes[0].h = default_height;
|
||||||
|
|
||||||
|
@ -460,15 +460,9 @@ static inline int sdl_display_height(void)
|
|||||||
return height;
|
return height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check wether specified mode is available
|
// Check whether specified mode is available
|
||||||
static bool has_mode(int type, int width, int height, int depth)
|
static bool has_mode(int type, int width, int height, int depth)
|
||||||
{
|
{
|
||||||
#ifdef SHEEPSHAVER
|
|
||||||
// Filter out Classic resolutions
|
|
||||||
if (width == 512 && height == 384)
|
|
||||||
return false;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Filter out out-of-bounds resolutions
|
// Filter out out-of-bounds resolutions
|
||||||
if (width > sdl_display_width() || height > sdl_display_height())
|
if (width > sdl_display_width() || height > sdl_display_height())
|
||||||
return false;
|
return false;
|
||||||
@ -1385,6 +1379,19 @@ bool VideoInit(bool classic)
|
|||||||
int h;
|
int h;
|
||||||
int resolution_id;
|
int resolution_id;
|
||||||
}
|
}
|
||||||
|
#ifdef SHEEPSHAVER
|
||||||
|
// Omit Classic resolutions
|
||||||
|
video_modes[] = {
|
||||||
|
{ -1, -1, 0x80 },
|
||||||
|
{ 640, 480, 0x81 },
|
||||||
|
{ 800, 600, 0x82 },
|
||||||
|
{ 1024, 768, 0x83 },
|
||||||
|
{ 1152, 870, 0x84 },
|
||||||
|
{ 1280, 1024, 0x85 },
|
||||||
|
{ 1600, 1200, 0x86 },
|
||||||
|
{ 0, }
|
||||||
|
};
|
||||||
|
#else
|
||||||
video_modes[] = {
|
video_modes[] = {
|
||||||
{ -1, -1, 0x80 },
|
{ -1, -1, 0x80 },
|
||||||
{ 512, 384, 0x80 },
|
{ 512, 384, 0x80 },
|
||||||
@ -1396,6 +1403,7 @@ bool VideoInit(bool classic)
|
|||||||
{ 1600, 1200, 0x86 },
|
{ 1600, 1200, 0x86 },
|
||||||
{ 0, }
|
{ 0, }
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
video_modes[0].w = default_width;
|
video_modes[0].w = default_width;
|
||||||
video_modes[0].h = default_height;
|
video_modes[0].h = default_height;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user