Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip sACPLoadOnDone when exiting Othello #29

Merged
merged 1 commit into from
Jul 30, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion source/dynload/dynload_function_replacements.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "loader_defines.h"
#include "logger.h"
#include <coreinit/dynload.h>
#include <coreinit/title.h>
#include <cstdio>
#include <cstring>
#include <wums.h>
Expand Down Expand Up @@ -161,8 +162,21 @@ DECL_FUNCTION(int32_t, sCheckOne, LOADED_RPL *rpl) {
return real_sCheckOne(rpl);
}

DECL_FUNCTION(void, sACPLoadOnDone, void) {
if (OSGetTitleID() == 0x0005000010140900L) { // オセロ (Othello)
DEBUG_FUNCTION_LINE_INFO("Skip sACPLoadOnDone for オセロ (Othello) as it might slow down exiting.");
// For some unknown reason unloading the nn_acp.rpl after playing Othello
// takes 30-100 seconds when many plugins are loaded... We take the very hacky and lazy route
// and just stop calling it and pray this won't break anything.
return;
}

return real_sACPLoadOnDone();
}

function_replacement_data_t dynload_function_replacements[] = {
REPLACE_FUNCTION_VIA_ADDRESS(__OSDynLoad_InternalAcquire, 0x32029054, 0x101C400 + 0x0cc54),
REPLACE_FUNCTION_VIA_ADDRESS(sACPLoadOnDone, 0x3201C400 + 0x29de0, 0x101C400 + 0x29de0),
REPLACE_FUNCTION_VIA_ADDRESS(__OSDynLoad_InternalAcquire, 0x3201C400 + 0x0cc54, 0x101C400 + 0x0cc54),
REPLACE_FUNCTION_VIA_ADDRESS(LiFindRPLByName, 0x32004BC4, 0x01004bc4),
REPLACE_FUNCTION_VIA_ADDRESS(LiBinSearchExport, 0x320002f8, 0x010002f8),
REPLACE_FUNCTION_VIA_ADDRESS(sCheckOne, 0x32007294, 0x01007294),
Expand Down