Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user eightbitswide ! (Registered 2024-12-24) You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Sprite problem (rasters)
2005-06-24 00:40
Wanderer
Account closed

Registered: Apr 2003
Posts: 478
Sprite problem (rasters)

Hi.

Here's my problem... I have 8 sprites on the screen. When they are motionless, they are fine. When I attempt to move them left (scrolling) they shake. The same goes for a sprite scroll routine in another demo I'm working on.

It looks like its the raster because it moves from the top of the sprites to the bottom (they are arranged on top of one another in a stack).

I've tried moving the routine that moves the sprites when the raster is below them or above them and even while it's updating the sprites.

It still shakes... it only does so maybe once every 4 seconds so it isn't every cycle. I don't know why this is happening..

Help?! :)

(This is on CCS64 with auto refresh rate, maybe it's the emulator??)
2005-06-24 02:47
Wanderer
Account closed

Registered: Apr 2003
Posts: 478
Quote: Hi.

Here's my problem... I have 8 sprites on the screen. When they are motionless, they are fine. When I attempt to move them left (scrolling) they shake. The same goes for a sprite scroll routine in another demo I'm working on.

It looks like its the raster because it moves from the top of the sprites to the bottom (they are arranged on top of one another in a stack).

I've tried moving the routine that moves the sprites when the raster is below them or above them and even while it's updating the sprites.

It still shakes... it only does so maybe once every 4 seconds so it isn't every cycle. I don't know why this is happening..

Help?! :)

(This is on CCS64 with auto refresh rate, maybe it's the emulator??)


Hrm.. it works under my Win2000 machine but on another machine it flickers something bad. I don't think this is a 'code' problem so much as it is the PC it's being coded on.

/me walks away feeling silly
2005-06-24 03:40
anix
Account closed

Registered: Feb 2004
Posts: 35
if it's NTSC (right?) then one machine is 60hz and looks correct, and your other machine must be 70,72,75... and will be ugly.
2005-06-24 07:34
Krill

Registered: Apr 2002
Posts: 2980
code oldschool effects on the real thing and new school effects on the pc, that's how i do it ;) prevents from ugly "bugs" that are caused by mismatching refresh rates =)
2005-06-24 08:23
Radiant

Registered: Sep 2004
Posts: 639
Actually, the problem with flickering graphics in emulators is unresolvable in most modern non-realtime OS's. It is due to the fact that it is impossible for a process/thread to be guaranteed to be running while the vertical retrace occurs, thus generating some jerkiness in the graphics even when syncing with the retrace.

So never judge the smoothness of your routines on an emulator - use the real machine for that, or an emulator in a realtime OS, or in an environment without context switches (such as DOS ;-) ).
2005-06-24 09:54
Graham
Account closed

Registered: Dec 2002
Posts: 990
AmigaOS shows that it is possible to do in a multitasking environment. The problem with PCs is the total ignorance towards such things from the side of the OS authors (both, linux and windows).

There are two ways how such thing could be solved: Via vertical blank irqs or for a "wait for vertical blank" which doesn't use a busy loop and REALLY puts the task on sleep until a vertical blank is reached. Also a simple frame counter would solve a lot of jerkyness problems...
2005-06-24 13:28
Radiant

Registered: Sep 2004
Posts: 639
Quote: AmigaOS shows that it is possible to do in a multitasking environment. The problem with PCs is the total ignorance towards such things from the side of the OS authors (both, linux and windows).

There are two ways how such thing could be solved: Via vertical blank irqs or for a "wait for vertical blank" which doesn't use a busy loop and REALLY puts the task on sleep until a vertical blank is reached. Also a simple frame counter would solve a lot of jerkyness problems...


Yes, that's why I wrote "most modern non-realtime OS's". ;-)

Indeed, a blocking call to wait for the next vertical blank would be awesome, and is the thing I most often mention when people ask me what I'm not satisfied with in Linux/Windows (yes, it happens all the time, really :-P).
2005-06-24 15:31
cadaver

Registered: Feb 2002
Posts: 1160
From memory, when you use triplebuffering in directdraw, the program (displaydriver) blocks until it can flip the buffers for the next time. This way you can get stable animation on each screen refresh, and it's just as good as waiting for the vertical retrace. But the refresh rate most probably isn't right (50.12Hz)
2005-06-24 15:37
Graham
Account closed

Registered: Dec 2002
Posts: 990
That is not the Problem. Ofcourse you have some functions which sync to the vertical blank (IDirectDraw4::WaitForVerticalBlank), but they do it with a busy loop eating up 100% cpu time. Also, if there is a task switch short before the vertical blank, the routine will not wait 1 but 2 frames... theoretically this could happen the 2nd frame also etc etc.
2005-06-24 15:54
cadaver

Registered: Feb 2002
Posts: 1160
Mmm, I still think the problem is mostly with coding of emulators. Just tested CCS64 V3, you can use a custom screen refresh rate, but the problem is that it systematically hiccups every time the difference between C64 refresh and screen refresh generates an extra frame. The multitasking isn't causing the problem, but the fact that CCS doesn't have balls to "cheat" and clamp the execution rate to the screen.

EDIT: Aha, by setting sync to "unlimited" it actually clamps the update exactly to screen refresh, so you get gloriously smooth screen update. But now it's going far too fast :( Maybe 50 Hz custom refresh isn't really anywhere near 50 Hz (at least for me...)

2005-06-24 17:30
Tch
Account closed

Registered: Sep 2004
Posts: 512
Hmmm,strange..

I have made a routine involving many sprites and there is no flickering whatsoever.
It uses close to every x-position on the screen.
I made it completely using Winvice (V1.14) with the refresh-rate set to "auto".
According to this thread,it ought to bug.

Maybe it is because I use Windows XP?
Could be as Slay Radio bugs when I run Vice in Warp-mode,stealing all my "rastertime". :P
Or maybe it will bug on a real C64..
 
... 7 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
doctorfargo/Binary L..
Guests online: 100
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 X-Mas Demo 2024  (9.5)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.038 sec.