ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/emul_op.cpp
(Generate patch)

Comparing SheepShaver/src/emul_op.cpp (file contents):
Revision 1.8 by cebix, 2004-01-12T15:37:18Z vs.
Revision 1.13 by gbeauche, 2004-06-03T21:52:54Z

# Line 287 | Line 287 | void EmulOp(M68kRegisters *r, uint32 pc,
287                          TimerReset();
288                          MacOSUtilReset();
289                          AudioReset();
290 < #if 0
291 <                        printf("DR activated\n");
292 <                        WriteMacInt32(KernelDataAddr + 0x17a0, 3);              // Prepare for DR emulator activation
293 <                        WriteMacInt32(KernelDataAddr + 0x17c0, DR_CACHE_BASE);
294 <                        WriteMacInt32(KernelDataAddr + 0x17c4, DR_CACHE_SIZE);
295 <                        WriteMacInt32(KernelDataAddr + 0x1b00, DR_CACHE_BASE + 0x10000);
296 <                        memcpy((void *)(DR_CACHE_BASE + 0x10000), (void *)(ROM_BASE + 0x370000), 0x10000);
297 <                        clear_caches((void *)(DR_CACHE_BASE + 0x10000), 0x10000, B_INVALIDATE_ICACHE | B_FLUSH_DCACHE);
298 < #endif
290 >
291 >                        // Enable DR emulator
292 >                        if (PrefsFindBool("jit68k")) {
293 >                                D(bug("DR activated\n"));
294 >                                WriteMacInt32(KernelDataAddr + 0x17a0, 3);              // Prepare for DR emulator activation
295 >                                WriteMacInt32(KernelDataAddr + 0x17c0, DR_CACHE_BASE);
296 >                                WriteMacInt32(KernelDataAddr + 0x17c4, DR_CACHE_SIZE);
297 >                                WriteMacInt32(KernelDataAddr + 0x1b04, DR_CACHE_BASE);
298 >                                WriteMacInt32(KernelDataAddr + 0x1b00, DR_EMULATOR_BASE);
299 >                                memcpy((void *)DR_EMULATOR_BASE, (void *)(ROM_BASE + 0x370000), DR_EMULATOR_SIZE);
300 >                                MakeExecutable(0, (void *)DR_EMULATOR_BASE, DR_EMULATOR_SIZE);
301 >                        }
302                          break;
303  
304                  case OP_IRQ:                    // Level 1 interrupt
# Line 456 | Line 459 | void EmulOp(M68kRegisters *r, uint32 pc,
459                          break;
460  
461                  case OP_IDLE_TIME:
459 #if __BEOS__
462                          // Sleep if no events pending
463 <                        if (ReadMacInt32(0x14c) == 0) {
464 <                                sleep(16667);
463 <                        }
464 < #endif
463 >                        if (ReadMacInt32(0x14c) == 0)
464 >                                Delay_usec(16667);
465                          r->a[0] = ReadMacInt32(0x2b6);
466                          break;
467  
468 +                case OP_IDLE_TIME_2:
469 +                        // Sleep if no events pending
470 +                        if (ReadMacInt32(0x14c) == 0)
471 +                                Delay_usec(16667);
472 +                        r->d[0] = (uint32)-2;
473 +                        break;
474 +
475                  default:
476                          printf("FATAL: EMUL_OP called with bogus selector %08x\n", selector);
477                          QuitEmulator();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines