English Amiga Board


Go Back   English Amiga Board > Coders > Coders. System

 
 
Thread Tools
Old 09 August 2023, 20:15   #1
damex
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:
damex is offline  
Old 10 August 2023, 17:21   #2
Thomas Richter
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.
Thomas Richter is offline  
Old 22 August 2023, 10:57   #3
damex
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.
damex is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 22:46.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.08200 seconds with 13 queries