45 |
|
#include "name_registry.h" |
46 |
|
#include "user_strings.h" |
47 |
|
#include "emul_op.h" |
48 |
+ |
#include "thunks.h" |
49 |
|
|
50 |
|
#define DEBUG 0 |
51 |
|
#include "debug.h" |
261 |
|
// Patch MakeExecutable() |
262 |
|
MakeExecutableTvec = (uint32 *)FindLibSymbol("\023PrivateInterfaceLib", "\016MakeExecutable"); |
263 |
|
D(bug("MakeExecutable TVECT at %p\n", MakeExecutableTvec)); |
264 |
< |
#if EMULATED_PPC |
265 |
< |
MakeExecutableTvec[0] = POWERPC_NATIVE_OP_FUNC(NATIVE_MAKE_EXECUTABLE); |
265 |
< |
#else |
266 |
< |
#ifdef __BEOS__ |
267 |
< |
MakeExecutableTvec[0] = ((uint32 *)MakeExecutable)[0]; |
268 |
< |
#else |
269 |
< |
MakeExecutableTvec[0] = (uint32)MakeExecutable; |
270 |
< |
#endif |
264 |
> |
MakeExecutableTvec[0] = htonl(NativeFunction(NATIVE_MAKE_EXECUTABLE)); |
265 |
> |
#if !EMULATED_PPC |
266 |
|
MakeExecutableTvec[1] = (uint32)TOC; |
267 |
|
#endif |
268 |
|
|
269 |
|
// Patch DebugStr() |
270 |
< |
static const uint8 proc[] = { |
271 |
< |
M68K_EMUL_OP_DEBUG_STR >> 8, M68K_EMUL_OP_DEBUG_STR & 0xff, |
272 |
< |
0x4e, 0x74, // rtd #4 |
273 |
< |
0x00, 0x04 |
270 |
> |
static const uint16 proc[] = { |
271 |
> |
PW(M68K_EMUL_OP_DEBUG_STR), |
272 |
> |
PW(0x4e74), // rtd #4 |
273 |
> |
PW(0x0004) |
274 |
|
}; |
275 |
|
WriteMacInt32(0x1dfc, (uint32)proc); |
276 |
|
break; |
307 |
|
#if !PRECISE_TIMING |
308 |
|
TimerInterrupt(); |
309 |
|
#endif |
315 |
– |
#if EMULATED_PPC |
310 |
|
ExecuteNative(NATIVE_VIDEO_VBL); |
317 |
– |
#else |
318 |
– |
ExecutePPC(VideoVBL); |
319 |
– |
#endif |
311 |
|
|
312 |
|
static int tick_counter = 0; |
313 |
|
if (++tick_counter >= 60) { |
325 |
|
} |
326 |
|
if (InterruptFlags & INTFLAG_ETHER) { |
327 |
|
ClearInterruptFlag(INTFLAG_ETHER); |
337 |
– |
#if EMULATED_PPC |
328 |
|
ExecuteNative(NATIVE_ETHER_IRQ); |
339 |
– |
#else |
340 |
– |
ExecutePPC(EtherIRQ); |
341 |
– |
#endif |
329 |
|
} |
330 |
|
if (InterruptFlags & INTFLAG_TIMER) { |
331 |
|
ClearInterruptFlag(INTFLAG_TIMER); |