Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Allow enabling or disabling extensions via config
This is necessary for at least one GMS port (Victory Heat Rally)
  • Loading branch information
JeodC committed Apr 24, 2025
commit 5dca34fe724a602f8acbfec65bb6700b24c124ab
2 changes: 2 additions & 0 deletions gmloader/configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ void from_json(const json& j, gml_config& c) {
get_if_exists("show_cursor", show_cursor);
get_if_exists("disable_controller", disable_controller);
get_if_exists("disable_depth", disable_depth);
get_if_exists("disable_extensions", disable_extensions);
get_if_exists("disable_rumble", disable_rumble);
get_if_exists("rumble_scale", rumble_scale);
get_if_exists("disable_texhack", disable_texhack);
Expand All @@ -23,6 +24,7 @@ void gml_config::init_defaults(){
show_cursor = true;
disable_controller = false;
disable_depth = false;
disable_extensions = true;
disable_rumble = false;
rumble_scale = 1.0;
disable_texhack = true; /* Disabled by default until properly tested. */
Expand Down
1 change: 1 addition & 0 deletions gmloader/configuration.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct gml_config {
bool show_cursor;
bool disable_controller;
bool disable_depth;
bool disable_extensions;
bool disable_rumble;
float rumble_scale;
bool disable_texhack;
Expand Down
10 changes: 6 additions & 4 deletions gmloader/libyoyo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,12 @@ void patch_libyoyo(so_module *mod)
FIND_SYMBOL(mod, surface_depth_disable, "_Z21F_SurfaceDepthDisableR6RValueP9CInstanceS2_iPS_");

// Disable extension support
FIND_SYMBOL(mod, Extension_Main_number, "Extension_Main_number");
//hook_symbol(mod, "_Z20Extension_Initializev", (uintptr_t)&dont_init_extensions, 1);
hook_symbol(mod, "_Z20Extension_PrePreparev", (uintptr_t)&dont_init_extensions, 1);
hook_symbol(mod, "_Z14Extension_LoadPhjS_", (uintptr_t)&dont_init_extensions, 1);
if (gmloader_config.disable_extensions == 1) {
FIND_SYMBOL(mod, Extension_Main_number, "Extension_Main_number");
//hook_symbol(mod, "_Z20Extension_Initializev", (uintptr_t)&dont_init_extensions, 1);
hook_symbol(mod, "_Z20Extension_PrePreparev", (uintptr_t)&dont_init_extensions, 1);
hook_symbol(mod, "_Z14Extension_LoadPhjS_", (uintptr_t)&dont_init_extensions, 1);
}

// Hook messages for debug
hook_symbol(mod, "_Z11ShowMessagePKc", (uintptr_t)&show_message, 1);
Expand Down