From 3c5855b64aeb5880ac4c1dbfa8453ed6bb393be9 Mon Sep 17 00:00:00 2001 From: Eidolon Date: Mon, 7 Nov 2022 19:38:30 -0600 Subject: [PATCH] Uncap sound test --- src/m_menu.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 673725773..b32561e9a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7670,7 +7670,7 @@ static void M_HandleEmblemHints(INT32 choice) static musicdef_t *curplaying = NULL; static INT32 st_sel = 0, st_cc = 0; -static tic_t st_time = 0; +static fixed_t st_time = 0; static patch_t* st_radio[9]; static patch_t* st_launchpad[4]; @@ -7734,16 +7734,17 @@ static void M_DrawSoundTest(void) { if (cv_soundtest.value) { - frame[1] = (2-st_time); + frame[1] = (2 - (st_time >> FRACBITS)); frame[2] = ((cv_soundtest.value - 1) % 9); frame[3] += (((cv_soundtest.value - 1) / 9) % (FIRSTSUPERCOLOR - frame[3])); - if (st_time < 2) - st_time++; + if (st_time < (2 << FRACBITS)) + st_time += renderdeltatics; } } else { - if (curplaying->stoppingtics && st_time >= curplaying->stoppingtics) + fixed_t stoppingtics = (fixed_t)(curplaying->stoppingtics) << FRACBITS; + if (stoppingtics && st_time >= stoppingtics) { curplaying = NULL; st_time = 0; @@ -7754,11 +7755,11 @@ static void M_DrawSoundTest(void) angle_t ang; //bpm = FixedDiv((60*TICRATE)<= (FRACUNIT>>1)) // prevent overflow jump - takes about 15 minutes of loop on the same song to reach - st_time = (work>>FRACBITS); + if (st_time >= (FRACUNIT << (FRACBITS - 2))) // prevent overflow jump - takes about 15 minutes of loop on the same song to reach + st_time = work; work = FixedDiv(work*180, bpm); frame[0] = 8-(work/(20<= i) - st_scroll %= i; + st_scroll += renderdeltatics; - x -= st_scroll; + while (st_scroll >= (i << FRACBITS)) + st_scroll -= i << FRACBITS; + + x -= st_scroll >> FRACBITS; while (x < BASEVIDWIDTH-y) x += i;