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 > plasma/linedoubling
2006-03-31 23:35
Trifox
Account closed

Registered: Mar 2006
Posts: 108
plasma/linedoubling

Hi all, now i have a question about how to implement a nice plasma effect, i saw many of those in nearly any demo, but many use these ugly fli flickering modes


i want to achieve an effect like this:
http://www.digitalgott.com/c64/plasma_000.prg

but in gfx mode ... i believe y scroll register comes in handy when trying to do stuff like this ... how to start?
2006-04-01 05:00
Oswald

Registered: Apr 2002
Posts: 5023
you're not specific enough.

what do you mean with "but in gfx mode" ? any gfx mode is a gfx mode :D

so, specify the gfx mode, and an example would be good from an existing demo, so we know what would you like your plasma to look like.

btw, using macros even for filling each 25 line is a bad coding habit, but you'll forget them soon if you're going for speed ;)
2006-04-01 07:37
Trifox
Account closed

Registered: Mar 2006
Posts: 108
yes, the stuff with the macros is really ugly, it eats up all my memory ... ;) but this way i do not have to fiddle around with crossing 256 byte page borders ... ;)))
2006-04-01 10:53
Scout

Registered: Dec 2002
Posts: 1568
Quote: Hi all, now i have a question about how to implement a nice plasma effect, i saw many of those in nearly any demo, but many use these ugly fli flickering modes


i want to achieve an effect like this:
http://www.digitalgott.com/c64/plasma_000.prg

but in gfx mode ... i believe y scroll register comes in handy when trying to do stuff like this ... how to start?


The example you gave wasn't a real plasma but you want something to make something I made in Accumulator, right?
That's done with some cheating; I only plot the outerside pixels instead of drawing horizontal lines.

---
-= Silicon Ltd. =-
http://forum.siliconlimited.com

Commodore 64 Scenemusic Podcast
http://8bitmayhem.blogspot.com/
2006-04-01 11:24
Trifox
Account closed

Registered: Mar 2006
Posts: 108
yes, this is exactly the effect i want to achieve .... and ... you do it by just removing one pixel on the left and adding one on the right ? and this for each row with some sine/cosine ? hmm, cool method ( i will steal it and reimplement it ... harhar ) .... but i saw such effects also with colors, and i also saw some scrollers which stretched smoothly in y-direction ... ;)
2006-04-01 11:38
Krill

Registered: Apr 2002
Posts: 2852
Do you mean a plasma like in the first hidden part of this demo: Panta Rhei ?
2006-04-01 11:51
Scout

Registered: Dec 2002
Posts: 1568
Quote: yes, this is exactly the effect i want to achieve .... and ... you do it by just removing one pixel on the left and adding one on the right ? and this for each row with some sine/cosine ? hmm, cool method ( i will steal it and reimplement it ... harhar ) .... but i saw such effects also with colors, and i also saw some scrollers which stretched smoothly in y-direction ... ;)

Yes, you got that right with the pixels.

The same effect done with colors is using a different technique which comes close to an Tech-Tech.
But you can't achieve 2 different sinewaves (on the left and on the right) with that like I did :P

---
-= Silicon Ltd. =-
http://forum.siliconlimited.com

Commodore 64 Scenemusic Podcast
http://8bitmayhem.blogspot.com/
2006-04-01 11:55
Trifox
Account closed

Registered: Mar 2006
Posts: 108
oh yes, that is the effect i wanted to achieve, sorry for not pointing you to an example file, so, how is this fullscreen smooth sine multicolor effect done ( the first in the demo ... ))
2006-04-01 11:56
Oswald

Registered: Apr 2002
Posts: 5023
IMHO things like waving a vertical color wash horizontally, or changing the width of a gradient doesnt counts as plasma
2006-04-01 12:03
Trifox
Account closed

Registered: Mar 2006
Posts: 108
yes yes yes, and this is the reason why the thread is called plasma/linedoubling ... ;)))
2006-04-01 12:07
Krill

Registered: Apr 2002
Posts: 2852
Oswald: that effect was called eci-plasma originally. And plasma rather refers to the looks of the effect, not the technicality behind it.
2006-04-01 12:10
Trifox
Account closed

Registered: Mar 2006
Posts: 108
but what can you c64-experts say about how it is done ?!?!
i used to believe that changing gfx mode starting adresses could be used, but due to the fact that the 64 can only adress in 16k jumps, this method falls out, another method which comes to my mind is playing around with the FLD .....
2006-04-01 12:14
Scout

Registered: Dec 2002
Posts: 1568
Quote:
so, how is this fullscreen smooth sine multicolor effect done ( the first in the demo ... ))


Well, that's a plasma.
The infamous 8x8 plasma that is, right Oswald? ;-)

That one is quite easy to do.
Setup a hiresscreen filled with $55 (%01010101) and $AA (%10101010).
If you poke, for example, #$bc to the screenmem ($0400) the 1st pixel gets dark grey and the 2nd get middle gray.
As the 2 pixels are close to eachother, your brain makes up an inbetween color of those 2 grey-values.

Anyway, back to the plasma.
Just add 2 (or more) sinustables, average them and use the result as an index for a color lookup table and poke that to the screenmemory.
That's actually really it.

---
-= Silicon Ltd. =-
http://forum.siliconlimited.com

Commodore 64 Scenemusic Podcast
http://8bitmayhem.blogspot.com/
2006-04-01 12:21
Trifox
Account closed

Registered: Mar 2006
Posts: 108
... but i have to do this for every line on the screen !?!? isnt that a bit expensive in rasterlength !?!? i actually have problems filling the text memory in an adequate time ...
2006-04-01 12:22
Krill

Registered: Apr 2002
Posts: 2852
Actually you don't plot any colour data at runtime. You just set up a couple of first screen lines (which are all the same colour line, only shifted by 1 char each), then stretch the first badline to 200 screen lines, and apply sine curves on dd00/d018/d016, for the horizontal shift.
2006-04-01 12:27
Scout

Registered: Dec 2002
Posts: 1568
Quote: ... but i have to do this for every line on the screen !?!? isnt that a bit expensive in rasterlength !?!? i actually have problems filling the text memory in an adequate time ...

Yes, you have :)

The trick is, don't do everything during the IRQ.
You can do loadsa stuff *outside* the IRQ too!

For example;

sei
lda #<irq
ldy #>irq
sta $fffe
sty $ffff

etc etc etc

loop:

jsr do_some_more_cool_stuff
jmp loop

irq:

pha
txa
pha
tya
pha
jsr playmusic
jsr dorasterbars

lsr $d019
pla
tay
pla
tax
pla
rti


---
-= Silicon Ltd. =-
http://forum.siliconlimited.com

Commodore 64 Scenemusic Podcast
http://8bitmayhem.blogspot.com/
2006-04-01 12:28
Scout

Registered: Dec 2002
Posts: 1568
I also have the feeling different how-to methods of plasma's are running through eachother in this thread =)

---
-= Silicon Ltd. =-
http://forum.siliconlimited.com

Commodore 64 Scenemusic Podcast
http://8bitmayhem.blogspot.com/
2006-04-01 12:33
Trifox
Account closed

Registered: Mar 2006
Posts: 108
what is $dd00 then ?!?!
2006-04-01 12:33
Krill

Registered: Apr 2002
Posts: 2852
Yes, Oswald referred to real 2d-plasmas, while trifox wanted to learn about 1d-plasmas that are just a wave applied to x-shift a colour line each screen line.
2006-04-01 12:35
Krill

Registered: Apr 2002
Posts: 2852
.define CIA_PIO0 %00000001
.define CIA_PIO1 %00000010
.define CIA_PIO2 %00000100
.define CIA_PIO3 %00001000
.define CIA_PIO4 %00010000
.define CIA_PIO5 %00100000
.define CIA_PIO6 %01000000
.define CIA_PIO7 %10000000

.define CIA2_PRA CIA2_BASE+$00; Port register A
.define VIC2_BANK0 %00000000
.define VIC2_BANK1 CIA_PIO0
.define VIC2_BANK2 CIA_PIO1
.define VIC2_BANK3 CIA_PIO1|CIA_PIO0
.define RS232_OUT CIA_PIO2
.define SERIAL_ATN_OUT CIA_PIO3
.define SERIAL_CLK_OUT CIA_PIO4
.define SERIAL_DAT_OUT CIA_PIO5
.define SERIAL_CLK_IN CIA_PIO6
.define SERIAL_DAT_IN CIA_PIO7

I referred to the lowmost 2 bits of $dd00 that determine which of the 4 16k banks the VIC sees.
2006-04-01 12:36
Oswald

Registered: Apr 2002
Posts: 5023
horizontally waved vertical color wash:

trifox, for this your stable source will come handy finally :)

set it up so that that your stretcher code starts on the first visible line.

each line will be 23 cycles "wide"

write to $d011 each line this:

$38,$39,$3a,$3b,$3c.. , $3f -> wrap back to $38

tweak the place (time) of the d011 writes horizontally, and the start of the $38... values until you see it stretches the first line all the way down.

what I'm unsure about is, that what value you have to start the $d011 writes, it might be anything between $38-$3f.

now you can set up different screens with different topmost gfx lines, and switch between them during the stretcher code.

add d018/d016/dd00 writes.

done.

example code for one rasterline:

lda #$3x ;x=8..f
sta $d011
lda table1,x
sta $d018
lda table2,x
sta $d016
lda table3,x
sta $dd00
(add nops to reach exactly 23 cycles)


dont forget: crossing 256 byte page boundaries with indexing costs an extra cycle -> kills your timing. put your tables at $xx00.
2006-04-01 21:00
Mirage

Registered: Jan 2003
Posts: 113
...(add nops to reach exactly 23 cycles)

I count more than 23 cycles already in that routine and you forgot an inx... How many nops is he supposed to add? -5? :)
2006-04-01 21:39
TDJ

Registered: Dec 2001
Posts: 1879
Negative nops .. now *that* is an illegal opcode you can sell!
2006-04-02 05:15
Oswald

Registered: Apr 2002
Posts: 5023
Thank you sirs. Probably you could explain it all better than me. Why have you wasted your precious time to pick on me instead of doing so?
2006-04-02 09:33
TDJ

Registered: Dec 2001
Posts: 1879
Don't put yourself down Oswald, picking on you is never a waste of time!
2006-08-14 14:30
Trifox
Account closed

Registered: Mar 2006
Posts: 108
hi, i heard a bout a method to do the line doubleing/plasma effekt i want to achieve, called fpp with this method it is said that you can assign each screen row a particular/different row of a given image, can someone help me on how to implement this?
2006-08-14 14:57
chatGPZ

Registered: Dec 2001
Posts: 11135
fpp==what oswald described :) i'd use a display routine like

lda #nn
sta $d018
sta $dd00
lda #$18+x
sta $d011

for every line. the nn values contain screen/videobank data and should be modified at runtime from another routine. (when you sit down and make a table of which bits are actually used by d018 and dd00 you will notice that you can conviniently merge them into one and save a lot of cycles)
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
MCM/ONSLAUGHT
Exile/Anubis
tlr
A3/AFL
cobbpg
rambo/Therapy/ Resou..
Operator Teleksu
pcollins/Quantum
kbs/Pht/Lxt
instant
AMB/Level 64
celticdesign/G★P/M..
Guests online: 100
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 Memento Mori  (9.6)
10 Bromance  (9.5)
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 Dawnfall V1.1  (9.5)
8 Quadrants  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Musicians
1 Vincenzo  (9.8)
2 Rob Hubbard  (9.7)
3 Stinsen  (9.7)
4 Jeroen Tel  (9.6)
5 Linus  (9.6)

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