English Amiga Board


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

 
 
Thread Tools
Old 22 April 2009, 15:54   #21
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
I made a routine (attached) that builds a copper list and then uses the blitter to push colours into the colour moves.

I though that the add_vals: part would make the colours cycle and give some kind of plasma-ish thing but it just stays static.

Would anyone mind checking the code out and explaining what I'm missing and if there's a simple way I can make it cycle?

Thanks.

EDIT: attachment removed. After Asman's post below - it needs changing / testing!

Last edited by pmc; 23 April 2009 at 11:12.
pmc is offline  
Old 22 April 2009, 16:17   #22
Frog
Junior Member
 
Frog's Avatar
 
Join Date: Aug 2001
Location: France
Posts: 1,385
Quote:
Originally Posted by musashi5150 View Post
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
Yep Hot Dots is a really great coding demo ! Some screenshot and test here Hot Dots / Coma "test

Check Overdose / Delight for some more Plasma and a great music by Audiomonster
Both "test" of the demo are in french but there's some screenshots at the bottom.
Frog is offline  
Old 22 April 2009, 17:26   #23
musashi5150
move.w #$4489,$dff07e
 
musashi5150's Avatar
 
Join Date: Sep 2005
Location: Norfolk, UK
Age: 42
Posts: 2,351
I'll check it out Frog, thanks. The pics look nice

Maybe I'll give you plasma a run too pmc
musashi5150 is offline  
Old 22 April 2009, 17:55   #24
heavy
noodle
 
Join Date: Jun 2007
Location: europe
Posts: 247
first, "lea $dff000,a5" missing in the interrupt_code.
heavy is offline  
Old 22 April 2009, 18:13   #25
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
@ musashi5150 - nice one, if you do all you'll see is static copper "effect" at the moment = lame

@ heavy - maybe I'm missing something obvious, and if so I apologise, but I don't see what difference that would make to the cycling - there doesn't seem to be any problem referencing custom register offsets from the base in a5 in the code running in the interrupt... Can you explain further to help me understand?
pmc is offline  
Old 23 April 2009, 09:25   #26
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Doesn't look like I was missing anything - out of curiosity I added an lea cust_regs,a5 to the interrupt code. Made no difference.
pmc is offline  
Old 23 April 2009, 10:07   #27
heavy
noodle
 
Join Date: Jun 2007
Location: europe
Posts: 247
setting custom reg in a5 it's only for a proper code : if your program change a5 somewhere, at the next interruption, a5 will be changed !!
I haven't tested your code, I only see this "missing".
heavy is offline  
Old 23 April 2009, 10:15   #28
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
Hi pmc, I checked you source and I found the reason(s).

1) When you filled in plasma_copper you forget to add 4 words ( because you add at end dc.w wait_mask,$fffe,$0180,$0000 but you forget allocate that 4 words! ). Without 4 words you overwrite copper int trigger and your int shouldn't run ( but in fact run one time - so amiga did that - because your takeOs routine didn't stop the ints ).

2) Your blitter routine is strange and complicate for me. Why don't you use simple blitter copy ( D = A ). I think that is better ( and faster ) if you just copy one large block of colours into plasma copper, isn't ?


Other things ( most non important ).

a) I prefer one type of comments and the winer is ;
b) I prefer include hardware/custom.i + _custom equ $dff000 instead of the lists of equates.
c) I think that better is separate routines for TakeOs and RestoreOs ( just make two routines ). And I think that much better is to store them in separate file ( like startup.i or startup.asm ). In future you can easy use and improve that routines.
d) If you want use ints then first you must disable, set int vector and enable ints, you can't just load int vector. Please improve TakeOs and RestoreOs or if you want I will sent to you mine.

If something is not clear or wrong then please inform me.

Regards
Asman is offline  
Old 23 April 2009, 11:09   #29
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
@ heavy - OK fair enough. I realised what you were saying in relation to setting the cust regs base in a5 again in the interrupt, I just didn't see how it related to the question I posted.

Sorry, it was me getting confused with what you were saying rather than you saying something wrong!

@ Asman - Cheers for checking it out, much appreciated!

For point 1 - I'll check it out and see if I can sort it, thanks.

For point 2 - It's probably complicated cos I only half know what I'm doing! My thinking was that if I make a big colour table and then directly copy the values from this table into the copper colour moves with the blitter then I just get those colours copied sequentially in a loop. However by taking separate red, green & blue values and using the blitter to combine them before pushing them into the colour moves I thought I might be able to do some more clever things later like stepping through the different tables at different speeds to get different combinations of colours and (hopefully) some more interesting combinations. Might be right, might be wrong but there's no harm in playing and trying things out.

For point a - Regarding comment delimeters I'm starting to agree with you. I prefer ; over * recently too - I'm going to change my source codes to only use ;

For point b - I've always tried to build my source codes so that they are self contained which is why I use my own list of equates for the custom register offsets. That way if someone grabs any of my sources to learn with / play with / modify then they only need my source code to assemble something working. I hate getting source codes and finding I can't assemble them cos half the files I need are missing.

For point c & d - I know the way I do take and restore of the OS is lazy and probably lame coding but I do it that way cos it works for me and I'm mainly interested in playing with the routines themselves than with getting my code to be perfect in terms of startup etc. Regarding sending me your routines, anything you can share will, as always, be much appreciated. Thanks mate.
pmc is offline  
Old 23 April 2009, 11:31   #30
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
1) When you filled in plasma_copper you forget to add 4 words ( because you add at end dc.w wait_mask,$fffe,$0180,$0000 but you forget allocate that 4 words! ). Without 4 words you overwrite copper int trigger and your int shouldn't run ( but in fact run one time - so amiga did that - because your takeOs routine didn't stop the ints ).
I reserved another 4 words in the plasma_copper area to make sure that the intreq in the copper list doesn't get overwritten but it didn't make any difference - still no cycling.

Never mind, I'll keep playing with the code to see what I can see.
pmc is offline  
Old 23 April 2009, 11:46   #31
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
I will look again today evening into your source and tommorow I will post modified source with comments of course.

Regards
Asman is offline  
Old 23 April 2009, 11:53   #32
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Asman - You're definitely correct that the copper's interrrupt request is getting overwritten. I tested this by commenting out the manual call to the interrupt routine in the startup as follows:

move.l cop_int_vect.w,cop_int_address
move.l #.interrupt_code,cop_int_vect.w
; move.w #%1000000000010000,intreq(a5)

Then when I ran the routine I got no colours written by the blitter routine that runs in the interrupt at all proving that the interrupt never gets called by the copper...

I'll keep looking to try and resolve it.
pmc is offline  
Old 23 April 2009, 12:05   #33
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Fixed it - cycling now works, far too fast at the moment, but it works!

I changed my plasma_copper calculation from this:

plasma_copper: dcb.w (wait_words+color_changes*2)*plas_height,0

to this:

plasma_copper: dcb.w (color_changes*2+wait_words)*plas_height,0

and added:

dcb.w 4,0

to make room for those four extra words that I was adding to end of the plasma area.

The calculation now gives the correct value and now it works correctly.

@ Asman - thank you very much for looking at my code and pointing that error out - you're a legend!
pmc is offline  
Old 23 April 2009, 13:02   #34
Asman
68k
 
Asman's Avatar
 
Join Date: Sep 2005
Location: Somewhere
Posts: 828
Quote:
plasma_copper: dcb.w (color_changes*2+wait_words)*plas_height,0

and added:

dcb.w 4,0
Exactly. Cheers.
Asman is offline  
Old 28 April 2009, 15:00   #35
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Watcha chaps. I've been playing with copper and blitter routines recently in an effort to increase my understanding of these things.

In doing so I've adapted a source code by Prophet of Goldfire that I couldn't assemble into a standalone source code that will assemble directly with Devpac.

It's a nice routine that writes and combines copper bars against a sine wave to give a nice plasma type effect.

I learned loads of stuff messing around with this and it might be helpful to you guys too. Enjoy.

EDIT: Updated version attached.

Last edited by pmc; 26 February 2010 at 12:23.
pmc is offline  
Old 18 August 2017, 18:50   #36
Yragael
Registered User
 
Join Date: Jun 2017
Location: Paris
Posts: 51
Thread seems closed for a long time now, but if anyone is looking for the full code for a RGB plasma effect, check here :

http://www.stashofcode.fr/wait-skip-...ance-copper-1/

Link to the source code after the plasma pictures.
Yragael is offline  
 


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 04:17
Amikit on 42" Plasma TV fatboy Retrogaming General Discussion 6 19 February 2010 16:40
a1200 on plasma tv THERAVEN New to Emulation or Amiga scene 28 15 June 2006 01:50
Plasma examples anyone? jobro Coders. General 5 27 November 2005 17:25
Anything by The Plasma Force Sune Salminen request.Demos 6 10 February 2005 18: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:09.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.09025 seconds with 15 queries