add comment about snapshot format

This commit is contained in:
Martin Michelsen
2023-09-18 11:06:09 -07:00
parent 9cb9e8064a
commit ed97279436
2 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -123,8 +123,8 @@ bool PSOGCSnapshotFile::checksum_correct() const {
}
static uint32_t decode_rgb565(uint16_t c) {
// Input: rrrrrggg gggbbbbb
// Output: rrrrrrrr gggggggg bbbbbbbb aaaaaaaa
// Input bits: rrrrrggg gggbbbbb
// Output bits: rrrrrrrr gggggggg bbbbbbbb aaaaaaaa
return ((c << 16) & 0xF8000000) | ((c << 11) & 0x07000000) | // R
((c << 13) & 0x00FC0000) | ((c << 7) & 0x00030000) | // G
((c << 11) & 0x0000F800) | ((c << 6) & 0x00000700) | // B
+2
View File
@@ -282,6 +282,8 @@ struct PSOGCSnapshotFile {
/* 00000 */ be_uint32_t checksum;
/* 00004 */ be_uint16_t width;
/* 00006 */ be_uint16_t height;
// Pixels are stored as 4x4 blocks of RGB565 values. See the implementation
// of decode_image for details.
/* 00008 */ parray<be_uint16_t, 0xC000> pixels;
/* 18008 */ uint8_t unknown_a1; // Always 0x18?
/* 18009 */ uint8_t unknown_a2;