-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
sprites_4.bas causes VDP to shut down after several minutes #66
Comments
I can reproduce this easily with no special effort. Boot into BBC BASIC, "LOAD TESTS\SPRITES_4.BAS", "RUN" and wait. In Trial A I set it of and only came back after 10m; in trial E I gave up watching after ~10m but when I came back after 30m the screen was blank. For B, C and D I sat and watched with a timer running on my phone. AL2 with MOS 1.03, VDP 1.03, BBC BASIC 1.04 |
I get the same crash on the original Agon Light (one that was assembled by Bernardo himself), with sprites_4.bas, and also with sprites_5.bas |
Trying to gather more data points, I changed line 960 to 40 SW%=320-16
50 SH%=200-16 but with the usual |
This seems to be related to animating the sprite (VDU 23, 27, 8). I've removed that from the demo and all is well. |
In sprites.h, changing the function nextSpriteFrame to this seems to fix the issue
which seems to indicate an issue with |
I think I see what is happening here: This function in vdp-gl (~line 571 of displayController.h) could for a brief period increment currentFrame to an invalid frame before the if condition is triggered to reset it to 0. If a sprite were to be drawn at that point, then you'd get a guru exception.
I've modified the code locally as follows and am testing now.
|
This has now been running for over 90 minutes on my test Agon, whereas before it would last no longer than 5-10 minutes. I've issued a pull request on the vdp-gl repo here avalonbits/vdp-gl#31. |
Thanks for fixing this. Should the fix also be sent upstream to FabGL? |
excellent investigation work @breakintoprogram I'd never managed to reproduce this error when I'd tried - left sprites_4 running for many many minutes, maybe even hours before with it seemingly quite happy. the unlikely circumstance of the I've been trying to fix sprites performance to reduce flickering for the past couple of weeks, and have been incidentally trying to look out for this bug. I have seen occasional/rare crashes when testing out my revised sprites code; i had put that down to bugs in my own code, which I couldn't see, but at least some of the crashes was probably this bug 😁 |
Cool, thanks @stevesims. It's a quick fix. Ideally it should fail gracefully if an invalid sprite frame is selected. |
I suspect this is a VDP bug but since the reproducer is in BBC BASIC I've raised it here. Straightforward to reproduce:
For me, after between 1 min 30 s and 5 minutes (across 4 runs), VDP appears to shut down, the monitor no longer detects a signal and shuts off, the keyboard is unresponsive to any input e.g. to toggle caps lock or num lock. Pressing the reset button is the only way back to a usable machine.
sprites_5.bas
can also cause a shutdown but takes longer, 12 minutes on the first run, the second run lasted 16 minutes before I stopped it.MOS 1.03, VDP 1.03, BBC BASIC 1.04 on an Agon Light 2. Has been reproduced on another Agon Light 2 running the same software versions.
The text was updated successfully, but these errors were encountered: