English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Tutorials

 
 
Thread Tools
Old 04 May 2007, 14:22   #1
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,595
Plasma

Since finishing the sine scroll routine I've hacked the code for that one around into the embryo of a plasma routine. I've posted it to the zone, if anyone wants to check it out...

At the moment it's static - all it does is setup a two bitplane display and draw in the copper effect. What I haven't really thought much about yet is what else I need to add to the routine so that it's a proper plasma effect - moving and changing colours etc. so I'll be trying to puzzle that out over the next few days.

In the meantime, as usual, any suggestions from the more experienced coders about what I should be looking to try and achieve would be welcome...
pmc is offline  
AdSense AdSense  
Old 04 May 2007, 15:40   #2
korruptor
TDI
korruptor's Avatar
 
Join Date: Feb 2007
Location: DUNDEE
Posts: 122
Sum of sine plasmas would be pretty easy to do but they don't look anywhere near as good as the sorts of RGB plasmas I remember on the Amiga. Can't help with the latter (not 100% sure how they're done) but I've got some examples for sine plasmas somewhere.
korruptor is offline  
Old 04 May 2007, 16:17   #3
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,595
@korruptor - nice one mate, any ideas are appreciated, I'd be keen to check out any sources you've got - even if I do something different for this effect than what they show they'd always come in handy at some point.
pmc is offline  
Old 06 May 2007, 19:44   #4
Asman
68k

Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 628
Hi

In the Zone you can find examples of plasma from different places. But I don't test this sources. There also exist exe files and some doc file about plasma. I think that this package will help you.

Gretz
Asman is offline  
Old 06 May 2007, 21:07   #5
AGN
Registered User
 
Join Date: Aug 2004
Location: Poland
Posts: 142
Quote:
Originally Posted by pmc
I've posted it to the zone, if anyone wants to check it out...
No files from pmc in da zone.
AGN is offline  
Old 06 May 2007, 23:33   #6
korruptor
TDI
korruptor's Avatar
 
Join Date: Feb 2007
Location: DUNDEE
Posts: 122
Asman: thanks for the sources, some awesome stuff in there.

pmc: I've found my old C/Python sources, can upload them if you want them but the 68k stuff in the zone is a lot better.
korruptor is offline  
Old 07 May 2007, 14:43   #7
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,595
@Asman - I've just donwloaded the stuff you put in the zone - I'll check it out. Thanks Asman, you're a diamond!

@korruptor - thanks for the offer but they won't be of any use to me for the simple reason that I don't understand either C or Python. I don't even understand BASIC! - I've only ever programmed anything in 68k assembler and sometimes I barely understand that!

@AGN - hello mate, yeah sorry - I took the source out of the zone again. All it did was put a colourful copper effect on the screen - there's just a big copper list with loads of waits and moves to the colour regs. After second thoughts I wanted to have a bigger stab at getting it to be a proper plasma effect before I start asking for help - I think I'll learn more that way. It'd be great if you could have a look when I post the next version though?
pmc is offline  
Old 10 January 2008, 14:15   #8
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,595
It's been a loooong time since my thoughts turned to this subject since I was first posting about it in May last year (man, where do the months go...?!) but now I think I'd like to try and get back into this and see what I can do.

My ideal would be to get something close to what can be seen in the Celtic's Plasmatronic demo which, I think, is the best plasma effect I ever saw from the Amiga's heydey. I've posted an .adf that boots to that demo into the zone if you've never seen it...

What are they actually doing there? At a basic level I think it's done with simple bitplane patterns and then using the copper to change the colour registers for the colours that make up the patterns...? What I don't understand is how the copper is used to interact with the patterns and how the patterns are altered (if they're altered?) to get the plasma effect.

So, as always, I need some help to get started cos I'm not really sure I understand the underlying things I need to try to do to achieve the effect. Its more than likely it's beyond my coding abilities but I won't know until I try...
pmc is offline  
Old 13 January 2008, 05:40   #9
AGN
Registered User
 
Join Date: Aug 2004
Location: Poland
Posts: 142
Quote:
Originally Posted by pmc View Post
What are they actually doing there? At a basic level I think it's done with simple bitplane patterns and then using the copper to change the colour registers for the colours that make up the patterns...? What I don't understand is how the copper is used to interact with the patterns and how the patterns are altered (if they're altered?) to get the plasma effect.
Background:
Due to limit in dma/whatever in amigas You can change color (by copperlist) at every 8 pixels in lores.

Many plasmas uses following copperlist:
wait, move, wait, move, wait, move....

This works fine when Your plasma area is a static block of copper "pixels" (8x1).

If You try to move horizontally whole plasma-area (or just one line of it) by 1 pixel left/right We hit another problem.

Wait instruction from coper have low horizontal resolution - 4 pixels in lores. So scroll won't be smooth enough.

Solution in this intro is to align plasma by using bitplanes.

One bitplane is "FF FF FF FF ...." and second "00 FF 00 FF 00 FF ...." so we got only 2 colors (02 and 03).
Look at copperlist from this intro. There is one wait at beginning of plasma line and then:
move clolor02, move color03, move color02.....

You can move bitplanes by 1px by hardware so whole plasma will move smooth.

Why 2 bitplanes instead of one?
One bitplane (filled with 00 FF 00 FF) means color00 and color01.
Color00 is background, so You will get garbage at right and left borders of plasma area.
AGN is offline  
Old 14 January 2008, 10:49   #10
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,595
Hello AGN, good to hear from you - I hope you're well.

Thanks very much for taking the time to give me that explanation, much appreciated. You are the guru.

I'll try to get my head around the information and have a first go at a routine.
pmc is offline  
Old 15 January 2008, 16:26   #11
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,595
Right then, first things first, I've been thinking about various aspects of getting a plasma routine working and I've decided to start at the beginning and make a single bitplane plasma and then (hopefully) build from there fingers crossed learning something as I go.

So far I reckon that I'll get something half decent if I setup a copper list with a bunch of waits and moves to a colour register and then use the processor to push colour values listed in a table into those moves in the copper list. Hopefully if I do this using some kind of offset into the table so that a different starting colour is used each iteration I should get some kind of moving plasma result.

Well, that's the idea anyway... Perhaps it'll work, perhaps it won't; perhaps it'll look OK, perhaps it won't!

Whatever I get working, as usual, I'll post the sources and welcome any comments or constructive criticism...
pmc is offline  
Old 19 January 2008, 13:31   #12
AGN
Registered User
 
Join Date: Aug 2004
Location: Poland
Posts: 142
Here is task for You

Code:
number_of_plasma_columns        equ     8
number_of_plasma_lines          equ     64
plasma_start_x                  equ     100
plasma_start_y                  equ     71      ; must be odd and +4


        section code_pmc,code

pmc_start:
        move.l  #plasma_area_01,a0
        move.w  #$0f0,d0
        bsr     fill_plasma_area
        move.l  #plasma_area_02,a0
        move.w  #$00f,d0
        bsr     fill_plasma_area
        rts

fill_plasma_area:
        ; !!!
        rts

        section customchips,data,chip


copperlist_01:
plasma_area_01:
        blk.w   (number_of_plasma_columns+1)*number_of_plasma_lines*2,$1234
        dc.w    $ffff,$fffe

copperlist_02:
plasma_area_02:
        blk.w   (number_of_plasma_columns+1)*number_of_plasma_lines*2,$1234
        dc.w    $ffff,$fffe
Write "fill_plasma_area" function.
AGN is offline  
Old 19 January 2008, 22:35   #13
AGN
Registered User
 
Join Date: Aug 2004
Location: Poland
Posts: 142
Quote:
Originally Posted by AGN View Post
Write "fill_plasma_area" function.
... and find bug I made
AGN is offline  
Old 19 January 2008, 23:10   #14
musashi5150
move.w #$4489,$dff07e
musashi5150's Avatar
 
Join Date: Sep 2005
Location: Norfolk, UK
Age: 36
Posts: 2,284
Glad to see you are keeping youself busy pmc My favourite plasma is the 'orplasm' in Coma's Hot Dots.

http://aminet.net/demo/ecs/HotDots.lha

I think it rocks

Last edited by musashi5150; 22 January 2008 at 14:12.
musashi5150 is offline  
Old 22 January 2008, 12:50   #15
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,595
@ AGN: Thanks (I think...!) for giving me that as a task. I'll take it away and have a think (and probably a bit of a cry...) and try to come back with a hopefully not too embarassingly bad try! I'm a bit busy at the moment at home and at work so bear with me.

@ musashi5150: Cheers man, truth be told it's mainly those couple of nudges you gave me to get off my lazy behind and get back to challenging myself that got me back to thinking about this. I checked out that demo you linked - personally I prefer the dot routines to the plasma in that one but it was cool all the same.

Hmmm, another one to think about, dot routines... by the looks of them though, they'd involve some heavy mathematics so that about rules me out cos I am absolutely terrible at maths! I read a book (still own a copy in fact) called Amiga Realtime 3D Graphics - the mathematical principles of 3D graphics made not one shred of sense to me at all so no spinning red cubes in my demo routines future!
pmc is offline  
Old 22 January 2008, 16:53   #16
AGN
Registered User
 
Join Date: Aug 2004
Location: Poland
Posts: 142
Quote:
Originally Posted by pmc View Post
Hmmm, another one to think about, dot routines... by the looks of them though, they'd involve some heavy mathematics so that about rules me out cos I am absolutely terrible at maths!
We'll do dot-flag with scroll on it.
No math involved.
AGN is offline  
Old 26 June 2008, 13:11   #17
pmc
rebooting...
pmc's Avatar
 
Join Date: Apr 2007
Location: Elsewhere
Posts: 1,595
@AGN - I must apologise for it being such a long (very long) time in replying but at last I've had enough time to be visiting here again and I've had a go with that code task you set me.

I'm not sure if I've completely missed the point with what you were asking but I've chopped the code around as follows:

Quote:
number_of_plasma_columns equ 8
number_of_plasma_lines equ 64
plasma_start_x equ 100
plasma_start_y equ 71 ; must be odd and +4

section code_pmc,code

pmc_start:
move.l #plasma_area_01,a0
move.w #$0f0,d0
move.w #area1_size-1,d1
bsr .fill_plasma_area
move.l #plasma_area_02,a0
move.w #$00f,d0
move.w #area2_size-1,d1
bsr .fill_plasma_area
rts

.fill_plasma_area:
move.w d0,(a0)+
dbra d1,.fill_plasma_area
rts

section customchips,data_c

plasma_area_01:
ds.w (number_of_plasma_columns+1)*number_of_plasma_lines*2
plasma_area_01_end:

area1_size equ plasma_area_01_end-plasma_area_01

copperlist_01:
* reg setups, followed by waits & multiple colour moves
dc.w $ffff,$fffe

plasma_area_02:
ds.w (number_of_plasma_columns+1)*number_of_plasma_lines*2
plasma_area_02_end:

area2_size equ plasma_area_02_end-plasma_area_02

copperlist_02:
* reg setups, followed by waits & multiple colour moves
dc.w $ffff,$fffe
I chopped it round to how I thought it should look, not sure if that fixes the bug you made...? I also made it Devpac friendly (cos that's what I use), hope that's OK.

If I'm totally wrong or being completely stupid with the above then at least I'll learn something from the exaplantions why!
pmc is offline  
Old 12 February 2009, 00:11   #18
Herpes
... aka Amix73

Herpes's Avatar
 
Join Date: Jan 2009
Location: Austria
Posts: 76
Very nice thread, I really enjoyed it. I am sorry that I joined the board too late to get actively involved in this I also coded some 68K assembly for some intros but that was about 18 years ago - so maybe I start again ... it's great fun compared to my Java coding work in telecommunications.

@pmc: I wonder how far you got by now with your coding but maybe I'll read it in some other thread in this section.

Adio!
Herpes is offline  
Old 12 February 2009, 00:55   #19
gimbal
cheeky scoundrel
gimbal's Avatar
 
Join Date: Nov 2004
Location: Spijkenisse/Netherlands
Age: 36
Posts: 2,946
Quote:
it's great fun compared to my Java coding work in telecommunications.
Java is great fun friend, you just have been using it for the wrong purposes

btw, nice nickname!
gimbal is offline  
Old 15 February 2009, 04:43   #20
Herpes
... aka Amix73

Herpes's Avatar
 
Join Date: Jan 2009
Location: Austria
Posts: 76
Quote:
Originally Posted by gimbal View Post
Java is great fun friend, you just have been using it for the wrong purposes
Yep, you're right.
But actually I love Java only my work I have to do is not such a pleasure and for the purpose of retro computing with my Amigas, 68K assembly fits better.

Quote:
btw, nice nickname!
thx.
Herpes is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plasma and Fire xArtx support.Demos 0 16 August 2013 05:17
Amikit on 42" Plasma TV fatboy Retrogaming General Discussion 6 19 February 2010 17:40
a1200 on plasma tv THERAVEN New to Emulation or Amiga scene 28 15 June 2006 02:50
Plasma examples anyone? jobro Coders. General 5 27 November 2005 18:25
Anything by The Plasma Force Sune Salminen request.Demos 6 10 February 2005 19:48

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 16:02.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.54377 seconds with 12 queries