09 August 2023, 20:15 | #1 |
Registered User
Join Date: Aug 2019
Location: PL
Posts: 15
|
Unstable bob rendering
Hi!
I'm learning how to draw bobs using graphics.library. I've modified the bob.c example from the RKM Companion disk 1 to render a bob on a custom screen but it behaves inconsistently from run to run. Everything works fine when I use the original bob dimensions, which are 32 pixels (2 words) by 4 lines. However, when I reduce the width of the bob (and its data) to 1 word the program behaves inconsistently. Sometimes it renders fine and sometimes it doesn't render the bob and when trying to run it again - hangs the Amiga. My guess is the program is corrupting the memory somehow but I don't know how. I'm using animtools.c from Commodore, which does the allocations. Here is a small reproduction program - buildable with SAS/C 6.50: https://github.com/dgaw/bobex/blob/main/bobex.c#L27 What am I doing wrong? I will appreciate any tips! The correct result looks like this: But sometimes it doesn't render the bob: |
10 August 2023, 17:21 | #2 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,231
|
It probably does draw the bob, though you do not see it because the main loop is so fast that, at the time the bob is draw, electron beam has already reached a position below the bob, and on the next iteration it is cleared again. You could try to add another WaitTOF() before SortGList() to see the bob for at least one frame.
|
22 August 2023, 10:57 | #3 |
Registered User
Join Date: Aug 2019
Location: PL
Posts: 15
|
The problem turned out to be a wrong raster depth in the NEWBOB structure: https://github.com/dgaw/bobex/blob/main/bobex.c#L56
I specified 2 bitplanes (which is what the bob uses) while apparently it should be the depth of the screen, which is 4 bitplanes. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
What can I do to speed up Workbench rendering? | cjard | support.WinUAE | 7 | 17 May 2020 17:48 |
octamed wav rendering | potato | request.Music | 5 | 25 November 2014 16:32 |
Bob's Bad Day - ... no Bob. | AB Positive | support.Games | 5 | 16 May 2009 01:45 |
rendering under wb 1.3 | _ThEcRoW | request.Apps | 2 | 02 October 2005 17:23 |
Slow rendering of windows! please help! | devilstar | support.WinUAE | 3 | 14 June 2003 10:13 |
|
|