Welcome, Guest. Please login or register.

Author Topic: Colors on the Amiga  (Read 13870 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline GreatLor

  • Jr. Member
  • **
  • Join Date: Apr 2004
  • Posts: 72
    • Show only replies by GreatLor
Re: Colors on the Amiga
« Reply #14 on: April 29, 2004, 02:32:15 PM »
I know thomas, just didnt have time/energy to look in my VERY old mags hehe ! hey thomas, have you done any Intros or soomething ?
 

Offline Thomas

Re: Colors on the Amiga
« Reply #15 on: April 29, 2004, 02:57:37 PM »
Well, some school friends of mine were members of a scene group. Alpha Flight, IIRC. They [d]provided me with cracked games and[/d] encouraged me to start coding intros and demos. I think I finished two or three works which were really published, but I never advanved as far as the "real" demo coders. If memory servers correctly just before end of school (must be 1989 or '90) we joined a group called Catwalk. But then I lost contact to the people and to the scene shortly after that.

One of my friends coded a translator which created 68k assembler code from Rob Hubbard C64 songs, just around the time when (or shortly before) PlaySID was developed.

Bye,
Thomas

Offline evil_nerdTopic starter

  • Jr. Member
  • **
  • Join Date: Apr 2004
  • Posts: 77
    • Show only replies by evil_nerd
    • http://www.evil-nerd.tk/
Re: Colors on the Amiga
« Reply #16 on: April 29, 2004, 03:01:29 PM »
ok I wanna give it a try! Using C, I wanna make some graphics :D But whats a good tutorial (never programmed on an Amiga before, is it much different from x86?
Having an Amiga 500 and enjoying it :-D  :-D  :-D
 

Offline GreatLor

  • Jr. Member
  • **
  • Join Date: Apr 2004
  • Posts: 72
    • Show only replies by GreatLor
Re: Colors on the Amiga
« Reply #17 on: April 29, 2004, 03:23:54 PM »
I you mean asm all I can say is that it is HELL alot more elegant syntax in the 680x0 family, I had a look at x86 asm syntax, I didnt exactly fall in love with it (actually was almost throwing up), do you know x86 evil_nerd ? I dont understand how ppl can code x86 cpu's, hell even in C it's a HELLISH SLAVISH amount of code just to use the damn API's for gods sake ! :-(
 

Offline pwest

  • Newbie
  • *
  • Join Date: Mar 2004
  • Posts: 20
    • Show only replies by pwest
Re: Colors on the Amiga
« Reply #18 on: April 29, 2004, 04:29:04 PM »
The basic Amiga 500 had a color palette of 32 basic colors. I'm not sure at what revision they also added Extra HalfBrite mode, but you couldn't modify the halfbrite colors directly since there were only 32 color registers, but you could basically have images with 64 colors total. There could be a maximum of 6 bitplanes.

Then you had HAM6 mode, in which 2 bits of each pixel's value determines the code of what to do (ie hold, modify red, modify green or modify blue), and 4 bits to determine the amount to modify that component. It could only modify one component at a time per pixel so took about 3 pixel to fully transition to a new color, although it did allow you to select from a base color palette of 16 colors when you told it to `hold`... ie use a real color.

The color palette itself had a 12-bit color resolution, ie 4096 maximum different shades. Some clever people invented something called Dynamic Ham making use of the Amiga's copperlists to modify the palette on give lines of the screen or at given intervals, allowing the literal pixels (from the palette of 16) to be used more often using modified colors... but if I recall, the copper could only modify one color register per 4 (or was it 8?) low-resolution pixels horizontally, so only so many changes could be performed in a given amount of space. Either way, this could be used to optimize an image and display using more individual colors and therefore less of the `modify` operations.

It was the inability of a modify operation to change more than one component at a time, requiring 3 pixels to completely transition, that led to the effect they called `Ham Fringing`, ie a color `bleed` where modify operations were used that didn't get close enough to the color you wanted for a given pixel. Good software would be able to change 24-bit images into a Ham image with a specially selected color palette to make best use of the 16 color registers so that there was the least fringing and best color representation.

There was also something called Sliced Ham which was basically dynamic ham but there were only a set number of palettes per image, divided into slices down the screen, rather than the constantly modifying copperlist of Dynamic HAm.

Also you can't really say that there were only 32 (or 64) real colors because you could also apply the copperlist to change color registers at any point in the display (although only one change per unit of (4 or 8?) pixels). ... With clever and diligent use this allowed several different slices of the display to be given different color palettes, so in a game like Shadow of the Beast you could have your 8-color clouds with their own palette, then some mountains with their own palette, then some horizon-ground stuff, then some foreground, and also the strip with the fence at the bottom of the screen, etc, and I'm sure the same effect was used for the other 8 colors of the foreground playfield (since it was a dual-playfield game with two separate bitmaps of 3 bitplanes each).

And that's another thing, dual playfields would split the 6 available bitplanes into two sets of 3, each with their own palette of 8 colors, and could be scrolled independently of each other... Bits (pixels) in one set of bitplanes would not be affected by bits in the other playfield, thus giving the impression that there were two layers (or playfields)... or in other words, the bits from the lower 3 bitplanes were overwritten with bits from the higher bitplanes rather than being combined with them, on-the-fly as the copper render the display. So in this mode, some software had only 16 base colors to work with. .. but of course they could do some copperlist magic to change color register contents across each line and down the screen... hense a cool colorful looking game like Shadow of the Beast I think was quoted as having at least a few hundred simultaneous colors onscreen.

So with judicious use of the copperlists and the dual playfields and careful design of whatever the particular software or game is, it was possible to actually output a lot more colors, and I know some games probably had way more than the basic 256 colors that PC's were starting to come out with their VGA displays. I don't think there were many Ham-based games, but there were some. "Universe" springs to mind. The only issue with Ham was that, since the color changes occured as the copper rendered the display to the output device (monitor/tv), it would modify the color based on what the color was immediately to the left. So you had to be careful to use one of those literal colors from the color registers down the left and right edges of moving images (blitter objects - bobs), so that there wouldn't be unsightly fringing or incorrect colors. That was quite a challenge to achieve, and could be noticed in all Ham paint packages that moved brushes around. As a result, Ham was kind of slow but it was pretty at the time.

Also there were hardware sprites which, even if the display was only using, say, 8 colors, would render the hardware sprites in colors from higher up in the palette, so there could be more colors used than the number of actual bitplanes in the bitmap data. With some judicious use of copperlist color changes and careful switching on and off of sprites as their data was rendered by the hardware on the fly down the screen, `virtual sprites` could be drawn each with their own color palette. I don't exactly remeber if sprites were 8 or 16 colors, tho, just that they were only up to 16 pixels wide and there were 8 of them (one of which was the mouse pointer in the o/s).

So basically overall it's hard to exactly say how many colors the A500 had. It was capable of 4096 colors - a 12-bit color palette, potentially simultaneously, but it would depend largely on clever design techniques and special copperlist palette changes to make full use of all of the colors at once. Even though there were only 32 modifyable color registers, and 32 halfbrite registers (in later revisions only I think), there were allowed to be up to 6 bitplanes... which could be used in various clever ways, either in split playfields or Ham modes or whatever. I am sure that some games I saw made very clever use of color changes to make the screen very colorful and I'm sure I've read some game companes reporting that their games had over 1000 colors on screen at a time in some cases.

The separated bitplane model - ie Planar graphics rather than Chunky, was cool.. even though proving eventually less efficient for certain kinds of graphics manipulation on a per-pixel basis.

Ahhhhhhhhhhhhhhhh.... those were the days. I'm surprised I remember all this! But of course I do, cus I really loved my Amiga 500!! *kissy*

Paul
 

Offline Thomas

Re: Colors on the Amiga
« Reply #19 on: April 29, 2004, 04:44:17 PM »
Quote

evil_nerd wrote:
ok I wanna give it a try! Using C, I wanna make some graphics :D But whats a good tutorial (never programmed on an Amiga before, is it much different from x86?




Before you start coding for the Amiga you have to learn about the structure of AmigaOS and its coding rules. #include will not work on the Amiga.

A big big recommendation is to buy the Amiga Developer CD. It is not too expensive, especially in its older versions which all cover the 1.3 NDK (Native Developer Kit).

It also covers the RKRMs (ROM Kernel Reference Manuals) which are essential readings.

Bye,
Thomas

Offline evil_nerdTopic starter

  • Jr. Member
  • **
  • Join Date: Apr 2004
  • Posts: 77
    • Show only replies by evil_nerd
    • http://www.evil-nerd.tk/
Re: Colors on the Amiga
« Reply #20 on: April 30, 2004, 03:23:27 PM »
No, I understand that #include will not work :-) But before I buy the CD, are there good sites on this topic?
Having an Amiga 500 and enjoying it :-D  :-D  :-D
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: Colors on the Amiga
« Reply #21 on: April 30, 2004, 04:11:00 PM »
The only website I know that has any decent example source is the Aminet.  There are also C compilers on there too.  (DICE C should work on Kickstart 1.3 but if you have Kickstart 2.0 or newer and a lot of memory VBCC produces better code.)
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
ALL AMIGA 500s HAVE 64 COLOR MODE +more
« Reply #22 on: May 01, 2004, 03:15:55 PM »
Every Amiga 500 ever built had 64 color mode.

This is why games like Dungeon Master were so dam
depressungly disappointing with its puny 16 colors.
Dungeon Master was ported from Atari ST which only
allowed lame 16 color games.

The 64 color EHB mode was introduced in 1985 with
the A1000.  Some A1000s came with the 64 color chip
while others did not.  I know because I was there.

The most colors I ever personally programmed in any
AmigaOS game for the A500 was about 80. (Chaos WWII)

The most colors I ever personally programmed in any
AmigaOS game for the A1200 was about 6000. (Total Chaos)

Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline Thomas

Re: ALL AMIGA 500s HAVE 64 COLOR MODE +more
« Reply #23 on: May 01, 2004, 03:19:45 PM »
Quote

But before I buy the CD


Why ??? It is essential. And it is cheap. And it has a C/C++ compiler with GUI on it (which requires Amiga OS 3.x though, and a CD-ROM drive of course).

However you might have a look at the programming part of http://www.amigau.com/

Bye,
Thomas

Offline Jose

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2871
    • Show only replies by Jose
Re: ALL AMIGA 500s HAVE 64 COLOR MODE +more
« Reply #24 on: May 01, 2004, 05:07:12 PM »
@ChaosLord

"...The most colors I ever personally programmed in any
AmigaOS game for the A1200 was about 6000. (Total Chaos)..."

Interestig. Never tried it. Was that with HAM8 or using the Copper to change the pallete on the fly?

 
\\"We made Amiga, they {bleep}ed it up\\"
 

Offline ChaosLord

  • Hero Member
  • *****
  • Join Date: Nov 2003
  • Posts: 2608
    • Show only replies by ChaosLord
    • http://totalchaoseng.dbv.pl/news.php
Re: ALL AMIGA 500s HAVE 64 COLOR MODE +more
« Reply #25 on: May 02, 2004, 04:15:26 PM »
Quote

"...The most colors I ever personally programmed in any
AmigaOS game for the A1200 was about 6000. (Total Chaos)..."

Interestig. Never tried it. Was that with HAM8 or using the Copper to change the pallete on the fly?


yes  :-D

HAM8 for 6000 colors + 16 more colors at bottom of
screen using AmigaOS Copper.

HAM8 can easily do 256000 colors I just never displayed
any artwork that actually used more than 6000 or so.

Wanna try a wonderfull strategy game with lots of handdrawn anims,
Magic Spells and Monsters, Incredible playability and lastability,
English speech, etc. Total Chaos AGA
 

Offline LocalH

  • Newbie
  • *
  • Join Date: Nov 2002
  • Posts: 39
    • Show only replies by LocalH
Re: ALL AMIGA 500s HAVE 64 COLOR MODE +more
« Reply #26 on: May 03, 2004, 07:14:03 AM »
What about those pictures that were in hires lace, but with 16 independent colors per scanline (IIRC)? What was the name of that mode? It's been so long since I've seen one that I've forgotten. Does WinUAE fully support those? I'd love to convert some of them over to truecolor images. The ones I used to have were quite brilliant, and I believe they used the full overscan too, but I could be wrong.
 

Offline GreatLor

  • Jr. Member
  • **
  • Join Date: Apr 2004
  • Posts: 72
    • Show only replies by GreatLor
Re: ALL AMIGA 500s HAVE 64 COLOR MODE +more
« Reply #27 on: May 04, 2004, 02:37:31 PM »
Hey I've got interested somewhat in coding the amiga in assembler again, during the past days I've been sick at home and reading a two-page article about coding the dos an assembler from a mag called "hemdator-nytt" (swedish mag) from 1990 (tears).
Now, I want to use the DOS in asm and I'm looking for pages containging files, giving all the info of the OS-libraries, the offsets to their routines and the in/out parameters, please post any links you have.

Thanx in advance !
 

Offline Karlos

  • Sockologist
  • Global Moderator
  • Hero Member
  • *****
  • Join Date: Nov 2002
  • Posts: 16879
  • Country: gb
  • Thanked: 5 times
    • Show only replies by Karlos
Re: ALL AMIGA 500s HAVE 64 COLOR MODE +more
« Reply #28 on: May 04, 2004, 04:39:58 PM »
Quote

LocalH wrote:
...but with 16 independent colors per scanline (IIRC)? What was the name of that mode?


That was SHAM (sliced HAM) or something wasn't it? I remember there was a HAM8 derived version that could get so close to 24-bit you'd struggle to tell the difference.

There was also a strange 15-bit emulation that used the old HAM6 laced mode. Each pixel was split into two (vertically) where the least significant bits of the 15-bit data were split between the upper and lower pixels.

So, suppose you wanted to show the lowest level of grey possible in 15-bits, the upper pixel would have 12-bit RGB values of 1 1 1 and the lower pixel would have 12-bit RGB balues of 0 0 0. This pattern of upper/lower was inverted every pixel to produce a regular dither pattern to improve the effect.

The eye thus saw one larger pixel as an average of the two colours and you got the effect of an extra bit of precision for each channel.

It was pretty simple, but effective :-)

The downside was you couldn't show images that were taller than the lowres mode because effectively the onscreen image was doubled.
int p; // A
 

Offline pwest

  • Newbie
  • *
  • Join Date: Mar 2004
  • Posts: 20
    • Show only replies by pwest
Re: ALL AMIGA 500s HAVE 64 COLOR MODE +more
« Reply #29 from previous page: May 04, 2004, 08:08:47 PM »
Interesting stuff about the SHAM and the vertically split ... ie two vertical pixels representing a color, thing... although obviously that would suffer a resolution penalty.

Another technique for a slightly flickery display just came to mind ... I don't know if anyone ever tried this but it would give the illusion of billions of colours....

I don't know exactly how fast screen/palette switching is on graphics cards these days .. I seem to remembering it was more difficult to synchronize such things with the vertical blanking cycle on gfx cards than it was on the old OCS/ECS/AGA chipsets. .. but anyway...

What if you had two versions of an image. One image has color precision rounded down to the nearest available colors, and the other has the color precision rounded up. Then you flip between the two images at 50/60fps so that each image is displayed for 1 frame.

The colors in the one image would seem to combine with the colors in the other image to produce a hybrid color?

For example, taking it to an extreme, black pixels in one image would combine with white pixels in the other to produce a grey?

Of course you wouldn't have to use only black and white. You'd use as many colors in each image as possible. If there was scrolling, both frames would scroll together... even if there is a 50fps refresh this produces the effect of it being a 25fps refresh.

It halves the refresh rate, but the illusion of a third color is produced for every pixel based on the combination of the two colors to the eye. Even if you only had 12-bit color in each image, surely this would give you an illusion of 24-bit color.. if not a lot more? I don't know what the exact formula would be.

I don't even know if the illusion would work but it would sure work BETTER if the refresh rate was high enough ... eg a 100hz refresh would produce a screen at 50hz with flips between screens being one flip per cycle. It would give you a 50hz screen with a whole lotta colors?

I haven't tried it, like I said, to see if the illusion actually holds up and if the flip is fast enough to make the effect, but hey... this just came to me and I don't have an Amiga. Maybe someone can try it and let us know if it works.

Imagine how many colours you could potentially have if you used the 18-bit color palette of AGA and flipped between two slightly differently colored versions of the same image? .... all those hybrid colors.. .36bit color?