GithubHelp home page GithubHelp logo

pvmm / rx.py Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 102 KB

Running XOR encoder

Home Page: https://www.msx.org/forum/msx-talk/development/hardware-accelerated-polygon-fill-using-lmmm

License: MIT License

Python 100.00%
msx msx2 hardware-acceleration image-format v9938 v9958 v9990

rx.py's Introduction

Running XOR encoder (or: the hardware accelerated polygon fill method)

What RX.py does?

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.

Parameters

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 <[email protected]>

Everybody loves screenshots

RX.py converts this:
Original image restored by the blitter on MSX2
into this:
RX.py encoded sample image
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. RX.py encoded sample image (horizontal and vertical sweep)

Reference

this thread

TODO list:

  • 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;

rx.py's People

Contributors

pvmm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

rx.py's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.