mirror of
https://github.com/PabloMK7/citra.git
synced 2025-09-11 13:20:04 +00:00
core, citra_qt: Implement a save states file format and slot UI
10 slots are offered along with 'Save to Oldest Slot' and 'Load from Newest Slot'. The savestate format is similar to the movie file format. It is called CST (Citra SavesTate), and is basically a 0x100 byte header (consisting of magic, revision, creation time and title ID) followed by Zstd compressed raw savestate data. The savestate files are saved to the `states` folder in Citra's user folder. The files are named like `<Title ID>.<Slot ID>.cst`.
This commit is contained in:
parent
7d880f94db
commit
a487016cb4
11 changed files with 384 additions and 77 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <QLabel>
|
||||
#include <QMainWindow>
|
||||
|
@ -14,6 +15,7 @@
|
|||
#include "common/announce_multiplayer_room.h"
|
||||
#include "core/core.h"
|
||||
#include "core/hle/service/am/am.h"
|
||||
#include "core/savestate.h"
|
||||
#include "ui_main.h"
|
||||
|
||||
class AboutDialog;
|
||||
|
@ -106,6 +108,7 @@ private:
|
|||
void InitializeWidgets();
|
||||
void InitializeDebugWidgets();
|
||||
void InitializeRecentFileMenuActions();
|
||||
void InitializeSaveStateMenuActions();
|
||||
|
||||
void SetDefaultUIGeometry();
|
||||
void SyncMenuUISettings();
|
||||
|
@ -149,6 +152,8 @@ private:
|
|||
*/
|
||||
void UpdateRecentFiles();
|
||||
|
||||
void UpdateSaveStates();
|
||||
|
||||
/**
|
||||
* If the emulation is running,
|
||||
* asks the user if he really want to close the emulator
|
||||
|
@ -163,8 +168,8 @@ private slots:
|
|||
void OnStartGame();
|
||||
void OnPauseGame();
|
||||
void OnStopGame();
|
||||
void OnSave();
|
||||
void OnLoad();
|
||||
void OnSaveState();
|
||||
void OnLoadState();
|
||||
void OnMenuReportCompatibility();
|
||||
/// Called whenever a user selects a game in the game list widget.
|
||||
void OnGameListLoadFile(QString game_path);
|
||||
|
@ -276,6 +281,13 @@ private:
|
|||
bool defer_update_prompt = false;
|
||||
|
||||
QAction* actions_recent_files[max_recent_files_item];
|
||||
std::array<QAction*, Core::SaveStateSlotCount> actions_load_state;
|
||||
std::array<QAction*, Core::SaveStateSlotCount> actions_save_state;
|
||||
|
||||
u32 oldest_slot;
|
||||
u64 oldest_slot_time;
|
||||
u32 newest_slot;
|
||||
u64 newest_slot_time;
|
||||
|
||||
QTranslator translator;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue