GithubHelp home page GithubHelp logo

mtshr / inflate-65c816 Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 0.0 33 KB

decompression code for Deflate in 65c816

License: zlib License

Assembly 93.17% Makefile 3.19% PHP 3.64%
65c816 assembly decompression inflate 65816

inflate-65c816's Introduction

inflate in 65c816

The decompression code written in 65c816. The code is originally written for SuperFamicom homebrew, but it should be able to be used for other devices with the 65c816 processor.

Requirements

Notes

  • You can define UNSAFE when assembling the code to reduce the code size and make it a little faster, with the restriction where you must locate a sequence of the deflate data within the same bank.
  • The code is executed on RAM to self-modify the code for optimization. The inflate routine requires the 0x5DB bytes with UNSAFE, and 0x68B without.
  • It requires 0x46A bytes for variables. These must be located in the same bank as the inflate routine on RAM.
  • It requires $00-$13 (included) for variables in Direct Page. You can set the arbitrary DP register value before calling the inflate routine.
  • The interruption may occur during the decompression if handled appropriately.
  • As the inflate routine is located on RAM, once you assemble the inflate.asm in /src directory, you can just include inflate.ram.bin into your source code with your favourite assembler.

Usage

  • Set the RAM address where you want to locate inflate routine in /src/inflate.inc
  • Assemble /src/inflate.asm, which outputs inflate.ram.bin
  • Include inflate.ram.bin in the your source code and write the code to copy the binary onto the same RAM address where you first configured.
  • Include deflated-data decompressed by zopfli with the --deflate option
  • Call JSL Inflate with the condition:
    • A : source bank << 8 | destination bank
    • X : source address
    • Y : destination address

Example

The SuperFamicom homebrew ROM is provided as an example. To assemble, run the following:

cd src && make
cd ../example && make

inflate-65c816's People

Contributors

mtshr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

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.