Width of a Rainbow

Started by KevG, November 29, 2009, 11:39:57 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

KevG

Hi folks.

Does ayone here know of a way to limit the width of a rainbow?
I am using colour 0 for the rainbow effect but I dont want the rainbow to be viewed in the left
and right border area's of the screen. I know I could just use another colour but that means one colour less for my display. It must use colour 0.

Is there a solution to this?

Many thanks, Kev G

Sidewinder

#1
Hello KevG,

A rainbow is basically a custom copper list that waits for the end of a line and then jams a new color value in the selected color register.  It is possible to create a custom copper list that waits for a given horizontal and vertical position before jamming the new color value.  This could, in theory, be used to set color 0 to black for the border and then to the rainbow color in the screen area, but I've never tried it in practice.

AMOS has some commands that allow you to create custom copper lists from within AMOS, see Appendix F of the Pro manual or the end of chapter 10 of the Creator manual.
- Sidewinder

KevG

Thanks Sidewinder for the info. I'll look into it.

Kev G


SamuraiCrow

Use caution when using custom copper lists because you then lose the Amos copper list generator and therefore lose computed sprites.

Lonewolf10


Hi,

As others have said you can limit the width of a rainbow. I suggest you take a look at this thread

Copper Play (Code)

in which I started playing with custom copperlists. There is also an AMOS file I uploaded, I suggest you take a look at this as it will help you create your own copperlist. Please be careful... if you get your copperlist wrong it's very difficult to recover the AMOS default copperlist (you can do it by pressing Ctrl-C to break out of your program and press Escape a few times to switch between the Editor and Direct mode - this usually does the trick if you haven't completely crashed the Amiga).


Regards,
Lonewolf10


KevG

Hey, thanks Lonewolf.

I will check it out :)

I have already tried playing around with my owncopper list but I dont seem to get any results :(

I am creating a rainbow, then DOKEing values in that copper list rather than create a copper list from scratch. Nothing is crashing, but then again, nothing is happening. I am using COP SWAP as well as you can only DOKE in the Logical list apparantly.

Lonewolf10


If you have looked at my example file I did't use the Doke command, as the copperlist is a special set of instructions and not just a list of numbers. You can only manipulate it directly when you understand how it fully works, and even then the slightest mess-up can corrupt the screen! These are the commands that you need:

Cop Move
Cop Swap
Cop Logic
Cop Movel
Cop Reset
Cop Wait
Copper Off
Copper On


Though having said that, I don't recall using the Cop Logic command. If you haven't already, do look at the example program I uploaded. The last one in it (7 or 8) is a fully working copperlist (well, except for the mouse...), and the others have some cool effects... I have one screen with something like 25 different rainbows active!


Regards,
Lonewolf10


KevG

#7
I think I have got it working. I have managed to get 7 copper rainbows side by side on the same scan line.
Look at the piccy below which only uses 3. (Sorry for my bad drawing skills)




The .iff image is a 4-colour image that I just knocked up in DPaint.

KevG

Hi folks.

Here is little demo showing 7 rainbows on the same scan line!
This means that each scan line can have its own unique palette of 8 colours.
If you do the math for a full screen (PAL) then it works out at 1792 possible colours!
Thats even on an OCS A500 too!

Below is a screen shot showing an 8 colour screen then afterwards showing the
copper list created screen.



I've attached a demo (.lha) so that you can try it out yourselfs :)

I am working on an updated version that allows 16 rainbows on the same scan line.
That is 16x256 (Pal) which will generate 4096 colours! NOT Ham Mode, just 4 bitplanes!


Kev G

SamuraiCrow

@KevG

It looks like you've become our "sliced HAM" expert.  (The so-called Sliced HAM mode was designed to allow maximal behind-the-boarder color changes primarily in HighRes mode on the OCS/ECS Amigas using palette changes with the copper.)

skateblind

What use would all these slices have and how easy would they be to use through out a game or application? It is very impressive.
What are you looking at?

SamuraiCrow

@skate

The problem with using these tricks in a game is that you have to disable the computed sprites before you can get these tricks to work.  I'm not sure if you can even do multiple screens when doing custom copper lists.  The Stars extension has some copper functions similar to sliced HAM but I don't know how well it works with screens and computed sprites.

KevG

#12
@Skate

This technique is only really useful for static screen games although it is useful for horizontal scrolling games too. Shadow Of The Beast used this technique to get all the colours on the screen. It really is only a dual playfield display ( 8 by 8 ) but if you rip the graphics, the mountains are the same colour as the clouds. They used the copper to change the mountain colour. The scrolling fence at the bottom is just another mini dual playfield display.

Vertical scrolling games would be a nightmare to design because you would have to move the rainbows up and down with your graphics.

I don't know of any applications that would benefit although I had an idea last night! It could be possible to load 256 colour .bmp .gif .pcx files into a standard 16 colour AMOS screen. You could in effect have AGA on a non-AGA Amiga! It would take alot of work using colour reduction (quantisation) but in theory it is possible. Another idea to shelve for the time being.....



Lonewolf10


@KevG

It's good to see that you have taken the work that I started and gone a bit further with it :)
I have yet to look at your code, but great job mate.


@SamuraiCrow

Multiple screens (one on screen at a time) are not a problem. The easiest way to switch screens is to:

- Remove current one from being displayed (and any others that are open)
- Switch on AMOS copperlist
- Load in the new screen
- Store address(es) of current bitplane(s)
- Create your new copperlist
- Deactivate AMOS copperlist and activate custom one :)

Dual playfield mode is tougher. You need a copperlist for each screen and... that's as much as I know at present. I never got that far into custom copperlists, as I was busy with other projects. (a phrase I seem to be using far too much :( )
I know there are 2 address registers (CopJmp1 and CopJmp2?). Perhaps they are the starting address of each of the copperlists for the 2 screens? Just guessing. I'll try to look into it sometime.


Regards,
Lonewolf10


SamuraiCrow

QuoteI know there are 2 address registers (CopJmp1 and CopJmp2?). Perhaps they are the starting address of each of the copperlists for the 2 screens? Just guessing. I'll try to look into it sometime.

Ummm... wrong.  The second pair of 16-bit copper registers is for the odd numbered pixels on an interlaced screenmode.  The copper actually supports interlaced copper lists but AmigaOS doesn't have that support built in.