Codetapper's Amiga Site

Palette

There are 3 main options available for palette selection:

  • ECS - Copy the 12-bit ECS colour palette from WinUAE save state
  • AGA - Copy the 24-bit AGA colour palette from WinUAE save state
  • Copperlist - Follow the Amiga copperlist, copying the palette entries until the beam reaches a specific Y co-ordinate

You can also right-mouse click on any colour in the palette and change it to one of the primary colours, or choose Custom and enter your own colour (in RGB format). It is often useful to set the background colour 0 to fuchsia or lime as games tend to use black as a background colour and also black somewhere in the palette.

ECS

The ECS button will work well in a lot of older games that do not use the copper to alter the palette. This also includes poorly written Amiga software (Tiertex games for example) where the colours are set once and never changed. Whatever was in the colour registers when the WinUAE savestate was created will be stored.

AGA

The AGA button will work well in a range of AGA games where 24-bit colour information is stored. There are lots of AGA games that also dynamically change the palette with the copperlist however, so this button will only restore the snapshot of exactly what was in memory at the time.

Copperlist

This is the most powerful mode, as the copperlist in memory will be traced and all colour palette changes will be remembered. At a specified Y co-ordinate, the trace will stop and the colours used at that exact location will be set.

By default, the copperlist will be followed until line $80. This will stop processing colour information somewhere in the middle section of the screen. In 99% of cases, this is correct and will mean any status panels at the top and bottom of the screen are ignored. You should be left with the palette from the game area.

Sometimes you will need to tweak the Y co-ordinate to extract the correct colours. The keyboard keys U and J will alter the Y co-ordinate by 1 pixel, or by 8 if you press the Shift key at the same time.

Take the beautiful game Pang as an example. If you take a screenshot of level 4 (Mt Keirin) and perform a colour count, you will see that the game features 55 unique colours! How is this possible on an ECS Amiga and how can we rip it?

Pang (55 unqiue colours)

Viewing memory as a single bitmap will give you a hint about how the game is handling so many colours:

Pang (55 unqiue colours)

There are 6 distinctive bands in the game area where the palette is being changed by the copper. This is a screenshot with the moving objects removed to make it more obvious:

Pang splits

If you use the ECS colour palette by pressing the ECS button, the colours will be a real mess. This is because the colours from the status panel at the bottom of the screen will be used by the game at the top:

Pang (ECS colours)

It is possible to rip each of the sections with the correct colour palette by following the copperlist and stopping at a particular Y co-ordinate. You can use trial-and-error to find the relevant locations, or get the exact co-ordinates by examining the copperlist in the Info tab:

Chip Addr: Copper instructions ; Comments
-----------------------------------------------------------------------
$00019576: 33E1 FFFE           ; Wait for vpos >= 0x33 and hpos >= 0xE0
$0001957A: 0182 0CFF           ; COLOR01 = 0x0CFF
$0001957E: 0184 06DF           ; COLOR02 = 0x06DF
$00019582: 0186 03BF           ; COLOR03 = 0x03BF
$00019586: 0188 00AF           ; COLOR04 = 0x00AF
$0001958A: 018A 0453           ; COLOR05 = 0x0453
$0001958E: 018C 0876           ; COLOR06 = 0x0876
$00019592: 018E 0A97           ; COLOR07 = 0x0A97
$00019596: 0190 08B6           ; COLOR08 = 0x08B6
$0001959A: 0192 09D9           ; COLOR09 = 0x09D9
$0001959E: 0194 0FDB           ; COLOR10 = 0x0FDB
$000195A2: 0196 0FFD           ; COLOR11 = 0x0FFD
$000195A6: 0198 0889           ; COLOR12 = 0x0889
$000195AA: 019A 0DDD           ; COLOR13 = 0x0DDD
$000195AE: 019C 0EEE           ; COLOR14 = 0x0EEE
$000195B2: 019E 0FFF           ; COLOR15 = 0x0FFF

This means that when the vertical beam position reaches the right edge of line $33, start changing the first 15 colour entries. By using the U and J keys, you can specify the exact stopping line:

Pang (copperlist stopping at line $33)

Looking through the copperlist will reveal all the locations that the game alters the colour palette. The next one is at the end of line $6d:

Chip Addr: Copper instructions ; Comments
-----------------------------------------------------------------------
$000195B6: 6DE1 FFFE           ; Wait for vpos >= 0x6D and hpos >= 0xE0
$000195BA: 0182 0AAB           ; COLOR01 = 0x0AAB
$000195BE: 0184 08BF           ; COLOR02 = 0x08BF
$000195C2: 0186 00AF           ; COLOR03 = 0x00AF
$000195C6: 0188 037C           ; COLOR04 = 0x037C
$000195CA: 018A 005B           ; COLOR05 = 0x005B
$000195CE: 018C 0767           ; COLOR06 = 0x0767
$000195D2: 018E 0889           ; COLOR07 = 0x0889
$000195D6: 0190 0876           ; COLOR08 = 0x0876
$000195DA: 0192 0A97           ; COLOR09 = 0x0A97
$000195DE: 0194 09D9           ; COLOR10 = 0x09D9
$000195E2: 0196 0FDB           ; COLOR11 = 0x0FDB
$000195E6: 0198 0FFD           ; COLOR12 = 0x0FFD
$000195EA: 019A 000D           ; COLOR13 = 0x000D
$000195EE: 019C 000E           ; COLOR14 = 0x000E
$000195F2: 019E 000F           ; COLOR15 = 0x000F

By specifying the stopping co-ordinate of $6d, the palette entries will be correct for the second horizontal strip:

Pang (copperlist stopping at line $6d)

Continuing on, we find $7f is the next location:

Chip Addr: Copper instructions ; Comments
-----------------------------------------------------------------------
$000195F6: 7FE1 FFFE           ; Wait for vpos >= 0x7F and hpos >= 0xE0
$000195FA: 0182 0AAB           ; COLOR01 = 0x0AAB
$000195FE: 0184 00AF           ; COLOR02 = 0x00AF
$00019602: 0186 037C           ; COLOR03 = 0x037C
$00019606: 0188 005B           ; COLOR04 = 0x005B
$0001960A: 018A 002B           ; COLOR05 = 0x002B
$0001960E: 018C 0767           ; COLOR06 = 0x0767
$00019612: 018E 0889           ; COLOR07 = 0x0889
$00019616: 0190 0876           ; COLOR08 = 0x0876
$0001961A: 0192 0A97           ; COLOR09 = 0x0A97
$0001961E: 0194 06BA           ; COLOR10 = 0x06BA
$00019622: 0196 09D9           ; COLOR11 = 0x09D9
$00019626: 0198 0FDB           ; COLOR12 = 0x0FDB
$0001962A: 019A 0FFD           ; COLOR13 = 0x0FFD
$0001962E: 019C 000E           ; COLOR14 = 0x000E
$00019632: 019E 000F           ; COLOR15 = 0x000F

Pang (copperlist stopping at line $7f)

The correct palette for the 4th strip requires $a2 to be set as the Y position:

Chip Addr: Copper instructions ; Comments
-----------------------------------------------------------------------
$00019636: A2E1 FFFE           ; Wait for vpos >= 0xA2 and hpos >= 0xE0
$0001963A: 0182 006B           ; COLOR01 = 0x006B
$0001963E: 0184 037C           ; COLOR02 = 0x037C
$00019642: 0186 005B           ; COLOR03 = 0x005B
$00019646: 0188 002B           ; COLOR04 = 0x002B
$0001964A: 018A 0364           ; COLOR05 = 0x0364
$0001964E: 018C 0767           ; COLOR06 = 0x0767
$00019652: 018E 0776           ; COLOR07 = 0x0776
$00019656: 0190 0597           ; COLOR08 = 0x0597
$0001965A: 0192 0AAB           ; COLOR09 = 0x0AAB
$0001965E: 0194 0889           ; COLOR10 = 0x0889
$00019662: 0196 06BA           ; COLOR11 = 0x06BA
$00019666: 0198 07B8           ; COLOR12 = 0x07B8
$0001966A: 019A 0FDB           ; COLOR13 = 0x0FDB
$0001966E: 019C 000E           ; COLOR14 = 0x000E
$00019672: 019E 000F           ; COLOR15 = 0x000F

Pang (copperlist stopping at line $a2)

Next up is $b9, which has the lower strip of land:

Chip Addr: Copper instructions ; Comments
-----------------------------------------------------------------------
$00019676: B9E1 FFFE           ; Wait for vpos >= 0xB9 and hpos >= 0xE0
$0001967A: 0182 002B           ; COLOR01 = 0x002B
$0001967E: 0184 035B           ; COLOR02 = 0x035B
$00019682: 0186 036D           ; COLOR03 = 0x036D
$00019686: 0188 058E           ; COLOR04 = 0x058E
$0001968A: 018A 07AF           ; COLOR05 = 0x07AF
$0001968E: 018C 0A86           ; COLOR06 = 0x0A86
$00019692: 018E 0654           ; COLOR07 = 0x0654
$00019696: 0190 0665           ; COLOR08 = 0x0665
$0001969A: 0192 0864           ; COLOR09 = 0x0864
$0001969E: 0194 0597           ; COLOR10 = 0x0597
$000196A2: 0196 0398           ; COLOR11 = 0x0398
$000196A6: 0198 0364           ; COLOR12 = 0x0364
$000196AA: 019A 07B8           ; COLOR13 = 0x07B8
$000196AE: 019C 000E           ; COLOR14 = 0x000E
$000196B2: 019E 000F           ; COLOR15 = 0x000F

Pang (copperlist stopping at line $b9)

And the final section of the game screen has a palette change at the end of line $ce to create the blue shades on the water:

Chip Addr: Copper instructions ; Comments
-----------------------------------------------------------------------
$000196B6: CEE1 FFFE           ; Wait for vpos >= 0xCE and hpos >= 0xE0
$000196BA: 0182 002B           ; COLOR01 = 0x002B
$000196BE: 0184 035B           ; COLOR02 = 0x035B
$000196C2: 0186 036D           ; COLOR03 = 0x036D
$000196C6: 0188 058E           ; COLOR04 = 0x058E
$000196CA: 018A 069F           ; COLOR05 = 0x069F
$000196CE: 018C 06AF           ; COLOR06 = 0x06AF
$000196D2: 018E 008D           ; COLOR07 = 0x008D
$000196D6: 0190 07BF           ; COLOR08 = 0x07BF
$000196DA: 0192 000F           ; COLOR09 = 0x000F
$000196DE: 0194 000F           ; COLOR10 = 0x000F
$000196E2: 0196 000F           ; COLOR11 = 0x000F
$000196E6: 0198 000F           ; COLOR12 = 0x000F
$000196EA: 019A 000F           ; COLOR13 = 0x000F
$000196EE: 019C 000F           ; COLOR14 = 0x000F
$000196F2: 019E 000F           ; COLOR15 = 0x000F

Pang (copperlist stopping at line $ce)

That's it for the game area palette changes. The is one other change a little further down, and that is to display the score panel at the bottom of the screen. At the very left of line $f4, the game is switched to 4 bitplane (16-colour) mode, and new bitplane pointers are set:

Chip Addr: Copper instructions ; Comments
-----------------------------------------------------------------------
$000197F6: F311 FFFE           ; Wait for vpos >= 0xF3 and hpos >= 0x10
$000197FA: 009C 8800           ; INTREQ = 0x8800
$000197FE: F411 FFFE           ; Wait for vpos >= 0xF4 and hpos >= 0x10
$00019802: 0100 4000           ; BPLCON0 = 0x4000 (16 colour mode)
$00019806: 0096 0020           ; DMACON = 0x0020
$0001980A: 00E0 0006 00E2 A430 ; BPL1PT = 0x0006A430
$00019812: 00E4 0006 00E6 ACF0 ; BPL2PT = 0x0006ACF0
$0001981A: 00E8 0006 00EA B5B0 ; BPL3PT = 0x0006B5B0
$00019822: 00EC 0006 00EE BE70 ; BPL4PT = 0x0006BE70
$0001982A: 0182 0FFF           ; COLOR01 = 0x0FFF
$0001982E: 0184 064A           ; COLOR02 = 0x064A
$00019832: 0186 0AAE           ; COLOR03 = 0x0AAE
$00019836: 0188 0620           ; COLOR04 = 0x0620
$0001983A: 018A 0EEE           ; COLOR05 = 0x0EEE
$0001983E: 018C 0A28           ; COLOR06 = 0x0A28
$00019842: 018E 0F8C           ; COLOR07 = 0x0F8C
$00019846: 0190 0C64           ; COLOR08 = 0x0C64
$0001984A: 0192 0EC8           ; COLOR09 = 0x0EC8
$0001984E: 0194 0A00           ; COLOR10 = 0x0A00
$00019852: 0196 0B00           ; COLOR11 = 0x0B00
$00019856: 0198 0000           ; COLOR12 = 0x0000
$0001985A: 019A 0FA8           ; COLOR13 = 0x0FA8
$0001985E: 019C 0FC0           ; COLOR14 = 0x0FC0
$00019862: 019E 0000           ; COLOR15 = 0x0000
$00019866: FFE1 FFFE           ; Wait for vpos >= 0xFF and hpos >= 0xE0

Pang score panel

By copying the individual strips into a new file, you can re-create the entire screen.

Post your comment

Comments

  • Gravatar for David

    Great analysis ! Love it. Thanks.

    David 03/08/2013 4:33pm (11 years ago)

RSS feed for comments on this page | RSS feed for all comments

You may enjoy these articles...

Palette

Comedy

If you look inside many Amiga games, secret messages have been hidden by the programmers. Richard Aplin was the king of hiding messages in the startup-sequence file, and his Line of Fire and Final Fight startup-sequences have become legendary! The Sensible Software team were also prolific at hiding messages in their games.

Palette

Interviews

A collection of technical interviews with Amiga programmers that worked on commercial software in the glory days of the Amiga (late 1980s to early 1990s!)

Palette

Maptapper

The Ultimate Amiga Graphics, Level and Map Ripper!

Palette

Random Rants

A random assortment of rants relating to the Amiga!

Palette

Sprite Tricks

An explanation of how many famous Amiga games utilised sprites in weird and interesting ways