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