From 8ade3f3fd4d0b488d19a5581419ffd72be595bb9 Mon Sep 17 00:00:00 2001 From: MooZ Date: Wed, 10 Apr 2019 21:37:48 +0200 Subject: [PATCH] Fixed jr range check. --- uPD7801.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uPD7801.lua b/uPD7801.lua index 4aee978..6f02c54 100644 --- a/uPD7801.lua +++ b/uPD7801.lua @@ -242,7 +242,7 @@ M.jr = function(label) end if type(x) ~= 'number' then error("unresolved branch target: " .. tostring(x)) end x = x-1 - offset - rorg(section.org) - if x < -32 or x > 0x32 then error("branch target out of range for " .. l .. ": " .. x) + if x < -32 or x > 32 then error("branch target out of range for " .. l .. ": " .. x) elseif x >= 0 then x = 0xc0 + x return x