1 |
|
/* |
2 |
|
* cpu_emulation.h - Definitions for CPU emulation and Mac memory access |
3 |
|
* |
4 |
< |
* SheepShaver (C) 1997-2002 Christian Bauer and Marc Hellwig |
4 |
> |
* SheepShaver (C) 1997-2004 Christian Bauer and Marc Hellwig |
5 |
|
* |
6 |
|
* This program is free software; you can redistribute it and/or modify |
7 |
|
* it under the terms of the GNU General Public License as published by |
90 |
|
* 680x0 and PPC emulation |
91 |
|
*/ |
92 |
|
|
93 |
+ |
// 68k procedure helper to write a big endian 16-bit word |
94 |
+ |
#ifdef WORDS_BIGENDIAN |
95 |
+ |
#define PW(W) W |
96 |
+ |
#else |
97 |
+ |
#define PW(X) ((((X) >> 8) & 0xff) | (((X) & 0xff) << 8)) |
98 |
+ |
#endif |
99 |
+ |
|
100 |
+ |
// PowerPC procedure helper to write a big-endian 32-bit word |
101 |
+ |
#ifdef WORDS_BIGENDIAN |
102 |
+ |
#define PL(X) X |
103 |
+ |
#else |
104 |
+ |
#define PL(X) \ |
105 |
+ |
((((X) & 0xff000000) >> 24) | (((X) & 0x00ff0000) >> 8) | \ |
106 |
+ |
(((X) & 0x0000ff00) << 8) | (((X) & 0x000000ff) << 24)) |
107 |
+ |
#endif |
108 |
+ |
|
109 |
|
struct M68kRegisters; |
110 |
|
extern void Execute68k(uint32, M68kRegisters *r); // Execute 68k subroutine from EMUL_OP routine, must be ended with RTS |
111 |
|
extern void Execute68kTrap(uint16 trap, M68kRegisters *r); // Execute 68k A-Trap from EMUL_OP routine |
112 |
|
#if EMULATED_PPC |
113 |
|
extern void FlushCodeCache(uintptr start, uintptr end); // Invalidate emulator caches |
98 |
– |
extern void ExecuteNative(int selector); // Execute native code from EMUL_OP routine (real mode switch) |
99 |
– |
#else |
100 |
– |
extern void ExecutePPC(void (*func)(void)); // Execute PPC code from EMUL_OP routine (real mode switch) |
114 |
|
#endif |
115 |
+ |
extern void ExecuteNative(int selector); // Execute native code from EMUL_OP routine (real mode switch) |
116 |
|
|
117 |
|
#endif |