Skip to content
This repository has been archived by the owner on Nov 6, 2024. It is now read-only.

Commit

Permalink
Fix showMouse hook
Browse files Browse the repository at this point in the history
  • Loading branch information
BroGamer4256 committed Jun 24, 2022
1 parent 481c4c5 commit b6c0fe4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions src/boilerplate.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#include "helpers.h"

// force show cursor
HOOK_DYNAMIC (i32, __stdcall, ShowMouse, i32 show) { return originalShowMouse (true); }

// xinput stuff
HOOK_DYNAMIC (u32, __stdcall, XinputGetState, u32 index, void *state) { return ERROR_DEVICE_NOT_CONNECTED; }
HOOK_DYNAMIC (u32, __stdcall, XinputSetState, u32 index, void *state) { return ERROR_DEVICE_NOT_CONNECTED; }
Expand Down Expand Up @@ -54,6 +57,7 @@ HOOK_DYNAMIC (i64, __fastcall, UsbFinderGetSerialNumber, i32 a1, i64 a2) { retur

void
init_boilerplate () {
INSTALL_HOOK_DYNAMIC (ShowMouse, PROC_ADDRESS ("user32.dll", "ShowCursor"));
INSTALL_HOOK_DYNAMIC (XinputGetState, PROC_ADDRESS ("xinput9_1_0.dll", "XInputGetState"));
INSTALL_HOOK_DYNAMIC (XinputSetState, PROC_ADDRESS ("xinput9_1_0.dll", "XInputSetState"));
INSTALL_HOOK_DYNAMIC (XinputGetCapabilites, PROC_ADDRESS ("xinput9_1_0.dll", "XInputGetCapabilities"));
Expand Down
13 changes: 5 additions & 8 deletions src/dllmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,23 @@
#include "helpers.h"
#include "poll.h"

// force show cursor
HOOK_DYNAMIC (i32, __stdcall, ShowMouse, i32 show) { return originalShowMouse (true); }

bool testEnabled = false;
u16 drumMax = 0xFFFF;
u16 drumMin = 0xFFFF;

#define ON_HIT(bind) IsButtonTapped (bind) ? drumMax == drumMin ? drumMax : (u16)(rand () % drumMax + drumMin) : 0

Keybindings EXIT = { .keycodes = { VK_ESCAPE } };
Keybindings COIN_ADD = { .keycodes = { VK_RETURN }, .buttons = { SDL_CONTROLLER_BUTTON_START } };
Keybindings TEST = { .keycodes = { VK_F1 } };
Keybindings SERVICE = { .keycodes = { VK_F2 } };
Keybindings DEBUG_UP = { .keycodes = { VK_UP } };
Keybindings DEBUG_DOWN = { .keycodes = { VK_DOWN } };
Keybindings DEBUG_ENTER = { .keycodes = { VK_RETURN } };
Keybindings P1_LEFT_BLUE = { .keycodes = { 'D' } };
Keybindings P1_LEFT_RED = { .keycodes = { 'F' } };
Keybindings P1_RIGHT_RED = { .keycodes = { 'J' } };
Keybindings P1_RIGHT_BLUE = { .keycodes = { 'K' } };
Keybindings COIN_ADD = { .keycodes = { VK_RETURN }, .buttons = { SDL_CONTROLLER_BUTTON_START } };
Keybindings P1_LEFT_BLUE = { .keycodes = { 'D' }, .axis = { SDL_AXIS_LTRIGGER_DOWN } };
Keybindings P1_LEFT_RED = { .keycodes = { 'F' }, .buttons = { SDL_CONTROLLER_BUTTON_LEFTSTICK } };
Keybindings P1_RIGHT_RED = { .keycodes = { 'J' }, .buttons = { SDL_CONTROLLER_BUTTON_RIGHTSTICK } };
Keybindings P1_RIGHT_BLUE = { .keycodes = { 'K' }, .axis = { SDL_AXIS_RTRIGGER_DOWN } };
Keybindings P2_LEFT_BLUE = {};
Keybindings P2_LEFT_RED = {};
Keybindings P2_RIGHT_RED = {};
Expand Down

0 comments on commit b6c0fe4

Please sign in to comment.