39 |
|
#include "video.h" |
40 |
|
#include "audio.h" |
41 |
|
#include "ether.h" |
42 |
+ |
#include "extfs.h" |
43 |
|
#include "emul_op.h" |
44 |
|
|
45 |
+ |
#if ENABLE_MON |
46 |
+ |
#include "mon.h" |
47 |
+ |
#endif |
48 |
+ |
|
49 |
|
#define DEBUG 0 |
50 |
|
#include "debug.h" |
51 |
|
|
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 |
+ |
#if ENABLE_MON |
72 |
+ |
char *arg[2]; |
73 |
+ |
arg[0] = "rmon"; |
74 |
+ |
arg[1] = NULL; |
75 |
+ |
mon(1, arg); |
76 |
+ |
#endif |
77 |
|
QuitEmulator(); |
78 |
|
break; |
79 |
|
} |
163 |
|
} |
164 |
|
} else if (reg < 0x08 && is_read) { |
165 |
|
uint32 t = TimerDateTime(); |
166 |
< |
uint8 b; |
166 |
> |
uint8 b = t; |
167 |
|
switch (reg & 3) { |
157 |
– |
case 0: b = t; break; |
168 |
|
case 1: b = t >> 8; break; |
169 |
|
case 2: b = t >> 16; break; |
170 |
|
case 3: b = t >> 24; break; |
306 |
|
break; |
307 |
|
|
308 |
|
case M68K_EMUL_OP_VIDEO_OPEN: // Video driver functions |
309 |
< |
r->d[0] = VideoOpen(r->a[0], r->a[1]); |
309 |
> |
r->d[0] = VideoDriverOpen(r->a[0], r->a[1]); |
310 |
|
break; |
311 |
|
|
312 |
|
case M68K_EMUL_OP_VIDEO_CONTROL: |
313 |
< |
r->d[0] = VideoControl(r->a[0], r->a[1]); |
313 |
> |
r->d[0] = VideoDriverControl(r->a[0], r->a[1]); |
314 |
|
break; |
315 |
|
|
316 |
|
case M68K_EMUL_OP_VIDEO_STATUS: |
317 |
< |
r->d[0] = VideoStatus(r->a[0], r->a[1]); |
317 |
> |
r->d[0] = VideoDriverStatus(r->a[0], r->a[1]); |
318 |
|
break; |
319 |
|
|
320 |
|
case M68K_EMUL_OP_SERIAL_OPEN: // Serial driver functions |
445 |
|
ClearInterruptFlag(INTFLAG_60HZ); |
446 |
|
if (HasMacStarted()) { |
447 |
|
|
448 |
< |
// Mac has started, execute video, ADB and Time Manager interrupt functions |
448 |
> |
// Mac has started, execute all 60Hz interrupt functions |
449 |
|
ADBInterrupt(); |
450 |
|
TimerInterrupt(); |
451 |
|
VideoInterrupt(); |
452 |
+ |
SonyInterrupt(); |
453 |
+ |
DiskInterrupt(); |
454 |
+ |
CDROMInterrupt(); |
455 |
|
|
456 |
|
// Call DoVBLTask(0) |
457 |
|
if (ROMVersion == ROM_VERSION_32) { |
503 |
|
r->d[0] = AudioDispatch(r->a[3], r->a[4]); |
504 |
|
break; |
505 |
|
|
506 |
+ |
#if SUPPORTS_EXTFS |
507 |
+ |
case M68K_EMUL_OP_EXTFS_COMM: // External file system routines |
508 |
+ |
WriteMacInt16(r->a[7] + 14, ExtFSComm(ReadMacInt16(r->a[7] + 12), ReadMacInt32(r->a[7] + 8), ReadMacInt32(r->a[7] + 4))); |
509 |
+ |
break; |
510 |
+ |
|
511 |
+ |
case M68K_EMUL_OP_EXTFS_HFS: |
512 |
+ |
WriteMacInt16(r->a[7] + 20, ExtFSHFS(ReadMacInt32(r->a[7] + 16), ReadMacInt16(r->a[7] + 14), ReadMacInt32(r->a[7] + 10), ReadMacInt32(r->a[7] + 6), ReadMacInt16(r->a[7] + 4))); |
513 |
+ |
break; |
514 |
+ |
#endif |
515 |
+ |
|
516 |
+ |
case M68K_EMUL_OP_BLOCK_MOVE: // BlockMove() replacement |
517 |
+ |
memmove(Mac2HostAddr(r->a[1]), Mac2HostAddr(r->a[0]), r->d[0]); |
518 |
+ |
break; |
519 |
+ |
|
520 |
|
default: |
521 |
|
printf("FATAL: EMUL_OP called with bogus opcode %08x\n", opcode); |
522 |
|
printf("d0 %08lx d1 %08lx d2 %08lx d3 %08lx\n" |