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 > Stable rasters
2003-02-04 15:47
Dr. Jay
Account closed

Registered: Jan 2003
Posts: 32
Stable rasters

Was going through some of the old code I wrote, back when I knew how to progam on the C=64, and found this routine. I think it works great. Too bad it's not precise enough (I think) to open the side borders, but it does help with stable rasters. I've seen people do these huge loops with nop / incrementing dummy locations / etc. which I think works great for timing necessary like side borders, and I've also seen code like Xbows where there are actual subroutines that are timed perfect ... anyway, my simple little routine works for rasters:

1. Get a stable raster, either with the sprite method, double interrupt, etc. Then, simply:

ldy #$00
loop lda colors,y
ldx timing,y
synch dex
bne synch
sta $d020
sta $d021
iny
cpy #16 ; number of rasters in table
bne loop

2003-02-04 20:14
Graham
Account closed

Registered: Dec 2002
Posts: 990
you can also do stable rasters in a loop without a timing table.
2003-02-05 20:20
xIII
Account closed

Registered: Dec 2001
Posts: 38
Yes, I made such a routine in my 1K intro called Tranparent Rasterbars. If u want the source, mail me.

BTW: Graham: where's my CD !! ;)
2003-02-05 21:16
Richard

Registered: Dec 2001
Posts: 619
Quote: you can also do stable rasters in a loop without a timing table.

How's that done?
2003-02-07 12:44
chatGPZ

Registered: Dec 2001
Posts: 11130
Richard: easy, instead of the timing table use a series of dummy instructions. for an example, look at the fli-displayer in crossbows "fli.txt" (i think published in go64 long ago)
2003-02-11 21:44
Merman

Registered: Dec 2002
Posts: 140
The timing loop like that is fine for colourbars, but I guarantee you will hit problems. Adding sprites will throw off your timing, particularly if they are anywhere near the colourbars.
As an example, I'm TRYING to get colourbars behind a sprite ROLscroller, and get it in the sideborders. The timing is horrible.
One tip - use those tedious code tables in the 64 Programmer's Reference Guide. NOP takes 2 cycles, LDA $00 (zeropage) takes 3, LDA #$00 takes 3, LDA $0000 takes 4 and so on.
Also, you have to take into account the "bad" lines - every 8 scanlines during the screen, VIC takes time to read the next row of character data. With that, your delay table would look like this:
.byte 8,8,8,8,8,8,8,1
for 8 rows
2003-02-11 22:00
Stryyker

Registered: Dec 2001
Posts: 465
lda #$02 is only 2 cycles :) VIC Article is a good read with PRG and 64Doc.

If you want sprites with colours then either keep Y positions the same to start off with or get a head ache :)
2003-02-21 13:09
HCL

Registered: Feb 2003
Posts: 717
Gosh.. Guys made dysps in the sideborder with split rasters fifteen years ago. What's the big problem? A nice little timer-interrupt loop will do the trick smoothly :).
2003-02-21 15:26
QuasaR

Registered: Dec 2001
Posts: 145
Try this one...

http://www.ffd2.com/fridge/vic/stableraster.txt
2003-03-07 04:08
Krill

Registered: Apr 2002
Posts: 2850
Quote: Gosh.. Guys made dysps in the sideborder with split rasters fifteen years ago. What's the big problem? A nice little timer-interrupt loop will do the trick smoothly :).

David, just accept that there *are* people with less coding skills than you have ;)
2003-03-07 16:34
chatGPZ

Registered: Dec 2001
Posts: 11130
Krill: but he is right with his bottomline. "the info is known for years. the info is out there."

some ppl just dont seem to bother spending a night with google to get themselves the info they need.

stable raster in particular must be one of the most often explained things about c64 coding....

google "c64 coding stable raster" gets you 96 hits, of which the first 5 immediatly point to a sourcecode.

SO WHAT ?!?!
2003-03-07 17:02
TDJ

Registered: Dec 2001
Posts: 1879
Groepaz, could you post that link here? Saves me the trouble of typing it in myself. Thank you.
2003-03-08 01:38
chatGPZ

Registered: Dec 2001
Posts: 11130
http://www.google.com/search?q=c64%20stable%20raster%20source&s..

0> i feel lucky <O

source for that standard double irq thing on c64, and the hcl-preferred double-timer thing for the vic-20 (its very much the same on c64 though, disasm some hcl code :0)).

marko even explains it well as far as i remember...however the link to c=hacking issue with all the info is second or third hit.

eh. you lazy bastard. :o)
2003-03-08 07:55
TDJ

Registered: Dec 2001
Posts: 1879
Why didn't you make it a link? Now I have to cut & paste it .. bastard ..
2004-01-08 07:06
Zodiac
Account closed

Registered: Jan 2004
Posts: 1
I remember using NOP to stabalize the rasters! Boy that brings back the memories...
2004-04-23 16:29
waffieblaffie
Account closed

Registered: Apr 2004
Posts: 1
Back in the 80's we used some routine called 'waitlin' to stabilize rasters. It didn't rely on double ints or sprite irq's or any other funny stuff. Just plain and simple code. It worked by testing $d012 at the right sideborder. It needed about 3 or 4 rasterlines to get the raster stable. Unfortunatly I lost the source. Does anybody know what I'm talking about :)

WaffieBlaffie.
2004-04-24 10:47
Graham
Account closed

Registered: Dec 2002
Posts: 990
3 to 4 lines is too much anyway, less than 2 lines and we're talking.
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
mutetus/Ald ^ Ons
Stratford/Xenon
zscs
curtcool
polynomy
onebitman
Guests online: 107
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Webmasters
1 Slaygon  (9.7)
2 Perff  (9.6)
3 Morpheus  (9.5)
4 Sabbi  (9.5)
5 CreaMD  (9.1)

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