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


Forums > C64 Coding > PAL/NTSC Half Variance Stable Raster
2024-03-20 09:00
Fungus

Registered: Sep 2002
Posts: 629
PAL/NTSC Half Variance Stable Raster

I needed such a routine, and this is based on JackAssers, which also looks very very similar to crossbows. So I whipped this up real quick.

Hope someone can add it to codebase.

		ldx #$38
		cpx $d012
		bne *-3

		ldy #$09
		dey
		bne *-1
		cmp #$ea		;ntsc with nop nop
		bit $ea
		nop
		inx
		cpx $d012
		beq branch1
		nop
		nop
branch1
		ldy #$09
		dey
		bne *-1
		cmp #$ea		;ntsc with nop nop
		bit $ea
		nop
		inx
		cpx $d012
		beq branch2
		bit $ea
branch2
		ldy #$09
		dey
		bne *-1
		cmp #$ea		;ntsc with nop nop
		nop
		nop
		inx
		cpx $d012
		bne branch3
branch3
2024-03-20 10:41
JackAsser

Registered: Jun 2002
Posts: 1994
I got "mine" from Krill.
2024-03-20 10:43
Fungus

Registered: Sep 2002
Posts: 629
Hah cool, the first time I saw it was from crossbow in one of his demos. I was aware of it, but didn't get how it worked until I read your article.
2024-03-20 14:18
chatGPZ

Registered: Dec 2001
Posts: 11148
BTW - "Crossbows" IIRC is actually Hannes Sommer's - published in 64er many moons ago (He also published the lightpen-trigger stable raster thing there, and the $D011 "wanker" i believe)

I think i learned it from Marko's article that explained stable raster using an auxiliary timer. Maybe. :)
2024-03-22 07:35
Krill

Registered: Apr 2002
Posts: 2855
And because it's not as widely known as it should be: i'm using Quiss+Copyfault's ingenious 8-byte sync method whenever i can. =)
2024-03-22 15:29
chatGPZ

Registered: Dec 2001
Posts: 11148
beware of broken emulators :)
2024-03-22 16:46
Krill

Registered: Apr 2002
Posts: 2855
Quoting chatGPZ
beware of broken emulators :)
The other way around. Broken eumlators, beware! =)
2024-03-22 17:22
chatGPZ

Registered: Dec 2001
Posts: 11148
you make Ian cry :(
2024-03-22 22:46
Oswald

Registered: Apr 2002
Posts: 5029
btw never occured to me until now, but wtf is half variance
2024-03-22 23:43
chatGPZ

Registered: Dec 2001
Posts: 11148
each "step" in the above code halves the jitter (variance), until it gone
2024-03-23 07:59
mankeli

Registered: Oct 2010
Posts: 110
Fixed link to Quiss+Copyfault's ingenious 8-byte sync method
2024-03-24 12:22
Fungus

Registered: Sep 2002
Posts: 629
Well apparently it was off by 1 cycle for each stage, thanks to Jedi for using it and fixing it.

		ldx #$38
		cpx $d012
		bne *-3

		ldy #$09
		dey
		bne *-1
fix1
		cmp #$ea		;ntsc with nop nop
		nop
		nop
		inx
		cpx $d012
		beq branch1
		nop
		nop
branch1
		ldy #$09
		dey
		bne *-1
fix2
		cmp #$ea		;ntsc with nop nop
		nop
		nop
		inx
		cpx $d012
		beq branch2
		bit $ea
branch2
		ldy #$0a
		dey
		bne *-1
fix3
		cmp #$ea		;ntsc with nop nop
		inx
		cpx $d012
		bne branch3
branch3
2024-03-25 08:30
Oswald

Registered: Apr 2002
Posts: 5029
Quote: each "step" in the above code halves the jitter (variance), until it gone

thanks, I didnt know that I thought only 1 cycle flicker can be eliminated per go.
2024-03-25 12:44
JackAsser

Registered: Jun 2002
Posts: 1994
Quote: thanks, I didnt know that I thought only 1 cycle flicker can be eliminated per go.

If you have X cycle of jitter and make sure the middle of this jitter is on a raster line boundary you effectively half the jitter.
2024-03-25 13:47
Krill

Registered: Apr 2002
Posts: 2855
Quoting JackAsser
If you have X cycle of jitter and make sure the middle of this jitter is on a raster line boundary you effectively half the jitter.
Sort of like a binary search of the original raster position, which you compensate for as you go along. =)
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
csabanw
Airwolf/F4CG
psenough
-trb-
Guests online: 120
Top Demos
1 Next Level  (9.8)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Aliens in Wonderland  (9.7)
5 Coma Light 13  (9.7)
6 Edge of Disgrace  (9.6)
7 No Bounds  (9.6)
8 Comaland 100%  (9.6)
9 Uncensored  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Happy Birthday Dr.J  (9.8)
2 Layers  (9.6)
3 It's More Fun to Com..  (9.6)
4 Cubic Dream  (9.6)
5 Party Elk 2  (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 Diskmag Editors
1 Jazzcat  (9.4)
2 Magic  (9.4)
3 hedning  (9.2)
4 Elwix  (9.1)
5 A Life in Hell  (9.1)

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