AgonConsole8 / agon-vdp

Official Firmware for the Agon Console8: ESP32 VDP
MIT License
38 stars 17 forks source link

fix VDU 24 #82

Closed stevesims closed 10 months ago

stevesims commented 10 months ago

VDU 24 sets the graphics viewport. essentially it sets a clipping rectangle, and that should be all it does…

this fixes a bug whereby setting the graphics viewport would also effectively change the graphics origin. this is contrary to how Acorn handles VDU 24. (additionally setting the origin using VDU 29 would make for a double-offset)

all uses of translateViewport have been changed to use translateCanvas instead. this should make behaviour more understandable, and more predictable, and consistent with Acorn.

besides fixing the observed VDU 24 issue, this PR changes the behaviour of two other commands so that they now both work strictly relative to the defined graphics origin, ignoring the defined graphics clipping rectangle/viewport. those changes apply to VDU 23,0,&89,4,x;t; which sets the mouse cursor position, and the “get pixel” command VDU 23,0,&84,x;y;

fixes breakintoprogram/agon-vdp#71