1 |
|
/* |
2 |
|
* main_amiga.cpp - Startup code for AmigaOS |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2001 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2002 Christian Bauer |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
188 |
|
QuitEmulator(); |
189 |
|
} |
190 |
|
|
191 |
+ |
if (FindTask((UBYTE *) "« Enforcer »")) |
192 |
+ |
{ |
193 |
+ |
ErrorAlert(STR_ENFORCER_RUNNING_ERR); |
194 |
+ |
QuitEmulator(); |
195 |
+ |
} |
196 |
+ |
|
197 |
|
// These two can fail (the respective gfx support won't be available, then) |
198 |
|
P96Base = OpenLibrary((UBYTE *)"Picasso96API.library", 2); |
199 |
|
CyberGfxBase = OpenLibrary((UBYTE *)"cybergraphics.library", 2); |
478 |
|
|
479 |
|
|
480 |
|
/* |
481 |
+ |
* Mutexes |
482 |
+ |
*/ |
483 |
+ |
|
484 |
+ |
struct B2_mutex { |
485 |
+ |
int dummy; //!! |
486 |
+ |
}; |
487 |
+ |
|
488 |
+ |
B2_mutex *B2_create_mutex(void) |
489 |
+ |
{ |
490 |
+ |
return new B2_mutex; |
491 |
+ |
} |
492 |
+ |
|
493 |
+ |
void B2_lock_mutex(B2_mutex *mutex) |
494 |
+ |
{ |
495 |
+ |
} |
496 |
+ |
|
497 |
+ |
void B2_unlock_mutex(B2_mutex *mutex) |
498 |
+ |
{ |
499 |
+ |
} |
500 |
+ |
|
501 |
+ |
void B2_delete_mutex(B2_mutex *mutex) |
502 |
+ |
{ |
503 |
+ |
delete mutex; |
504 |
+ |
} |
505 |
+ |
|
506 |
+ |
|
507 |
+ |
/* |
508 |
|
* Interrupt flags (must be handled atomically!) |
509 |
|
*/ |
510 |
|
|
604 |
|
|
605 |
|
static __saveds void xpram_func(void) |
606 |
|
{ |
607 |
< |
uint8 last_xpram[256]; |
608 |
< |
memcpy(last_xpram, XPRAM, 256); |
607 |
> |
uint8 last_xpram[XPRAM_SIZE]; |
608 |
> |
memcpy(last_xpram, XPRAM, XPRAM_SIZE); |
609 |
|
|
610 |
|
while (xpram_proc_active) { |
611 |
|
for (int i=0; i<60 && xpram_proc_active; i++) |
612 |
|
Delay(50); // Only wait 1 second so we quit promptly when xpram_proc_active becomes false |
613 |
< |
if (memcmp(last_xpram, XPRAM, 256)) { |
614 |
< |
memcpy(last_xpram, XPRAM, 256); |
613 |
> |
if (memcmp(last_xpram, XPRAM, XPRAM_SIZE)) { |
614 |
> |
memcpy(last_xpram, XPRAM, XPRAM_SIZE); |
615 |
|
SaveXPRAM(); |
616 |
|
} |
617 |
|
} |