duckstation

duckstation, but archived from the revision just before upstream changed it to a proprietary software project, this version is the libre one
git clone https://git.neptards.moe/u3shit/duckstation.git
Log | Files | Refs | README | LICENSE

save_state_version.h (1238B)


      1 // SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin <stenzek@gmail.com>
      2 // SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
      3 
      4 #pragma once
      5 
      6 #include "common/types.h"
      7 
      8 static constexpr u32 SAVE_STATE_MAGIC = 0x43435544;
      9 static constexpr u32 SAVE_STATE_VERSION = 71;
     10 static constexpr u32 SAVE_STATE_MINIMUM_VERSION = 42;
     11 
     12 static_assert(SAVE_STATE_VERSION >= SAVE_STATE_MINIMUM_VERSION);
     13 
     14 #pragma pack(push, 4)
     15 struct SAVE_STATE_HEADER
     16 {
     17   enum : u32
     18   {
     19     MAX_TITLE_LENGTH = 128,
     20     MAX_SERIAL_LENGTH = 32,
     21     MAX_SAVE_STATE_SIZE = 32 * 1024 * 1024,
     22   };
     23 
     24   enum class CompressionType : u32
     25   {
     26     None = 0,
     27     Deflate = 1,
     28     Zstandard = 2,
     29   };
     30 
     31   u32 magic;
     32   u32 version;
     33   char title[MAX_TITLE_LENGTH];
     34   char serial[MAX_SERIAL_LENGTH];
     35 
     36   u32 media_path_length;
     37   u32 offset_to_media_path;
     38   u32 media_subimage_index;
     39   
     40   // Screenshot compression added in version 69.
     41   // Uncompressed size not stored, it can be inferred from width/height.
     42   u32 screenshot_compression_type;
     43   u32 screenshot_width;
     44   u32 screenshot_height;
     45   u32 screenshot_compressed_size;
     46   u32 offset_to_screenshot;
     47 
     48   u32 data_compression_type;
     49   u32 data_compressed_size;
     50   u32 data_uncompressed_size;
     51   u32 offset_to_data;
     52 };
     53 #pragma pack(pop)