Skip to content

pvmm/XPM2SC5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XPM2SC5

Converts XPM file into SCREEN5/V9990 (p1 mode) without any additional library other than libc. This is done by creating an executable that #includes the XPM file as source code, since XPM files are C-compatible files. This project should work on windows if you use the WSL (Windows Subsystem for Linux). It is meant to be used inside another, by a parent Makefile calling this Makefile inside a subdirectory. If the image is called image1.xpm, run the code like this:

make images/image1
build/image1 --image --raw --file image1.raw
build/image1 --palette --raw --file image1.pal
build/image1 --both --header > image1.h

To create a raw RAM file called image2.raw that you can dump to ROM or RAM. You may also create .c and .h (source and header files) with the following commands:

make images/image2
build/image2 --both > image2.c
build/image2 --both --header > image2.h

to create a BASIC program called AUTOEXEC.BAS that sets the palette correctly and loads IMAGE.BIN, use it like this:

make images/image3
build/image3 --both --basic --file IMAGE.BIN > AUTOEXEC.BAS
openmsx -machine Panasonic_FS-A1GT -diska .

extra parameters

The binary generated by converter.c recognise these command line parameters:

--help                   Displays this message.
--screen5                Outputs a SCREEN5 compatible image (256 width max. with 15 colors).
--v9990                  Outputs a P1 mode compatible image (V9990 graphics card).
--keep-unused            Unused palette colors are still converted to output file.
--contains-palette       Get palette colors and order from first disposable line of the image.
--palette                Outputs palette too.
--image                  Outputs image pattern too.
--both                   Outputs both palette and image.
--header                 Outputs C-style header.
--file <filename>        Output binary output to file.
--raw                    Outputs raw file (RAM memory dump without dimension data).
--basic                  Outputs BASIC to stdout and respective VRAM COPY to file.
--trans-color <RRGGBB>   Supply hex string RRGGBB as a transparent color replacement.
--skip0                  Skip color 0 (transparent) in output files.

About

Converts xpm image into MSX2 SCREEN5 (GRAPHICS4)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published