From 8d2a6e7f19bf7247bb17f7ffc579bad82163ed67 Mon Sep 17 00:00:00 2001 From: alpine9000 Date: Sun, 6 Mar 2016 21:00:16 +1100 Subject: [PATCH] Kinda workinng extra half brite converter --- tools/imagecon/README.md | 5 +++++ tools/imagecon/imagecon.c | 8 ++++++-- tools/imagecon/imagecon.h | 4 ++-- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/tools/imagecon/README.md b/tools/imagecon/README.md index cf5cfee..04fb46f 100644 --- a/tools/imagecon/README.md +++ b/tools/imagecon/README.md @@ -17,6 +17,7 @@ usage --output-bitplanes --output-mask --output-copperlist + --extra-half-brite --use-palette --verbose ``` @@ -71,6 +72,10 @@ Generate m68k assembler instructions to install the palette. No symbols are gene Generate m68k assembler instructions to install a greyscale version of the palette. No symbols are generated. Registers are preserved. +**--extra-half-brite + +Generate an extra half brite image. This only works in combination with --colors 32. A 32 color palette will be output, however there will be a sixth bitplane that includes the half brite control bits for any pixels that can use it. + **--use-palette** <palette file> Specify a palette file to use that will override the image or quantized palette. Overrides the --colors and --quantize options. diff --git a/tools/imagecon/imagecon.c b/tools/imagecon/imagecon.c index 5280d12..32ac7f7 100644 --- a/tools/imagecon/imagecon.c +++ b/tools/imagecon/imagecon.c @@ -342,9 +342,13 @@ outputBitplanes(char* outFilename, imagecon_image_t* ic) int palette_index = ic->amigaImage[(ic->width*y)+x]; int ehb = 0; if (palette_index >= numColors) { - printf("EHB Detected %d -> ", palette_index); + if (config.verbose) { + printf("EHB Detected e%d -> ", palette_index); + } palette_index -= numColors; - printf("%d\n", palette_index); + if (config.verbose) { + printf("%d\n", palette_index); + } ehb = 1; } int _numBitPlanes = config.ehbMode ? numBitPlanes-1 : numBitPlanes; diff --git a/tools/imagecon/imagecon.h b/tools/imagecon/imagecon.h index 1841084..2e5ab14 100644 --- a/tools/imagecon/imagecon.h +++ b/tools/imagecon/imagecon.h @@ -1,6 +1,6 @@ #pragma once -#define MAX_PALETTE 64 +#define MAX_PALETTE 32 typedef struct { @@ -32,7 +32,7 @@ typedef struct { int height; png_bytep* rowPointers; unsigned char* amigaImage; - amiga_color_t palette[MAX_PALETTE]; + amiga_color_t palette[MAX_PALETTE*2]; // extra half brite mode } imagecon_image_t;