--- BasiliskII/src/emul_op.cpp 1999/10/19 17:41:13 1.4 +++ BasiliskII/src/emul_op.cpp 2000/06/23 14:22:45 1.14 @@ -1,7 +1,7 @@ /* * emul_op.cpp - 68k opcodes for ROM patches * - * Basilisk II (C) 1997-1999 Christian Bauer + * Basilisk II (C) 1997-2000 Christian Bauer * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -42,6 +42,10 @@ #include "extfs.h" #include "emul_op.h" +#if ENABLE_MON +#include "mon.h" +#endif + #define DEBUG 0 #include "debug.h" @@ -64,6 +68,10 @@ void EmulOp(uint16 opcode, M68kRegisters r->d[0], r->d[1], r->d[2], r->d[3], r->d[4], r->d[5], r->d[6], r->d[7], r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7], r->sr); +#if ENABLE_MON + char *arg[2] = {"rmon", NULL}; + mon(1, arg); +#endif QuitEmulator(); break; } @@ -76,9 +84,10 @@ void EmulOp(uint16 opcode, M68kRegisters D(bug("*** RESET ***\n")); TimerReset(); EtherReset(); + AudioReset(); // Create BootGlobs at top of memory - memset((void *)(RAMBaseHost + RAMSize - 4096), 0, 4096); + Mac_memset(RAMBaseMac + RAMSize - 4096, 0, 4096); uint32 boot_globs = RAMBaseMac + RAMSize - 0x1c; WriteMacInt32(boot_globs + 0x00, RAMBaseMac); // First RAM bank WriteMacInt32(boot_globs + 0x04, RAMSize); @@ -296,15 +305,15 @@ void EmulOp(uint16 opcode, M68kRegisters break; case M68K_EMUL_OP_VIDEO_OPEN: // Video driver functions - r->d[0] = VideoOpen(r->a[0], r->a[1]); + r->d[0] = VideoDriverOpen(r->a[0], r->a[1]); break; case M68K_EMUL_OP_VIDEO_CONTROL: - r->d[0] = VideoControl(r->a[0], r->a[1]); + r->d[0] = VideoDriverControl(r->a[0], r->a[1]); break; case M68K_EMUL_OP_VIDEO_STATUS: - r->d[0] = VideoStatus(r->a[0], r->a[1]); + r->d[0] = VideoDriverStatus(r->a[0], r->a[1]); break; case M68K_EMUL_OP_SERIAL_OPEN: // Serial driver functions @@ -402,33 +411,6 @@ void EmulOp(uint16 opcode, M68kRegisters break; } - case M68K_EMUL_OP_MEMORY_DISPATCH: { // MemoryDispatch() replacement routine - int16 sel = r->d[0]; - D(bug("MemoryDispatch(%d)\n", sel)); - switch (sel) { - case -6: // GetLogicalRAMSize - r->d[0] = RAMSize; - break; - case -3: - r->d[0] = 0x1000; - break; - case 0: // HoldMemory - case 1: // UnholdMemory - case 2: // LockMemory - case 3: // UnlockMemory - case 4: // LockMemoryContiguous - case 6: // ProtectMemory - case 7: // UnprotectMemory - r->d[0] = 0; - break; - default: - printf("FATAL: MemoryDispatch(%d): illegal selector\n", sel); - r->d[0] = (uint32)-502; - break; - } - break; - } - case M68K_EMUL_OP_IRQ: // Level 1 interrupt r->d[0] = 0; if (InterruptFlags & INTFLAG_60HZ) { @@ -493,6 +475,7 @@ void EmulOp(uint16 opcode, M68kRegisters r->d[0] = AudioDispatch(r->a[3], r->a[4]); break; +#if SUPPORTS_EXTFS case M68K_EMUL_OP_EXTFS_COMM: // External file system routines WriteMacInt16(r->a[7] + 14, ExtFSComm(ReadMacInt16(r->a[7] + 12), ReadMacInt32(r->a[7] + 8), ReadMacInt32(r->a[7] + 4))); break; @@ -500,6 +483,11 @@ void EmulOp(uint16 opcode, M68kRegisters case M68K_EMUL_OP_EXTFS_HFS: 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))); break; +#endif + + case M68K_EMUL_OP_BLOCK_MOVE: // BlockMove() replacement + memmove(Mac2HostAddr(r->a[1]), Mac2HostAddr(r->a[0]), r->d[0]); + break; default: printf("FATAL: EMUL_OP called with bogus opcode %08x\n", opcode); @@ -511,6 +499,10 @@ void EmulOp(uint16 opcode, M68kRegisters r->d[0], r->d[1], r->d[2], r->d[3], r->d[4], r->d[5], r->d[6], r->d[7], r->a[0], r->a[1], r->a[2], r->a[3], r->a[4], r->a[5], r->a[6], r->a[7], r->sr); +#if ENABLE_MON + char *arg[2] = {"rmon", NULL}; + mon(1, arg); +#endif QuitEmulator(); break; }