RX.py is a Python script that prepares images for rendering them on the MSX2 blitter using this method described by Laurens Holst (Grauw). It can be quite efficient compressing images rich in flat polygons, replacing the original image by a bunch of line segments (which are both easy to store and draw) and recreate the original image using the MSX2 hardware blitter (which is relatively fast). Imagine writing adventure games with lots of screens using this method.
For now RX.py generates SCREEN 5 compatible images, but a SCREEN 8 version is planned.
usage: rx.py [-h] [--version] [-v] [-b] [-5] [-s] image [image ...]
PNG to RX (Running XOR) encoder
positional arguments:
image image or images to convert
options:
-h, --help show this help message and exit
--version show program's version number and exit
-v, --vertical use vertical sweep only
-b, --both use both horizontal and vertical sweep (default: horizontal)
-5, --screen5 activate SCREEN 5 mode
-s, --show-result show result at the end in a popup
Copyright (C) 2023 Pedro de Medeiros <pedro.medeiros@gmail.com>
RX.py converts this:
into this:
and going back to the original is as simple as calling a MSX-BASIC screen COPY operation (sample BASIC code included). Or two COPYs if you use both vertical and horizontal sweep operations.
- Horizontal and vertical sweep;
- Output SC5 raw format directly;
- Output SC8 raw format directly;
- Output screen as a MSX-BASIC program;
- Output V9990 formats;
- Add line detection;
- Implement Bresenham's modified line algorithm (Python and C);
- Write screen renderer in Python;
- Write screen renderer in C for the MSX;