| |
Dr. Jay Account closed
Registered: Jan 2003 Posts: 32 |
Decimal arithmetic on the C=64 and bitmaps
Looking for commented source/tutorials on:
1. Floating point computations
2. Bitmapping ... I know that you have to byte-align and then plot your pixel but I don't know the "fast" routines for doing so
Thanks.
|
|
| |
CreaMD
Registered: Dec 2001 Posts: 3057 |
Hint: It could be quite cool if you first checked google, then came here asking for additional questions... maybe.
Roman |
| |
Stryyker
Registered: Dec 2001 Posts: 468 |
for fast pixel plotters for bitmaps. Time can develop one or check comp.sys.cbm in the pasy year where this was discussed. Comes back to CreaMD, check google, groups.google.com :) |
| |
yago
Registered: May 2002 Posts: 333 |
Most often, Coders do not use "real" bitmap, but set up an array of characters to speed up plotting.
e.g.
@E
AF
BG
CH
DI
...
If you want to do full-screen bitmap plotting, a table with the addresses of the lines might speed things up.
Something like:
word $2000,$2001,$2002,$2003,$2004,$2005,$2006,$2007
word $2000+320,$2000+321 ...
Except that the table should be split into two table of lo/high values.
I have no Idea about Floating Point, most Folks seem to use fix-point instead. Maybe you should take a Look how the Basic does floating point arithmetic.
|
| |
Dr. Jay Account closed
Registered: Jan 2003 Posts: 32 |
Cool. I'll check out all of those resources. It's tough coming back after 13 years when all the rage in '86 that I was exposed to were raster routines, sprite moves, and FLD effects. Now I jump on here asking basic questions, and the people frequenting the board are some of the best coders in the C=64 scene - probably rolling their eyes and going, "Why do people even ask about stable interrupts ... I had those assigned to a macro key 10 years ago ..." LOL.
|
| |
White Flame
Registered: Sep 2002 Posts: 136 |
For floating point info, check out Mapping the C64 for documentation on the 64 routines and disassemble them to see how it's done. For a really tight implementation of fp, hit http://www.6502.org . |
| |
MagerValp
Registered: Dec 2001 Posts: 1078 |
But you rarely need FP. Fixed point is both simpler, faster, and accurate enougn for pretty much everything you ever do in a demo.
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11390 |
1) you dont need floats... if you ever really do (to precalculate some stuff or whatever), use the basic-rom.
2) google for apple2 and floating point and grab the implementation from steve wozniak...nice, tight, well documented (and piece of history aswell)
|
| |
White Flame
Registered: Sep 2002 Posts: 136 |
Woz's implementation: http://www.6502.org/source/floats/wozfp3.txt |
| |
Graham Account closed
Registered: Dec 2002 Posts: 990 |
Quote: But you rarely need FP. Fixed point is both simpler, faster, and accurate enougn for pretty much everything you ever do in a demo.
and on some calculations fixed point is even more accurate than floating point, especially when your calculations are in a limited range of numbers or your fraction is based on another number base than two (like for example: dollars and cents, you would never use floating point to represent the cents). |