jkotlinski / durexforth

Modern C64 Forth
Other
230 stars 28 forks source link

gfx: PEEK should switch out Kernal automatically #301

Closed rhalkyard closed 3 years ago

rhalkyard commented 3 years ago

PEEK is documented as a graphics word that can be used without any special preparation, but it assumed that the Kernal had already been switched out, causing incorrect results unless the Kernal had already been switched out before it was invoked.

For example: $10 clrcol 3 3 plot 3 3 peek . should output 16, but instead we get 0

The only use of PEEK that I could find was in PAINT inside gfx.fs itself; I have updated PAINT to work with the fixed PEEK.

Alternatively, we could simply document that PEEK must be used in conjunction with KERNAL-OUT and KERNAL-IN, but changing PEEK's behavior seems more user-friendly :)

rhalkyard commented 3 years ago

Added a CHANGELOG.md entry for the fix. Thanks!