Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Better ways to stabilizing raster when sprite multiplexing
2019-07-18 03:38
ZIG

Registered: Feb 2004
Posts: 37
Better ways to stabilizing raster when sprite multiplexing

This is an odd one. I am trying to get cycle timing correct on lines that have multiple sprites at different locations in different 'frames' of screen update. It's a repetitive multiplexer effect, so every $12 screen updates I have the same configuration of sprites cutting a given raster location.

By just using a $d012 compare (instead of the second IRQ) the variability of the initial IRQ invocation (background code is running) combined with the lower cycle count per line due to sprites makes timing variability *massive* and *inconsistent* - especially when I am trying to hit a color change on a badline.

How would one get a stable raster in this situation? Is the only answer to trigger a second IRQ during the first IRQ and then on the second IRQ lookup a preconfigured delay based on the 'frame' of sprite configuration or am I missing a simpler solution?

Appreciate any ideas.
2019-07-18 07:48
Oswald

Registered: Apr 2002
Posts: 5094
faster methods use the cia timer. CIA timers count 1 tick per cpu cycle, and can count downwards continously from a given number without intervention, so if you start them at the right time they can be used to see where you are within a rasterline.


shortest CIA-stable raster


you can use then the timer value as a selfmod value to a branch, to skip the nr of cycles needed to stabling. or you can form a jmp $xxyy from the cia registers, so the irq will jump to a routine that has the exact needed delay built int.
2019-07-18 08:16
ZIG

Registered: Feb 2004
Posts: 37
This sounds very promising. Will try this out... Appreciate your reply.
2019-07-18 10:11
Oswald

Registered: Apr 2002
Posts: 5094
btw if you only have $12 type of sprite configurations you can "simply" just code a different routine set for each of the $12 possible frames.
2019-07-18 23:02
Krill

Registered: Apr 2002
Posts: 2980
If there is enough memory for two sets of sprites, i'd always go for the half-sprite technique or similar.
These allow for switching sprite patterns anywhere within the top and bottom 10 lines, without the need for cycle-exact register writes.

Doubly so for concurrent writes to switch colours, which generally does not mix well with badlines AND sprites.
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
Mike
Steffan/BOOM!
Rub_0201
Derision/Longshot
RetroGL
rexbeng
Case/Padua
Guests online: 108
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 No Listen  (9.6)
3 Party Elk 2  (9.6)
4 Cubic Dream  (9.6)
5 Copper Booze  (9.6)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (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 Triad  (9.3)
5 Censor Design  (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.