X16Community / x16-rom

Other
43 stars 27 forks source link

[KERNAL] fix old CBM porting bug which assumed color variable was 0-15 for unconditional branch #339

Closed mooinglemur closed 3 months ago

mooinglemur commented 3 months ago

The original C64 code did this

image

The color variable on C64 is limited to 0-15, so the location is always positive. The original C64 source code was using bpl as an unconditional branch. The X16 uses the high nibble for the background color (or colors >= $80 in T256C mode), so this is no longer a good assumption.

In the course of X16 development, the branch became too far away, so the sense was inverted, but the logic was still incorrect.

Changed it to a jmp instead.

Closes #338