Cleanup for PR, return old sprite tracker

This commit is contained in:
Rickey Fehr
2025-10-19 15:52:36 -07:00
parent e40f3c989f
commit 517d40c294
4 changed files with 34 additions and 27 deletions
+10 -3
View File
@@ -1,11 +1,18 @@
#include "pool.h"
#include "util.h"
void pool_bm_clear_idx(PoolBitmap *bm, int idx)
{
// Divide by 32 to get the word index
uint32_t i = idx >> 5;
uint32_t i = idx / 32;
// Get last 5-bits, same as a modulo (% 32) operation on positive numbers
uint32_t b = idx & 0x1F;
uint32_t b = idx % 32;
// Below are the "fast" forms of the above operations, respectively.
// These are more efficient, but removed for readability
// See: https://github.com/cellos51/balatro-gba/pull/132#discussion_r2365966071
//uint32_t i = idx >> 5;
//uint32_t b = idx & 0x1F;
bm->w[i] &= ~((uint32_t)1 << b);
}
@@ -32,7 +39,7 @@ int pool_bm_get_free_idx(PoolBitmap *bm)
}
}
return -1;
return UNDEFINED;
}