[Coco] Help with algorithm in assembly...

Lee leep at tigerbase.com
Mon Oct 17 06:58:50 EDT 2022


Thanks! :)  I'm setting a palette that matches the default EGA 16-color
palette pretty closely.  As for pre-converting the images, I could do that,
and it certainly would make my life much easier, but the game I'm writing
is a clone of an existing DOS game and I'd rather be able to drop the
original game's data files in.  The original game's tiles are in planar
format, so I'm loading/converting them in memory when the game starts.  I'm
pretty close to having it right.  Someone on the FB group gave me the hint
I needed.  Shift the left-most bit out of each 2-byte plane out through
carry into the converted byte, do that twice then move to the next
converted byte.  Continue until all 16 bits of the four color planes are
converted to the 8 interleaved bytes, then move to the next row.

-----
Lee

On Sun, Oct 16, 2022 at 9:04 PM Walter ZAMBOTTI via Coco <
coco at maltedmedia.com> wrote:

> I think your forgetting the CoCo 16 color per pixel mode doesn't map
> directly to RGB values directly.
>
> The values map to a palette which in turn provides the RGB value.
>
> Which means unless you create palette values that coincide with RGB
> values your technique wont work.
>
> Another way to tackle this is to load your image into GIMP and then tell
> GIMP to convert the image to a 16 or 15(+transparency) color image.
>
> Once GIMP has this new palette remember to choose it when processing
> subsequent images.
>
> GIMP will determine the best 15/16 colors that will recreate your
> original image and provide you the list of colors in the new palette.
> You can then find the closest  colors in the CoCo palette.
>
> So do all your conversions before hand rather than on the fly.
>


More information about the Coco mailing list