Skip to content

Pointer Compression

r0ah edited this page Oct 26, 2019 · 2 revisions

Pointer version of the Compression code type.

Format

Definition

  • 7: Code-Type Identifier
  • X: Bit
    • 0 - 8bit
    • 1 - 16bit
    • 2 - 32bit
  • A3-A4: Pointer Level
  • B1-B8: Valid Memory Address
  • C1-C8: 1st Pointer Offset
  • D1-D8: 2nd Pointer Offset (Optional)
  • E1-E8: Value
  • F1-F4: Number of Compression
  • G5-G8: Address Gap
  • H5-H8: Value Gap (This increments the E1-E8) (Optional)
  • 77: (Not changeable)

Note: Ellipses means you can add more pointer offsets.

Note: I lowered the Address Gap (G) and Value Gap (H) range from 1-8 to 5-8. I think 1-8 is too much and I don't think 1-4 really works.

Examples

Increment the Pointer Offset

This example will increment the pointer offset, with the value remaining static.

_V0 Max Stats
$7203 818714E8 00000FDC
$7200 00000000 0000000C
$7200 00000000 000005DD
$7703 00000000 000003E6
$0002 00000004 00000000

Compress the third pointer offset which is 0x05DD with the address gap of 0x04. Number of compression is 0x02.

The code above is equivalent to:

$3203 818714E8 00000FDC
$3200 00000000 0000000C
$3200 00000000 000005DD
$3300 00000000 000003E6

$3203 818714E8 00000FDC
$3200 00000000 0000000C
$3200 00000000 000005E1 #INCREMENT ADDRESS GAP: `0x05DD` + `0x04` = `0x05E1`
$3300 00000000 000003E6 #VALUE IS STATIC

Increment the Pointer Offset + Value

This example will increment the pointer offset and the value.

_V0 Max Stats
$7203 818714E8 00000FDC
$7200 00000000 0000000C
$7200 00000000 000005DD
$7703 00000000 000003E6
$0002 00000004 00000063

Compress the third pointer offset which is 0x05DD with the address gap of 0x04. Compress the value 0x03E6 with the value gap of 0x63. Number of compression is 0x02.

The code above is equivalent to:

$3203 818714E8 00000FDC
$3200 00000000 0000000C
$3200 00000000 000005DD
$3300 00000000 000003E6

$3203 818714E8 00000FDC
$3200 00000000 0000000C
$3200 00000000 000005E1 #INCREMENT ADDRESS GAP: `0x05DD` + `0x04` = `0x05E1`
$3300 00000000 00000449 #INCREMENT VALUE GAP: `0x03E6` + `0x63` = `0x0449`
Clone this wiki locally