XipZ
Mini packer ▶►▸ for small programs.
|
LZ77-like compression routine. More...
#include <algorithm>
#include <fstream>
#include <iostream>
#include <iterator>
#include <vector>
#include <boost/format.hpp>
#include <stdio.h>
#include <stdint.h>
#include <limits.h>
#include "data.hh"
#include "decrunchqadzstub.inc"
Go to the source code of this file.
Macros | |
#define | LOOK_BACK 255 |
#define | MAX_LEN 128 |
#define | MAX_PLAIN_LEN 127 |
Functions | |
int | decrunch_main (int argc, char **argv) |
std::ostream & | write_qadz_stub (std::ostream &out, uint16_t size, uint16_t loadaddr, uint16_t jmp) |
write the decrunch stub More... | |
std::vector< uint8_t > | crunch_qadz (const Data &data) |
LZ77-like compression routine.
Simpe LZ77 like compression routine. It is optimised to use while bytes as using nybbles is quite expensinve on an architecture like the 6502. This makes LZ4 painful.
Definition in file qadz.cc.
std::vector<uint8_t> crunch_qadz | ( | const Data & | data | ) |
std::ostream& write_qadz_stub | ( | std::ostream & | out, |
uint16_t | size, | ||
uint16_t | loadaddr, | ||
uint16_t | jmp | ||
) |
write the decrunch stub
The decrunching stub is written and all parameters like decrunching address and jump address are adjusted. Please take care to adjust all the defines above otherwise the code will probably just crash. It may also fry your cat so be careful!
out | output stream to write to |
size | number of compressed bytes |
loadaddr | original load address of the data |
jmp | jump address to jump after decrunching |