Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
  You are not logged in 
C&A Drivecalc preview   [2010]

C&A Drivecalc preview Released by :
Mr Wegi, FanCA [web]

Release Date :
26 January 2010

Type :
C64 Misc.

User rating:*********_  8.6/10 (5 votes)   See votestatistics

Credits :
Code .... Mr Wegi of Atlantic, Black Sun, Samar Productions

Download :
http://csdb.dk/getinternalfile.php/84218/CAFAN2.ZIP (downloads: 679)
http://csdb.dk/getinternalfile.php/101834/drivecalcsources.zip (downloads: 149)

Look for downloads on external sites:
 Pokefinder.org


User Comment
Submitted by Bitbreaker on 18 November 2011
As it is for education purposes it could benefit from adding lots of comments to the code. Also, if it is not intended to be optimized, why unrolling the bresenham then (without much gain, as a loop would just be 1 cycle slower when you use immediate values for adc/sbc)? That does not make the code more readable. On the other hand i am someone who is happy about 5% performance gain. At some point when all the big stuff is optimized, also the small waste of cycle and overhead gets noticeable. However still haven't found the right thing to do with drivecode yet. Waiting for the border for each transfer doesn't seem to be a effective way to me either. So transfered data should be small and a transfer occur seldom or synched to some raster-irq.
But yeah, it gives a quick chance for all to play around with that concept, that is how i stumbled over this example on codebase64.org. So thumbs up!
User Comment
Submitted by Mr Wegi on 4 February 2010
@krill - I'd check x-rotator from Pantha Rei - in one frame??(!!) that's was perfect! - Great
User Comment
Submitted by Krill on 3 February 2010
Nice to have some educational drive code.

I actually plan to add drive-code capabilities to my loader, so you can swap in your routine and later go on loading easily. It will also come with a toolbox giving you easy-to-use transfer and syncing routines.

Depending on the effect, you can get much more than 5% speed-up, even to the point that you can implement effects which aren't possible on a C64 alone, and i'm not talking of merely offloading computations to the drive for some sideborder usage.

And yes, my released productions featuring drive code are +H2K (the gouraud-shaded vector objects) and Panta Rhei (the plasma-mapped x-rotator).

What is the earliest scene demo using drive code? The Masque (highly underrated classic) comes to mind, but Altered States 50% seems to have been released at the same time (funnily, at different parties). (Note: No, i don't mean drive code "effects" like in that 1541 fuck part in whatsitsname :D)
User Comment
Submitted by FATFrost on 29 January 2010
haha, this shit is funny! like old women at coffee morning talking about clothes washing techniques! ;)

(hmpf! does this mean i am an oldy too? ;) )
ps: (pah!)
User Comment
Submitted by Hermit on 28 January 2010
I agree the 'revolutionary' word was not up-to-date in knowledge of these facts...
(BTW, I cannot understand how I could miss that a bunch of demoes use this trick... maybe it can happen to anybody who misses the demoscene for 8 years :)...

It seems indeed from optimization point of view, the 5% help from the drive doesn't count that much...on the other hand this method can come well in other kinda tricky situations, even if it's introduced for educational purposes...

All in all I'm happy about this info being shared, and everybody can deal with it in mind afterwards :):)

User Comment
Submitted by snerg on 28 January 2010
Well Wackee I said "non Polish" and to make it clear only because Wegi just gave us a list of Polish demos..

And yes, Almighty has spoken..but truly missed a point!
User Comment
Submitted by Mr Wegi on 28 January 2010
Here is bether than forum !! THX for titles - I'll look :) Peace for HCL.
User Comment
Submitted by wacek on 28 January 2010
I'd say it like this: HCL, you are right for most things, but:
* "revolutionary" is a word from Hermit's comment, not Wegi
* "Polish-only" is a word from Snerg's comment, not Wegi etc.
...so I don't think you can say that this is "overhyped" by Mr Wegi ;)
For me the fact that this is published mainly for educational purposes is the most important angle that you missed, yet I am sure it was absolutely involuntary ;)
User Comment
Submitted by Oswald on 28 January 2010
HCL, you are overreacting. it got not overhyped nobody said its a world record, perfectly optimized, etc etc.
User Comment
Submitted by HCL on 28 January 2010
Oh, then it's fantastic.
User Comment
Submitted by Nitro on 28 January 2010
Yep, but it's not a little demo but code from the Polish tutorial in the C&A magazine which teaches basics of making vectors, the lack of optimizations is intentional, they are up to readers to implement :)
User Comment
Submitted by HCL on 28 January 2010
Ok, sorry to be a bitter mothafucker here, but this is a good example of how to *not* do optimized code. Never forget the #1 algorithm:

* Find where the prog spends most of its time.
* Put 99% of your effort there.

Here we have optimized away at most 5% of calculation code from the c64 and put it in the drive. Probably most of the gained time is spent fiddeling with the 2-bit transfer. Then we have ~50% of the code doing eor-filling, and the code is not even unrolled :(. Further the last ~40% of time is spent in a line-routine with looping increments :P. The shit runs every 3:rd frame!, a normal vector like this without drive-code runs every 2:nd easily.

I say it again. I'm sure you had fun doing this little demo (and that's also what's most important!), but please save us from naive yelling attributes like worldfirst, Polish-only, revolutionary etc.

..Oh, but the colors were nice ;).
User Comment
Submitted by Ninja on 28 January 2010
...and the note from Deus Ex Machina.
User Comment
Submitted by Groepaz on 28 January 2010
"What about a sid routine using the extra speed with 3 sids? ;)"

that reminds me of "give me a try" by crossbow :)
User Comment
Submitted by JackAsser on 27 January 2010
Also, despite Mr Wegi's good efforts I think it's good to mention that EOR-filling and line drawing is 95% of CPU load for a part like this and 5% is for the 3d-calcs if done properly.

The drive can theoretically do the 3d-calcs (not faster than the C64 though due to too little memory for tables) for the next frame during the filling of the current frame hence save those 5%. So, to be honest, using the drive for this is rather pointless. But FUN! :D
User Comment
Submitted by FATFrost on 27 January 2010
This is cool! i always wondered why no-one mentioned using the 1541 cpu as it's as powerful as c64 cpu. lol (i think! plz don't flame me!)
What about a sid routine using the extra speed with 3 sids? ;)

User Comment
Submitted by JackAsser on 27 January 2010
Nice! Drivecode by me in chessboard in Panta Rhei and in the double zoomscrollers in The Wild Bunch.
User Comment
Submitted by Oswald on 27 January 2010
another one: the mask/oxyron endpart
User Comment
Submitted by Ninja on 27 January 2010
Krill likes the drive, too, so +H2K might be another candidate. Oh, and some fractal generator published by the 64'er magazine :)
User Comment
Submitted by Mr Wegi on 27 January 2010
Please forgive me my ignorance and sorry Hermit for being unable to point at other titles but I was absent for nearly 12yrs in C64 world. Programming drives was always my hobby and I am very curious of any other ways of using it for calculations!! So can You please name as many demos as possible with mentioned stuff so I can satisfy my hunger.
User Comment
Submitted by Oswald on 27 January 2010
speed problem solved, I was using vice2.2.
User Comment
Submitted by hollowman on 27 January 2010
@snerg , Panta Rhei
User Comment
Submitted by Groepaz on 27 January 2010
"is there any non Polish demo using drive for calculations? Anybody?"

many :) if you pick random, and relativly new, "top" demos, i guess most do it :)
User Comment
Submitted by Count Zero on 27 January 2010
Yay - nice one.
User Comment
Submitted by snerg on 27 January 2010
Not so revolutionary this is but thanks to Wegi it may become popular way to speed up some effects - cheers for sharing with us Grzegorz. Anyway great effort was put into this tutorial!

Question: is there any non Polish demo using drive for calculations? Anybody?
User Comment
Submitted by Mr Wegi on 27 January 2010
@oswald - of course I'll up all sorces from this - no any problem, no any secret's. Nice for me when guru coder wrote great job THX for professional look and to skyte and cobra =)

@Hermit check the Altered States Huge Vectors, Realtime Intro by Victor, Mobanim ;-). In the CCS press alt+m and *8 (*nr drive) and d0300.

2bit transmission 16bytes for faces (8*X & 8*Y after perspective) like loader is not that long. Forgot about math procedures in the ROM...
User Comment
Submitted by Oswald on 27 January 2010
not a 486, but a core 2 duo 1.5 mhz, is this normal ? :)

Hermit, there are a handful of demos using it, try digital world / samar & watch the drive led.
User Comment
Submitted by Hermit on 27 January 2010
This is a Revolutionary idea...at least I've newer known about any demo that uses the 1541 for 3D calculations!
(And it's not a SUPERCPU, but the standard C64 set, outstanding:)

Is the remaining RAM/CPU in the Disk drive and the transfer speed enough for doing fastload simultaneously?
(Of course I know this would make the timings much more complicated.)
Did you use kernal routines in the Drive ROM for the calculations?

Let's see some more stuffs using this trick! :)
User Comment
Submitted by Groepaz on 27 January 2010
"vice drops back to 30fps even when I turn off TDE, doublesize,etc :)"
time to ditch your 486' :=)
User Comment
Submitted by Jammer on 27 January 2010
oswald: i don't have such problems with vice :) yay for wegi - the king of 1541 \o/
User Comment
Submitted by Skate on 27 January 2010
Drivecalc is one of my favorite c64 hardware tricks. Good job.
User Comment
Submitted by Oswald on 27 January 2010
great job! dont forget to up the source to codebase:) btw, vice drops back to 30fps even when I turn off TDE, doublesize,etc :)
User Comment
Submitted by Cobra/Samar on 27 January 2010
There is useful course, because are else beginner coders.
We wait to full version course.
Greetz.
Search CSDb
Advanced
Navigate
Prev - Random - Next
Detailed Info
· Summaries
· User Comments (33)
· Production Notes (1)
Fun Stuff
· Goofs
· Hidden Parts
· Trivia
Forum
· Discuss this release
Sponsored links
Support CSDb
Help keep CSDb running:



Funding status:




About this site:
CSDb (Commodore 64 Scene Database) is a website which goal is to gather as much information and material about the scene around the commodore 64 computer - the worlds most popular home computer throughout time. Here you can find almost anything which was ever made for the commodore 64, and more is being added every day. As this website is scene related, you can mostly find demos, music and graphics made by the people who made the scene (the sceners), but you can also find a lot of the old classic games here. Try out the search box in the top right corner, or check out the CSDb main page for the latest additions.
Home - Disclaimer
Copyright © No Name 2001-2018
Page generated in: 0.104 sec.