From 483a0635155c73c6d3f9f9dbc21fd0d8e5056438 Mon Sep 17 00:00:00 2001 From: KallDrexx Date: Fri, 17 Oct 2025 20:26:15 -0400 Subject: [PATCH] Decompilation should be possible from the first byte of a code region --- NESDecompiler.Core/Decompilation/FunctionDecompiler.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NESDecompiler.Core/Decompilation/FunctionDecompiler.cs b/NESDecompiler.Core/Decompilation/FunctionDecompiler.cs index faab97b..160a4fb 100644 --- a/NESDecompiler.Core/Decompilation/FunctionDecompiler.cs +++ b/NESDecompiler.Core/Decompilation/FunctionDecompiler.cs @@ -104,7 +104,7 @@ public static DecompiledFunction Decompile(ushort functionAddress, IReadOnlyList private static DisassembledInstruction? GetNextInstruction(ushort address, IReadOnlyList regions) { var relevantRegion = regions - .Where(x => x.BaseAddress < address) + .Where(x => x.BaseAddress <= address) .Where(x => x.BaseAddress + x.Bytes.Length > address) .FirstOrDefault();