| |
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? |
|
| |
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 ;) |
| |
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 ... ;))) |
| |
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/ |
| |
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 ... ;) |
| |
Krill
Registered: Apr 2002 Posts: 2852 |
Do you mean a plasma like in the first hidden part of this demo: Panta Rhei ? |
| |
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/ |
| |
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 ... )) |
| |
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 |
| |
Trifox Account closed
Registered: Mar 2006 Posts: 108 |
yes yes yes, and this is the reason why the thread is called plasma/linedoubling ... ;))) |
| |
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. |
| |
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 ..... |
| |
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/ |
| |
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 ... |
| |
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. |
| |
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/ |
| |
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/ |
| |
Trifox Account closed
Registered: Mar 2006 Posts: 108 |
what is $dd00 then ?!?! |
| |
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. |
| |
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. |
| |
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. |
| |
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? :) |
| |
TDJ
Registered: Dec 2001 Posts: 1879 |
Negative nops .. now *that* is an illegal opcode you can sell! |
| |
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? |
| |
TDJ
Registered: Dec 2001 Posts: 1879 |
Don't put yourself down Oswald, picking on you is never a waste of time! |
| |
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? |
| |
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) |