diff --git a/README.md b/README.md index 150a66f..113dc2a 100644 --- a/README.md +++ b/README.md @@ -21,8 +21,9 @@ This is not a virus, but you probably shouldn't believe a random file on the int - You can also run or create a shortcut to `MAXWELL.exe --launch_game ..` to launch the game automatically - Check `--help` for other command line switches - `MAXWELL.dll` also works with other generic DLL injectors -- Also works with Wine 9 -- Might work with Proton, but trying to load MAXWELL through Steam will probably just make things more complicated +- Also works with Wine 9 / Proton 9 +- You can also rename `MAXWELL.dll` to `xinput9_1_0.dll` and place it next to `Animal Well.exe` to load it without the injector + - Use the Steam launch options `PROTON_USE_WINED3D=1 WINEDLLOVERRIDES="xinput9_1_0=n,b" %command%` to load this on Proton - Doesn't seem to work with some builds of Goldberg's emulator if it has overlay enabled - To fix this, create a `Animal Well/steam_settings/disable_overlay.txt` file diff --git a/dllmain.cpp b/dllmain.cpp index 677a97a..14a45ac 100644 --- a/dllmain.cpp +++ b/dllmain.cpp @@ -122,3 +122,16 @@ BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul_reason_for_call, extern "C" __declspec(dllexport) const char *dll_version() { return get_version_cstr(); } + +auto xinput = LoadLibraryA("c:\\Windows\\system32\\xinput9_1_0.dll"); +typedef DWORD(__stdcall *XInputFun)(DWORD, void *); +auto xinput_get_state = + reinterpret_cast(GetProcAddress(xinput, "XInputGetState")); +auto xinput_set_state = + reinterpret_cast(GetProcAddress(xinput, "XInputSetState")); +extern "C" __declspec(dllexport) DWORD XInputGetState(DWORD a, void *b) { + return xinput_get_state(a, b); +} +extern "C" __declspec(dllexport) DWORD XInputSetState(DWORD a, void *b) { + return xinput_set_state(a, b); +}