1 |
|
/* |
2 |
|
* thunks.cpp - Thunks to share data and code with MacOS |
3 |
|
* |
4 |
< |
* SheepShaver (C) 1997-2002 Christian Bauer and Marc Hellwig |
4 |
> |
* SheepShaver (C) 1997-2008 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 |
57 |
|
switch (selector) { |
58 |
|
case NATIVE_CHECK_LOAD_INVOC: |
59 |
|
case NATIVE_NAMED_CHECK_LOAD_INVOC: |
60 |
+ |
case NATIVE_NQD_SYNC_HOOK: |
61 |
+ |
case NATIVE_NQD_BITBLT_HOOK: |
62 |
+ |
case NATIVE_NQD_FILLRECT_HOOK: |
63 |
+ |
case NATIVE_NQD_UNKNOWN_HOOK: |
64 |
+ |
case NATIVE_NQD_BITBLT: |
65 |
+ |
case NATIVE_NQD_INVRECT: |
66 |
+ |
case NATIVE_NQD_FILLRECT: |
67 |
|
opcode = POWERPC_NATIVE_OP(0, selector); |
68 |
|
break; |
69 |
|
case NATIVE_PATCH_NAME_REGISTRY: |
96 |
|
case NATIVE_GET_NAMED_RESOURCE: |
97 |
|
case NATIVE_GET_1_NAMED_RESOURCE: |
98 |
|
case NATIVE_MAKE_EXECUTABLE: |
92 |
– |
case NATIVE_SYNC_HOOK: |
93 |
– |
case NATIVE_BITBLT_HOOK: |
94 |
– |
case NATIVE_FILLRECT_HOOK: |
95 |
– |
case NATIVE_BITBLT: |
96 |
– |
case NATIVE_INVRECT: |
97 |
– |
case NATIVE_FILLRECT: |
99 |
|
opcode = POWERPC_NATIVE_OP(1, selector); |
100 |
|
break; |
101 |
|
default: |
262 |
|
{ |
263 |
|
#if EMULATED_PPC |
264 |
|
for (int i = 0; i < NATIVE_OP_MAX; i++) { |
265 |
< |
uintptr base = SheepMem::Reserve(12); |
265 |
> |
uintptr base = SheepMem::Reserve(16); |
266 |
|
WriteMacInt32(base + 0, base + 8); |
267 |
|
WriteMacInt32(base + 4, 0); // Fake TVECT |
268 |
|
WriteMacInt32(base + 8, NativeOpcode(i)); |
269 |
+ |
WriteMacInt32(base + 12, POWERPC_BLR); |
270 |
|
native_op[i].tvect = base; |
271 |
|
native_op[i].func = base + 8; |
272 |
|
} |
321 |
|
DEFINE_NATIVE_OP(NATIVE_SERIAL_STATUS, SerialStatus); |
322 |
|
DEFINE_NATIVE_OP(NATIVE_SERIAL_CLOSE, SerialClose); |
323 |
|
DEFINE_NATIVE_OP(NATIVE_MAKE_EXECUTABLE, MakeExecutable); |
324 |
< |
DEFINE_NATIVE_OP(NATIVE_SYNC_HOOK, NQD_sync_hook); |
325 |
< |
DEFINE_NATIVE_OP(NATIVE_BITBLT_HOOK, NQD_bitblt_hook); |
326 |
< |
DEFINE_NATIVE_OP(NATIVE_FILLRECT_HOOK, NQD_fillrect_hook); |
327 |
< |
DEFINE_NATIVE_OP(NATIVE_BITBLT, NQD_bitblt); |
328 |
< |
DEFINE_NATIVE_OP(NATIVE_INVRECT, NQD_invrect); |
329 |
< |
DEFINE_NATIVE_OP(NATIVE_FILLRECT, NQD_fillrect); |
324 |
> |
DEFINE_NATIVE_OP(NATIVE_NQD_SYNC_HOOK, NQD_sync_hook); |
325 |
> |
DEFINE_NATIVE_OP(NATIVE_NQD_BITBLT_HOOK, NQD_bitblt_hook); |
326 |
> |
DEFINE_NATIVE_OP(NATIVE_NQD_FILLRECT_HOOK, NQD_fillrect_hook); |
327 |
> |
DEFINE_NATIVE_OP(NATIVE_NQD_UNKNOWN_HOOK, NQD_unknown_hook); |
328 |
> |
DEFINE_NATIVE_OP(NATIVE_NQD_BITBLT, NQD_bitblt); |
329 |
> |
DEFINE_NATIVE_OP(NATIVE_NQD_INVRECT, NQD_invrect); |
330 |
> |
DEFINE_NATIVE_OP(NATIVE_NQD_FILLRECT, NQD_fillrect); |
331 |
|
#undef DEFINE_NATIVE_OP |
332 |
|
#endif |
333 |
|
|