Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprite over bitplane graphics mode is offset by 1 up, 1 right #810

Open
dansanderson opened this issue Jul 17, 2024 · 1 comment
Open

Sprite over bitplane graphics mode is offset by 1 up, 1 right #810

dansanderson opened this issue Jul 17, 2024 · 1 comment

Comments

@dansanderson
Copy link
Collaborator

When a sprite is over bitplane graphics, the sprite is rendered one pixel too high and one pixel too far right. The sprite is overlapping the top or right borders by one pixel, and not reaching the bottom or left borders by one pixel.

Here's a simple joystick-controlled drawing program that illustrates the issue:

10 screen 0,320,200,5
15 sprite 0,1
20 x=100:y=100
30 pen 1
40 j=joy(2)
45 movspr 0,x+24,y+50
50 if j and 128 then dot x,y:j=j and 127
55 sleep 0.01
60 if (j=4 or j=5 or j=6) and y<199 then y=y+1
70 if (j=2 or j=3 or j=4) and x<319 then x=x+1
80 if (j=8 or j=1 or j=2) and y>0 then y=y-1
90 if (j=8 or j=7 or j=6) and x>0 then x=x-1
100 goto 40

Notice that the same program in text mode does not exhibit this issue:

15 sprite 0,1
20 x=100:y=100
40 j=joy(2)
45 movspr 0,x+24,y+50
55 sleep 0.01
60 if (j=4 or j=5 or j=6) and y<199 then y=y+1
70 if (j=2 or j=3 or j=4) and x<319 then x=x+1
80 if (j=8 or j=1 or j=2) and y>0 then y=y-1
90 if (j=8 or j=7 or j=6) and x>0 then x=x-1
100 goto 40

This nominally sounds similar to #132 or #289 but those issues are very old and I can't tell if they're actually the same, just related, or unrelated.

@sir-lazarus
Copy link

sir-lazarus commented Dec 31, 2024

Tested with ROM V920409 beta and dev core 0.97.
This problem also occurs when the mouse sprite is visible. It is more than a pixel off.
image
I wrote a little test program to illustrate the issue. You can paint pixels on screen while pushing the left mouse button. The position should be the upper left corner of the mouse pointer, which is not.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants