termcol: define 512 and 4k colour rgb maps
authorMischa POSLAWSKY <perl@shiar.org>
Sun, 1 Nov 2015 19:33:57 +0000 (20:33 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 5 Jan 2016 00:05:07 +0000 (01:05 +0100)
Common 9- and 12-bit palettes used by various legacy systems.

termcol.inc.pl

index 385f277845fb3f4976c130d176ee285f597a0117..e3fbd71071fcc6a33fa2e5d9a19ccdeb9f694075 100644 (file)
@@ -200,4 +200,19 @@ my @msxorder = ( 0,6,2,10,4,13,7,14 , 1,8,3,11,5,9,12,15 );
                        [ map { $_ * 10 + 8 } 0 .. 23 ],
                ],
        },
+       512 => {
+               name => '9-bit RGB map',
+               # atari st, msx2, sega genesis/nomad, turbografx16
+               rgbmap => [8],
+       },
+       '4k' => {
+               name => '12-bit RGB map',
+               # amiga, apple IIgs, game gear, neo geo, lynx, cpc+, nextstation
+               rgbmap => [
+                       12 => sub {
+                               join('', map { sprintf '%X', $_ } @_),
+                               map { int $_ * 255 / 11 } @_
+                       },
+               ],
+       },
 }