67 |
|
|
68 |
|
void EmulOp(M68kRegisters *r, uint32 pc, int selector) |
69 |
|
{ |
70 |
– |
|
70 |
|
D(bug("EmulOp %04x at %08x\n", selector, pc)); |
71 |
|
switch (selector) { |
72 |
|
case OP_BREAK: // Breakpoint |
257 |
|
// Install drivers |
258 |
|
InstallDrivers(); |
259 |
|
|
261 |
– |
#if !EMULATED_PPC |
260 |
|
// Patch MakeExecutable() |
261 |
|
MakeExecutableTvec = (uint32 *)FindLibSymbol("\023PrivateInterfaceLib", "\016MakeExecutable"); |
262 |
|
D(bug("MakeExecutable TVECT at %p\n", MakeExecutableTvec)); |
263 |
+ |
#if EMULATED_PPC |
264 |
+ |
MakeExecutableTvec[0] = POWERPC_NATIVE_OP_FUNC(NATIVE_MAKE_EXECUTABLE); |
265 |
+ |
#else |
266 |
|
#ifdef __BEOS__ |
267 |
|
MakeExecutableTvec[0] = ((uint32 *)MakeExecutable)[0]; |
268 |
|
#else |
272 |
|
#endif |
273 |
|
|
274 |
|
// Patch DebugStr() |
275 |
< |
static const uint16 proc[] = { |
276 |
< |
M68K_EMUL_OP_DEBUG_STR, |
277 |
< |
0x4e74, // rtd #4 |
278 |
< |
0x0004 |
275 |
> |
static const uint8 proc[] = { |
276 |
> |
M68K_EMUL_OP_DEBUG_STR >> 8, M68K_EMUL_OP_DEBUG_STR & 0xff, |
277 |
> |
0x4e, 0x74, // rtd #4 |
278 |
> |
0x00, 0x04 |
279 |
|
}; |
280 |
|
WriteMacInt32(0x1dfc, (uint32)proc); |
281 |
|
break; |
312 |
|
#if !PRECISE_TIMING |
313 |
|
TimerInterrupt(); |
314 |
|
#endif |
315 |
+ |
#if EMULATED_PPC |
316 |
+ |
ExecuteNative(NATIVE_VIDEO_VBL); |
317 |
+ |
#else |
318 |
|
ExecutePPC(VideoVBL); |
319 |
+ |
#endif |
320 |
|
|
321 |
|
static int tick_counter = 0; |
322 |
|
if (++tick_counter >= 60) { |
334 |
|
} |
335 |
|
if (InterruptFlags & INTFLAG_ETHER) { |
336 |
|
ClearInterruptFlag(INTFLAG_ETHER); |
337 |
+ |
#if EMULATED_PPC |
338 |
+ |
ExecuteNative(NATIVE_ETHER_IRQ); |
339 |
+ |
#else |
340 |
|
ExecutePPC(EtherIRQ); |
341 |
+ |
#endif |
342 |
|
} |
343 |
|
if (InterruptFlags & INTFLAG_TIMER) { |
344 |
|
ClearInterruptFlag(INTFLAG_TIMER); |