Skip to content

fix VDU 24#131

Merged
breakintoprogram merged 1 commit intobreakintoprogram:mainfrom
stevesims:upstream-fix-vdu24
Nov 6, 2023
Merged

fix VDU 24#131
breakintoprogram merged 1 commit intobreakintoprogram:mainfrom
stevesims:upstream-fix-vdu24

Conversation

@stevesims
Copy link
Copy Markdown
Contributor

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 #71

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;`
@breakintoprogram breakintoprogram added the bug Something isn't working label Nov 5, 2023
@breakintoprogram breakintoprogram self-assigned this Nov 6, 2023
@breakintoprogram breakintoprogram merged commit 5587f7b into breakintoprogram:main Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

VDU 24 behaves differently from original BBC BASIC

2 participants