-
Notifications
You must be signed in to change notification settings - Fork 1
HzMod Packet Format
ChainSwordCS edited this page Sep 6, 2023
·
1 revision
See also: ChirunoMod packet format
In a given packet, data is ordered like so:
┌───┬───┬───┬───┬───┬───
│ T | L │ L │ L │ D │...
└───┴───┴───┴───┴───┴───
T: Packet Type
L: Length (3 bytes, LE)
D: Data ($Length bytes)
0x01: Disconnect
0x02: Set Mode
0x03: TGA
0x04: JPEG
0x7E: Config ("CFGBLK")
0xFF: Debug
16 bytes in total.
- Top Screen Color Format [32-bit integer]
- Top Screen 'Stride' / "bytesize" [32-bit integer]
- Bottom Screen Color Format [32-bit integer]
- Bottom Screen 'Stride' / "bytesize" [32-bit integer]
Notes:
- When using Color Format, make sure to perform an "& 7" operation to discard all but the lowest three bits.
- 'Stride' / "bytesize" is the screen height (240) multiplied by the number of bytes-per-pixel of the current color format. (This should be redundant... But maybe not, after seeing weird resolution-based bugs with games like Mario Kart 7. -C)
- To mimic HorizonScreen behavior: if a given screen's color format is zeroed-out, that's a signal to leave that screen's format info unchanged. (I don't know if this ever happens in practice. -C)
- Header [8 bytes]
- Horizontal pixel offset [32-bit integer]
- unused 4 bytes
- JPEG image data
Notes:
- If the offset is greater than or equal to 400 (hex $190) this is the bottom screen. In this case, subtract 400 from this number to find the relative offset.