From ed972794362b4a584ac4d43c608bae5d48e84598 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Mon, 18 Sep 2023 11:06:09 -0700 Subject: [PATCH] add comment about snapshot format --- src/SaveFileFormats.cc | 4 ++-- src/SaveFileFormats.hh | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SaveFileFormats.cc b/src/SaveFileFormats.cc index 852a7769..64f074d9 100644 --- a/src/SaveFileFormats.cc +++ b/src/SaveFileFormats.cc @@ -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 diff --git a/src/SaveFileFormats.hh b/src/SaveFileFormats.hh index 1f89b01c..8bf430a0 100644 --- a/src/SaveFileFormats.hh +++ b/src/SaveFileFormats.hh @@ -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 pixels; /* 18008 */ uint8_t unknown_a1; // Always 0x18? /* 18009 */ uint8_t unknown_a2;