fix prng_scale16() not actually scaling

wrong type. oops.
This commit is contained in:
true 2024-08-06 00:56:30 -07:00
parent 6ca388b6c3
commit 411d46531d
2 changed files with 2 additions and 3 deletions

View File

@ -418,8 +418,7 @@ static void pep_6_random(uint8_t tick)
rand_flash_timeout--;
if (!rand_timeout) {
rand_timeout = prng_scale16(20, 150);
rand_timeout <<= 7;
rand_timeout = prng_scale16(20*128, 150*128);
rand_program = 6 * prng_get8();
rand_program >>= 8;

View File

@ -151,7 +151,7 @@ static uint32_t tinymt32_temper (tinymt32_t* s)
uint16_t prng_scale16(uint16_t min, uint16_t max)
{
uint16_t rnd;
uint32_t rnd;
rnd = prng_get16();
rnd *= (max - min);