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 > Crunch and Pack algorithms + curve algorithms
2010-07-02 13:46
Testa
Account closed

Registered: Oct 2004
Posts: 197
Crunch and Pack algorithms + curve algorithms

hi,

I am looking for good tutorials or books with different Crunch and Pack algorithms....

Iam also looking for a tutorial/ book witch explains how to generate a sinus or cosin table with a ML routine..

oh my god.. i am moving forward.... 6 months i already bought the book: Computer Graphics C version from Donald Hearn and Pauline baker... this is a very good documented book. lots of alogorithms. like circels. eclipse, 2d, 3d vector rotations. Bresenham, linedrawing and lots more..

but no Crunch and Pack algorithmes or methodes and also no sinus or cosin algorithms..

every body a happy summer!
bye Testa





 
... 2 posts hidden. Click here to view all posts....
 
2010-07-02 16:57
Graham
Account closed

Registered: Dec 2002
Posts: 990
sin, cos and others: Taylor series
2010-07-02 17:20
Testa
Account closed

Registered: Oct 2004
Posts: 197
okay guys, thanx a lot... you will not believe this, since i take adhd medication i finaly can concentrate a lot better this means i can read and understand all those tutorials a lot better than before.... sometimes when i read my topics from the past i feel a little bit foolish..
but hey i am an open book... my motivation to make a nice quality c64 production increased a lot!..

2010-07-02 20:04
Perplex

Registered: Feb 2009
Posts: 255
For sine generation, if you want to do it in 6510 assembler for fun then great. In practice, it's easier to generate a sine table using a high level language with builtin math libraries. If you want to save on space, you can limit the table to the [0,PI/2] interval and expand it to a full [0,2*PI] table using simple mirroring code. To save even more space, let the table contain deltas instead, which usually fit inside a few bits each, depending on the accuracy you need.
2010-07-03 08:07
Testa
Account closed

Registered: Oct 2004
Posts: 197
Perplex:

i see what you mean.. i can generate sine table's with Kickassembler witch uses buildin math fuctions, i can also generate a sine table with Kernal and Basic routines... but it is kind of slow.. now i have a c64 platform sine creator and i am bussy with ripping and analyzing the code.. i want to know what is optimized in this code comparing to the standard kernal/basic routines..

I'am not sure what you mean with 'Deltas'.. but thanx for all the other advice..
2010-07-03 10:19
Cybernator

Registered: Jun 2002
Posts: 154
Delta means difference. Instead of storing the actual sine values in the table, you store the difference (delta) from the previous value. Since there are no abrupt jumps in the sine table, these deltas will be small values, thus needing less bits to store.
2010-07-03 11:01
Testa
Account closed

Registered: Oct 2004
Posts: 197
oh yes. i see... thanks a lot.....
2010-07-03 17:38
4mat

Registered: May 2010
Posts: 66
Dunno if this is any use to you but this is the sine generator I used in my 1k intros. It's not very accurate and I'm sure a proper coder could make it much smaller. :)

lda #$05
sta $63
lda #$1f
sta $61
ldy #$3f
ldx #$00
addsine
inc $61
startsine
lda $63
sta $62
keepsine
lda $61
sta $0400,x
sta $04c0,y
eor #$ff
sta $0480,x
sta $0440,y
inx
dey
bmi nomoresine
dec $62
bpl keepsine
inc $61
dec $63
clc
lda $64
adc $63
asl
sta $64
bcs startsine
bne addsine
nomoresine
2010-07-03 18:52
Frantic

Registered: Mar 2003
Posts: 1648
There is some sine/cos wave approximation code at Codebase, submitted by Whiteflame:

http://codebase64.org/doku.php?id=base:generating_approximate_s..

There is also some info on splines in one of the C=Hacking issues:

http://codebase64.org/doku.php?id=magazines:chacking20#quick_qu..
2010-07-03 22:37
doynax
Account closed

Registered: Oct 2004
Posts: 212
You can also generate a series of sines from the first couple of entries with a little bit of arithmetic.

One of those trigonometric laws they made you use in school said something like:
sin u sin v = 1/2 ( cos(u - v) - cos(u + v) )
Which means that:
F(x + 1) = F(x) * k - F(x - 1)
Where:
F(x) = sin(x * t)
k = 2 cos t
Granted you need a multiplication function with decent precision for this to give reasonable results so I suppose you're probably better off mirroring a table on the C64.
2010-07-04 15:56
Testa
Account closed

Registered: Oct 2004
Posts: 197
okay. this is what i am looking for... thanks for the examples and links.........
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
Jazzcat/Onslaught
E$G/HF ⭐ 7
ΛΛdZ
iAN CooG/HVSC
LightSide
Acidchild/Padua
Guests online: 135
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 Triad  (9.3)
5 Censor Design  (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.048 sec.