From 2f9d25df05a75fa4075167a8f93017d74167ab4f Mon Sep 17 00:00:00 2001 From: CrazyRedMachine Date: Sun, 3 Sep 2023 14:23:51 +0200 Subject: [PATCH] wip reoptim --- popnhax/dllmain.cc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/popnhax/dllmain.cc b/popnhax/dllmain.cc index 83760a8..3553ad4 100644 --- a/popnhax/dllmain.cc +++ b/popnhax/dllmain.cc @@ -2202,6 +2202,19 @@ static bool patch_add_to_base_offset(int8_t delta) { bool g_enhanced_poll_ready = false; int (*usbPadRead)(uint32_t*); + +#pragma GCC push_options +#pragma GCC optimize ("O0") +static void __inline wait_a_little() +{ + int j=0; + for (int i=0; i<450000; i++) + { + j++; + } +} +#pragma GCC pop_options + uint32_t g_poll_rate_avg = 0; uint32_t g_last_button_state = 0; uint8_t g_debounce = 0; @@ -2243,7 +2256,7 @@ static unsigned int __stdcall enhanced_polling_stats_proc(void *ctx) if (curr_poll_time == prev_poll_time) { curr_poll_time++; - Sleep(1); + wait_a_little(); } prev_poll_time = curr_poll_time;