ref: d3c0956455d1545759e2124606196189c7ab3ce6
parent: 8995d8ad4f5f496f5abca5b971974ba35a142a2d
author: Snesrev <snesrev@protonmail.com>
date: Thu Sep 29 21:32:17 EDT 2022
Fix recently introduced hud gfx glitch
--- a/hud.c
+++ b/hud.c
@@ -1401,6 +1401,14 @@
}
void Hud_Rebuild() { // 8dfa70
+ // Ensure all of the 165 hud words are initialized.
+ // This was broken by my previous reorg... quick fix for now.
+ if (hud_tile_indices_buffer[HUDXY(8, 2)] == 0) {
+ for (int i = 0; i < 165; i++)
+ hud_tile_indices_buffer[i] = 0x207f;
+ }
+
+
// The magic meter and item box
static const uint16 kHudTilemapLeftPart[8 * 6] = {
0x207f, 0x207f, 0x2850, 0xa856, 0x2852, 0x285b, 0x285b, 0x285c,
--- a/nmi.c
+++ b/nmi.c
@@ -237,7 +237,7 @@
}
if (flag_update_hud_in_nmi) {
- memcpy(&g_zenv.vram[word_7E0219], hud_tile_indices_buffer, 0x14a);
+ memcpy(&g_zenv.vram[word_7E0219], hud_tile_indices_buffer, 165 * sizeof(uint16));
}
if (flag_update_cgram_in_nmi) {