Merge commit '2e302d60a337daa252c6992335e6365a9beac83f'

This commit is contained in:
kanjitalk755 2018-06-08 14:11:27 +09:00
commit d247c35d58
50 changed files with 3090 additions and 224 deletions

20
.travis.yml Normal file
View File

@ -0,0 +1,20 @@
language: cpp
matrix:
include:
- os: linux
dist: trusty
sudo: required
compiler: gcc
addons:
apt:
packages:
- libsdl1.2-dev
- libgtk2.0-dev
script:
- cd BasiliskII/src/Unix
- NO_CONFIGURE=1 ./autogen.sh
- ./configure --enable-sdl-video --enable-sdl-audio --disable-vosf --disable-jit-compiler --with-x --with-gtk --with-mon
- make -j 4

View File

@ -442,25 +442,43 @@ ether <ethernet card description>
instead of sending packets via physical media writes them to instead of sending packets via physical media writes them to
the user space program. the user space program.
Prerequesties: Prerequisites:
- Make sure the "tun" kernel module is loaded - Make sure the "tun" kernel module is loaded
# modprobe tun
- Make sure IP Fordwarding is enabled on your system
# echo 1 >/proc/sys/net/ipv4/ip_forward
A virtual network configuration script is required and the # modprobe tun
- If you wish to route IP packets from Basilisk II, make sure
IP Forwarding is enabled on your system (not required for
bridging)
# echo 1 >/proc/sys/net/ipv4/ip_forward
A virtual network configuration script is required in order
to configure the tunN interface after it is created, and the
default is /usr/local/BasiliskII/tunconfig unless you specify default is /usr/local/BasiliskII/tunconfig unless you specify
a different file with the "etherconfig" item. a different file with the "etherconfig" item.
This script requires you that "sudo" is properly configured The default "tunconfig" script configures the tunN interface
for IP NAT. It requires that "sudo" is properly configured
so that "/sbin/ifconfig" and "/sbin/iptables" can be executed so that "/sbin/ifconfig" and "/sbin/iptables" can be executed
as root. Otherwise, you can still write a helper script which as root. Otherwise, you can still write a helper script which
invokes your favorite program to enhance a user priviledges. invokes your favorite program to elevate user privileges.
e.g. in a KDE environment, kdesu can be used as follows: e.g. in a KDE environment, kdesu can be used as follows:
#!/bin/sh #!/bin/sh
exec /usr/bin/kdesu -c /path/to/tunconfig $1 $2 exec /usr/bin/kdesu -c /path/to/tunconfig $1 $2
As an alternative to configuring IP on the tunN interface,
you may attach it to a bridge, which will enable AppleTalk
frames to be forwarded without Linux needing to route them.
No tunconfig-like script is provided to configure bridging,
but you may simply configure "etherconfig /bin/true" to skip
the automatic configuration and then configure bridging
manually once Basilisk II has started, e.g.:
# ifconfig tun0 up
# brctl addif bridge1 tun0
4. Access the network through the user mode network stack. 4. Access the network through the user mode network stack.
(the code and this documentation come from QEMU) (the code and this documentation come from QEMU)

View File

@ -176,7 +176,7 @@ static void sigsegv_dump_state(sigsegv_info_t *sip)
#endif #endif
VideoQuitFullScreen(); VideoQuitFullScreen();
#ifdef ENABLE_MON #ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
#endif #endif
QuitEmulator(); QuitEmulator();
@ -550,7 +550,7 @@ static void sigint_handler(...)
extern void m68k_dumpstate(uaecptr *nextpc); extern void m68k_dumpstate(uaecptr *nextpc);
m68k_dumpstate(&nextpc); m68k_dumpstate(&nextpc);
VideoQuitFullScreen(); VideoQuitFullScreen();
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
QuitEmulator(); QuitEmulator();
} }

View File

@ -256,7 +256,7 @@ void DarwinAddFloppyPrefs(void)
} }
// Iterate through each floppy // Iterate through each floppy
while ( nextFloppy = IOIteratorNext(allFloppies)) while ((nextFloppy = IOIteratorNext(allFloppies)))
{ {
char bsdPath[MAXPATHLEN]; char bsdPath[MAXPATHLEN];
long size; long size;
@ -333,7 +333,7 @@ void DarwinAddSerialPrefs(void)
} }
// Iterate through each modem // Iterate through each modem
while ( nextModem = IOIteratorNext(allModems)) while ((nextModem = IOIteratorNext(allModems)))
{ {
char bsdPath[MAXPATHLEN]; char bsdPath[MAXPATHLEN];
CFTypeRef bsdPathAsCFString = CFTypeRef bsdPathAsCFString =

View File

@ -22,16 +22,6 @@
#import <video.h> #import <video.h>
/* Set the strategy for drawing the bitmap in the Mac OS X window */
//#define CGDRAWBITMAP
#if defined __i386__
#define CGIMAGEREF
//#define NSBITMAP
#else
#define CGIMAGEREF
//#define NSBITMAP
#endif
// Using Core Graphics is fastest when rendering 32bit data. // Using Core Graphics is fastest when rendering 32bit data.
// Using CGImageRefs allows us to use all the bitmaps that BasiliskII supports. // Using CGImageRefs allows us to use all the bitmaps that BasiliskII supports.
// When both Basilisk II and OS X are set to 'Thousands', updating a 312x342 // When both Basilisk II and OS X are set to 'Thousands', updating a 312x342

View File

@ -371,16 +371,11 @@ class OSX_monitor : public monitor_desc
bool init_window(const video_mode &mode); bool init_window(const video_mode &mode);
#ifdef CGIMAGEREF
CGColorSpaceRef colourSpace; CGColorSpaceRef colourSpace;
uint8 *colourTable; uint8 *colourTable;
CGImageRef imageRef; CGImageRef imageRef;
CGDataProviderRef provider; CGDataProviderRef provider;
short x, y, bpp, depth, bpr; short x, y, bpp, depth, bpr;
#endif
#ifdef NSBITMAP
NSBitmapImageRep *bitmap;
#endif
void *the_buffer; void *the_buffer;
@ -397,24 +392,17 @@ OSX_monitor :: OSX_monitor (const vector<video_mode> &available_modes,
uint32 default_id) uint32 default_id)
: monitor_desc (available_modes, default_depth, default_id) : monitor_desc (available_modes, default_depth, default_id)
{ {
#ifdef CGIMAGEREF
colourSpace = nil; colourSpace = nil;
colourTable = (uint8 *) malloc(256 * 3); colourTable = (uint8 *) malloc(256 * 3);
imageRef = nil; imageRef = nil;
provider = nil; provider = nil;
#endif
#ifdef NSBITMAP
bitmap = nil;
#endif
newMode = originalMode = nil; newMode = originalMode = nil;
the_buffer = NULL; the_buffer = NULL;
theDisplay = nil; theDisplay = nil;
}; };
// Should also have a destructor which does // Should also have a destructor which does
//#ifdef CGIMAGEREF
// free(colourTable); // free(colourTable);
//#endif
// Set Mac frame layout and base address (uses the_buffer/MacFrameBaseMac) // Set Mac frame layout and base address (uses the_buffer/MacFrameBaseMac)
@ -422,17 +410,10 @@ void
OSX_monitor::set_mac_frame_buffer(const video_mode mode) OSX_monitor::set_mac_frame_buffer(const video_mode mode)
{ {
#if !REAL_ADDRESSING && !DIRECT_ADDRESSING #if !REAL_ADDRESSING && !DIRECT_ADDRESSING
switch ( mode.depth )
{
// case VDEPTH_15BIT:
case VDEPTH_16BIT: MacFrameLayout = FLAYOUT_HOST_555; break;
// case VDEPTH_24BIT:
case VDEPTH_32BIT: MacFrameLayout = FLAYOUT_HOST_888; break;
default : MacFrameLayout = FLAYOUT_DIRECT;
}
set_mac_frame_base(MacFrameBaseMac); set_mac_frame_base(MacFrameBaseMac);
// Set variables used by UAE memory banking // Set variables used by UAE memory banking
MacFrameLayout = FLAYOUT_DIRECT;
MacFrameBaseHost = (uint8 *) the_buffer; MacFrameBaseHost = (uint8 *) the_buffer;
MacFrameSize = mode.bytes_per_row * mode.y; MacFrameSize = mode.bytes_per_row * mode.y;
InitFrameBufferMapping(); InitFrameBufferMapping();
@ -508,7 +489,6 @@ OSX_monitor::init_window(const video_mode &mode)
unsigned char *offsetBuffer = (unsigned char *) the_buffer; unsigned char *offsetBuffer = (unsigned char *) the_buffer;
offsetBuffer += 1; // OS X NSBitmaps are RGBA, but Basilisk generates ARGB offsetBuffer += 1; // OS X NSBitmaps are RGBA, but Basilisk generates ARGB
#ifdef CGIMAGEREF
switch ( mode.depth ) switch ( mode.depth )
{ {
case VDEPTH_1BIT: bpp = 1; break; case VDEPTH_1BIT: bpp = 1; break;
@ -578,61 +558,6 @@ OSX_monitor::init_window(const video_mode &mode)
// CGDataProviderRef provider, const float decode[], bool shouldInterpolate); // CGDataProviderRef provider, const float decode[], bool shouldInterpolate);
#endif #endif
return true;
#endif
#ifndef CGIMAGEREF
short bitsPer, samplesPer; // How big is each Pixel?
if ( mode.depth == VDEPTH_1BIT )
bitsPer = 1;
else
bitsPer = 8;
if ( mode.depth == VDEPTH_32BIT )
samplesPer = 3;
else
samplesPer = 1;
#endif
#ifdef NSBITMAP
bitmap = [NSBitmapImageRep alloc];
bitmap = [bitmap initWithBitmapDataPlanes: (unsigned char **) &offsetBuffer
pixelsWide: mode.x
pixelsHigh: mode.y
bitsPerSample: bitsPer
samplesPerPixel: samplesPer
hasAlpha: NO
isPlanar: NO
colorSpaceName: NSCalibratedRGBColorSpace
bytesPerRow: mode.bytes_per_row
bitsPerPixel: bits_from_depth(mode.depth)];
if ( ! bitmap )
{
ErrorAlert("Could not allocate an NSBitmapImageRep");
return false;
}
[output readyToDraw: bitmap
imageWidth: mode.x
imageHeight: mode.y];
#endif
#ifdef CGDRAWBITMAP
[output readyToDraw: offsetBuffer
width: mode.x
height: mode.y
bps: bitsPer
spp: samplesPer
bpp: bits_from_depth(mode.depth)
bpr: mode.bytes_per_row
isPlanar: NO
hasAlpha: NO];
#endif
return true; return true;
} }
@ -787,13 +712,11 @@ bool VideoInit(bool classic)
case DISPLAY_OPENGL: case DISPLAY_OPENGL:
// Same as window depths and sizes? // Same as window depths and sizes?
case DISPLAY_WINDOW: case DISPLAY_WINDOW:
#ifdef CGIMAGEREF
add_standard_modes(VDEPTH_1BIT); add_standard_modes(VDEPTH_1BIT);
add_standard_modes(VDEPTH_2BIT); add_standard_modes(VDEPTH_2BIT);
add_standard_modes(VDEPTH_4BIT); add_standard_modes(VDEPTH_4BIT);
add_standard_modes(VDEPTH_8BIT); add_standard_modes(VDEPTH_8BIT);
add_standard_modes(VDEPTH_16BIT); add_standard_modes(VDEPTH_16BIT);
#endif
add_standard_modes(VDEPTH_32BIT); add_standard_modes(VDEPTH_32BIT);
break; break;
} }
@ -866,14 +789,9 @@ OSX_monitor::video_close()
[output disableDrawing]; [output disableDrawing];
// Free frame buffer stuff // Free frame buffer stuff
#ifdef CGIMAGEREF
CGImageRelease(imageRef); CGImageRelease(imageRef);
CGColorSpaceRelease(colourSpace); CGColorSpaceRelease(colourSpace);
CGDataProviderRelease(provider); CGDataProviderRelease(provider);
#endif
#ifdef NSBITMAP
[bitmap release];
#endif
free(the_buffer); free(the_buffer);
break; break;
@ -936,7 +854,6 @@ OSX_monitor::set_palette(uint8 *pal, int num)
CGPaletteRelease(CGpal); CGPaletteRelease(CGpal);
} }
#ifdef CGIMAGEREF
if ( display_type != DISPLAY_WINDOW ) if ( display_type != DISPLAY_WINDOW )
return; return;
@ -988,7 +905,6 @@ OSX_monitor::set_palette(uint8 *pal, int num)
CGColorSpaceRelease(oldColourSpace); CGColorSpaceRelease(oldColourSpace);
CGImageRelease(oldImageRef); CGImageRelease(oldImageRef);
#endif
} }
@ -1035,7 +951,6 @@ OSX_monitor::switch_to_current_mode(void)
failure = "Could not get base address of screen"; failure = "Could not get base address of screen";
} }
#ifdef CGIMAGEREF
// Clean up the old CGImageRef stuff // Clean up the old CGImageRef stuff
else if ( display_type == DISPLAY_WINDOW && imageRef ) else if ( display_type == DISPLAY_WINDOW && imageRef )
{ {
@ -1054,7 +969,6 @@ OSX_monitor::switch_to_current_mode(void)
else else
failure = "Could not video_open() requested mode"; failure = "Could not video_open() requested mode";
} }
#endif
else if ( ! video_open(mode) ) else if ( ! video_open(mode) )
failure = "Could not video_open() requested mode"; failure = "Could not video_open() requested mode";

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,166 @@
/* GIMP RGBA C-Source image dump (BasiliskII_32x32x32_icon.c) */
static const struct {
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel; /* 2:RGB16, 3:RGB, 4:RGBA */
unsigned char pixel_data[32 * 32 * 4 + 1];
} icon_32x32x32 = {
32, 32, 4,
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0q'\17s\377s\0\377q\37\6s\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0JJJ\377\7\7\7!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0h(\16k\377\214\0\377"
"\356b\16\357\36\27\27!\12\12\12\30%%%)\356b\16\357\315Y\40\316\263I\40\326"
"\245B)\377\203\27\0\204z\16\0{z\16\0{\203\27\0\204z\16\0{\203\27\0\204z\16"
"\0{z\16\0{\203\27\0\204\264I\27\265,\26\15""9\0\0\0\10\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\377{\0\377\377\204"
"\0\377%\22\22)\27\27\27!AAARbbb\224jjj\224\377\224\0\377\377\214\0\377\377"
"\224\0\377\377\224\0\377\377\214\0\377\377\224\0\377\377\224\0\377\377\224"
"\0\377\377\224\0\377\377\224\0\377\377\224\0\377\377\224\0\377\377\224\0"
"\377\377s\0\377,((9\37\37\37)\0\0\0\0\0\0\0\0,,,9jjj\204jjj\204aaa{jjj\204"
"\2138\40\224\377\224\0\377\377k\0\377bbb\204jjj\234zzz\306zzz\326\203\203"
"\203\316zzz\245\377\224\0\377\377\204\0\377\377s\0\377\377s\0\377\377{\0"
"\377\377s\0\377\377s\0\377\377s\0\377\377{\0\377\377s\0\377\377s\0\377\377"
"s\0\377\377s\0\377\377c\0\377zzz\306rrr\265\0\0\0\0\0\0\0\0jjj\204\234\234"
"\234\377\234\234\234\377\245\245\245\377\357c\30\377\377\224\0\377\367c\0"
"\377\224\224\224\377{{{\377ccc\377sss\377\214\214\214\377\234\234\234\377"
"\234\234\234\377\377\224\0\377\377{\0\377\377s\0\377\377k\0\377\377k\0\377"
"\377s\0\377\377k\0\377\377s\0\377\377k\0\377\377s\0\377\377s\0\377\377s\0"
"\377\377s\0\377\306Z9\377{{{\377rrr\275\0\0\0\0\0\0\0\0bbb\204\234\234\234"
"\377\245\245\245\377\367s\20\377\377\204\0\377\377k\0\377\214\214\214\377"
"kkk\377ZZZ\377{{{\377\224\224\224\377\234\234\234\377\245\245\245\377\224"
"\224\224\377\2559!\377\306\224\204\377\214kk\377kkk\377sss\377sss\377sss"
"\377sss\377sss\377sss\377sss\377\367R\10\377\377k\0\377{{{\377\203\203\203"
"\367XXX\204\0\0\0\0\0\0\0\0jjj\204\245\245\245\377\357c\30\377\377\204\0"
"\377\377s\0\377\224\204\204\377ccc\377ZZZ\377{{{\377\234\234\234\377\245"
"\245\245\377\245\245\245\377\234\234\234\377RRR\377sss\377\306\306\306\377"
"\214\214\214\377\214\214\214\377\214\214\214\377\214\214\214\377\214\214"
"\214\377\224\224\224\377\214\214\214\377\214\214\214\377\224\224\224\377"
"\377c\0\377\357R\30\377\204\204\204\377zzz\326666B\0\0\0\0\0\0\0\0aaa{\306"
"sR\377\377\224\0\377\377{\0\377\316R1\377ccc\377RRR\377JJJ\377{{{\377\234"
"\234\234\377\245\245\245\377\234\234\234\377\224\224\224\377RRR\377\336\336"
"\336\377\336\336\336\377\316\316\316\377\316\316\316\377\224\224\224\377"
"RRR\377\326\326\326\377\326\326\326\377\326\326\326\377\326\326\326\377\326"
"\306\306\377\377k\0\377\306\275\265\377\203\203\203\357jjj\234\25\25\25\30"
"\0\0\0\0\0\0\0\0jbb\204\377\224\0\377\377{\0\377\377k\0\377ccc\377RRR\377"
"kkk\377ccc\377\204\204\204\377\245\245\245\377\245\245\245\377\234\234\234"
"\377ZZZ\377ccc\377\347\347\347\377\347\347\347\377\347\347\347\377\347\347"
"\347\377\224\224\224\377RRR\377\347\347\347\377\336\336\336\377\347\347\347"
"\377\347\347\347\377\367k9\377\377c\0\377\275\275\275\377\203\203\203\347"
"IIIZ\0\0\0\0\0\0\0\0\0\0\0\0\356j\16\357\377\204\0\377\377s\0\377\234R9\377"
"RRR\377ZZZ\377\214\214\214\377ccc\377\204\204\204\377\234\234\234\377\234"
"\234\234\377\245\245\245\377RRR\377\326\326\326\377\347\347\347\377\336\336"
"\336\377\347\347\347\377\336\336\336\377\234\234\234\377JJJ\377\347\347\347"
"\377\347\347\347\377\347\347\347\377\336\336\336\377\377k\0\377\347\224\204"
"\377\234\234\234\377\203\203\203\326\36\36\36!\0\0\0\0\0\0\0\0\0\0\0\10\377"
"\224\0\377\377{\0\377\377k\0\377RRR\377RRR\377sss\377\224\224\224\377\234"
"\234\234\377\245\245\245\377\245\245\245\377\234\234\234\377\214\214\214"
"\377JJJ\377\347\347\347\377\347\347\347\377\347\347\347\377\336\336\336\377"
"\347\347\347\377\347\347\347\377\347\347\347\377\347\347\347\377\347\347"
"\347\377\336\336\336\377\347\275\265\377\377s\0\377\316\316\316\377\214\214"
"\214\377\203\203\203\265\0\0\0\10\0\0\0\0\0\0\0\0\335Y\26\336\377\214\0\377"
"\377s\0\377\316B\30\377JJJ\377ZZZ\377\204\204\204\377\234\234\234\377\245"
"\245\245\377\245\245\245\377\234\234\234\377\245\245\245\377ccc\377kkk\377"
"\347\347\347\377\336\336\336\377\347\347\347\377\347\347\347\377\347\347"
"\347\377\336\336\336\377\336\336\336\377\347\347\347\377\336\336\336\377"
"\347\347\347\377\377c!\377\367c)\377\265\265\265\377\214\214\214\377zzz\224"
"\0\0\0\0\0\0\0\0\0\0\0\0\377\224\0\377\377{\0\377\377k\0\377ZRR\377RRR\377"
"{kk\377\377Z\10\377\377s\0\377\377s\0\377\377s\0\377\357R\30\377\245\245"
"\245\377RRR\377\255\255\255\377\347\347\347\377\336\336\336\377\347\347\347"
"\377\336\336\336\377\347\347\347\377\347\347\347\377\347\347\347\377\347"
"\347\347\377\347\347\347\377\347\347\347\377\377k\0\377\336\316\316\377\234"
"\234\234\377\245\245\245\377yyy\204\0\0\0\0\0\0\0\0\36\27\27!\377\224\0\377"
"\377s\0\377\377k\0\377RRR\377ZRR\377\377k\0\377\316cJ\377\316cJ\377\377\214"
"\0\377\377s\0\377\377s\0\377\377c\0\377RRR\377\326\326\326\377\336\336\336"
"\377\347\347\347\377\347\347\347\377\347\347\347\377\336\336\336\377\347"
"\347\347\377\336\336\336\377\347\347\347\377\336\336\336\377\357\245\224"
"\377\377c\0\377\306\306\306\377\214\214\214\377\275\275\275\377yyy\204\0"
"\0\0\0\0\0\0\0\212(\16\214\377\224\0\377\377k\0\377\377R\0\377RRR\377ccc"
"\377\224\224\224\377\234\234\234\377{{{\377ccc\377\377\214\0\377\377s\0\377"
"\377s\0\377\347B\10\377\316\316\316\377\347\347\347\377\347\347\347\377\347"
"\347\347\377\336\336\336\377\347\347\347\377\347\347\347\377\347\347\347"
"\377\347\347\347\377\347\347\347\377\377R\0\377\357\204c\377\255\255\255"
"\377\224\224\224\377\326\326\326\377zzz{\0\0\0\0\0\0\0\0\335b\26\336\377"
"\214\0\377\377s\0\377\336J\20\377RRR\377kkk\377\224\224\224\377\204\204\204"
"\377kkk\377{{{\377\265ZJ\377\377\214\0\377\377s\0\377\377s\0\377111\377J"
"JJ\377RRR\377JJJ\377RRR\377\347\347\347\377\347\347\347\377\347\347\347\377"
"\336\336\336\377\347\347\347\377\377k\0\377\326\326\326\377\234\234\234\377"
"\255\255\255\377\336\336\336\377yyy\204\0\0\0\0\0\0\0\0\377Z\0\377\377\204"
"\0\377\377k\0\377\275B\30\377JJJ\377{{{\377\234\234\234\377\234\234\234\377"
"\234\234\234\377\234\234\234\377\234\234\234\377\377\224\0\377\377{\0\377"
"\377s\0\377\265B)\377sss\377\224\224\224\377kkk\377ZZZ\377\336\336\336\377"
"\336\336\336\377\347\347\347\377\347\347\347\377\367\224{\377\377Z\10\377"
"\306\306\306\377\214\214\214\377\306\306\306\377\336\336\336\377\203\203"
"\203\204\0\0\0\0\0\0\0\0\377c\0\377\377\204\0\377\377s\0\377\275B!\377RR"
"R\377{{{\377\234\234\234\377\245\245\245\377\234\234\234\377\245\245\245"
"\377\234\234\234\377\377c\0\377\377\214\0\377\377k\0\377\357J\10\377ccc\377"
"\224\224\224\377RRR\377\214\214\214\377\347\347\347\377\347\347\347\377\347"
"\347\347\377\336\336\336\377\377Z\0\377\347\245\234\377\255\255\255\377\234"
"\234\234\377\326\326\326\377\347\347\347\377zzz{\0\0\0\0\0\0\0\0\377c\0\377"
"\377\204\0\377\377s\0\377\316J\30\377RRR\377\204\204\204\377\224\224\224"
"\377kkk\377{{{\377\234\234\234\377\245\245\245\377\347c)\377\377\224\0\377"
"\377s\0\377\377R\0\377RRR\377\204\204\204\377JJJ\377\265\265\265\377\347"
"\347\347\377\336\336\336\377\347\347\347\377\336\336\336\377\377k\0\377J"
"JJ\377\214\214\214\377\265\265\265\377\336\336\336\377\347\347\347\377zz"
"z{\0\0\0\0\0\0\0\0\346b\17\347\377\214\0\377\377k\0\377\347J\10\377ZZZ\377"
"\204\204\204\377\245\245\245\377\214\214\214\377kkk\377kkk\377kkk\377\275"
"J1\377\377\224\0\377\377s\0\377\377Z\0\377JJJ\377sss\377RRR\377\214\214\214"
"\377sss\377ZZZ\377JJJ\377\275B!\377\336J\20\377\255\255\255\377\224\224\224"
"\377\316\316\316\377\336\336\336\377\347\347\347\377zzz{\0\0\0\0\0\0\0\0"
"\2437\27\245\377\214\0\377\377s\0\377\377Z\0\377RRR\377\204\204\204\377\234"
"\234\234\377\245\245\245\377\234\234\234\377\245\245\245\377\234\234\234"
"\377\306ZB\377\377\224\0\377\377s\0\377\367J\0\377111\377RRR\377RRR\377Z"
"ZZ\377sss\377\224\224\224\377\326\326\326\377\377c\0\377\336\326\316\377"
"\245\245\245\377\245\245\245\377\336\336\336\377\347\347\347\377\347\347"
"\347\377zzz{\0\0\0\0\0\0\0\0%\22\22)\377\214\0\377\377s\0\377\377k\0\377"
"RRR\377{{{\377\234\234\234\377\245\245\245\377\234\234\234\377\245\245\245"
"\377\234\234\234\377\326kJ\377\377\214\0\377\377s\0\377\306J!\377RRR\377"
"sss\377JJJ\377\265\265\265\377\336\336\336\377\347\347\347\377\347\326\326"
"\377\377c\0\377\316\316\316\377\224\224\224\377\275\275\275\377\336\336\336"
"\377\347\347\347\377\336\336\336\377zzz{\0\0\0\0\0\0\0\0\0\0\0\0\377\224"
"\0\377\377\204\0\377\377s\0\377kJJ\377kkk\377\234\234\234\377\245\245\245"
"\377\234\234\234\377\245\245\245\377\245\245\245\377\347c)\377\377\214\0"
"\377\377s\0\377cJB\377ZZZ\377{{{\377RRR\377\224\224\224\377\347\347\347\377"
"\347\347\347\377\367c)\377\367\204c\377\275\275\275\377\224\224\224\377\316"
"\316\316\377\347\347\347\377\347\347\347\377\347\347\347\377yyy\204\0\0\0"
"\0\0\0\0\0\0\0\0\0\264@\27\265\377\214\0\377\377s\0\377\357J\10\377kkk\377"
"\224\224\224\377\245\245\245\377\234\234\234\377\245\245\245\377\234\234"
"\234\377\377c\0\377\377\204\0\377\377c\0\377RRR\377ZZZ\377\204\204\204\377"
"ccc\377ccc\377\336\336\336\377\347\347\347\377\377s\0\377\326\326\326\377"
"\245\245\245\377\245\245\245\377\336\336\336\377\336\336\336\377\336\336"
"\336\377\347\347\347\377zzz{\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\377\224\0\377"
"\377\204\0\377\377k\0\377kkc\377\245\245\245\377\265\265\265\377\275\275"
"\275\377\265\265\265\377\265\265\265\377\377\224\0\377\377s\0\377\234ZR\377"
"ccc\377kkk\377\245\245\245\377\245\245\245\377RRR\377\357\357\357\377\357"
"\255\234\377\377R\0\377\326\326\326\377\234\234\234\377\326\326\326\377\357"
"\357\357\377\357\357\357\377\367\367\367\377\357\357\357\377zzz{\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0H%\37J\377\214\0\377\377{\0\377\367Z\0\377XXX\204"
"\17\17\17\20\0\0\0\0\0\0\0\0\2128\27\214\377{\0\377\335Q\16\336zzz\326zz"
"z\367bbb\224\17\17\17\20\0\0\0\0RRR\377\0\0\0\0\377Z\0\377W\37\26ZQQQkjj"
"j\234\27\27\27!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0yA0\204\377\224\0\377\377{\0\377\367Z\10\3776..B\0"
"\0\0\0P\37\17R\377{\0\377\346Y\16\357QQQk\203\203\203\357zzz\316666B\0\0"
"\0\10\0\0\0\0III\336777\234\377s\0\377\27\27\27!rrr\245QQQk\0\0\0\10\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\17\17\17\20YYY{\356Y\7\367\377k\0\377\377k\0\377\377s\0\377\377c\0\377"
"a&\27c%%%)rrr\265zzz\326QQQk\0\0\0\10\0\0\0\0\0\0\0\0\0\0\0\20RRR\377\0\0"
"\0\0""777Jrrr\265$$$1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\25\25\25\30YYY{zzz\336\203\203"
"\203\357rrr\255IIIZIIIZjjj\245zzz\316QQQk\17\17\17\20\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\10IIIZXXXs\17\17\17\20\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\10\17\17\17\20AAAJbbb\224rrr\275zzz\275jjj\255bbb\214666B\17\17\17"
"\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\10\0\0\0\20\17"
"\17\17\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
"\0\0\0\0",
};

View File

@ -300,21 +300,31 @@ if [[ "x$WANT_SDL" = "xyes" ]]; then
ac_cv_framework_SDL=no ac_cv_framework_SDL=no
fi fi
if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then if [[ "x$ac_cv_framework_SDL" = "xno" ]]; then
PKG_CHECK_MODULES([sdl], [sdl >= 1.2], [ AC_PATH_PROG(sdl_config, "sdl-config")
CFLAGS="$CFLAGS $sdl_CFLAGS" if [[ -n "$sdl_config" ]]; then
CXXFLAGS="$CXXFLAGS $sdl_CFLAGS" sdl_cflags=`$sdl_config --cflags`
LIBS="$LIBS $sdl_LIBS" if [[ "x$WANT_SDL_STATIC" = "xyes" ]]; then
], [ sdl_libs=`$sdl_config --static-libs`
WANT_SDL=no else
]) sdl_libs=`$sdl_config --libs`
fi
CFLAGS="$CFLAGS $sdl_cflags"
CXXFLAGS="$CXXFLAGS $sdl_cflags"
LIBS="$LIBS $sdl_libs"
else
WANT_SDL=no
WANT_SDL_VIDEO=no
WANT_SDL_AUDIO=no
SDL_SUPPORT="none"
fi
fi fi
SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"` SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`
else else
SDL_SUPPORT="none" SDL_SUPPORT="none"
fi fi
dnl We need X11, if not using SDL. dnl We need X11, if not using SDL or Mac GUI.
if [[ "x$WANT_SDL_VIDEO" = "xno" ]]; then if [[ "x$WANT_SDL_VIDEO" = "xno" -a "x$WANT_MACOSX_GUI" = "xno" ]]; then
AC_PATH_XTRA AC_PATH_XTRA
if [[ "x$no_x" = "xyes" ]]; then if [[ "x$no_x" = "xyes" ]]; then
AC_MSG_ERROR([You need X11 to run Basilisk II.]) AC_MSG_ERROR([You need X11 to run Basilisk II.])
@ -896,6 +906,9 @@ dnl Check that the host supports TUN/TAP devices
AC_CACHE_CHECK([whether TUN/TAP is supported], AC_CACHE_CHECK([whether TUN/TAP is supported],
ac_cv_tun_tap_support, [ ac_cv_tun_tap_support, [
AC_TRY_COMPILE([ AC_TRY_COMPILE([
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H) #if defined(HAVE_LINUX_IF_H) && defined(HAVE_LINUX_IF_TUN_H)
#include <linux/if.h> #include <linux/if.h>
#include <linux/if_tun.h> #include <linux/if_tun.h>
@ -1288,7 +1301,7 @@ AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack",
dnl Resolve and set the proper sigsegv_recovery method... dnl Resolve and set the proper sigsegv_recovery method...
if [[ "x$ac_cv_have_win32_exceptions" = "xyes" ]]; then if [[ "x$ac_cv_have_mach_exceptions" = "xyes" ]]; then
sigsegv_recovery=mach sigsegv_recovery=mach
elif [[ "x$ac_cv_have_win32_exceptions" = "xyes" ]]; then elif [[ "x$ac_cv_have_win32_exceptions" = "xyes" ]]; then
sigsegv_recovery=win32 sigsegv_recovery=win32

View File

@ -371,7 +371,7 @@ bool ether_init(void)
#endif #endif
// Get Ethernet address // Get Ethernet address
if (net_if_type == NET_IF_ETHERTAP) { if (net_if_type == NET_IF_ETHERTAP || net_if_type == NET_IF_TUNTAP) {
pid_t p = getpid(); // If configured for multicast, ethertap requires that the lower 32 bit of the Ethernet address are our PID pid_t p = getpid(); // If configured for multicast, ethertap requires that the lower 32 bit of the Ethernet address are our PID
ether_addr[0] = 0xfe; ether_addr[0] = 0xfe;
ether_addr[1] = 0xfd; ether_addr[1] = 0xfd;

View File

@ -292,7 +292,7 @@ static void sigsegv_dump_state(sigsegv_info_t *sip)
#endif #endif
VideoQuitFullScreen(); VideoQuitFullScreen();
#ifdef ENABLE_MON #ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
#endif #endif
QuitEmulator(); QuitEmulator();
@ -958,7 +958,7 @@ static void sigint_handler(...)
m68k_dumpstate(&nextpc); m68k_dumpstate(&nextpc);
#endif #endif
VideoQuitFullScreen(); VideoQuitFullScreen();
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
QuitEmulator(); QuitEmulator();
} }
@ -1505,7 +1505,7 @@ ill: printf("SIGILL num %d, code %d\n", sig, code);
VideoQuitFullScreen(); VideoQuitFullScreen();
#ifdef ENABLE_MON #ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
#endif #endif
QuitEmulator(); QuitEmulator();

10
BasiliskII/src/Unix/sys_unix.cpp Normal file → Executable file
View File

@ -883,10 +883,12 @@ void SysEject(void *arg)
// Try to use "diskutil eject" but it can take up to 5 // Try to use "diskutil eject" but it can take up to 5
// seconds to complete // seconds to complete
static const char eject_cmd[] = "/usr/sbin/diskutil eject %s 2>&1 >/dev/null"; if (fh->ioctl_name) {
char *cmd = (char *)alloca(strlen(eject_cmd) + strlen(fh->ioctl_name) + 1); static const char eject_cmd[] = "/usr/sbin/diskutil eject %s 2>&1 >/dev/null";
sprintf(cmd, eject_cmd, fh->ioctl_name); char *cmd = (char *)alloca(strlen(eject_cmd) + strlen(fh->ioctl_name) + 1);
system(cmd); sprintf(cmd, eject_cmd, fh->ioctl_name);
system(cmd);
}
} }
fh->is_media_present = false; fh->is_media_present = false;
} }

View File

@ -424,30 +424,17 @@ static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {uint8 *b = (uint8 *)a
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
/* Intel x86 */ /* Intel x86 */
#define X86_PPRO_OPT
static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint32 retval; __asm__ ("bswap %0" : "=r" (retval) : "0" (*a) : "cc"); return retval;} static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint32 retval; __asm__ ("bswap %0" : "=r" (retval) : "0" (*a) : "cc"); return retval;}
#ifdef X86_PPRO_OPT
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("movzwl %w1,%k0\n\tshll $16,%k0\n\tbswapl %k0\n" : "=&r" (retval) : "m" (*a) : "cc"); return retval;} static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("movzwl %w1,%k0\n\tshll $16,%k0\n\tbswapl %k0\n" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
#else
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("xorl %k0,%k0\n\tmovw %w1,%w0\n\trolw $8,%w0" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
#endif
#define HAVE_GET_WORD_UNSWAPPED #define HAVE_GET_WORD_UNSWAPPED
#define do_get_mem_word_unswapped(a) ((uae_u32)*((uae_u16 *)(a))) #define do_get_mem_word_unswapped(a) ((uae_u32)*((uae_u16 *)(a)))
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v) : "cc"); *a = v;} static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
#ifdef X86_PPRO_OPT
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); *a = v;} static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); *a = v;}
#else
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
#endif
#define HAVE_OPTIMIZED_BYTESWAP_32 #define HAVE_OPTIMIZED_BYTESWAP_32
/* bswap doesn't affect condition codes */ /* bswap doesn't affect condition codes */
static inline uae_u32 do_byteswap_32(uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v)); return v;} static inline uae_u32 do_byteswap_32(uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v)); return v;}
#define HAVE_OPTIMIZED_BYTESWAP_16 #define HAVE_OPTIMIZED_BYTESWAP_16
#ifdef X86_PPRO_OPT
static inline uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); return v;} static inline uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); return v;}
#else
static inline uae_u32 do_byteswap_16(uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); return v;}
#endif
#elif defined(CPU_CAN_ACCESS_UNALIGNED) #elif defined(CPU_CAN_ACCESS_UNALIGNED)

View File

@ -38,6 +38,7 @@ user_string_def platform_strings[] = {
{STR_FBDEV_NAME_ERR, "The %s frame buffer is not supported in %d bit mode."}, {STR_FBDEV_NAME_ERR, "The %s frame buffer is not supported in %d bit mode."},
{STR_FBDEV_MMAP_ERR, "Cannot mmap() the frame buffer memory (%s)."}, {STR_FBDEV_MMAP_ERR, "Cannot mmap() the frame buffer memory (%s)."},
{STR_VOSF_INIT_ERR, "Cannot initialize Video on SEGV signals."}, {STR_VOSF_INIT_ERR, "Cannot initialize Video on SEGV signals."},
{STR_X_ICON_ATOM_ALLOC_ERR, "Failed to allocate X Atom. Icon will not be set."},
{STR_NO_DEV_ZERO_ERR, "Cannot open /dev/zero (%s)."}, {STR_NO_DEV_ZERO_ERR, "Cannot open /dev/zero (%s)."},
{STR_LOW_MEM_MMAP_ERR, "Cannot map Low Memory Globals (%s)."}, {STR_LOW_MEM_MMAP_ERR, "Cannot map Low Memory Globals (%s)."},
{STR_SIGALTSTACK_ERR, "Cannot install alternate signal stack (%s)."}, {STR_SIGALTSTACK_ERR, "Cannot install alternate signal stack (%s)."},
@ -84,8 +85,6 @@ user_string_def platform_strings[] = {
{STR_IGNORESEGV_CTRL, "Ignore Illegal Memory Accesses"}, {STR_IGNORESEGV_CTRL, "Ignore Illegal Memory Accesses"},
{STR_WINDOW_TITLE_GRABBED, "Basilisk II (mouse grabbed, press Ctrl-F5 to release)"},
{STR_NO_B2_EXE_FOUND, "Could not start %s (%s)."}, {STR_NO_B2_EXE_FOUND, "Could not start %s (%s)."},
{-1, NULL} // End marker {-1, NULL} // End marker

View File

@ -29,6 +29,7 @@ enum {
STR_FBDEV_NAME_ERR, STR_FBDEV_NAME_ERR,
STR_FBDEV_MMAP_ERR, STR_FBDEV_MMAP_ERR,
STR_VOSF_INIT_ERR, STR_VOSF_INIT_ERR,
STR_X_ICON_ATOM_ALLOC_ERR,
STR_NO_DEV_ZERO_ERR, STR_NO_DEV_ZERO_ERR,
STR_LOW_MEM_MMAP_ERR, STR_LOW_MEM_MMAP_ERR,
STR_SIGALTSTACK_ERR, STR_SIGALTSTACK_ERR,
@ -75,8 +76,6 @@ enum {
STR_IGNORESEGV_CTRL, STR_IGNORESEGV_CTRL,
STR_WINDOW_TITLE_GRABBED,
STR_NO_B2_EXE_FOUND STR_NO_B2_EXE_FOUND
}; };

View File

@ -29,6 +29,7 @@
#include "sysdeps.h" #include "sysdeps.h"
#include <X11/Xatom.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/keysym.h> #include <X11/keysym.h>
@ -445,6 +446,87 @@ static void set_window_name(Window w, int name)
} }
} }
// This struct is designed to match the ones generated by GIMP in
// BasiliskII_*_icon.c
struct gimp_image {
unsigned int width;
unsigned int height;
unsigned int bytes_per_pixel;
unsigned char pixel_data[0]; // Variable-length
};
// These were generated by using 'icns2png -x
// ../MacOSX/BasiliskII.icns', then using GIMP to convert the
// resulting .png files into "C source code (*.c)". GIMP doesn't
// generate corresponding .h files with extern declarations, so just
// #include the .c files here.
#include "BasiliskII_32x32x32_icon.c"
#include "BasiliskII_128x128x32_icon.c"
// Set window icons
static void set_window_icons(Window w)
{
// As per the _NET_WM_ICON documentation at
// https://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idm140200472568384,
// "The first two cardinals are width, height."
const unsigned int HEADER_SIZE = 2;
// We will pass 32-bit values to XChangeProperty()
const unsigned int FORMAT = 32;
// Icon data from GIMP to be converted and passed to the
// Window Manager
const struct gimp_image* const icons[] =
{(struct gimp_image *) &icon_32x32x32,
(struct gimp_image *) &icon_128x128x32};
const unsigned int num_icons = sizeof(icons) / sizeof(icons[0]);
unsigned int icon;
// Work out how big the buffer needs to be to store all of our icons
unsigned int buffer_size = 0;
for (icon = 0; icon < num_icons; icon++) {
buffer_size += HEADER_SIZE +
icons[icon]->width * icons[icon]->height;
}
// As per the XChangeProperty() man page, "If the specified
// format is 32, the property data must be a long array."
unsigned long buffer[buffer_size];
// This points to the start of the current icon within buffer
unsigned long *buffer_icon = buffer;
// Copy the icons into the buffer
for (icon = 0; icon < num_icons; icon++) {
const unsigned int pixel_count = icons[icon]->width *
icons[icon]->height;
assert(icons[icon]->bytes_per_pixel == 4);
buffer_icon[0] = icons[icon]->width;
buffer_icon[1] = icons[icon]->height;
unsigned long *const buffer_pixels = buffer_icon + HEADER_SIZE;
unsigned int i;
for (i = 0; i < pixel_count; i++) {
const unsigned char *src =
&icons[icon]->pixel_data[i * icons[icon]->bytes_per_pixel];
buffer_pixels[i] = (src[3] << 24 |
src[0] << 16 |
src[1] << 8 |
src[2]);
}
buffer_icon += HEADER_SIZE + pixel_count;
}
Atom net_wm_icon = XInternAtom(x_display, "_NET_WM_ICON", False);
if (net_wm_icon == None) {
ErrorAlert(STR_X_ICON_ATOM_ALLOC_ERR);
// We can still continue running, just without an icon
return;
}
XChangeProperty(x_display, w, net_wm_icon, XA_CARDINAL, FORMAT,
PropModeReplace, (const unsigned char *) buffer,
buffer_size);
}
// Set window input focus flag // Set window input focus flag
static void set_window_focus(Window w) static void set_window_focus(Window w)
{ {
@ -733,6 +815,9 @@ driver_window::driver_window(X11_monitor_desc &m)
// Set window name/class // Set window name/class
set_window_name(w, STR_WINDOW_TITLE); set_window_name(w, STR_WINDOW_TITLE);
// Set window icons
set_window_icons(w);
// Indicate that we want keyboard input // Indicate that we want keyboard input
set_window_focus(w); set_window_focus(w);

View File

@ -181,7 +181,7 @@ static void sigsegv_dump_state(sigsegv_info_t *sip)
#endif #endif
VideoQuitFullScreen(); VideoQuitFullScreen();
#ifdef ENABLE_MON #ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
QuitEmulator(); QuitEmulator();
#endif #endif

View File

@ -220,7 +220,6 @@ static inline int spin_trylock(spinlock_t *lock)
} }
#endif #endif
#define X86_PPRO_OPT
#define HAVE_OPTIMIZED_BYTESWAP_32 #define HAVE_OPTIMIZED_BYTESWAP_32
#define HAVE_OPTIMIZED_BYTESWAP_16 #define HAVE_OPTIMIZED_BYTESWAP_16
@ -234,24 +233,12 @@ static inline uae_u32 do_byteswap_16_g(uae_u32 v) {return _byteswap_ushort(v);}
#else #else
/* Intel x86 */ /* Intel x86 */
static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint32 retval; __asm__ ("bswap %0" : "=r" (retval) : "0" (*a) : "cc"); return retval;} static inline uae_u32 do_get_mem_long(uae_u32 *a) {uint32 retval; __asm__ ("bswap %0" : "=r" (retval) : "0" (*a) : "cc"); return retval;}
#ifdef X86_PPRO_OPT
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("movzwl %w1,%k0\n\tshll $16,%k0\n\tbswapl %k0\n" : "=&r" (retval) : "m" (*a) : "cc"); return retval;} static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("movzwl %w1,%k0\n\tshll $16,%k0\n\tbswapl %k0\n" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
#else
static inline uae_u32 do_get_mem_word(uae_u16 *a) {uint32 retval; __asm__ ("xorl %k0,%k0\n\tmovw %w1,%w0\n\trolw $8,%w0" : "=&r" (retval) : "m" (*a) : "cc"); return retval;}
#endif
static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v) : "cc"); *a = v;} static inline void do_put_mem_long(uae_u32 *a, uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
#ifdef X86_PPRO_OPT
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); *a = v;} static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); *a = v;}
#else
static inline void do_put_mem_word(uae_u16 *a, uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); *a = v;}
#endif
/* bswap doesn't affect condition codes */ /* bswap doesn't affect condition codes */
static inline uae_u32 do_byteswap_32_g(uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v)); return v;} static inline uae_u32 do_byteswap_32_g(uae_u32 v) {__asm__ ("bswap %0" : "=r" (v) : "0" (v)); return v;}
#ifdef X86_PPRO_OPT
static inline uae_u32 do_byteswap_16_g(uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); return v;} static inline uae_u32 do_byteswap_16_g(uae_u32 v) {__asm__ ("bswapl %0" : "=&r" (v) : "0" (v << 16) : "cc"); return v;}
#else
static inline uae_u32 do_byteswap_16_g(uae_u32 v) {__asm__ ("rolw $8,%0" : "=r" (v) : "0" (v) : "cc"); return v;}
#endif
#endif #endif
#define HAVE_GET_WORD_UNSWAPPED #define HAVE_GET_WORD_UNSWAPPED

View File

@ -37,7 +37,6 @@ user_string_def platform_strings[] = {
{STR_NO_AUDIO_WARN, "No audio device found, audio output will be disabled."}, {STR_NO_AUDIO_WARN, "No audio device found, audio output will be disabled."},
{STR_KEYCODE_FILE_WARN, "Cannot open keycode translation file %s (%s)."}, {STR_KEYCODE_FILE_WARN, "Cannot open keycode translation file %s (%s)."},
{STR_KEYCODE_VENDOR_WARN, "Cannot find vendor '%s' in keycode translation file %s."}, {STR_KEYCODE_VENDOR_WARN, "Cannot find vendor '%s' in keycode translation file %s."},
{STR_WINDOW_TITLE_GRABBED, "Basilisk II (mouse grabbed, press Ctrl-F5 to release)"},
{STR_NO_WIN32_NT_4, "Basilisk II does not run on Windows NT versions less than 4.0"}, {STR_NO_WIN32_NT_4, "Basilisk II does not run on Windows NT versions less than 4.0"},
{STR_PREFS_MENU_FILE_GTK, "/_File"}, {STR_PREFS_MENU_FILE_GTK, "/_File"},

View File

@ -39,7 +39,6 @@ enum {
STR_NO_AUDIO_WARN, STR_NO_AUDIO_WARN,
STR_KEYCODE_FILE_WARN, STR_KEYCODE_FILE_WARN,
STR_KEYCODE_VENDOR_WARN, STR_KEYCODE_VENDOR_WARN,
STR_WINDOW_TITLE_GRABBED,
STR_NO_WIN32_NT_4, STR_NO_WIN32_NT_4,
STR_PREFS_MENU_FILE_GTK, STR_PREFS_MENU_FILE_GTK,

View File

@ -70,7 +70,7 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
r->sr); r->sr);
VideoQuitFullScreen(); VideoQuitFullScreen();
#ifdef ENABLE_MON #ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
#endif #endif
QuitEmulator(); QuitEmulator();
@ -575,7 +575,7 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7], r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7],
r->sr); r->sr);
#ifdef ENABLE_MON #ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
#endif #endif
break; break;
@ -592,7 +592,7 @@ void EmulOp(uint16 opcode, M68kRegisters *r)
r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7], r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7],
r->sr); r->sr);
#ifdef ENABLE_MON #ifdef ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
#endif #endif
QuitEmulator(); QuitEmulator();

View File

@ -175,9 +175,9 @@ static uint32 next_cnid = fsUsrCNID; // Next available CNID
#if defined __APPLE__ && defined __MACH__ #if defined __APPLE__ && defined __MACH__
struct crtimebuf { struct crtimebuf {
unsigned long length; u_int32_t length;
struct timespec crtime; struct timespec crtime;
}; } __attribute__((aligned(4), packed));
static uint32 do_get_creation_time(const char *path) static uint32 do_get_creation_time(const char *path)
{ {

View File

@ -213,6 +213,7 @@ enum {
// Mac window // Mac window
STR_WINDOW_TITLE = 4000, STR_WINDOW_TITLE = 4000,
STR_WINDOW_TITLE_FROZEN, STR_WINDOW_TITLE_FROZEN,
STR_WINDOW_TITLE_GRABBED,
STR_WINDOW_MENU = 4050, STR_WINDOW_MENU = 4050,
STR_WINDOW_ITEM_ABOUT, STR_WINDOW_ITEM_ABOUT,
STR_WINDOW_ITEM_REFRESH, STR_WINDOW_ITEM_REFRESH,

View File

@ -1683,8 +1683,8 @@ bool PatchROM(void)
if (ROMBreakpoint) { if (ROMBreakpoint) {
#if ENABLE_MON #if ENABLE_MON
mon_add_break_point(ROMBaseMac + ROMBreakpoint); mon_add_break_point(ROMBaseMac + ROMBreakpoint);
printf("ROM start address at %08lx\n", ROMBaseMac); printf("ROM start address at %08x\n", ROMBaseMac);
printf("Set ROM break point at %08lx\n", ROMBaseMac + ROMBreakpoint); printf("Set ROM break point at %08x\n", ROMBaseMac + ROMBreakpoint);
#else #else
uint16 *wp = (uint16 *)(ROMBaseHost + ROMBreakpoint); uint16 *wp = (uint16 *)(ROMBaseHost + ROMBreakpoint);
*wp = htons(M68K_EMUL_BREAK); *wp = htons(M68K_EMUL_BREAK);

View File

@ -6533,7 +6533,7 @@ void disasm_block(int target, uint8 * start, size_t length)
mon_read_byte = mon_read_byte_jit; mon_read_byte = mon_read_byte_jit;
mon_write_byte = mon_write_byte_jit; mon_write_byte = mon_write_byte_jit;
char *arg[5] = {"mon", "-m", "-r", disasm_str, NULL}; const char *arg[5] = {"mon", "-m", "-r", disasm_str, NULL};
mon(4, arg); mon(4, arg);
mon_read_byte = old_mon_read_byte; mon_read_byte = old_mon_read_byte;

View File

@ -89,7 +89,7 @@ static void REGPARAM2 dummy_bput (uaecptr, uae_u32) REGPARAM;
uae_u32 REGPARAM2 dummy_lget (uaecptr addr) uae_u32 REGPARAM2 dummy_lget (uaecptr addr)
{ {
if (illegal_mem) if (illegal_mem)
write_log ("Illegal lget at %08lx\n", addr); write_log ("Illegal lget at %08x\n", addr);
return 0; return 0;
} }
@ -97,7 +97,7 @@ uae_u32 REGPARAM2 dummy_lget (uaecptr addr)
uae_u32 REGPARAM2 dummy_wget (uaecptr addr) uae_u32 REGPARAM2 dummy_wget (uaecptr addr)
{ {
if (illegal_mem) if (illegal_mem)
write_log ("Illegal wget at %08lx\n", addr); write_log ("Illegal wget at %08x\n", addr);
return 0; return 0;
} }
@ -105,7 +105,7 @@ uae_u32 REGPARAM2 dummy_wget (uaecptr addr)
uae_u32 REGPARAM2 dummy_bget (uaecptr addr) uae_u32 REGPARAM2 dummy_bget (uaecptr addr)
{ {
if (illegal_mem) if (illegal_mem)
write_log ("Illegal bget at %08lx\n", addr); write_log ("Illegal bget at %08x\n", addr);
return 0; return 0;
} }
@ -113,17 +113,17 @@ uae_u32 REGPARAM2 dummy_bget (uaecptr addr)
void REGPARAM2 dummy_lput (uaecptr addr, uae_u32 l) void REGPARAM2 dummy_lput (uaecptr addr, uae_u32 l)
{ {
if (illegal_mem) if (illegal_mem)
write_log ("Illegal lput at %08lx\n", addr); write_log ("Illegal lput at %08x\n", addr);
} }
void REGPARAM2 dummy_wput (uaecptr addr, uae_u32 w) void REGPARAM2 dummy_wput (uaecptr addr, uae_u32 w)
{ {
if (illegal_mem) if (illegal_mem)
write_log ("Illegal wput at %08lx\n", addr); write_log ("Illegal wput at %08x\n", addr);
} }
void REGPARAM2 dummy_bput (uaecptr addr, uae_u32 b) void REGPARAM2 dummy_bput (uaecptr addr, uae_u32 b)
{ {
if (illegal_mem) if (illegal_mem)
write_log ("Illegal bput at %08lx\n", addr); write_log ("Illegal bput at %08x\n", addr);
} }
/* Mac RAM (32 bit addressing) */ /* Mac RAM (32 bit addressing) */
@ -268,19 +268,19 @@ uae_u32 REGPARAM2 rom_bget(uaecptr addr)
void REGPARAM2 rom_lput(uaecptr addr, uae_u32 b) void REGPARAM2 rom_lput(uaecptr addr, uae_u32 b)
{ {
if (illegal_mem) if (illegal_mem)
write_log ("Illegal ROM lput at %08lx\n", addr); write_log ("Illegal ROM lput at %08x\n", addr);
} }
void REGPARAM2 rom_wput(uaecptr addr, uae_u32 b) void REGPARAM2 rom_wput(uaecptr addr, uae_u32 b)
{ {
if (illegal_mem) if (illegal_mem)
write_log ("Illegal ROM wput at %08lx\n", addr); write_log ("Illegal ROM wput at %08x\n", addr);
} }
void REGPARAM2 rom_bput(uaecptr addr, uae_u32 b) void REGPARAM2 rom_bput(uaecptr addr, uae_u32 b)
{ {
if (illegal_mem) if (illegal_mem)
write_log ("Illegal ROM bput at %08lx\n", addr); write_log ("Illegal ROM bput at %08x\n", addr);
} }
uae_u8 *REGPARAM2 rom_xlate(uaecptr addr) uae_u8 *REGPARAM2 rom_xlate(uaecptr addr)

View File

@ -373,7 +373,7 @@ uae_s32 ShowEA (int reg, amodes mode, wordsizes size, char *buf)
if (dp & 4) base += dispreg; if (dp & 4) base += dispreg;
addr = base + outer; addr = base + outer;
sprintf (buffer,"(%s%c%d.%c*%d+%ld)+%ld == $%08lx", name, sprintf (buffer,"(%s%c%d.%c*%d+%d)+%d == $%08lx", name,
dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W',
1 << ((dp >> 9) & 3), 1 << ((dp >> 9) & 3),
disp,outer, disp,outer,
@ -420,7 +420,7 @@ uae_s32 ShowEA (int reg, amodes mode, wordsizes size, char *buf)
if (dp & 4) base += dispreg; if (dp & 4) base += dispreg;
addr = base + outer; addr = base + outer;
sprintf (buffer,"(%s%c%d.%c*%d+%ld)+%ld == $%08lx", name, sprintf (buffer,"(%s%c%d.%c*%d+%d)+%d == $%08lx", name,
dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W', dp & 0x8000 ? 'A' : 'D', (int)r, dp & 0x800 ? 'L' : 'W',
1 << ((dp >> 9) & 3), 1 << ((dp >> 9) & 3),
disp,outer, disp,outer,
@ -1170,7 +1170,7 @@ void m68k_mull (uae_u32 opcode, uae_u32 src, uae_u16 extra)
} }
#endif #endif
} }
static char* ccnames[] = static const char* ccnames[] =
{ "T ","F ","HI","LS","CC","CS","NE","EQ", { "T ","F ","HI","LS","CC","CS","NE","EQ",
"VC","VS","PL","MI","GE","LT","GT","LE" }; "VC","VS","PL","MI","GE","LT","GT","LE" };
@ -1257,7 +1257,7 @@ void REGPARAM2 op_illg (uae_u32 opcode)
return; return;
} }
write_log ("Illegal instruction: %04x at %08lx\n", opcode, pc); write_log ("Illegal instruction: %04x at %08x\n", opcode, pc);
#if USE_JIT && JIT_DEBUG #if USE_JIT && JIT_DEBUG
compiler_dumpstate(); compiler_dumpstate();
#endif #endif
@ -1473,11 +1473,11 @@ void m68k_disasm (uaecptr addr, uaecptr *nextpc, int cnt)
} }
if (ccpt != 0) { if (ccpt != 0) {
if (cctrue(dp->cc)) if (cctrue(dp->cc))
printf (" == %08lx (TRUE)", newpc); printf (" == %08x (TRUE)", newpc);
else else
printf (" == %08lx (FALSE)", newpc); printf (" == %08x (FALSE)", newpc);
} else if ((opcode & 0xff00) == 0x6100) /* BSR */ } else if ((opcode & 0xff00) == 0x6100) /* BSR */
printf (" == %08lx", newpc); printf (" == %08x", newpc);
printf ("\n"); printf ("\n");
} }
if (nextpc) if (nextpc)
@ -1488,19 +1488,19 @@ void m68k_dumpstate (uaecptr *nextpc)
{ {
int i; int i;
for (i = 0; i < 8; i++){ for (i = 0; i < 8; i++){
printf ("D%d: %08lx ", i, m68k_dreg(regs, i)); printf ("D%d: %08x ", i, m68k_dreg(regs, i));
if ((i & 3) == 3) printf ("\n"); if ((i & 3) == 3) printf ("\n");
} }
for (i = 0; i < 8; i++){ for (i = 0; i < 8; i++){
printf ("A%d: %08lx ", i, m68k_areg(regs, i)); printf ("A%d: %08x ", i, m68k_areg(regs, i));
if ((i & 3) == 3) printf ("\n"); if ((i & 3) == 3) printf ("\n");
} }
if (regs.s == 0) regs.usp = m68k_areg(regs, 7); if (regs.s == 0) regs.usp = m68k_areg(regs, 7);
if (regs.s && regs.m) regs.msp = m68k_areg(regs, 7); if (regs.s && regs.m) regs.msp = m68k_areg(regs, 7);
if (regs.s && regs.m == 0) regs.isp = m68k_areg(regs, 7); if (regs.s && regs.m == 0) regs.isp = m68k_areg(regs, 7);
printf ("USP=%08lx ISP=%08lx MSP=%08lx VBR=%08lx\n", printf ("USP=%08x ISP=%08x MSP=%08x VBR=%08x\n",
regs.usp,regs.isp,regs.msp,regs.vbr); regs.usp,regs.isp,regs.msp,regs.vbr);
printf ("T=%d%d S=%d M=%d X=%d N=%d Z=%d V=%d C=%d IMASK=%d\n", printf ("T=%d%d S=%d M=%d X=%ld N=%ld Z=%ld V=%ld C=%ld IMASK=%d\n",
regs.t1, regs.t0, regs.s, regs.m, regs.t1, regs.t0, regs.s, regs.m,
GET_XFLG, GET_NFLG, GET_ZFLG, GET_VFLG, GET_CFLG, regs.intmask); GET_XFLG, GET_NFLG, GET_ZFLG, GET_VFLG, GET_CFLG, regs.intmask);
@ -1509,5 +1509,5 @@ void m68k_dumpstate (uaecptr *nextpc)
m68k_disasm(m68k_getpc (), nextpc, 1); m68k_disasm(m68k_getpc (), nextpc, 1);
if (nextpc) if (nextpc)
printf ("next PC: %08lx\n", *nextpc); printf ("next PC: %08x\n", *nextpc);
} }

View File

@ -204,9 +204,9 @@ static __inline__ void m68k_setpc (uaecptr newpc)
#if ENABLE_MON #if ENABLE_MON
if (IS_BREAK_POINT(newpc)) { if (IS_BREAK_POINT(newpc)) {
printf("Stopped at break point address: %08lx. Last PC: %08lx\n", newpc, previous_pc); printf("Stopped at break point address: %08x. Last PC: %08x\n", newpc, previous_pc);
m68k_dumpstate(NULL); m68k_dumpstate(NULL);
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
} }
#endif // end of #if ENABLE_MON #endif // end of #if ENABLE_MON
@ -221,9 +221,9 @@ static __inline__ void m68k_incpc (uae_s32 delta)
#if ENABLE_MON #if ENABLE_MON
uaecptr next_pc = m68k_getpc(); uaecptr next_pc = m68k_getpc();
if (IS_BREAK_POINT(next_pc)) { if (IS_BREAK_POINT(next_pc)) {
printf("Stopped at break point address: %08lx. Last PC: %08lx\n", next_pc, previous_pc); printf("Stopped at break point address: %08x. Last PC: %08x\n", next_pc, previous_pc);
m68k_dumpstate(NULL); m68k_dumpstate(NULL);
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
} }
#endif // end of #if ENABLE_MON #endif // end of #if ENABLE_MON

View File

@ -226,6 +226,7 @@ user_string_def common_strings[] = {
{STR_WINDOW_TITLE, "Basilisk II"}, {STR_WINDOW_TITLE, "Basilisk II"},
{STR_WINDOW_TITLE_FROZEN, "Basilisk II *** FROZEN ***"}, {STR_WINDOW_TITLE_FROZEN, "Basilisk II *** FROZEN ***"},
{STR_WINDOW_TITLE_GRABBED, "Basilisk II (mouse grabbed, press Ctrl-F5 to release)"},
{STR_WINDOW_MENU, "Basilisk II"}, {STR_WINDOW_MENU, "Basilisk II"},
{STR_WINDOW_ITEM_ABOUT, "About Basilisk II" ELLIPSIS}, {STR_WINDOW_ITEM_ABOUT, "About Basilisk II" ELLIPSIS},
{STR_WINDOW_ITEM_REFRESH, "Refresh Rate"}, {STR_WINDOW_ITEM_REFRESH, "Refresh Rate"},

2
README.md Normal file
View File

@ -0,0 +1,2 @@
# BasiliskII
[![Build Status](https://travis-ci.org/rickyzhang82/macemu.svg)](https://travis-ci.org/rickyzhang82/macemu)

View File

@ -120,11 +120,14 @@ static NSString *getStringFromPrefs(const char *key)
/* Fetch all CDROMs */ /* Fetch all CDROMs */
index = 0; index = 0;
while ((dsk = PrefsFindString("cdrom", index++)) != NULL) { while ((dsk = PrefsFindString("cdrom", index++)) != NULL) {
DiskType *disk = [[[DiskType alloc] init] autorelease]; NSString *path = [NSString stringWithUTF8String: dsk ];
[disk setPath:[NSString stringWithUTF8String: dsk ]]; if (![path hasPrefix:@"/dev/"]) {
[disk setIsCDROM:YES]; DiskType *disk = [[[DiskType alloc] init] autorelease];
[disk setPath:[NSString stringWithUTF8String: dsk ]];
[disk setIsCDROM:YES];
[diskArray addObject:disk]; [diskArray addObject:disk];
}
} }
[disks setDataSource: self]; [disks setDataSource: self];
@ -403,10 +406,19 @@ static NSString *makeRelativeIfNecessary(NSString *path)
// Remove all disks // Remove all disks
while (PrefsFindString("disk")) while (PrefsFindString("disk"))
PrefsRemoveItem("disk"); PrefsRemoveItem("disk");
// Remove all cdroms // Remove all cdroms (but keep the ones in /dev/)
while (PrefsFindString("cdrom")) const char *path;
PrefsRemoveItem("cdrom"); int index = 0;
while ((path = PrefsFindString("cdrom", index)) != NULL) {
NSString *p = [NSString stringWithUTF8String: path];
if (![p hasPrefix:@"/dev/"]) {
PrefsRemoveItem("cdrom", index);
} else {
// only increase the index if the current entry has not been deleted
// if it has been deleted, the next entry is on the current entrys index
index++;
}
}
// Write all disks // Write all disks
for (int i = 0; i < [diskArray count]; i++) { for (int i = 0; i < [diskArray count]; i++) {

View File

@ -489,6 +489,7 @@
); );
name = Sources; name = Sources;
sourceTree = "<group>"; sourceTree = "<group>";
usesTabs = 1;
}; };
0856CD7E14A99EEF000B1711 /* dummy */ = { 0856CD7E14A99EEF000B1711 /* dummy */ = {
isa = PBXGroup; isa = PBXGroup;

View File

@ -209,6 +209,7 @@ if [[ "x$WANT_SDL" = "xyes" ]]; then
WANT_SDL=no WANT_SDL=no
WANT_SDL_VIDEO=no WANT_SDL_VIDEO=no
WANT_SDL_AUDIO=no WANT_SDL_AUDIO=no
SDL_SUPPORT="none"
fi fi
fi fi
SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"` SDL_SUPPORT=`echo "$SDL_SUPPORT" | sed -e "s/^ //"`

View File

@ -1414,7 +1414,7 @@ static void *tick_func(void *arg)
#ifdef ENABLE_MON #ifdef ENABLE_MON
// Start up mon in real-mode // Start up mon in real-mode
printf("Welcome to the sheep factory.\n"); printf("Welcome to the sheep factory.\n");
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
#endif #endif
return NULL; return NULL;

View File

@ -84,7 +84,6 @@ user_string_def platform_strings[] = {
{STR_VOSF_INIT_ERR, "Cannot initialize Video on SEGV signals."}, {STR_VOSF_INIT_ERR, "Cannot initialize Video on SEGV signals."},
{STR_OPEN_WINDOW_ERR, "Cannot open Mac window."}, {STR_OPEN_WINDOW_ERR, "Cannot open Mac window."},
{STR_WINDOW_TITLE_GRABBED, "SheepShaver (mouse grabbed, press Ctrl-F5 to release)"},
{STR_NO_B2_EXE_FOUND, "Could not start %s (%s)."}, {STR_NO_B2_EXE_FOUND, "Could not start %s (%s)."},

View File

@ -18,8 +18,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef USER_STRINGS_LINUX_H #ifndef USER_STRINGS_UNIX_H
#define USER_STRINGS_LINUX_H #define USER_STRINGS_UNIX_H
enum { enum {
STR_NO_DEV_ZERO_ERR = 10000, STR_NO_DEV_ZERO_ERR = 10000,
@ -78,7 +78,6 @@ enum {
STR_MOUSEWHEELLINES_CTRL, STR_MOUSEWHEELLINES_CTRL,
STR_OPEN_WINDOW_ERR, STR_OPEN_WINDOW_ERR,
STR_WINDOW_TITLE_GRABBED,
STR_NO_B2_EXE_FOUND STR_NO_B2_EXE_FOUND
}; };

View File

@ -45,7 +45,6 @@ user_string_def platform_strings[] = {
{STR_VOSF_INIT_ERR, "Cannot initialize Video on SEGV signals."}, {STR_VOSF_INIT_ERR, "Cannot initialize Video on SEGV signals."},
{STR_OPEN_WINDOW_ERR, "Cannot open Mac window."}, {STR_OPEN_WINDOW_ERR, "Cannot open Mac window."},
{STR_WINDOW_TITLE_GRABBED, "SheepShaver (mouse grabbed, press Ctrl-F5 to release)"},
{STR_NO_WIN32_NT_4, "SheepShaver does not run on Windows NT versions less than 4.0"}, {STR_NO_WIN32_NT_4, "SheepShaver does not run on Windows NT versions less than 4.0"},
{STR_PREFS_MENU_FILE_GTK, "/_File"}, {STR_PREFS_MENU_FILE_GTK, "/_File"},

View File

@ -39,7 +39,6 @@ enum {
STR_KEYCODE_FILE_WARN, STR_KEYCODE_FILE_WARN,
STR_KEYCODE_VENDOR_WARN, STR_KEYCODE_VENDOR_WARN,
STR_OPEN_WINDOW_ERR, STR_OPEN_WINDOW_ERR,
STR_WINDOW_TITLE_GRABBED,
STR_NO_WIN32_NT_4, STR_NO_WIN32_NT_4,
STR_PREFS_MENU_FILE_GTK, STR_PREFS_MENU_FILE_GTK,

View File

@ -212,7 +212,7 @@ static void dump(void)
// Start up mon in real-mode // Start up mon in real-mode
#if ENABLE_MON #if ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
#endif #endif
QuitEmulator(); QuitEmulator();

View File

@ -166,6 +166,7 @@ enum {
// Mac window // Mac window
STR_WINDOW_TITLE = 4000, STR_WINDOW_TITLE = 4000,
STR_WINDOW_TITLE_FROZEN, STR_WINDOW_TITLE_FROZEN,
STR_WINDOW_TITLE_GRABBED,
STR_WINDOW_MENU = 4050, STR_WINDOW_MENU = 4050,
STR_WINDOW_ITEM_ABOUT, STR_WINDOW_ITEM_ABOUT,
STR_WINDOW_ITEM_REFRESH, STR_WINDOW_ITEM_REFRESH,

View File

@ -83,7 +83,7 @@ static void enter_mon(void)
{ {
// Start up mon in real-mode // Start up mon in real-mode
#if ENABLE_MON #if ENABLE_MON
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
#endif #endif
} }

View File

@ -527,7 +527,7 @@ bool powerpc_cpu::check_spcflags()
spcflags().clear(SPCFLAG_CPU_ENTER_MON); spcflags().clear(SPCFLAG_CPU_ENTER_MON);
#if ENABLE_MON #if ENABLE_MON
// Start up mon in real-mode // Start up mon in real-mode
char *arg[] = { const char *arg[] = {
"mon", "mon",
#ifdef SHEEPSHAVER #ifdef SHEEPSHAVER
"-m", "-m",

View File

@ -67,7 +67,7 @@ void powerpc_cpu::execute_illegal(uint32 opcode)
disass_ppc(stdout, pc(), opcode); disass_ppc(stdout, pc(), opcode);
// Start up mon in real-mode // Start up mon in real-mode
char *arg[4] = {"mon", "-m", "-r", NULL}; const char *arg[4] = {"mon", "-m", "-r", NULL};
mon(3, arg); mon(3, arg);
#endif #endif
abort(); abort();

View File

@ -95,7 +95,7 @@ static void disasm_block(int target, uint8 *start, uint32 length)
target == TARGET_POWERPC ? "d" : "x", target == TARGET_POWERPC ? "d" : "x",
start, start + length - 1); start, start + length - 1);
char *arg[] = {"mon", const char *arg[] = {"mon",
#ifdef SHEEPSHAVER #ifdef SHEEPSHAVER
"-m", "-m",
#endif #endif

View File

@ -172,6 +172,7 @@ user_string_def common_strings[] = {
{STR_WINDOW_TITLE, "SheepShaver"}, {STR_WINDOW_TITLE, "SheepShaver"},
{STR_WINDOW_TITLE_FROZEN, "SheepShaver *** FROZEN ***"}, {STR_WINDOW_TITLE_FROZEN, "SheepShaver *** FROZEN ***"},
{STR_WINDOW_TITLE_GRABBED, "SheepShaver (mouse grabbed, press Ctrl-F5 to release)"},
{STR_WINDOW_MENU, "SheepShaver"}, {STR_WINDOW_MENU, "SheepShaver"},
{STR_WINDOW_ITEM_ABOUT, "About SheepShaver" ELLIPSIS}, {STR_WINDOW_ITEM_ABOUT, "About SheepShaver" ELLIPSIS},
{STR_WINDOW_ITEM_REFRESH, "Refresh Rate"}, {STR_WINDOW_ITEM_REFRESH, "Refresh Rate"},

View File

@ -418,7 +418,7 @@ Here's how to do it (all functions are defined in the mon.h header file):
arguments and the mon_read/write_*() functions to access memory. arguments and the mon_read/write_*() functions to access memory.
5. To enter cxmon, call the mon() function like this: 5. To enter cxmon, call the mon() function like this:
char *args[3] = {"mon", "-r", NULL}; const char *args[3] = {"mon", "-r", NULL};
mon(2, args); mon(2, args);
6. If you're done with cxmon, call mon_exit(). 6. If you're done with cxmon, call mon_exit().

View File

@ -872,7 +872,7 @@ static void help_or_hunt()
} }
fprintf(monout, "x Quit mon\n" fprintf(monout, "x Quit mon\n"
"h This help text\n"); "h This help text\n");
fprintf(monout, cmd_help); fprintf(monout, "%s", cmd_help);
} }
@ -1180,7 +1180,7 @@ void mon_exit()
* Main function, read-execute loop * Main function, read-execute loop
*/ */
void mon(int argc, char **argv) void mon(int argc, const char **argv)
{ {
bool done = false, interactive = true; bool done = false, interactive = true;

View File

@ -31,7 +31,7 @@
void mon_init(); void mon_init();
void mon_exit(); void mon_exit();
void mon(int argc, char **argv); void mon(int argc, const char **argv);
// Break points prompt // Break points prompt
const char STR_ACTIVE_BREAK_POINTS[] = "Active Break Points:\n"; const char STR_ACTIVE_BREAK_POINTS[] = "Active Break Points:\n";

View File

@ -1,4 +1,4 @@
/* /*
* mon_cmd.cpp - cxmon standard commands * mon_cmd.cpp - cxmon standard commands
* *
* cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig * cxmon (C) 1997-2004 Christian Bauer, Marc Hellwig

View File

@ -30,7 +30,7 @@ static unsigned short imm;
// Codes for trap instructions // Codes for trap instructions
static char *to_code[32] = { static const char *to_code[32] = {
NULL, "lgt", "llt", NULL, "eq", "lge", "lle", NULL, NULL, "lgt", "llt", NULL, "eq", "lge", "lle", NULL,
"gt", NULL, NULL, NULL, "ge", NULL, NULL, NULL, "gt", NULL, NULL, NULL, "ge", NULL, NULL, NULL,
"lt", NULL, NULL, NULL, "le", NULL, NULL, NULL, "lt", NULL, NULL, NULL, "le", NULL, NULL, NULL,
@ -187,7 +187,7 @@ static void disass31(FILE *f, unsigned int adr, unsigned int w);
static void disass59(FILE *f, unsigned int adr, unsigned int w); static void disass59(FILE *f, unsigned int adr, unsigned int w);
static void disass63(FILE *f, unsigned int adr, unsigned int w); static void disass63(FILE *f, unsigned int adr, unsigned int w);
static unsigned int mbme2mask(int mb, int me); static unsigned int mbme2mask(int mb, int me);
static char *get_spr(int reg); static const char *get_spr(int reg);
/* /*
@ -279,7 +279,7 @@ void disass_ppc(FILE *f, unsigned int adr, unsigned int w)
case 16: { case 16: {
int target = short(imm & 0xfffc); int target = short(imm & 0xfffc);
char *form; const char *form;
if (w & 1) if (w & 1)
if (w & 2) if (w & 2)
form = "la"; form = "la";
@ -817,7 +817,7 @@ static void disass31(FILE *f, unsigned int adr, unsigned int w)
else if ((ra | (rb << 5)) == 256) else if ((ra | (rb << 5)) == 256)
fprintf(f, "mfvrsave\tr%d\n", rd); fprintf(f, "mfvrsave\tr%d\n", rd);
else { else {
char *spr = get_spr(ra | (rb << 5)); const char *spr = get_spr(ra | (rb << 5));
if (spr) if (spr)
fprintf(f, "mfspr\tr%d,%s\n", rd, spr); fprintf(f, "mfspr\tr%d,%s\n", rd, spr);
else else
@ -894,7 +894,7 @@ static void disass31(FILE *f, unsigned int adr, unsigned int w)
else if ((ra | (rb << 5)) == 256) else if ((ra | (rb << 5)) == 256)
fprintf(f, "mtvrsave\tr%d\n", rd); fprintf(f, "mtvrsave\tr%d\n", rd);
else { else {
char *spr = get_spr(ra | (rb << 5)); const char *spr = get_spr(ra | (rb << 5));
if (spr) if (spr)
fprintf(f, "mtspr\t%s,r%d\n", spr, rd); fprintf(f, "mtspr\t%s,r%d\n", spr, rd);
else else
@ -1058,7 +1058,7 @@ static unsigned int mbme2mask(int mb, int me)
* Convert SPR number to register name * Convert SPR number to register name
*/ */
char *get_spr(int reg) const char *get_spr(int reg)
{ {
switch (reg) { switch (reg) {
case 1: return "xer"; case 1: return "xer";