1 |
|
/* |
2 |
|
* emul_op.cpp - 68k opcodes for ROM patches |
3 |
|
* |
4 |
< |
* Basilisk II (C) 1997-2000 Christian Bauer |
4 |
> |
* Basilisk II (C) 1997-2004 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 |
68 |
|
r->d[0], r->d[1], r->d[2], r->d[3], r->d[4], r->d[5], r->d[6], r->d[7], |
69 |
|
r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7], |
70 |
|
r->sr); |
71 |
+ |
VideoQuitFullScreen(); |
72 |
|
#ifdef ENABLE_MON |
73 |
< |
char *arg[2] = {"rmon", NULL}; |
74 |
< |
mon(1, arg); |
73 |
> |
char *arg[4] = {"mon", "-m", "-r", NULL}; |
74 |
> |
mon(3, arg); |
75 |
|
#endif |
76 |
|
QuitEmulator(); |
77 |
|
break; |
349 |
|
EtherReadPacket((uint8 **)&r->a[0], r->a[3], r->d[3], r->d[1]); |
350 |
|
break; |
351 |
|
|
352 |
+ |
case M68K_EMUL_OP_SOUNDIN_OPEN: // Sound input driver functions |
353 |
+ |
r->d[0] = SoundInOpen(r->a[0], r->a[1]); |
354 |
+ |
break; |
355 |
+ |
|
356 |
+ |
case M68K_EMUL_OP_SOUNDIN_PRIME: |
357 |
+ |
r->d[0] = SoundInPrime(r->a[0], r->a[1]); |
358 |
+ |
break; |
359 |
+ |
|
360 |
+ |
case M68K_EMUL_OP_SOUNDIN_CONTROL: |
361 |
+ |
r->d[0] = SoundInControl(r->a[0], r->a[1]); |
362 |
+ |
break; |
363 |
+ |
|
364 |
+ |
case M68K_EMUL_OP_SOUNDIN_STATUS: |
365 |
+ |
r->d[0] = SoundInStatus(r->a[0], r->a[1]); |
366 |
+ |
break; |
367 |
+ |
|
368 |
+ |
case M68K_EMUL_OP_SOUNDIN_CLOSE: |
369 |
+ |
r->d[0] = SoundInClose(r->a[0], r->a[1]); |
370 |
+ |
break; |
371 |
+ |
|
372 |
|
case M68K_EMUL_OP_SCSI_DISPATCH: { // SCSIDispatch() replacement |
373 |
|
uint32 ret = ReadMacInt32(r->a[7]); // Get return address |
374 |
|
uint16 sel = ReadMacInt16(r->a[7] + 4); // Get selector |
437 |
|
|
438 |
|
if (InterruptFlags & INTFLAG_60HZ) { |
439 |
|
ClearInterruptFlag(INTFLAG_60HZ); |
440 |
+ |
|
441 |
+ |
// Increment Ticks variable |
442 |
+ |
WriteMacInt32(0x16a, ReadMacInt32(0x16a) + 1); |
443 |
+ |
|
444 |
|
if (HasMacStarted()) { |
445 |
|
|
446 |
|
// Mac has started, execute all 60Hz interrupt functions |
422 |
– |
ADBInterrupt(); |
447 |
|
TimerInterrupt(); |
448 |
|
VideoInterrupt(); |
449 |
|
|
460 |
|
|
461 |
|
if (InterruptFlags & INTFLAG_1HZ) { |
462 |
|
ClearInterruptFlag(INTFLAG_1HZ); |
439 |
– |
|
463 |
|
if (HasMacStarted()) { |
464 |
|
SonyInterrupt(); |
465 |
|
DiskInterrupt(); |
481 |
|
ClearInterruptFlag(INTFLAG_AUDIO); |
482 |
|
AudioInterrupt(); |
483 |
|
} |
484 |
+ |
|
485 |
+ |
if (InterruptFlags & INTFLAG_ADB) { |
486 |
+ |
ClearInterruptFlag(INTFLAG_ADB); |
487 |
+ |
if (HasMacStarted()) |
488 |
+ |
ADBInterrupt(); |
489 |
+ |
} |
490 |
+ |
|
491 |
+ |
if (InterruptFlags & INTFLAG_NMI) { |
492 |
+ |
ClearInterruptFlag(INTFLAG_NMI); |
493 |
+ |
if (HasMacStarted()) |
494 |
+ |
TriggerNMI(); |
495 |
+ |
} |
496 |
|
break; |
497 |
|
|
498 |
|
case M68K_EMUL_OP_PUT_SCRAP: { // PutScrap() patch |
531 |
|
break; |
532 |
|
#endif |
533 |
|
|
534 |
< |
case M68K_EMUL_OP_BLOCK_MOVE: // BlockMove() replacement |
535 |
< |
memmove(Mac2HostAddr(r->a[1]), Mac2HostAddr(r->a[0]), r->d[0]); |
534 |
> |
case M68K_EMUL_OP_BLOCK_MOVE: // BlockMove() cache flushing |
535 |
> |
FlushCodeCache(Mac2HostAddr(r->a[0]), r->a[1]); |
536 |
> |
break; |
537 |
> |
|
538 |
> |
case M68K_EMUL_OP_DEBUGUTIL: |
539 |
> |
// printf("DebugUtil d0=%08lx a5=%08lx\n", r->d[0], r->a[5]); |
540 |
> |
r->d[0] = DebugUtil(r->d[0]); |
541 |
|
break; |
542 |
|
|
543 |
|
default: |
544 |
< |
printf("FATAL: EMUL_OP called with bogus opcode %04x\n", opcode); |
544 |
> |
printf("FATAL: EMUL_OP called with bogus opcode %08x\n", opcode); |
545 |
|
printf("d0 %08x d1 %08x d2 %08x d3 %08x\n" |
546 |
|
"d4 %08x d5 %08x d6 %08x d7 %08x\n" |
547 |
|
"a0 %08x a1 %08x a2 %08x a3 %08x\n" |
551 |
|
r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7], |
552 |
|
r->sr); |
553 |
|
#ifdef ENABLE_MON |
554 |
< |
char *arg[2] = {"rmon", NULL}; |
555 |
< |
mon(1, arg); |
554 |
> |
char *arg[4] = {"mon", "-m", "-r", NULL}; |
555 |
> |
mon(3, arg); |
556 |
|
#endif |
557 |
|
QuitEmulator(); |
558 |
|
break; |