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 > fastest plotter
2024-07-27 05:50
Repose

Registered: Oct 2010
Posts: 225
fastest plotter

Does anyone know the record for most pixels plotted per frame?
The best I can imagine is between 500 and 800 hires pixels (NTSC).
I think the quickest way is to use redefined charsets to create an ideal memory layout.
Imagine a vertical layout with (theoretically) 32 chars down. With 8 bytes per character that equals 256 bytes. That means y is itself as the offset. Each x/8 becomes the high byte, or (x&$fb)<<3. So the plot is just:
lda tabl,x ;4
sta zp+1 ;3
lda (zp),y ;5 never crosses page boundary
eor plot,x ;4
sta (zp),y ;5
;21, about 811 pixels per frame
alternate, plot only
lda plot,x ;4
sta (zp),y ;5
;16

One charset is only 8 chars by 32 chars so a pixel plot area of 64x200, but you can make a fast extension by changing the charset pointer at $d018 each raster, for 128 lines, taking 14 cycles (lda #base0:sta $d018:lda #base1:nop:sta $d018) plus sync code each line.
Now we have two charsets, 8x32 and 8x32, for a cropped 128x128 plot area.

For comparison, a hires plot is about 32 cycles.

The erasing has to be added too. Depending on what you're plotting, you might be able to overwrite it, but a full erase is 16x128=2048 bytes.
Or, eor the same pixels again for exactly half the speed.

I suppose a 16x16 layout is just as fast? The formula has two x components, but I think they could be combined.
byt=y+(x&8)>>7+(x&f8)>>4
I think.

To put this in perspective, in a plotted scroller with about 20 pixels per character, that's about 25 letters per frame.
That would easily fill the plot area and have time for effects.
2024-07-27 06:28
Repose

Registered: Oct 2010
Posts: 225
Here's the 16x16 char or 128x128 pixel hires code:
;ldy ycoord
;ldx xcoord
lda mul128low,x ;4
sta $fe ;3
lda mul128high,x ;4
sta $ff ;3

lda mask,x ;4
ora ($fe),y ;5
sta ($fe),y ;5
;28
This isn't very fast or much better than a bitmap it seems.

thanks to
https://csdb.dk/forums/?roomid=11&topicid=24359&showallposts=1
2024-07-27 10:37
Jammer

Registered: Nov 2002
Posts: 1334
OMG Got Balls!
2024-07-27 12:54
HCL

Registered: Feb 2003
Posts: 727
Quote:
Does anyone know the record for most pixels plotted per frame?

Oups, that's quite a vague request.. There are many ways to plot pixels and generally speed gets traded against flexibility. Pimp My Snail comes to mind but there are many others.
2024-07-27 13:33
Oswald

Registered: Apr 2002
Posts: 5083
to clr you can just store the calculated address while in the drawing phase in a speedcode that looks like:

sta
sta
sta
sta

each sta clears one dot :)


animated dot sphere records:

- one trick is to use sprites with 1 pixel vertical line in them, change spr xcoo per rasterline to set xcoo of pixel
- you can collect writes with the same ZP hi address into chunks, so you only need to change the lo byte for a number of pixels. (sta (),y)


I guess got balls animated ball uses the fact that many times there is 2 pixels in same byte, and sets them with one write.
2024-08-04 08:00
Repose

Registered: Oct 2010
Posts: 225
Thanks. OMG Got Balls and Pimp my snail have the same code for fullscreen bitmap, with unrolled code for 38 cycles. This is from the plotter of Pimp my snail.
.C:4008  B1 38       LDA ($38),Y ; slowly varying data
.C:400a  9D 00 24    STA $2400,X
.C:400d  BC 00 65    LDY $6500,X
.C:4010  8C 41 3E    STY $3E41 ; $3E47
.C:4013  AA          TAX
.C:4014  BD 00 66    LDA $6600,X
.C:4017  99 00 2B    STA $2B00,Y
.C:401a  A0 1B       LDY #$1B ; $1A
.C:401c  B3 28       LAX ($28),Y
.C:401e  8D 44 3E    STA $3E44 ; $3E4A
 ; 3/4 sinewave at $6400?

I don't quite follow it yet, but I think the points are sorted somehow. That's a good idea. I haven't seen anything yet faster than my idea.
2024-08-04 11:37
Oswald

Registered: Apr 2002
Posts: 5083
4 stores for plotting a dot ? I have no idea what that code does
2024-08-04 14:32
Sparta

Registered: Feb 2017
Posts: 42
Quoting Repose
Thanks. OMG Got Balls and Pimp my snail have the same code for fullscreen bitmap, with unrolled code for 38 cycles. This is from the plotter of Pimp my snail.
.C:4008  B1 38       LDA ($38),Y ; slowly varying data
.C:400a  9D 00 24    STA $2400,X
.C:400d  BC 00 65    LDY $6500,X
.C:4010  8C 41 3E    STY $3E41 ; $3E47
.C:4013  AA          TAX
.C:4014  BD 00 66    LDA $6600,X
.C:4017  99 00 2B    STA $2B00,Y
.C:401a  A0 1B       LDY #$1B ; $1A
.C:401c  B3 28       LAX ($28),Y
.C:401e  8D 44 3E    STA $3E44 ; $3E4A
 ; 3/4 sinewave at $6400?

Just to set things straight, that code snippet is from OMG got balls, and it is far from being the same as Pimp my snail's plotter code. It takes 40 cycles for two screen writes and also preps the erase routine. Hence the four writes. :)
2024-08-04 15:08
Oswald

Registered: Apr 2002
Posts: 5083
ah so ball mirror included, that clears things up
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
bugjam
Acidchild/Padua
Fred/Channel 4
Norrland/G*P/GSW
Guests online: 77
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Mojo  (9.6)
6 Unity  (9.6)
7 Uncensored  (9.6)
8 Comaland 100%  (9.6)
9 Wonderland XIV  (9.6)
10 Still Rising  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Party Elk 2  (9.6)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.6)
5 Libertongo  (9.5)
6 Rainbow Connection  (9.5)
7 It's More Fun to Com..  (9.5)
8 Raising Snakes  (9.5)
9 Moving Balls  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Nostalgia  (9.3)
5 Triad  (9.3)
Top Organizers
1 Burglar  (9.9)
2 Sixx  (9.8)
3 hedning  (9.7)
4 Irata  (9.7)
5 Tim  (9.7)

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