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

FB_set_pixels crashes when count > 255 #179

Closed
irmen opened this issue Dec 10, 2020 · 3 comments · Fixed by #180
Closed

FB_set_pixels crashes when count > 255 #179

irmen opened this issue Dec 10, 2020 · 3 comments · Fixed by #180

Comments

@irmen
Copy link
Contributor

irmen commented Dec 10, 2020

FB_set_pixels with a count of 256 or more crashes.
I think it's caused by the jsr that it's doing internally and that it is not properly dealing with the double loop invocation or some thing.

What confuses me is that FB_set_pixels is defined twice:


and also here
FB_set_pixels:

@greg-king5
Copy link

What confuses me is that FB_set_pixels: is defined twice:

; XXX This code is incomplete and not currently included in the build.

Ignore that file.

@greg-king5
Copy link

FB_set_pixels with a count of 256 or more crashes.

It's caused by the PopB lines in the inner loop -- that's the wrong place. When the count's high-byte is non-zero, they "eat" the stack! The pseudo-registers must be handled in the same way that FB_get_pixels does it:

FB_get_pixels:
PushB r0H
PushB r1H
jsr get_pixels_FG
PopB r1H
PopB r0H
rts
.

@irmen
Copy link
Contributor Author

irmen commented Dec 10, 2020

That looks like something I can attempt to make a fix and a PR for later this week or in the weekend perhaps.

edit: fix was made #180

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

Successfully merging a pull request may close this issue.

2 participants