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 > Double buffering color ram in half of the screen?
2017-10-18 09:52
Rastah Bar
Account closed

Registered: Oct 2012
Posts: 336
Double buffering color ram in half of the screen?

Suppose you have some text or MC bitmap graphics only in the bottom half of the screen, perhaps you could double buffer (color ram & gfx) using FLD?

I mean: in one frame you first switch to an empty screen in the top half (where you have some sprite action, say) and in the bottom half you switch to the desired graphics screen. In another frame you FLD the top half of desired color ram & gfx down to the bottom half.

Don't know if this can be useful though.
2017-10-18 09:58
Oswald

Registered: Apr 2002
Posts: 5094
should work, but instead of fighting against the HW instead just lean into and use it imho. (fex for a game)
2017-10-18 10:18
Cruzer

Registered: Dec 2001
Posts: 1048
Or use linecrunch like Peiselulli did in Incoherent Nightmare
2017-10-18 10:48
chatGPZ

Registered: Dec 2001
Posts: 11386
linecrunch+doubled lines, no?
2017-10-18 11:40
lft

Registered: Jul 2007
Posts: 369
Yes, I believe Peiselulli is repeating rows to use the same colour data twice. Since the counters increment anyway, only every other row will be fetched. The remaining rows are the back buffer. To switch, add a linecrunch at the top of the screen.

But due to the double-height rows, that's a different effect from what Color Bar is proposing.
2017-10-18 11:44
chatGPZ

Registered: Dec 2001
Posts: 11386
indeed

as for the original question..... what are you going to show at the top half of the screen then? its a bit much for a sprite scoreboard i guess :)
2017-10-18 12:06
ChristopherJam

Registered: Aug 2004
Posts: 1409
As others have said, yes, you certainly *could* do that.. and if you used linecrunch to slurp upwards instead of FLD to push down, you could even have some graphics in the top of the frame, as long as it didn't care about d800 contents (eg a BMP that never used the 11 bitpair)

But moving 480 bytes of color ram doesn't take that long at all; a naive slightly unrolled loop is only around 75 rasterlines, and colour-sorted speedcode chunks gets it down to around 40.
2017-10-18 12:37
Cruzer

Registered: Dec 2001
Posts: 1048
@Groepaz: Correct.

Btw, if I was to code a scrolling game these days, where VSP has gone out of style, I think I would look into ways of delta-updating the color RAM rather than trying to get it to double-buffer. I.e. look at which cells actually needs to be updated and which stay the same as on the last screen position. My guess is that if you take some actual game gfx, most chars will have the same color after you scroll the screen one char in X or Y.

Then the next question is of course, how to do this in an efficient way. I also have some loose ideas for this.
2017-10-18 12:39
Cruzer

Registered: Dec 2001
Posts: 1048
Quoting ChristopherJam
eg a BMP that never used the 11 bitpair
Or hires bitmap.
2017-10-18 14:03
TWW

Registered: Jul 2009
Posts: 545
For the screenram colors, you can double buffer and spread the gfx-move routine over the amount of HW scroll pixels you scroll with by toggling the screenram location.

For the colorram however, this could work imho. However I would pro'lly speedcode it as I am fucking daft with these VIC tricks.
2017-10-18 14:37
Rastah Bar
Account closed

Registered: Oct 2012
Posts: 336
I wasn't really thinking about a game. I just posted it to get the discussion going. Perhaps it might be useful for some kind of interlaced graphics effect in an intro or demo. But I guess speedcode is the preferred technique in any case.

Cruzer, thanks for the link. Really cool (or should I say "chilly"?) demo. It is the effect just before the twister, isn't it? I love that twister, btw, so colorful.
2017-10-18 16:57
Peiselulli

Registered: Oct 2006
Posts: 81
Yes, it is the greetings part.
The double buffer color ram has a nice feature: If you scroll not at maximum speed and you need for example only a frame update every 4th frame, than you can build up a quarter of the screen with color ram in one of each of this frames. So you need to update only 120 chars (=240 bytes) per frame if you scroll with 2 pixel per frame.
The idea comes from Groepaz (he posted it some years ago in the Forum64) btw.
2017-10-18 17:09
chatGPZ

Registered: Dec 2001
Posts: 11386
actually the idea is even older... some other guy came up with a japanese-style bullet-hell shooter like thingy which used this technique and posted it here on csdb even more years before. too bad i totally forgot the name of the guy or the production (maybe someone else remembers?)
2017-10-18 17:10
Krill

Registered: Apr 2002
Posts: 2980
And there are more benefits, beyond technical advantages: there are 256 freely-positionable double-height tiles (8x16 or 4x16 pixels), which is (almost) double as much graphics to play with for a graphician/level designer. :)
2017-10-18 19:09
ChristopherJam

Registered: Aug 2004
Posts: 1409
Quote: actually the idea is even older... some other guy came up with a japanese-style bullet-hell shooter like thingy which used this technique and posted it here on csdb even more years before. too bad i totally forgot the name of the guy or the production (maybe someone else remembers?)

That was Doynax's Balls of the Scrolling Thunder; he commented extensively about it in the Sorting discussion ten years ago.
2017-10-18 19:38
chatGPZ

Registered: Dec 2001
Posts: 11386
mmmh but where is it then? pretty sure it had a csdb entry too.... *shrug*
2017-10-18 19:40
ChristopherJam

Registered: Aug 2004
Posts: 1409
Never completed to my knowledge.
2017-10-18 19:41
chatGPZ

Registered: Dec 2001
Posts: 11386
no, but binary posted and added as "preview". i certainly have run it myself :)

edit: Balls of Scrolling Thunder Preview
2017-10-18 22:09
Rastah Bar
Account closed

Registered: Oct 2012
Posts: 336
Quote: That was Doynax's Balls of the Scrolling Thunder; he commented extensively about it in the Sorting discussion ten years ago.

Quoting doynax
The d800 copy is double buffered and evenly distributed across 16 frames, so it really doesn't take much raster time at all ;)

Yes, I remember having seen this, but how does he do it? With linecrunching or FLD?
2017-10-18 22:16
chatGPZ

Registered: Dec 2001
Posts: 11386
in one frame, push down the screen 12(?*) (raster)lines using FLD, then create 12 doubled (character)lines. in the second frame crunch the first 12(?*) lines and then create 12 doubled lines.

(*) not sure if that is the optimum if you also want to do vertical scrolling
2017-10-19 00:51
Skate

Registered: Jul 2003
Posts: 494
if anyone interested in original version of the Doynax's game, there you go.

http://www.akaydin.com/c64/stuff/Balls_of_the_Scrolling_Thunder..
2017-10-19 01:05
chatGPZ

Registered: Dec 2001
Posts: 11386
Balls of the Scrolling Thunder (Preview) :)
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
E$G/HF ⭐ 7
csabanw
Freeze/Blazon
El Gato
AArt1256/MoonShine
slimeysmine
t0m3000/hf^boom!^ibx
Andy/AEG
sailor/Triad
acrouzet/G★P
Guests online: 96
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 Layers  (9.6)
2 No Listen  (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 Logo Graphicians
1 t0m3000  (10)
2 Sander  (9.8)
3 Mermaid  (9.5)
4 Facet  (9.4)
5 Shine  (9.4)

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