The program now supports 1/2/4/8 bits-per-pixel in the output, plus allows you to designate specific palette offsets in the output palette, for files not using 8 bits-per-pixel. As always, the generated palette has 12-bit entries (plus the extra 4-bit unused portion, required by VERA).
This version fixes the VRAM map issue when using the '-n' option. An example is:
Code: Select all
/home/curtis/x16/image2binary/target/release/image2binary \
-w 64 -h 32 -a mb alpha-tile-map \
-w 64 -h 32 -a mb image-tile-map \
-b 4 -p 11 -a tb f-blue.png \
-b 4 -p 12 -n -a tb f-green.png \
-b 4 -p 13 -n -a tb f-red.png \
-b 4 -p 14 -n -a tb f-yellow.png \
-b 4 -p 15 -n -a tb f-white.png \
-a tb brdtiles.png \
-a sp seq08.png \
-a sp seq16.png \
-a sp seq32.png \
-a sp seq64.png >SEQ.LOG
V1.0 - initial upload
V1.1 - output file path fix
V1.2 - include 2 zero bytes in front of binary image data
V1.3 - support creating VRAM memory map
V1.4 - output 2 extra files when image crosses VRAM page boundary
V1.5 - support 1, 2, 4, and 8 bits per pixel in output, plus specifying palette offsets
V1.6 - fix issue in VRAM map when using '-n' option
This program inputs PNG (24-bit RGB or 32-bit RGBA) files, and converts them into binary data for VERA. It consolidates the needed palette information across multiple files into a single palette, and provides that data as output, too. The intent is to be able to prepare multiple images, tiles, and/or sprites for display on the X16.
Starting with version 1.3, the program will create a VRAM memory map by attempting to fit the various output binary images into the VRAM memory space. They may be reordered, when compared to the order of the files listed in the command line. This feature also allows you to specify the required memory alignment for any of the input files, and you can include entries for the tile maps, which may be used for VERA Layer 0 and/or Layer 1. The program knows the particular alignments of tile maps, tile data, sprite data, and bitmap data, so you can easily indicate those things in the command line. Below is an example of an output VRAM map, computed by the program. The "Start" addresses can be used in code (BASIC or assembler) when loading file data into VRAM. See the "samples" directory in the repository for more information, particularly the log file there, and the one in the samples/alignment directory.
Here is the command line that was used to process the samples/alignment files, which resulted in the memory map below. Also, I have attached a screenshot from a test program that displayed data from the files, meaning that it showed the "board" background (as tiles) on Layer 0, the text "A" (as tiles) on Layer 1, and 5 sprites (4 spinning apples and 1 stationary apple). It does not show the monochrome image, because that feature is new.
Code: Select all
cd alignment
../image2binary \
-w 64 -h 32 -a mb alpha-tile-map \
-w 64 -h 32 -a mb image-tile-map \
-a tb abctiles.png \
-a tb brdtiles.png \
-b 1 -p 15 monochrome.png \
-a sp seq08.png \
-a sp seq16.png \
-a sp seq32.png \
-a sp seq64.png >alignment.log
Code: Select all
VRAM Address Arrangement
Waste Start End Size Align Width Height Path/Name
----- ------ ------ ----- ----- ----- ------ ----------------------------------
0 $00000 $00fff 4096 512 64 32 alpha-tile-map
0 $01000 $01fff 4096 512 64 32 image-tile-map
0 $02000 $0a2ff 33536 2048 16 2096 brdtiles.png
0 $0a300 $0aeff 3072 32 16 192 seq16.png
0 $0af00 $0af19 26 1 13 13 monochrome.png
230 $0b000 $0feff 20224 2048 16 1264 abctiles.png
0 $0ff00 $1beff 49152 32 64 768 seq64.png
$0ff00 $0ffff 256 SEQ64P0.BIN
$10000 $1beff 48896 SEQ64P1.BIN
0 $1bf00 $1eeff 12288 32 32 384 seq32.png
0 $1ef00 $1f1ff 768 32 8 96 seq08.png
NOTE: one output image crosses the VRAM page boundary, so there are now two
extra output files, for loading the data in two sections, if needed.
Please see the README file in the repository, as it provides much more information.
https://github.com/TurboVega/image2binary
If you have any questions, or issues, please let me know. Thanks!