73 |
|
const int SCRATCH_MEM_SIZE = 0x10000; // Size of scratch memory area |
74 |
|
|
75 |
|
|
76 |
+ |
static char *bundle = NULL; // If in an OS X application bundle, its path |
77 |
+ |
|
78 |
+ |
|
79 |
|
// CPU and FPU type, addressing mode |
80 |
|
int CPUType; |
81 |
|
bool CPUIs68060; |
185 |
|
|
186 |
|
|
187 |
|
/* |
188 |
+ |
* Screen fault handler |
189 |
+ |
*/ |
190 |
+ |
|
191 |
+ |
bool Screen_fault_handler(sigsegv_info_t *sip) |
192 |
+ |
{ |
193 |
+ |
return true; |
194 |
+ |
} |
195 |
+ |
|
196 |
+ |
|
197 |
+ |
/* |
198 |
|
* Main program |
199 |
|
*/ |
200 |
|
|
254 |
|
// Init system routines |
255 |
|
SysInit(); |
256 |
|
|
257 |
+ |
// Set the current directory somewhere useful. |
258 |
+ |
// Handy for storing the ROM file |
259 |
+ |
bundle = strstr(argv[0], "BasiliskII.app/Contents/MacOS/BasiliskII"); |
260 |
+ |
if (bundle) |
261 |
+ |
{ |
262 |
+ |
while (*bundle != '/') |
263 |
+ |
++bundle; |
264 |
+ |
|
265 |
+ |
*bundle = 0; // Throw away Contents/... on end of argv[0] |
266 |
+ |
bundle = argv[0]; |
267 |
+ |
|
268 |
+ |
chdir(bundle); |
269 |
+ |
} |
270 |
+ |
|
271 |
|
// Open display, attach to window server, |
272 |
|
// load pre-instantiated classes from MainMenu.nib, start run loop |
273 |
|
int i = NSApplicationMain(argc, (const char **)argv); |
396 |
|
// Get rom file path from preferences |
397 |
|
const char *rom_path = PrefsFindString("rom"); |
398 |
|
if ( ! rom_path ) |
399 |
+ |
if ( bundle ) |
400 |
+ |
WarningAlert("No rom pathname set. Trying BasiliskII.app/ROM"); |
401 |
+ |
else |
402 |
|
WarningAlert("No rom pathname set. Trying ./ROM"); |
403 |
|
|
404 |
|
// Load Mac ROM |
507 |
|
void FlushCodeCache(void *start, uint32 size) |
508 |
|
{ |
509 |
|
#if USE_JIT |
510 |
< |
if (UseJIT) |
510 |
> |
if (UseJIT) |
511 |
|
flush_icache_range((uint8 *)start, size); |
512 |
|
#endif |
513 |
|
} |