English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 29 January 2010, 15:39   #1
Dan Locke
Registered User
 
Dan Locke's Avatar
 
Join Date: Oct 2009
Location: USA
Posts: 111
Copper color-changing restrictions?

What are the restrictions on the copper's ability to switch colors between scanlines? I know that it has to be in a gradient, but I don't know anything else.
Dan Locke is offline  
Old 29 January 2010, 17:01   #2
chiark
Needs a life
 
chiark's Avatar
 
Join Date: Jan 2008
Location: England
Posts: 1,707
No restrictions. It doesn't have to be in a gradient, either. And you can switch during a scanline - quite a lot of demos use this for a copper plasma effect...
chiark is offline  
Old 29 January 2010, 17:02   #3
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
The copper can be used to change colours line to line and also within a line.

Within a line there's a limit on colour changes - if I remember correctly the limit is a change every 8 pixels - this is due to a limit on DMA.

To change line to line, you wait for a line and change a colour, wait for the next line, change a colour, as follows:

Code:
 
$2007,$fffe,color00,$0555
$2107,$fffe,color00,$0fff
To change within a line, wait for a line and just start changing colours:

Code:
 
$2007,$fffe,color00,$0111
color00,$0222,color00,$0333
etc. etc.

Bear in mind that if you do the second example you'll have to change the colours several times before you see the change on screen, either that or change the horizontal wait position - in this case you'd change the $07 in $2007 to something larger, say $35 and then you'll see the colour changes sooner.

Any other questions, just shout.

Last edited by pmc; 29 January 2010 at 20:20. Reason: Typos...
pmc is offline  
Old 29 January 2010, 17:24   #4
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,833
The copper can be used to change the contents of any of the custom chip registers, and this includes the color registers. The copper therefore isn't limited to changing colors, but can be used to setup whole displays for example. Or control sprites, or program the blitter, or... you get the picture

The speed at which these copper moves happen is eight lowres pixels in the border area (without overscan you can set fifteen 12bit colors per scanline in the border), and eight pixels in the screen area for low color modes (16 colors or less).

As said before, there aren't any restrictions, except for speed.
Thorham is offline  
Old 29 January 2010, 18:09   #5
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Actually if you have nothing more than a lowres 16 color display then you have enough time to change all 16 colors each line. You can do at most 57 move instructions per line under the best circumstances.
Leffmann is offline  
Old 29 January 2010, 20:40   #6
korruptor
TDI
 
korruptor's Avatar
 
Join Date: Feb 2007
Location: Blitter Town
Posts: 124
Do you mean that you can change all 16 between the end of one line and the start of another, or all 16 during the total length of the scanline?

Edit: Dur, didn't read the post above. 15 in the border.
korruptor is offline  
Old 29 January 2010, 20:56   #7
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Sorry, I meant 16 color changes/move instructions between end of the line and start of the next yes, and I just noticed you can do 17 in fact.
Leffmann is offline  
Old 29 January 2010, 20:58   #8
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,833
Quote:
Originally Posted by Leffmann View Post
Actually if you have nothing more than a lowres 16 color display then you have enough time to change all 16 colors each line. You can do at most 57 move instructions per line under the best circumstances.
I thought it was 15 moves in the border+320/8 moves during the rest of the scanline=55 moves per scanline? Well, it should be at least 55, any more is a nice bonus.

Edit: You checked, and it's 17 moves during the border?
Thorham is offline  
Old 29 January 2010, 21:16   #9
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by Thorham View Post
I thought it was 15 moves in the border+320/8 moves during the rest of the scanline=55 moves per scanline? Well, it should be at least 55, any more is a nice bonus.
57 is correct. On AGA machines you can do this in 8 BPL even if you use the correct fetchmode.
StingRay is offline  
Old 29 January 2010, 21:39   #10
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Yep. The blue color changes are the 17th and the 57th respectively here:
Attached Thumbnails
Click image for larger version

Name:	copper.png
Views:	910
Size:	8.5 KB
ID:	24111  
Leffmann is offline  
Old 29 January 2010, 22:50   #11
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,833
WinUae is nice and all, but has anyone checked this with actual hardware?
Thorham is offline  
Old 29 January 2010, 23:00   #12
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
I haven't got my Amiga here so I can't test, but I trust WinUAE A500 CE mode to be accurate. I've attached the exe here, do you get the same result?
Attached Files
File Type: lha coppertest.lha (1,013 Bytes, 256 views)
Leffmann is offline  
Old 29 January 2010, 23:02   #13
korruptor
TDI
 
korruptor's Avatar
 
Join Date: Feb 2007
Location: Blitter Town
Posts: 124
Quote:
Originally Posted by Leffmann View Post
Sorry, I meant 16 color changes/move instructions between end of the line and start of the next yes, and I just noticed you can do 17 in fact.
Ah, brilliant, didn't realise you could do so many. Is that due to lack of bitplane fetching?
korruptor is offline  
Old 29 January 2010, 23:23   #14
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
Yeah, if you add more bitplanes or disk, sprite or audio DMA then they will start stealing too many cycles from the copper. But let's hear from someone with a real Amiga hooked up first
Leffmann is offline  
Old 30 January 2010, 00:15   #15
Thorham
Computer Nerd
 
Thorham's Avatar
 
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 48
Posts: 3,833
Quote:
Originally Posted by Leffmann View Post
I haven't got my Amiga here so I can't test, but I trust WinUAE A500 CE mode to be accurate. I've attached the exe here, do you get the same result?
Sorry, but I can't test it right now, because my A1200 is dead again Asm1 has offered me a nice deal on an A1200 motherboard, but he still has to check it, and it has to be shipped from the United Kingdom to the Netherlands, so that will take a while.

Off topic: I really wish some company would just buy all the cool old chip sets from Nes to Aga and make the ultimate retro machine. With all those emulators out there, there's probably a big market for a simple box that allows running software from old console and computer platforms.
Thorham is offline  
Old 30 January 2010, 00:16   #16
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,652
Quote:
Originally Posted by Thorham View Post
WinUae is nice and all, but has anyone checked this with actual hardware?
OCS 512k:
Yes, I have. Don't have time to dig up my "little experiments", I'm gonna let Leffman supply the hard data in the meantime...

From memory,

Basically the copper, just like the CPU, can move a word in 4px clocks. Since the copper needs 2 words to change a color (registernumber, value), it can go no faster than 8px per color change.

As you add bitplanes (why ruin the beautiful chunky pixel display... with stuff covering it??) bitplane DMA will steal cycles from the CPU (but not the copper) until you have 5 or 6 bitplanes on, then copper can change color every 12px and 16px resp, while the CPU is in trouble (and will concede priority to the copper ofc).

So the CPU will be twice as fast in the hblanking, if you want to change palettes each scanline, so 32 colors are certainly possible with only a little overscan, you can increase overscan a smidgeon if you turn off sprite,disk,audio dma.

So. Put simply, both copper and bitplane dma will compete with the CPU's ability to do palette changes, so don't use them "in overlapping raster time". On AGA it should be the same, only the pixelclock is twice as fast.
Photon is offline  
Old 30 January 2010, 01:06   #17
Rebel-CD32
Amiga will never die!
 
Rebel-CD32's Avatar
 
Join Date: Nov 2004
Location: Tasmania, Australia
Age: 43
Posts: 532
Send a message via MSN to Rebel-CD32
Sorry this isn't going to help answer any technical questions, but if you'd like to play around with the Copper's ability to change colours all over the screen, give CopColEd a try. It lets you make gradients as well as full screen images with the Copper.

http://aminet.net/package/dev/moni/CopColEdV12

I quickly made this with it http://i50.tinypic.com/29w94ck.jpg
Rebel-CD32 is offline  
Old 30 January 2010, 14:55   #18
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
@ Photon - I'm sure I read somewhere that the copper gradient you used in Blitter Sweet used a trick that allows selection from a larger than 4096 colour palette. Is that correct? If so, care to give us an insight into how that's done?
pmc is offline  
Old 30 January 2010, 21:34   #19
hitchhikr
Registered User
 
Join Date: Jun 2008
Location: somewhere else
Posts: 523
Quote:
@ Photon - I'm sure I read somewhere that the copper gradient you used in Blitter Sweet used a trick that allows selection from a larger than 4096 colour palette. Is that correct? If so, care to give us an insight into how that's done?
Probably switched colors (like displaying $111 in first frame and $222 in second one would give something like flickering $1.51.51.5, etc).
hitchhikr is offline  
Old 30 January 2010, 21:38   #20
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Ah OK, that makes sense - thanks hitchhikr.

So maybe have two identical copper lists (obviously except for the colour changes...) and flip them sequentially?

Wouldn't that lead to some kind of flicker though? A bit like what happens when colours are interlaced on the C64 in some graphics modes?
pmc 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
Combining copper scrolling with copper background phx Coders. Asm / Hardware 16 13 February 2021 12:41
Color Saturation and Color Tint/Hue Retro-Nerd support.WinUAE 22 02 August 2018 10:38
Printing in color with WinUAE on color laser source support.Apps 7 14 April 2013 00:32
Color difference Leandro Jardim support.WinUAE 3 16 November 2012 08:51
ISO true color to 256 color algorithm Lord Riton Coders. General 19 15 April 2011 17:49

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 13:37.

Top

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