wip reoptim

This commit is contained in:
CrazyRedMachine 2023-09-03 14:23:51 +02:00
parent 848105eb27
commit 2f9d25df05

View File

@ -2202,6 +2202,19 @@ static bool patch_add_to_base_offset(int8_t delta) {
bool g_enhanced_poll_ready = false; bool g_enhanced_poll_ready = false;
int (*usbPadRead)(uint32_t*); 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_poll_rate_avg = 0;
uint32_t g_last_button_state = 0; uint32_t g_last_button_state = 0;
uint8_t g_debounce = 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) if (curr_poll_time == prev_poll_time)
{ {
curr_poll_time++; curr_poll_time++;
Sleep(1); wait_a_little();
} }
prev_poll_time = curr_poll_time; prev_poll_time = curr_poll_time;