Fixing the .rpx build

This commit is contained in:
Maschell 2017-05-20 13:12:29 +02:00
parent 48c554a9dd
commit cd06b1b44b
2 changed files with 11 additions and 4 deletions

View File

@ -147,7 +147,7 @@ void ControllerPatcher::ResetConfig(){
ControllerPatcherUtils::getNextSlotData(&slotdata); ControllerPatcherUtils::getNextSlotData(&slotdata);
u32 switch_pro_slot = slotdata.deviceslot; u32 switch_pro_slot = slotdata.deviceslot;
gHID_LIST_SWITCH_PRO = slotdata.hidmask; gHID_LIST_SWITCH_PRO = slotdata.hidmask;
printf("ControllerPatcher::ResetConfig(line %d): Register Switch-Pro-Config. HID-Mask %s Device-Slot: %d\n",__LINE__,CPStringTools::byte_to_binary(gHID_LIST_SWITCH_PRO),switch_pro_slot); if(HID_DEBUG){ printf("ControllerPatcher::ResetConfig(line %d): Register Switch-Pro-Config. HID-Mask %s Device-Slot: %d\n",__LINE__,CPStringTools::byte_to_binary(gHID_LIST_SWITCH_PRO),switch_pro_slot); }
config_controller_hidmask[gc_slot] = gHID_LIST_GC; config_controller_hidmask[gc_slot] = gHID_LIST_GC;
@ -478,10 +478,17 @@ bool ControllerPatcher::Init(){
InitVPadFunctionPointers(); InitVPadFunctionPointers();
InitPadScoreFunctionPointers();*/ InitPadScoreFunctionPointers();*/
gSamplingCallback = (wpad_sampling_callback_t)((u32)KPADRead + 0x1F0); OSDynLoadModule padscore_handle = 0;
OSDynLoad_Acquire("padscore.rpl", &padscore_handle);
void(*KPADRead_test)();
OSDynLoad_FindExport(padscore_handle, 0, "KPADRead", (void**)&KPADRead_test);
printf("ControllerPatcher::Init(line %d): Found the KPADRead at %08X \n",__LINE__,KPADRead_test);
gSamplingCallback = (wpad_sampling_callback_t)((u32)KPADRead_test + 0x1F0);
if(*(u32*)gSamplingCallback != FIRST_INSTRUCTION_IN_SAMPLING_CALLBACK){ if(*(u32*)gSamplingCallback != FIRST_INSTRUCTION_IN_SAMPLING_CALLBACK){
gSamplingCallback = NULL;
//In Firmware <= 5.1.2 the offset changes //In Firmware <= 5.1.2 the offset changes
gSamplingCallback = (wpad_sampling_callback_t)((u32)KPADRead + 0x1F8); gSamplingCallback = (wpad_sampling_callback_t)((u32)KPADRead_test + 0x1F8);
if(*(u32*)gSamplingCallback != FIRST_INSTRUCTION_IN_SAMPLING_CALLBACK){ if(*(u32*)gSamplingCallback != FIRST_INSTRUCTION_IN_SAMPLING_CALLBACK){
//Should never happen. I looked into the padscore.rpl of ALL firmwares. //Should never happen. I looked into the padscore.rpl of ALL firmwares.
gSamplingCallback = NULL; gSamplingCallback = NULL;

View File

@ -908,7 +908,7 @@ ControllerMappingPAD * ControllerPatcherUtils::getControllerMappingByType(UContr
CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcherUtils::doSampling(u16 deviceslot,u8 padslot = 0,bool ignorePadSlot = false){ CONTROLLER_PATCHER_RESULT_OR_ERROR ControllerPatcherUtils::doSampling(u16 deviceslot,u8 padslot = 0,bool ignorePadSlot = false){
if(gSamplingCallback != NULL){ if(gSamplingCallback != NULL){
for(int i=0;i<4;i++){ for(int i=0;i<4;i++){
ControllerMappingPADInfo * padinfo = gProPadInfo[i]; ControllerMappingPADInfo * padinfo = &gControllerMapping.proController[i].pad_infos[0];
if(padinfo->active){ if(padinfo->active){
DeviceInfo device_info; DeviceInfo device_info;