mra_loader: fix mapping

This commit is contained in:
JOTEGO
2025-09-11 08:46:00 +02:00
committed by GitHub
parent c46f248b58
commit 7aad9e81e3

View File

@@ -250,12 +250,19 @@ static int rom_data(const uint8_t *buf, int chunk, int map, struct MD5Context *m
return 0;
map_reg = map;
bool first = true;
int gaps = 0;
for (int i = 0; i < unitlen; i++)
{
if (map_reg & 0xf)
{
offsets[bytes_in_iter] = idx + (map_reg & 0xf) - 1;
offsets[bytes_in_iter] = idx + (map_reg & 0xf) - 1 + gaps;
bytes_in_iter++;
first = false;
}
else if(!first)
{
gaps++;
}
map_reg >>= 4;
}