Skip to content

If you let "sprites5.bbc" run for a while, then interrupt with ESC, and then CHAIN "sprites2.bbc", it can crash #13

Closed

Description

@breakintoprogram

This bug was reported by Lennart Benschop on 23/12/2023.
It shows the reboot message for Agon VPD 1.02 and then hangs

Activity

  1. converted this from a draft issue on Dec 23, 2022
  2. breakintoprogram commented on Feb 25, 2023

    @breakintoprogram
    OwnerAuthor

    I'm able to replicate this.
    Note that it does not seem to happen if you LOAD then RUN sprites_2 instead of CHAIN

  3. moved this from In Progress to QA in AGON Quark Firmwareon Feb 25, 2023
  4. breakintoprogram commented on Feb 25, 2023

    @breakintoprogram
    OwnerAuthor

    Added VDU 23,27,16 to clear the screen and reset the sprite system
    That seems to crash if called more than once after running SPRITES_5.BAS
    Indicates some issues with malloc/free, possibly the bitmaps.

  5. moved this from QA to In Progress in AGON Quark Firmwareon Feb 25, 2023
  6. moved this from In Progress to No status in AGON Quark Firmwareon Feb 25, 2023
  7. breakintoprogram commented on Mar 26, 2023

    @breakintoprogram
    OwnerAuthor

    Lennart Benschop has also noted that it crashes if running for more than a couple of minutes. I can replicate this.

    Also:
    - sprites_4.bas crashes, though it will run a lot longer before it does
    - sprites_3.bas is fine; that only has 1 frame per sprite
    - triangles.bas crashes in MODE 2 after 30 seconds or so

  8. breakintoprogram commented on Mar 26, 2023

    @breakintoprogram
    OwnerAuthor

    This is looking like the increased throughput of the comms is overflowing something in FabGL.

    Potential fix:

    - VGAController->enableBackgroundPrimitiveExecution(true)
    - VGAController->enableBackgroundPrimitiveExecution(false)

    And also:

    - Canvas->waitCompletion(false) after lengthy drawing operations like triangle, circle

  9. moved this from In Progress to QA in AGON Quark Firmwareon Mar 26, 2023
  10. moved this from QA to In Progress in AGON Quark Firmwareon Mar 26, 2023
  11. breakintoprogram commented on Mar 26, 2023

    @breakintoprogram
    OwnerAuthor

    The above fixes have not resolved the original issue. Forked this issue breakintoprogram/agon-vdp#28

  12. breakintoprogram commented on Mar 27, 2023

    @breakintoprogram
    OwnerAuthor

    The fault can be fixed in sprites_2.bas by adding an extra line (345 of the below snippet)

      320   VDU 23,27,4,I%: REM Select sprite I%
      330   VDU 23,27,5: REM Clear frames for current sprite
      340   VDU 23,27,6,0: REM Add bitmap 0 as frame 0 of sprite
      345   VDU 23,27,6,0: REM Dummy frame 1 for this sprite seems to fix the crash
      350   VDU 23,27,11: REM Show the sprite
    

    Seems to indicate an issue with the sprite engine when a sprite is assigned less frames than previous.

    Fix:

    Set the current sprite frame to 0 and make invisible when clearing the sprite(s).

  13. moved this from In Progress to QA in AGON Quark Firmwareon Mar 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions