If <condition>
<small code: < 128 bytes>
Else
While <condition>
<large code: > 127 bytes>
End
End
Result: the While <condition> injects a JP to its End, but the If <condition> uses a JR to its Else part, causing to move the entire While code 2 bytes up, which clearly makes the JP invalid.
Result: the
While <condition>
injects a JP to its End, but theIf <condition>
uses a JR to its Else part, causing to move the entire While code 2 bytes up, which clearly makes the JP invalid.Thanks @TheLastMillennial for finding the bug!