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 > Text (screen) box drawing algorithm
2003-02-13 13:57
Dr. Jay
Account closed

Registered: Jan 2003
Posts: 32
Text (screen) box drawing algorithm

Anyone have a nice, fast box drawing algorithm for the screen? What I'm trying to do is make a sort of kaleidoscope representation of data.

Let's say I have this sequence: XYXZZ

Then on the screen I would want to render (centered):

ZZZZZZZZZZ
ZZZZZZZZZZ
ZZXXXXXXZZ
ZZXYYYYXZZ
ZZXYXXYXZZ
ZZXYYYYXZZ
ZZXXXXXXZZ
ZZZZZZZZZZ
ZZZZZZZZZZ

I'm assuming I can do it with some mirrorored line-drawing, etc, but I feel like I'm overcomplicating the code. I know how to draw a line, what I'm more interested in is the algorithm to map the sequence to the individual boxes.

Thanks,

Jay
2003-02-13 19:33
WVL

Registered: Mar 2002
Posts: 886
why not RLE encode the data?

so put the data like this in your code :

16 01 02 02 -> 16 times y, then 2 times x etc..

also put in a code for enter/return and just output the data with chrout or something...

Werns
2003-02-13 19:44
Dr. Jay
Account closed

Registered: Jan 2003
Posts: 32
I actually figured it out .. pretty stupid. I'm getting used to it. I just defined the upper left corner. I have a 24 x 24 grid which is really a 12 x 12 quad mirrored over each corner. So by definining the upper left corner, I simply increment in steps of 41 until I hit the middle, then draw the top, bottom, left, and right lines simultaneously - the top, bottom can use an index and the left, right use addition.

Jeremy
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
Ko-Ko
Mason/Unicess
Harry/Alivers
goerp/F4CG
Knut Clausen/SHAPE/F..
Guests online: 108
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Bromance  (9.6)
10 Memento Mori  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Webmasters
1 Slaygon  (9.7)
2 Perff  (9.6)
3 Morpheus  (9.5)
4 Sabbi  (9.5)
5 CreaMD  (9.1)

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