From 9068403d56b319c73c81e461aceea2b3dad9ae95 Mon Sep 17 00:00:00 2001 From: KallDrexx Date: Sun, 28 Sep 2025 21:16:37 -0400 Subject: [PATCH] Fix 16KB roms not decompiling Roms with only 16KB of program code had the incorrect base address during the disassembly process. This caused the instructions not to be found. Fixed by making sure the base address is adjusted based on the prgRomData size. --- NESDecompiler.Core/Disassembly/Disassembler.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NESDecompiler.Core/Disassembly/Disassembler.cs b/NESDecompiler.Core/Disassembly/Disassembler.cs index 80f86d3..edfa66d 100644 --- a/NESDecompiler.Core/Disassembly/Disassembler.cs +++ b/NESDecompiler.Core/Disassembly/Disassembler.cs @@ -230,7 +230,8 @@ namespace NESDecompiler.Core.Disassembly { try { - ushort baseAddress = 0x8000; + // ushort baseAddress = 0x8000; + ushort baseAddress = (ushort)(0x10000 - romInfo.PRGROMSize); while (offset < codeData.Length) {