-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Splitted the function patcher into mutiple files and..
changed the logging to UDP logging. - updated to newest controller patcher (improves deadzone handling)
- Loading branch information
Showing
27 changed files
with
2,317 additions
and
2,035 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule controller_patcher
updated
6 files
+13 −0 | README.md | |
+1 −1 | config_reader.cpp | |
+1 −1 | config_reader.h | |
+26 −10 | controller_patcher.c | |
+1 −2 | controller_patcher.h | |
+6 −6 | pad_const.c |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#include <stdio.h> | ||
#include "aoc_patcher.h" | ||
#include "common/retain_vars.h" | ||
#include "controller_patcher/cp_retain_vars.h" | ||
|
||
DECL(int, ACPGetAddOnUniqueId, unsigned int * id_buffer, int buffer_size) | ||
{ | ||
int result = real_ACPGetAddOnUniqueId(id_buffer, buffer_size); | ||
|
||
if(GAME_LAUNCHED && gEnableDLC) | ||
{ | ||
id_buffer[0] = (cosAppXmlInfoStruct.title_id >> 8) & 0xffff; | ||
result = 0; | ||
} | ||
|
||
return result; | ||
} | ||
|
||
DECL(int, AOC_OpenTitle, char * path, void * target, void * buffer, unsigned int buffer_size) | ||
{ | ||
int result = real_AOC_OpenTitle(path, target, buffer, buffer_size); | ||
|
||
if(GAME_LAUNCHED && gEnableDLC && (result != 0)) | ||
{ | ||
sprintf(path, "/vol/aoc0005000c%08x", (u32)(cosAppXmlInfoStruct.title_id & 0xffffffff)); | ||
result = 0; | ||
} | ||
return result; | ||
} | ||
|
||
/* ***************************************************************************** | ||
* Creates function pointer array | ||
* ****************************************************************************/ | ||
|
||
hooks_magic_t method_hooks_aoc[] __attribute__((section(".data"))) = { | ||
MAKE_MAGIC(AOC_OpenTitle, LIB_AOC,DYNAMIC_FUNCTION), | ||
MAKE_MAGIC(ACPGetAddOnUniqueId, LIB_NN_ACP,DYNAMIC_FUNCTION), | ||
}; | ||
|
||
|
||
u32 method_hooks_size_aoc __attribute__((section(".data"))) = sizeof(method_hooks_aoc) / sizeof(hooks_magic_t); | ||
|
||
//! buffer to store our instructions needed for our replacements | ||
volatile unsigned int method_calls_aoc[sizeof(method_hooks_aoc) / sizeof(hooks_magic_t) * FUNCTION_PATCHER_METHOD_STORE_SIZE] __attribute__((section(".data"))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef _AOC_FUNCTION_PATCHER_H | ||
#define _AOC_FUNCTION_PATCHER_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include "utils/function_patcher.h" | ||
#include "common/kernel_defs.h" | ||
|
||
extern hooks_magic_t method_hooks_aoc[]; | ||
extern u32 method_hooks_size_aoc; | ||
extern volatile unsigned int method_calls_aoc[]; | ||
|
||
extern ReducedCosAppXmlInfo cosAppXmlInfoStruct; | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* _AOC_FUNCTION_PATCHER_H */ |
Oops, something went wrong.