51 |
|
NATIVE_GET_IND_RESOURCE, |
52 |
|
NATIVE_GET_1_IND_RESOURCE, |
53 |
|
NATIVE_R_GET_RESOURCE, |
54 |
– |
NATIVE_DISABLE_INTERRUPT, |
55 |
– |
NATIVE_ENABLE_INTERRUPT, |
54 |
|
NATIVE_MAKE_EXECUTABLE, |
55 |
+ |
NATIVE_CHECK_LOAD_INVOC, |
56 |
+ |
NATIVE_SYNC_HOOK, |
57 |
+ |
NATIVE_BITBLT_HOOK, |
58 |
+ |
NATIVE_FILLRECT_HOOK, |
59 |
+ |
NATIVE_BITBLT, |
60 |
+ |
NATIVE_INVRECT, |
61 |
+ |
NATIVE_FILLRECT, |
62 |
|
NATIVE_OP_MAX |
63 |
|
}; |
64 |
|
|
65 |
|
// Initialize the thunks system |
66 |
|
extern bool ThunksInit(void); |
67 |
|
|
68 |
+ |
// Exit the thunks system |
69 |
+ |
extern void ThunksExit(void); |
70 |
+ |
|
71 |
|
// Return the fake PowerPC opcode to handle specified native code |
72 |
|
#if EMULATED_PPC |
73 |
|
extern uint32 NativeOpcode(int selector); |
79 |
|
// Return the native function address |
80 |
|
extern uint32 NativeFunction(int selector); |
81 |
|
|
82 |
+ |
// Return the routine descriptor address of the native function |
83 |
+ |
extern uint32 NativeRoutineDescriptor(int selector); |
84 |
+ |
|
85 |
|
|
86 |
|
/* |
87 |
|
* Helpers to share 32-bit addressable data with MacOS |
90 |
|
class SheepMem { |
91 |
|
static uint32 align(uint32 size); |
92 |
|
protected: |
93 |
+ |
static uint32 page_size; |
94 |
|
static uintptr zero_page; |
95 |
|
static uintptr base; |
96 |
|
static uintptr top; |
97 |
< |
static const uint32 size = 0x40000; |
97 |
> |
static const uint32 size = 0x40000; // 256 KB |
98 |
|
public: |
99 |
|
static bool Init(void); |
100 |
|
static void Exit(void); |
101 |
+ |
static uint32 PageSize(); |
102 |
|
static uintptr ZeroPage(); |
103 |
|
static uintptr Reserve(uint32 size); |
104 |
|
static void Release(uint32 size); |
111 |
|
return (size + 3) & -4; |
112 |
|
} |
113 |
|
|
114 |
+ |
inline uint32 SheepMem::PageSize() |
115 |
+ |
{ |
116 |
+ |
return page_size; |
117 |
+ |
} |
118 |
+ |
|
119 |
|
inline uintptr SheepMem::ZeroPage() |
120 |
|
{ |
121 |
|
return zero_page; |