From 6376c091cf1b5f320a4166171780055328043199 Mon Sep 17 00:00:00 2001 From: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com> Date: Tue, 4 Feb 2025 10:21:35 -0800 Subject: [PATCH] Don't use zero[7] in ines header Looks like this byte was used as some indicator a ripper put their name within the header, and as a response make the ROM unusable within quickNES. This byte has no defined meaning in iNES, but it does for NES 2.0 (although that can safely be ignored here) --- source/quickerNES/core/cart.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/quickerNES/core/cart.hpp b/source/quickerNES/core/cart.hpp index abf1a42..ccd61f4 100644 --- a/source/quickerNES/core/cart.hpp +++ b/source/quickerNES/core/cart.hpp @@ -34,7 +34,7 @@ class Cart uint8_t chr_count; // number of 8K CHR banks uint8_t flags; // MMMM FTBV Mapper low, Four-screen, Trainer, Battery, V mirror uint8_t flags2; // MMMM --XX Mapper high 4 bits - uint8_t zero[8]; // if zero [7] is non-zero, treat flags2 as zero + uint8_t zero[8]; }; static_assert(sizeof(ines_header_t) == 16); @@ -49,7 +49,7 @@ class Cart memcpy(&h, &buffer[bufferPos], copySize); bufferPos += copySize; } - if (h.zero[7]) h.flags2 = 0; + set_mapper(h.flags, h.flags2); // skip trainer @@ -114,4 +114,4 @@ class Cart unsigned mapper; }; -} // namespace quickerNES \ No newline at end of file +} // namespace quickerNES