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


Forums > C64 Coding > Is this a proper stable raster?
2010-09-21 00:37
MC
Account closed

Registered: Jul 2009
Posts: 71
Is this a proper stable raster?

I was searching for stable raster interrupts and only found ugly looking code tbh. I came up with this little trick and wonder if it will be stable under all conditions...

It is on VICE but I haven't had the chance to test this interrupt on a real machine yet... This is what I do in the IRQ:

raster1:	lda #rast1
br1:		cmp $d012
		bne br1
		nop
		nop
		nop
		nop
		nop
		lda #$00
		sta $d020
		sta $d021
(rest of interrupt stuff goes here)


The code simply compares the value in $d012 with the value stored in there by the last IRQ call and waits until the raster makes the switch, then a built in delay of 5 x nop makes sure we are in between the left and right border flip. (4 x nop and 6x nop also seem to work so I chose the safe value of 5 nops).

It SEEMS to work properly but I forgot how I used to do stuff before my 20 year lunchbreak...

I managed to open up the border with my second attempt at an all dancing & singing piece of raster interrupts with music-assembler tunes playing. Next up is a bouncy sprite scroller in the lower (and side) border area.

2010-09-21 01:13
MagerValp

Registered: Dec 2001
Posts: 709
No, that's about as unstable as they get. Check Codebase for good code:

http://codebase64.org/doku.php?id=base:interrupts
2010-09-21 04:28
SIDwave

Registered: Apr 2002
Posts: 2013
stable raster my ass, here is 1988 method:

ldx #7 ; delay
.dex
bne .

lda #1
sta $D020
sta $d021
...


now adjust the ldx, and set d012 on the lines you want, using multiple interrupts

:)
2010-09-21 08:17
Oswald

Registered: Apr 2002
Posts: 3411
probably it got stable because you have a jmp * for "main" program. try it with nop bit $ea lda ($00,x) jmp 2nop and it will fail.
2010-09-21 08:23
Mr. SID

Registered: Jan 2003
Posts: 266
With that you probably only were able to open the top/bottom border, not the sideborder, right?

Btw, in VICE you can set the VIC border size to Normal, Full or Debug. The latter option will show you that your raster is not stable, but flickering somewhere off-screen. Good enough for a lot of things, but not perfectly stable.
2010-09-21 09:07
TPM

Registered: Jan 2004
Posts: 93
heheh.. that's exactly the way i did back then. Put some nops here and there, have a jmp * for the main program and voila.
I didn't know it was unstable like hell (well, i did know, but had no solution for it), but by playing with those nops it became stable enough to do the thing.

maybe that's why i hated to open borders.. i couldn't manage it, now i know why :D
2010-09-21 10:13
daison

Registered: May 2005
Posts: 88
There's a forum post floating around here in which I make the same mistake based on the confusion of what a stable raster actually is ;)

A stable raster is basically the luxury of having an exact X position on where your IRQ execution starts.

Your raster starts 'somewhere' off screen. Which is nice for rasterbars and many other cool fx, but this is not yet what stable means.

With a stable raster you should be able to see a non flickering line starting somewhere on-screen.

This way you can for example open the sideborder by adjusting the 38/40 column setting *exactly* in the 40th column. Without a stable raster, you'll never hit the 40th column each frame.
2010-09-21 10:19
Frantic

Registered: Mar 2003
Posts: 1095
Imagine the amount of effort that would have been spared throughout the years if Commodore had simply included a switch in the VIC to disable the border. ;)
2010-09-21 10:22
wacek

Registered: Nov 2007
Posts: 304
Quote: Imagine the amount of effort that would have been spared throughout the years if Commodore had simply included a switch in the VIC to disable the border. ;)

Imagine how much poorer the scene history would have been if they did :)
2010-09-21 11:16
enthusi

Registered: May 2004
Posts: 594
IMHO it always helps to have SOME SID tune playing inbetween.
You can more less be certain of something being stable or not.
JMP * oder BVC * wont do any good there.
2010-09-21 12:07
MC
Account closed

Registered: Jul 2009
Posts: 71
well my last raster plays music and jumps to $ea31... It seems stable enoug to start outside screen but it does flicker one cycle.

Thanks for the infos
 
... 3 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
CRT/Censor Design
Groepaz/Hitmen
cadaver/covertbitops
TheRyk/ASC/MYD
Elder0010/Onslaught
The USER/MYD
PopMilo
Guests online: 27
Top Demos
1 Edge of Disgrace  (9.6)
2 Uncensored  (9.6)
3 Coma Light 13  (9.6)
4 Comaland  (9.6)
5 Wonderland XII  (9.6)
6 We Are All Connected  (9.4)
7 Deus Ex Machina  (9.3)
8 RGB  (9.3)
9 +H2K  (9.2)
10 Disco Apocalypso  (9.2)
Top onefile Demos
1 Daah, Those Acid Pil..  (9.5)
2 Dawnfall  (9.3)
3 One-Der  (9.2)
4 Hardware Accelerated..  (9.1)
5 Tiki Pahu!  (9.1)
6 Safe VSP  (9.0)
7 Te-Te-Te-TechTech It..  (9.0)
8 Raster Blast  (8.9)
9 Cubase64  (8.9)
10 Are we there yet?  (8.9)
Top Groups
1 Booze Design  (9.4)
2 Censor Design  (9.4)
3 Crest  (9.3)
4 Oxyron  (9.2)
5 Offence  (9.2)
Top Mega Swappers
1 Aslive  (9.3)
2 Calypso  (9.3)
3 Nightshade  (9.2)
4 Violator  (9.0)
5 Puma  (1.0)

Home - Disclaimer
Copyright © No Name 2001-2014
Page generated in: 0.336 sec.