//
//  Copyright (C) 2018 Team Kodi
//  This file is part of Kodi - https://kodi.tv
//
//  SPDX-License-Identifier: MIT
//  See LICENSES/README.md for more information.
//

namespace KODI.RETRO;

// Savestate schema
// Version 2

file_identifier "SAV_";

enum SaveType : uint8 {
  Unknown,
  Auto,
  Manual
}

table Savestate {
  // Schema version
  version:uint8 (id: 0);

  // Savestate properties
  type:SaveType (id: 1);
  slot:uint8 (id: 2);
  label:string (id: 3);
  caption:string (id: 11);
  created:string (id: 4); // W3C date time [ISO 8601 : 1988 (E)] with timezone info

  // Game properties
  game_file_name:string (id: 5);

  // Environment properties
  timestamp_frames:uint64 (id: 6);
  timestamp_wall_clock_ns:uint64 (id: 7);

  // Emulator properties
  emulator_addon_id:string (id: 8);
  emulator_version:string (id: 9); // Semantic version

  // Memory properties
  memory_data:[uint8] (id: 10);
}

root_type Savestate;
