243 |
|
RAMBaseHost = (uint8 *)0x10000000; |
244 |
|
ram_area = create_area(RAM_AREA_NAME, (void **)&RAMBaseHost, B_BASE_ADDRESS, RAMSize, B_NO_LOCK, B_READ_AREA | B_WRITE_AREA); |
245 |
|
if (ram_area < 0) { |
246 |
< |
ErrorAlert(GetString(STR_NO_RAM_AREA_ERR)); |
246 |
> |
ErrorAlert(STR_NO_RAM_AREA_ERR); |
247 |
|
PostMessage(B_QUIT_REQUESTED); |
248 |
|
return; |
249 |
|
} |
253 |
|
try { |
254 |
|
init_rom(); |
255 |
|
} catch (area_error) { |
256 |
< |
ErrorAlert(GetString(STR_NO_ROM_AREA_ERR)); |
256 |
> |
ErrorAlert(STR_NO_ROM_AREA_ERR); |
257 |
|
PostMessage(B_QUIT_REQUESTED); |
258 |
|
return; |
259 |
|
} catch (file_open_error) { |
260 |
< |
ErrorAlert(GetString(STR_NO_ROM_FILE_ERR)); |
260 |
> |
ErrorAlert(STR_NO_ROM_FILE_ERR); |
261 |
|
PostMessage(B_QUIT_REQUESTED); |
262 |
|
return; |
263 |
|
} catch (file_read_error) { |
264 |
< |
ErrorAlert(GetString(STR_ROM_FILE_READ_ERR)); |
264 |
> |
ErrorAlert(STR_ROM_FILE_READ_ERR); |
265 |
|
PostMessage(B_QUIT_REQUESTED); |
266 |
|
return; |
267 |
|
} catch (rom_size_error) { |
268 |
< |
ErrorAlert(GetString(STR_ROM_SIZE_ERR)); |
268 |
> |
ErrorAlert(STR_ROM_SIZE_ERR); |
269 |
|
PostMessage(B_QUIT_REQUESTED); |
270 |
|
return; |
271 |
|
} |
469 |
|
|
470 |
|
|
471 |
|
/* |
472 |
+ |
* Mutexes |
473 |
+ |
*/ |
474 |
+ |
|
475 |
+ |
struct B2_mutex { |
476 |
+ |
int dummy; //!! |
477 |
+ |
}; |
478 |
+ |
|
479 |
+ |
B2_mutex *B2_create_mutex(void) |
480 |
+ |
{ |
481 |
+ |
return new B2_mutex; |
482 |
+ |
} |
483 |
+ |
|
484 |
+ |
void B2_lock_mutex(B2_mutex *mutex) |
485 |
+ |
{ |
486 |
+ |
} |
487 |
+ |
|
488 |
+ |
void B2_unlock_mutex(B2_mutex *mutex) |
489 |
+ |
{ |
490 |
+ |
} |
491 |
+ |
|
492 |
+ |
void B2_delete_mutex(B2_mutex *mutex) |
493 |
+ |
{ |
494 |
+ |
delete mutex; |
495 |
+ |
} |
496 |
+ |
|
497 |
+ |
|
498 |
+ |
/* |
499 |
|
* Interrupt flags (must be handled atomically!) |
500 |
|
*/ |
501 |
|
|
550 |
|
|
551 |
|
status_t BasiliskII::xpram_func(void *arg) |
552 |
|
{ |
553 |
< |
uint8 last_xpram[256]; |
554 |
< |
memcpy(last_xpram, XPRAM, 256); |
553 |
> |
uint8 last_xpram[XPRAM_SIZE]; |
554 |
> |
memcpy(last_xpram, XPRAM, XPRAM_SIZE); |
555 |
|
|
556 |
|
while (((BasiliskII *)arg)->xpram_thread_active) { |
557 |
|
snooze(60*1000000); |
558 |
< |
if (memcmp(last_xpram, XPRAM, 256)) { |
559 |
< |
memcpy(last_xpram, XPRAM, 256); |
558 |
> |
if (memcmp(last_xpram, XPRAM, XPRAM_SIZE)) { |
559 |
> |
memcpy(last_xpram, XPRAM, XPRAM_SIZE); |
560 |
|
SaveXPRAM(); |
561 |
|
} |
562 |
|
} |