mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-02-08 10:30:45 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
b5cec617eb
@ -875,25 +875,25 @@ static int present_sdl_video()
|
||||
SDL_SetRenderDrawColor(sdl_renderer, 0, 0, 0, 0); // Use black
|
||||
SDL_RenderClear(sdl_renderer); // Clear the display
|
||||
|
||||
// We're about to work with sdl_update_video_rect, so stop other threads from
|
||||
// modifying it!
|
||||
SDL_LockMutex(sdl_update_video_mutex);
|
||||
|
||||
// We're about to work with sdl_update_video_rect, so stop other threads from
|
||||
// modifying it!
|
||||
LOCK_PALETTE;
|
||||
SDL_LockMutex(sdl_update_video_mutex);
|
||||
// Convert from the guest OS' pixel format, to the host OS' texture, if necessary.
|
||||
if (host_surface != guest_surface &&
|
||||
host_surface != NULL &&
|
||||
guest_surface != NULL)
|
||||
{
|
||||
SDL_Rect destRect = sdl_update_video_rect;
|
||||
LOCK_PALETTE;
|
||||
int result = SDL_BlitSurface(guest_surface, &sdl_update_video_rect, host_surface, &destRect);
|
||||
UNLOCK_PALETTE;
|
||||
if (result != 0) {
|
||||
SDL_UnlockMutex(sdl_update_video_mutex);
|
||||
SDL_UnlockMutex(sdl_update_video_mutex);
|
||||
UNLOCK_PALETTE;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
UNLOCK_PALETTE; // passed potential deadlock, can unlock palette
|
||||
|
||||
// Update the host OS' texture
|
||||
void * srcPixels = (void *)((uint8_t *)host_surface->pixels +
|
||||
sdl_update_video_rect.y * host_surface->pitch +
|
||||
@ -942,6 +942,34 @@ void update_sdl_video(SDL_Surface *s, Sint32 x, Sint32 y, Sint32 w, Sint32 h)
|
||||
update_sdl_video(s, 1, &temp);
|
||||
}
|
||||
|
||||
#ifdef SHEEPSHAVER
|
||||
static void MagBits(Uint8 *dst, Uint8 *src, int mag) {
|
||||
for (int y = 0; y < 16; y++)
|
||||
for (int x = 0; x < 16; x++) {
|
||||
int sa = 16 * y + x;
|
||||
if (!(src[sa >> 3] & 0x80 >> (sa & 7))) continue;
|
||||
for (int dy = 0; dy < mag; dy++)
|
||||
for (int dx = 0; dx < mag; dx++) {
|
||||
int da = 16 * mag * (mag * y + dy) + mag * x + dx;
|
||||
dst[da >> 3] |= 0x80 >> (da & 7);
|
||||
}
|
||||
}
|
||||
}
|
||||
static SDL_Cursor *MagCursor(bool hot) {
|
||||
int w, h;
|
||||
SDL_GetWindowSize(sdl_window, &w, &h);
|
||||
int mag = std::min(w / drv->VIDEO_MODE_X, h / drv->VIDEO_MODE_Y);
|
||||
Uint8 *data = (Uint8 *)SDL_calloc(1, 32 * mag * mag);
|
||||
Uint8 *mask = (Uint8 *)SDL_calloc(1, 32 * mag * mag);
|
||||
MagBits(data, &MacCursor[4], mag);
|
||||
MagBits(mask, &MacCursor[36], mag);
|
||||
SDL_Cursor *cursor = SDL_CreateCursor(data, mask, 16 * mag, 16 * mag, hot ? MacCursor[2] * mag : 0, hot ? MacCursor[3] * mag : 0);
|
||||
SDL_free(data);
|
||||
SDL_free(mask);
|
||||
return cursor;
|
||||
}
|
||||
#endif
|
||||
|
||||
void driver_base::set_video_mode(int flags)
|
||||
{
|
||||
int depth = sdl_depth_of_video_depth(VIDEO_MODE_DEPTH);
|
||||
@ -1018,7 +1046,7 @@ void driver_base::adapt_to_video_mode() {
|
||||
hardware_cursor = video_can_change_cursor();
|
||||
if (hardware_cursor) {
|
||||
// Create cursor
|
||||
if ((sdl_cursor = SDL_CreateCursor(MacCursor + 4, MacCursor + 36, 16, 16, 0, 0)) != NULL) {
|
||||
if ((sdl_cursor = MagCursor(false)) != NULL) {
|
||||
SDL_SetCursor(sdl_cursor);
|
||||
}
|
||||
}
|
||||
@ -1814,10 +1842,7 @@ void SDL_monitor_desc::switch_to_current_mode(void)
|
||||
#ifdef SHEEPSHAVER
|
||||
bool video_can_change_cursor(void)
|
||||
{
|
||||
if (display_type != DISPLAY_WINDOW || !PrefsFindBool("hardcursor"))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
return PrefsFindBool("hardcursor") && (display_type == DISPLAY_WINDOW || PrefsFindBool("scale_integer"));
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1832,7 +1857,7 @@ void video_set_cursor(void)
|
||||
// Set new cursor image if it was changed
|
||||
if (sdl_cursor) {
|
||||
SDL_FreeCursor(sdl_cursor);
|
||||
sdl_cursor = SDL_CreateCursor(MacCursor + 4, MacCursor + 36, 16, 16, MacCursor[2], MacCursor[3]);
|
||||
sdl_cursor = MagCursor(true);
|
||||
if (sdl_cursor) {
|
||||
SDL_ShowCursor(private_data == NULL || private_data->cursorVisible);
|
||||
SDL_SetCursor(sdl_cursor);
|
||||
@ -2260,6 +2285,7 @@ static void handle_events(void)
|
||||
|
||||
// Window "close" widget clicked
|
||||
case SDL_QUIT:
|
||||
if (SDL_GetModState() & (KMOD_LALT | KMOD_RALT)) break;
|
||||
ADBKeyDown(0x7f); // Power key
|
||||
ADBKeyUp(0x7f);
|
||||
break;
|
||||
|
@ -1 +0,0 @@
|
||||
../../../../../SheepShaver/src/Unix/config.h
|
@ -28,7 +28,7 @@
|
||||
<string>sheepvm</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string>SheepShaver.icns</string>
|
||||
<string>SheepVM.icns</string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>SheepShaver VM</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
|
@ -79,6 +79,7 @@
|
||||
087B91C01B780FFC00825F7F /* vm_alloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 087B91BC1B780FFC00825F7F /* vm_alloc.cpp */; };
|
||||
08CD42DC14B7B85B009CA2A2 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08CD42DB14B7B85B009CA2A2 /* Cocoa.framework */; };
|
||||
08CD42E814B7B8AA009CA2A2 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 08CD42E714B7B8AA009CA2A2 /* Carbon.framework */; };
|
||||
3D2C25B5221092BA00B635DE /* SheepVM.icns in Resources */ = {isa = PBXBuildFile; fileRef = 3D2C25B4221092BA00B635DE /* SheepVM.icns */; };
|
||||
A7B1921418C35D4700791D8D /* DiskType.m in Sources */ = {isa = PBXBuildFile; fileRef = A7B1921318C35D4700791D8D /* DiskType.m */; };
|
||||
E413A40320CF7E6D00FBE967 /* video_sdl2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E413A40220CF7E6D00FBE967 /* video_sdl2.cpp */; };
|
||||
E4150D1220D557820077C51A /* SDL2.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = E4150D1120D557820077C51A /* SDL2.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
|
||||
@ -321,6 +322,7 @@
|
||||
087B91BD1B780FFC00825F7F /* vm_alloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = vm_alloc.h; path = ../CrossPlatform/vm_alloc.h; sourceTree = SOURCE_ROOT; };
|
||||
08CD42DB14B7B85B009CA2A2 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = /System/Library/Frameworks/Cocoa.framework; sourceTree = "<absolute>"; };
|
||||
08CD42E714B7B8AA009CA2A2 /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
|
||||
3D2C25B4221092BA00B635DE /* SheepVM.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = SheepVM.icns; sourceTree = "<group>"; };
|
||||
A7B1921218C35D4700791D8D /* DiskType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DiskType.h; sourceTree = "<group>"; };
|
||||
A7B1921318C35D4700791D8D /* DiskType.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DiskType.m; sourceTree = "<group>"; };
|
||||
E413A40220CF7E6D00FBE967 /* video_sdl2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = video_sdl2.cpp; path = ../../../BasiliskII/src/SDL/video_sdl2.cpp; sourceTree = "<group>"; };
|
||||
@ -712,6 +714,7 @@
|
||||
0856CE6D14A99EF0000B1711 /* macos_util_macosx.h */,
|
||||
0856CE7014A99EF0000B1711 /* prefs_macosx.mm */,
|
||||
0856CE8314A99EF0000B1711 /* SheepShaver.icns */,
|
||||
3D2C25B4221092BA00B635DE /* SheepVM.icns */,
|
||||
0856CE8714A99EF0000B1711 /* sys_darwin.cpp */,
|
||||
0873A80014AC515D004F12B7 /* utils_macosx.h */,
|
||||
0873A80114AC515D004F12B7 /* utils_macosx.mm */,
|
||||
@ -961,6 +964,7 @@
|
||||
E44C460820D262B0000583AE /* VERSION in Resources */,
|
||||
0856D05914A99EF1000B1711 /* SheepShaver.icns in Resources */,
|
||||
E44C460F20D262B0000583AE /* COPYRIGHT in Resources */,
|
||||
3D2C25B5221092BA00B635DE /* SheepVM.icns in Resources */,
|
||||
0856D33514A9A704000B1711 /* VMSettingsWindow.nib in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
@ -1126,7 +1130,7 @@
|
||||
_REENTRANT,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
/Library/Frameworks/SDL.framework/Versions/A/Headers/,
|
||||
/Library/Frameworks/SDL2.framework/Headers/,
|
||||
./config/,
|
||||
../Unix,
|
||||
../MacOSX/Launcher,
|
||||
@ -1163,7 +1167,7 @@
|
||||
_REENTRANT,
|
||||
);
|
||||
HEADER_SEARCH_PATHS = (
|
||||
/Library/Frameworks/SDL.framework/Versions/A/Headers/,
|
||||
/Library/Frameworks/SDL2.framework/Headers/,
|
||||
./config/,
|
||||
../Unix,
|
||||
../MacOSX/Launcher,
|
||||
|
BIN
SheepShaver/src/MacOSX/SheepVM.icns
Normal file
BIN
SheepShaver/src/MacOSX/SheepVM.icns
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user