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 > *newbie* Raster Bars ....
2006-03-26 16:10
Trifox
Account closed

Registered: Mar 2006
Posts: 108
*newbie* Raster Bars ....

Hi all, i am wondering how to implement as nice
raster bar algorithm, i started with:
http://www.ffd2.com/fridge/vic/stableraster.txt

for a stable entry point, how do i now change raster bar color in each subsequent line ? i was fiddling around with after the irq3 exits, it calls irq1 with a subsequent line, and then start it over, the problem is, when initiating the interrupt routine more than once in a it shifts abit to the right so the starting position of the change of color is visible on screen ... any hints to fill subsequent lines at allways the same x-position ?!
2006-03-26 17:25
WVL

Registered: Mar 2002
Posts: 886
you have to count the number of cpu cycles in your loop, and match this to the number of cycles the cpu has available each rasterline. If there are too many cycles each loop, the position where you change will slowly drift 'to the right', if there are too few cycles in your loop, it will 'drift to the left'. On normal rasterlines, there are 63 cycles available for the cpu. However, there are also lines called 'bad lines', which have less. Also using sprites on a certain rasterline means less cycles available for the cpu.

For further reference, I suggest you pick up the 'Vic Article' :) google for it.
2006-03-27 01:28
Trifox
Account closed

Registered: Mar 2006
Posts: 108
puh, ok, i have implemented a bunch of this ... ;)

here are some results, if you like watch'em:

http://www.digitalgott.de/c64/sines-raster.asm
and
http://www.digitalgott.de/c64/sines-raster.prg
2006-03-27 01:35
Wanderer
Account closed

Registered: Apr 2003
Posts: 478
It works great in PAL. I see that you're using $d020 only.

See the other thread for a way to do it using $d020/$d021 which allows you to have text on the screen.

Looks nice though.

2006-03-27 02:39
Trifox
Account closed

Registered: Mar 2006
Posts: 108
at the moment i am just playing around with the copper-like effects ... ;) next time i watch how to display a sprite logo or some scrolltext, or a sprite scrolltext,

if you like you can watch another raster bar example,
this time more like a 1d dotflag .. ;)

http://www.digitalgott.de/c64/sinus_raster_flag.prg

and the source
http://www.digitalgott.de/c64/sinus_raster_flag.asm
2006-03-27 09:32
Oswald

Registered: Apr 2002
Posts: 5031
btw you dont need any flicker fix for a rasterbar routine, you _dont_ need to be cycle exact at all. Max is about 8 cycle jitter, which can be placed on a screen area (right and left border of the screen) that will be never visible.

cycle exact timings were invented for hi tech stuff, like opening the side borders.

simpleirqsetup:

sei
lda #$7f ;disable default cia #1 timer interrupts
sta $dc0d ;which is used by kernal to flash cursor, etc.
lda #$01
sta $d01a ;ask for raster interrupts from vic
lda #$40
sta $d012 ;at rasterline $40
lda $d011
and #%01111111
sta $d011 ;0 into 9th bit of requested rasterline

lda $dc0d ;acknowledge any pending cia #1
lda $dd0d ;cia #2
lsr $d019 ;or raster irq

lda #<irq ;set up interrupt vector
sta $fffe
lda #>irq
sta $ffff

lda #$35
sta $01

cli

jmp *


irq

sta tempa+1
stx tempx+1
sty tempy+1

;do your stuff

lsr $d019 ;acknowledge irq (if you dont do this your irq routine will be reentered right after the rti again and again.., resulting in a mess)

tempa lda #$00
tempx ldx #$00
tempy ldy #$00
rti

even if you wont use this I think this helps in understanding whats going on more, than the messy tricky double irq example.
2006-03-27 11:17
Trifox
Account closed

Registered: Mar 2006
Posts: 108
har har, but this way i have full screen bars .... but i can not do anything else then displaying those bars...
2006-03-27 12:05
Oswald

Registered: Apr 2002
Posts: 5031
both methods allows you to have fullscreen bars.
2006-03-27 12:20
Graham
Account closed

Registered: Dec 2002
Posts: 990
Quote: har har, but this way i have full screen bars .... but i can not do anything else then displaying those bars...

You want to do an IRQ every rasterline so you can use some "remaining time"? Forget about this, even if you do almost nothing there are not enough clock cycles to have an IRQ each rasterline.
2006-03-27 12:23
Oswald

Registered: Apr 2002
Posts: 5031
graham, if ninja can do every 2nd line fli with separated irqs, how much impossible is this ? :)
2006-03-27 12:36
Graham
Account closed

Registered: Dec 2002
Posts: 990
Yes, every 2nd line FLI is ofcourse the perfect beginner example :P

Anyway, you might be able to do every line IRQ, but it wont help you. Your rasterbars will be buggy because you change colors in the middle of the screen, and you wont have much cycles free.
 
... 5 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
Knut Clausen/SHAPE/F..
TheEnemy/TREX/THD
Perff/No Name
iAN CooG/HVSC
Brittle/Dentifrice^(?)
mutetus/Ald ^ Ons
teloni0
Mibri/ATL^MSL^PRX
Guests online: 107
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 No Bounds  (9.6)
7 Aliens in Wonderland  (9.6)
8 Comaland 100%  (9.6)
9 Uncensored  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 It's More Fun to Com..  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Happy Birthday Dr.J  (9.6)
6 Copper Booze  (9.6)
7 TRSAC, Gabber & Pebe..  (9.5)
8 Rainbow Connection  (9.5)
9 Dawnfall V1.1  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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