89 |
|
|
90 |
|
// From rsrc_patches.cpp |
91 |
|
extern "C" void check_load_invoc(uint32 type, int16 id, uint32 h); |
92 |
+ |
extern "C" void named_check_load_invoc(uint32 type, uint32 name, uint32 h); |
93 |
|
|
94 |
|
// PowerPC EmulOp to exit from emulation looop |
95 |
|
const uint32 POWERPC_EXEC_RETURN = POWERPC_EMUL_OP | 1; |
344 |
|
dg.gen_invoke_T0_T1_T2((void (*)(uint32, uint32, uint32))check_load_invoc); |
345 |
|
status = COMPILE_CODE_OK; |
346 |
|
break; |
347 |
+ |
case NATIVE_NAMED_CHECK_LOAD_INVOC: |
348 |
+ |
dg.gen_load_T0_GPR(3); |
349 |
+ |
dg.gen_load_T1_GPR(4); |
350 |
+ |
dg.gen_load_T2_GPR(5); |
351 |
+ |
dg.gen_invoke_T0_T1_T2((void (*)(uint32, uint32, uint32))named_check_load_invoc); |
352 |
+ |
status = COMPILE_CODE_OK; |
353 |
+ |
break; |
354 |
|
#endif |
355 |
< |
case NATIVE_BITBLT: |
355 |
> |
case NATIVE_NQD_BITBLT: |
356 |
|
dg.gen_load_T0_GPR(3); |
357 |
|
dg.gen_invoke_T0((void (*)(uint32))NQD_bitblt); |
358 |
|
status = COMPILE_CODE_OK; |
359 |
|
break; |
360 |
< |
case NATIVE_INVRECT: |
360 |
> |
case NATIVE_NQD_INVRECT: |
361 |
|
dg.gen_load_T0_GPR(3); |
362 |
|
dg.gen_invoke_T0((void (*)(uint32))NQD_invrect); |
363 |
|
status = COMPILE_CODE_OK; |
364 |
|
break; |
365 |
< |
case NATIVE_FILLRECT: |
365 |
> |
case NATIVE_NQD_FILLRECT: |
366 |
|
dg.gen_load_T0_GPR(3); |
367 |
|
dg.gen_invoke_T0((void (*)(uint32))NQD_fillrect); |
368 |
|
status = COMPILE_CODE_OK; |
979 |
|
} |
980 |
|
} |
981 |
|
|
974 |
– |
static void get_resource(void); |
975 |
– |
static void get_1_resource(void); |
976 |
– |
static void get_ind_resource(void); |
977 |
– |
static void get_1_ind_resource(void); |
978 |
– |
static void r_get_resource(void); |
979 |
– |
|
982 |
|
// Execute NATIVE_OP routine |
983 |
|
void sheepshaver_cpu::execute_native_op(uint32 selector) |
984 |
|
{ |
1033 |
|
case NATIVE_ETHER_RSRV: |
1034 |
|
gpr(3) = ether_rsrv((queue_t *)gpr(3)); |
1035 |
|
break; |
1036 |
< |
case NATIVE_SYNC_HOOK: |
1036 |
> |
case NATIVE_NQD_SYNC_HOOK: |
1037 |
|
gpr(3) = NQD_sync_hook(gpr(3)); |
1038 |
|
break; |
1039 |
< |
case NATIVE_BITBLT_HOOK: |
1039 |
> |
case NATIVE_NQD_BITBLT_HOOK: |
1040 |
|
gpr(3) = NQD_bitblt_hook(gpr(3)); |
1041 |
|
break; |
1042 |
< |
case NATIVE_BITBLT: |
1042 |
> |
case NATIVE_NQD_BITBLT: |
1043 |
|
NQD_bitblt(gpr(3)); |
1044 |
|
break; |
1045 |
< |
case NATIVE_FILLRECT_HOOK: |
1045 |
> |
case NATIVE_NQD_FILLRECT_HOOK: |
1046 |
|
gpr(3) = NQD_fillrect_hook(gpr(3)); |
1047 |
|
break; |
1048 |
< |
case NATIVE_INVRECT: |
1048 |
> |
case NATIVE_NQD_INVRECT: |
1049 |
|
NQD_invrect(gpr(3)); |
1050 |
|
break; |
1051 |
< |
case NATIVE_FILLRECT: |
1051 |
> |
case NATIVE_NQD_FILLRECT: |
1052 |
|
NQD_fillrect(gpr(3)); |
1053 |
|
break; |
1054 |
|
case NATIVE_SERIAL_NOTHING: |
1072 |
|
break; |
1073 |
|
} |
1074 |
|
case NATIVE_GET_RESOURCE: |
1075 |
+ |
get_resource(ReadMacInt32(XLM_GET_RESOURCE)); |
1076 |
+ |
break; |
1077 |
|
case NATIVE_GET_1_RESOURCE: |
1078 |
+ |
get_resource(ReadMacInt32(XLM_GET_1_RESOURCE)); |
1079 |
+ |
break; |
1080 |
|
case NATIVE_GET_IND_RESOURCE: |
1081 |
+ |
get_resource(ReadMacInt32(XLM_GET_IND_RESOURCE)); |
1082 |
+ |
break; |
1083 |
|
case NATIVE_GET_1_IND_RESOURCE: |
1084 |
< |
case NATIVE_R_GET_RESOURCE: { |
1085 |
< |
typedef void (*GetResourceCallback)(void); |
1086 |
< |
static const GetResourceCallback get_resource_callbacks[] = { |
1087 |
< |
::get_resource, |
1080 |
< |
::get_1_resource, |
1081 |
< |
::get_ind_resource, |
1082 |
< |
::get_1_ind_resource, |
1083 |
< |
::r_get_resource |
1084 |
< |
}; |
1085 |
< |
get_resource_callbacks[selector - NATIVE_GET_RESOURCE](); |
1084 |
> |
get_resource(ReadMacInt32(XLM_GET_1_IND_RESOURCE)); |
1085 |
> |
break; |
1086 |
> |
case NATIVE_R_GET_RESOURCE: |
1087 |
> |
get_resource(ReadMacInt32(XLM_R_GET_RESOURCE)); |
1088 |
|
break; |
1087 |
– |
} |
1089 |
|
case NATIVE_MAKE_EXECUTABLE: |
1090 |
|
MakeExecutable(0, gpr(4), gpr(5)); |
1091 |
|
break; |
1092 |
|
case NATIVE_CHECK_LOAD_INVOC: |
1093 |
|
check_load_invoc(gpr(3), gpr(4), gpr(5)); |
1094 |
|
break; |
1095 |
+ |
case NATIVE_NAMED_CHECK_LOAD_INVOC: |
1096 |
+ |
named_check_load_invoc(gpr(3), gpr(4), gpr(5)); |
1097 |
+ |
break; |
1098 |
|
default: |
1099 |
|
printf("FATAL: NATIVE_OP called with bogus selector %d\n", selector); |
1100 |
|
QuitEmulator(); |
1181 |
|
const uint32 args[] = { arg1, arg2, arg3, arg4, arg5, arg6, arg7 }; |
1182 |
|
return ppc_cpu->execute_macos_code(tvect, sizeof(args)/sizeof(args[0]), args); |
1183 |
|
} |
1180 |
– |
|
1181 |
– |
/* |
1182 |
– |
* Resource Manager thunks |
1183 |
– |
*/ |
1184 |
– |
|
1185 |
– |
void get_resource(void) |
1186 |
– |
{ |
1187 |
– |
ppc_cpu->get_resource(ReadMacInt32(XLM_GET_RESOURCE)); |
1188 |
– |
} |
1189 |
– |
|
1190 |
– |
void get_1_resource(void) |
1191 |
– |
{ |
1192 |
– |
ppc_cpu->get_resource(ReadMacInt32(XLM_GET_1_RESOURCE)); |
1193 |
– |
} |
1194 |
– |
|
1195 |
– |
void get_ind_resource(void) |
1196 |
– |
{ |
1197 |
– |
ppc_cpu->get_resource(ReadMacInt32(XLM_GET_IND_RESOURCE)); |
1198 |
– |
} |
1199 |
– |
|
1200 |
– |
void get_1_ind_resource(void) |
1201 |
– |
{ |
1202 |
– |
ppc_cpu->get_resource(ReadMacInt32(XLM_GET_1_IND_RESOURCE)); |
1203 |
– |
} |
1204 |
– |
|
1205 |
– |
void r_get_resource(void) |
1206 |
– |
{ |
1207 |
– |
ppc_cpu->get_resource(ReadMacInt32(XLM_R_GET_RESOURCE)); |
1208 |
– |
} |