resonance 1.0.1
Loading...
Searching...
No Matches
ARle8Reader Class Reference

Cursor over a run length encoded eight bit pixel stream. More...

#include <arle8reader.h>

Public Member Functions

unsigned char * UnpackRow (unsigned char *pDest)
 Decode one row into a buffer.
void UnpackAll (unsigned char *pDest)
 Decode rows into a buffer until the stream terminates.
void SkipRow (int nRows)
 Advance past a number of rows without writing.

Public Attributes

const unsigned char * mSource
short mWidth
short mPad06
int mTransparentValue

Detailed Description

Cursor over a run length encoded eight bit pixel stream.

The record is not polymorphic and has no RTTI. Its name comes from the debugging symbols of the North American demo release.

The three routines sit at 0x0060da78, 0x0060dc10, and 0x0060dc98, well outside the canvas cluster. 13 of the 15 callers of the first two are ACanvas slots, and the third serves PsTex alone. Which source file they belong to is not settled.

The encoding is one control byte followed by data. The low seven bits are the run length. A set top bit introduces that many literal bytes, and a clear top bit introduces one byte repeated that many times.

A control byte of zero terminates the stream, and both routines examine it only at a row boundary. A row ends when its pixel count is exhausted rather than on a zero, and a zero control byte reached part way through a row is decoded as a run of length zero.

mTransparentValue changes what a run does to the destination rather than what it consumes. A value of zero or more skips a byte equal to it, and kARleReaderNoTransparentValue stores every byte.

Member Function Documentation

◆ UnpackRow()

unsigned char * ARle8Reader::UnpackRow ( unsigned char * pDest)

Decode one row into a buffer.

Parameters
pDestThe row to write.
Returns
pDest advanced past the row.
Ghidra address:
NTSC-U/C: 0x0060da78
Ghidra address:
PAL: 0x0064e6e8

◆ UnpackAll()

void ARle8Reader::UnpackAll ( unsigned char * pDest)

Decode rows into a buffer until the stream terminates.

Tests for the terminator before the first row, so an empty stream writes nothing. Each row starts where UnpackRow() ended the previous one, so the rows land contiguously at the width mWidth.

Parameters
pDestThe first row to write.
Ghidra address:
NTSC-U/C: 0x0060dc98
Ghidra address:
PAL: 0x0064e908

◆ SkipRow()

void ARle8Reader::SkipRow ( int nRows)

Advance past a number of rows without writing.

mWidth is read once before the first row. A width written between rows is not seen.

Parameters
nRowsThe number of rows to consume.
Ghidra address:
NTSC-U/C: 0x0060dc10
Ghidra address:
PAL: 0x0064e880

Member Data Documentation

◆ mSource

const unsigned char* ARle8Reader::mSource

The next control byte. +0x00

◆ mWidth

short ARle8Reader::mWidth

Pixels in one row. +0x04

◆ mPad06

short ARle8Reader::mPad06

Padding no caller writes. +0x06

◆ mTransparentValue

int ARle8Reader::mTransparentValue

The byte to skip, or kARleReaderNoTransparentValue. +0x08


The documentation for this class was generated from the following file: