English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 26 January 2016, 05:49   #1
turrican3
Moon 1969 = amiga 1985
 
turrican3's Avatar
 
Join Date: Apr 2007
Location: belgium
Age: 48
Posts: 3,913
copper ?

hi coders,
how many colours could we add to a game like fightin spirit using the full copper possibilities ??? without slow down ??? I chosed this game because there is not multi scroll or things like that, just big characters and some tiny animations. Just think about it without the tiny background animations (flags etc...) how many colours could reach a coder with a good skill and without slow down ? What's the limits of copper ?? I suppose that the limit is the number of colours it could change during 1 frame ???
turrican3 is offline  
Old 26 January 2016, 09:42   #2
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,437
Well, a copper wait takes 3 DMA slots and a copper move takes 2 DMA slots, so while it's very cheap to wait on a position and change a colour it's not completely free.

Changing 16 colours (incl. the wait) takes 35 out of 226 available slots in a scanline. So, for a 320x256 screen changing 16 colours every scanline takes 8960 slots, or 12,6% of all DMA time available per frame.

Maximum amount of copper colour changes is 56 or 57 per scanline (the copper can only access the odd DMA slots, so 226/2/2 = 56,5). This amounts to a maximum of 14336 colour changes per 320x256 screen, at a cost of using half of the available DMA time during display


As for Fighting Spirit - I guess it all depends on how much time it has left in a frame. If it has 10% time left, you'd be able to change far more colours than when it has only 1% left.
roondar is offline  
Old 26 January 2016, 12:50   #3
turrican3
Moon 1969 = amiga 1985
 
turrican3's Avatar
 
Join Date: Apr 2007
Location: belgium
Age: 48
Posts: 3,913
Then with a game like fighting spirit the copper could change more or less 2800 colours !!!! It's really huge !!! But it must be tried in the reality.
Often i read that jim power reach sometimes more than 1.000 colours... But is it true ? not in a cycle color background change like in turrican, which is easier. But i never saw a proof of it, if someone know the part which could have this amount of colour in jim power, which stage ???
When i read you, i realize that the amiga could make better games that he had with more than 200 colours on the screen... Every adventure game should be in 256 colours on amiga 500, why coders didn't use that trick more often ??? they were lazy or was it difficult to do ?? Why game coders didn't use more that trick ???
turrican3 is offline  
Old 26 January 2016, 13:28   #4
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,437
Well, the problem with copper palette changes is really two-fold.

1) Your graphics must actually be able to use all these extra colours. They also need to be designed for colour changes, which is not always easy to do - especially not with the standard tools in the 80's and 90's (Deluxe Paint and such don't let you edit a screen with copper colour changes).

After all, you still only have 16 (or 32) colour registers per scanline. If things have to move about on screen, this means a number of these colours need to be locked at all times. The more colourful your bobs and sprites are, the fewer colours you can reuse on the same scanline.

For non moving object it is easier, but remember that the Amiga's 4096 colours do limit you in how many shades of a colour you can pick which does somewhat limit the usefullness of changing colours here.

2) managing the copperlist and palette becomes a lot more challenging.
A simple fade out operation becomes much harder if you need to fade 2000 colours spread over many copper instructions over one that simply does 32 directly in the colour registers.

For example, check out the demo Frazetta by Scoopex*, which explains at the end how much effort was put into making the colour fades work.

Furthermore, it does take some DMA time to change colours and lots of games on the Amiga struggled to reach 50Hz even without such tricks, so it could be a question of choice: rather having more bobs than more colours.

---

That said, I do agree that the Amiga was a bit short-changed. Games with still backgrounds could easily have used more colour than they did (like Universe and to a lesser extent Pang did).

Personally I think that most games didn't get more colours because they where created on multiple platforms and just picked a colour scheme that would work on all systems. Amiga exclusives did on occasion use tons of colours, but like I pointed out, working with copper colour changes can be difficult.

*) [ Show youtube player ]

Last edited by roondar; 26 January 2016 at 13:36.
roondar is offline  
Old 26 January 2016, 14:25   #5
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by turrican3 View Post
hi coders,
how many colours could we add to a game like fightin spirit using the full copper possibilities ??? without slow down ??? I chosed this game because there is not multi scroll or things like that, just big characters and some tiny animations. Just think about it without the tiny background animations (flags etc...) how many colours could reach a coder with a good skill and without slow down ? What's the limits of copper ?? I suppose that the limit is the number of colours it could change during 1 frame ???
First a question: why several question marks? Isn't one just enough?

Second, well, your questions are very generic and assume a lot of knowledge about how Fightin Spirit operates which makes the best answer to be: I don't know.

The reason being that we would need to know the following facts about the games:
  • How many free DMA slots does it have on every frame?
    The Copper needs DMA slots to change colors so if there are none, the answer to your question is "zero".
  • Doesn't it already use the Copper?
    Hard to answer without using UAE to look at the copperlist but my impression is that it very likely already uses the Copper to increase background colors.
    Look at the backgrounds: they all have very clear horizontal sections which use distinctly different colors. Many times the top and bottom sections use completely different colors so if could already be using the Copper for that.

"What are the limits of the Copper?"

Well, too generic again: a Copper color change costs 2 DMA slots, display costs DMA slots, CPU costs DMA slots, Blitter costs DMA slots. So what you can do with the Copper depends on how many free DMA slots you have after doing the rest.

Fightin Spirit seems to use EHB which consumes a lot of DMA slots, it probably uses the Blitter to draw characters and given that it does not draw many things we can assume that either:
they did not have enough time to code more effects
or that:
they are actually using all available DMA cycles and not much more can be added.

But to answer your question: if
  • you set the display to use 4 or less bitplanes,
Then the Copper can be used to change color 0 at max speed, that is, every eight pixels. This results in a display where 4096 colors can be used but where each pixel is 8 lowres pixel wide and which is called "Copper chunky".

You can do a lot of nice things with that mode and a lot of demos used it but updating the copperlist takes a large amount of CPU or Blitter. I am certain that fantastic games could be designed around Copper chunky but they would have a lot of constraints.

Fightin Spirit cannot use Copper chunky because it uses more than 4 bitplanes graphics and Copper chunky is only possible with <= 4 bitplanes with full horizontal width.

So what can be done? Well, check how many free DMA cycles the game has, then we will be able to tell precisely.
ReadOnlyCat is offline  
Old 26 January 2016, 14:33   #6
turrican3
Moon 1969 = amiga 1985
 
turrican3's Avatar
 
Join Date: Apr 2007
Location: belgium
Age: 48
Posts: 3,913
Thanks for the explanations but (sorry for thee noob question) but what means dma ???
turrican3 is offline  
Old 26 January 2016, 14:37   #7
ReadOnlyCat
Code Kitten
 
Join Date: Aug 2015
Location: Montreal/Canadia
Age: 52
Posts: 1,178
Quote:
Originally Posted by turrican3 View Post
Then with a game like fighting spirit the copper could change more or less 2800 colours !!!! It's really huge !!! But it must be tried in the reality.
Often i read that jim power reach sometimes more than 1.000 colours... But is it true ? not in a cycle color background change like in turrican, which is easier. But i never saw a proof of it, if someone know the part which could have this amount of colour in jim power, which stage ???
When i read you, i realize that the amiga could make better games that he had with more than 200 colours on the screen... Every adventure game should be in 256 colours on amiga 500, why coders didn't use that trick more often ??? they were lazy or was it difficult to do ?? Why game coders didn't use more that trick ???
Argh, too many questions again. Take a deep breath! Ask one question first to understand, then ask the next one.
Asking too many will not yield clear answers.

So to answer only this part because the answers to the rest derives from it:
Quote:
Originally Posted by turrican3 View Post
Then with a game like fighting spirit the copper could change more or less 2800 colours !!!! It's really huge !!! But it must be tried in the reality.
Short answer: No way this is possible.

You are ignoring basic constraints.
Color changes take 2 DMA slots to occur.
So you need free DMA slots before you can add new colors. Cf roondar's answer for details.

Most important rule ever: "if it was that easy and huge then it would already have been done".

There are many things which have not been tried on the Amiga but all the easy ones have been tried. So what remains are the really hard ones or the very tricky to conceptualize.

Quote:
Originally Posted by turrican3 View Post
Thanks for the explanations but (sorry for thee noob question) but what means dma ???
Short answer: DMA is the first thing one needs to know about to understand what can and cannot be done on the Amiga.

It looks like I am trolling but that is true. Alas I have no time to explain now.

Last edited by TCD; 26 January 2016 at 15:51. Reason: Back-to-back posts merged.
ReadOnlyCat is offline  
Old 26 January 2016, 15:04   #8
turrican3
Moon 1969 = amiga 1985
 
turrican3's Avatar
 
Join Date: Apr 2007
Location: belgium
Age: 48
Posts: 3,913
I suppose DMA means direct memory access, could it be the way that each amiga co-pro can use the chip ram without using the cpu.
Is it right ?
turrican3 is offline  
Old 26 January 2016, 15:14   #9
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,437
The short, short version of what DMA is:

DMA stands for Direct Memory Access, which basically makes it possible for other things than the CPU to use memory directly - hence the term Direct

On the Amiga this is used by (at least) the Blitter, Copper, Sprites, Display, Audio and Disk Drive.

Now, like all things, DMA is limited. In the Amiga's case, it is limited to a certain number of DMA operations or 'DMA slots' per screen update (50hz for PAL).

On the Amiga we have 226 such slots per scanline (basically the 'Y' position of the screen). Including the time needed to reset the beam to the top of the screen (Amiga was based on screens using CRT technology), the Amiga has 313 scanlines for a PAL display.

Which means it has 226*313 DMA slots, or 70.738 of them per frame.

How is all works is that (basically) the CPU, copper, blitter, etc each take turns using some of these slots to do their thing or take no slots if they don't do anything. Display and Blitter tend to use lots of DMA slots to do their work, the CPU less so and the sprite, audio, copper and diskdrive tend to use far less.

To add copper colour changes, we need free DMA slots. And like ReadOnlyCat explained, how many we have depends on screen mode & blitter use.
roondar is offline  
Old 27 January 2016, 07:35   #10
Knocker
Registered User
 
Join Date: Jan 2016
Location: Santa Cruz/US
Posts: 48
FYI, section 1.5.2 in Amiga System Programmer's Guide (e.g. see here) has a good explanation of how DMA works.
Knocker is offline  
Old 27 January 2016, 09:10   #11
turrican3
Moon 1969 = amiga 1985
 
turrican3's Avatar
 
Join Date: Apr 2007
Location: belgium
Age: 48
Posts: 3,913
Thank you guys for the explanations.
turrican3 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
Copper cycles leoha Coders. Asm / Hardware 4 02 November 2012 11:02
Copper tricks Lonewolf10 Coders. General 14 31 March 2011 22:09
Copper Bars Vortex Coders. Tutorials 51 26 June 2009 23:23
Stuck with copper example cosmiq Coders. General 6 17 October 2008 22:29

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 01:36.

Top

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