1
0
mirror of https://github.com/pumpitupdev/pumptools.git synced 2025-01-31 11:53:45 +01:00

hook/pro: Cleanup IO hooking and use new piuio-khack module

See the comment in the code for details and reasoning.
This commit is contained in:
icex2 2021-03-19 12:33:14 +01:00
parent 0a01503227
commit df135a19b0

View File

@ -13,6 +13,7 @@
#include "hook/patch/hook-mon.h"
#include "hook/patch/piuio.h"
#include "hook/patch/piuio-exit.h"
#include "hook/patch/piuio-khack.h"
#include "hook/patch/redir.h"
#include "hook/patch/usb-emu.h"
#include "hook/patch/usb-init-fix.h"
@ -151,13 +152,26 @@ static void prohook_patch_piuio_init(struct prohook_options* options)
{
log_assert(options);
/* Hook before IO emulation */
if (options->patch.piuio.exit_test_serv) {
patch_piuio_exit_init();
}
// The order of layering the hooks is important here because of deps
// 1. Fix low level libusb thing with init
// 2. Introduce the shim layer to allow adding fakedevs required for forther software emulation
// 3. Turn the ITG 2 piuio kernel hack calls into normal piuio ctrl transfer calls
// 4. Exit module to allow exiting the game with test + service
// 5. Software emulation layer for piuio
//
// For example, the kernel hack layer takes care of removing that, so software
// emulation code doesn't have to bother with that edge case. Furthermore, it allows you
// to use the game with real hardware without any additional software emulation layers
// that have to detour to real hardware again
patch_usb_init_fix_init();
patch_usb_emu_init();
patch_piuio_khack_init();
/* Hook before PIUIO emulation */
if (options->patch.piuio.exit_test_serv) {
patch_piuio_exit_init();
}
if (options->patch.piuio.api_lib) {
char* abs_path_iolib = util_fs_get_abs_path(options->patch.piuio.api_lib);