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 > How can this code work???
2012-01-03 22:57
Shadow
Account closed

Registered: Apr 2002
Posts: 355
How can this code work???

I'm using a bit of FPP-code I wrote a while ago. It seems to work like a charm, but now when I look at it, I can't figure out why it is, because if I count correctly, my code per line is 20 cycles, while a badline should be 23, correct?
This means that my code should be badly out of sync after some lines, but somehow it seems to work!

	lda #$32
!wait:
	cmp $d012
	bne !wait-
	ldy #$03
!delay:
	dey
	bne !delay-
.for(var i=0;i<200;i++)
{
	lda #$18+[[i+$32]&7]
	sta $d011
	ldy fpptable+i
	lda fpporig,y
	sta $d018
	nop
}


(both fpptable and fpptable are page-aligned, non-ZP memory locations. I have no sprites enabled)
 
... 10 posts hidden. Click here to view all posts....
 
2012-01-05 19:29
tlr

Registered: Sep 2003
Posts: 1790
Quote: ...which should obviously be read as 63-40-3 = 20. It would have been so much nicer if a raster line was actually 64 cycles on the C64. Damnit! :)

Old NTSC? ;)
2012-01-06 06:05
Frantic

Registered: Mar 2003
Posts: 1648
@tlr: mpfngghh... I thought you were my PAL. ;) Anyway, in that case the rest of the calculation would be wrong. ;)
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
Andy/AEG
Alakran_64
thesuperfrog
Guests online: 97
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 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (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 Censor Design  (9.3)
5 Triad  (9.3)
Top Musicians
1 Rob Hubbard  (9.7)
2 Mutetus  (9.7)
3 Jeroen Tel  (9.7)
4 Linus  (9.6)
5 Stinsen  (9.6)

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