lgblgblgb / xemu

Emulations (running on Linux/Unix/Windows/macOS, utilizing SDL2) of some - mainly - 8 bit machines, including the Commodore LCD, Commodore 65, and the MEGA65 as well.
https://github.com/lgblgblgb/xemu/wiki
GNU General Public License v2.0
208 stars 32 forks source link

M65: fix crash + proper trigger on $D05C/$D05D change #301 #305

Closed hernandp closed 3 years ago

hernandp commented 3 years ago

Ok, I confirm crash is not longer occurring, both by inspecting proper output and by using address sanitizer (which always crashed with a dump).

Now:

VIC: Write $005d SIDEBORDER/HOTREG: $ff
VIC4: set border left=400, right=400, textxpos=80

with bugged version this was:

VIC: Write $005d SIDEBORDER/HOTREG: $ff
VIC4: set border left=16208, right=-15408, textxpos=4095

2) Additionally, this PR includes proper handling of Sideborder register change. Before, it was triggered only with HOTREG change, but this was not correct (I confirmed empirically with hardware and VHDL). In other words, you can always trigger sideborder change without HOTREG first.

Thanks.