1 #ifndef _moviefile__hpp__included__
2 #define _moviefile__hpp__included__
8 #include "controllerdata.hpp"
13 * This structure gives parsed representationg of movie file, as result of decoding or for encoding.
18 * This constructor construct movie structure with default settings.
20 * throws std::bad_alloc: Not enough memory.
22 moviefile() throw(std::bad_alloc
);
25 * This constructor loads a movie/savestate file and fills structure accordingly.
27 * parameter filename: The file to load.
28 * throws std::bad_alloc: Not enough memory.
29 * throws std::runtime_error: Can't load the movie file
31 moviefile(const std::string
& filename
) throw(std::bad_alloc
, std::runtime_error
);
34 * Reads this movie structure and saves it into file.
36 * parameter filename: The file to save to.
37 * parameter compression: The compression level 0-9. 0 is uncompressed.
38 * throws std::bad_alloc: Not enough memory.
39 * throws std::runtime_error: Can't save the movie file.
41 void save(const std::string
& filename
, unsigned compression
) throw(std::bad_alloc
, std::runtime_error
);
44 * What is the ROM type and region?
56 * Emulator Core version string.
58 std::string coreversion
;
64 * Project ID (used to identify if two movies are from the same project).
66 std::string projectid
;
68 * Rerecord count (only saved).
70 std::string rerecords
;
72 * SHA-256 of main ROM (empty string if none).
74 std::string rom_sha256
; //SHA-256 of main ROM.
76 * SHA-256 of main ROM XML (empty string if none).
78 std::string romxml_sha256
; //SHA-256 of main ROM XML.
80 * SHA-256 of slot A ROM (empty string if none).
82 std::string slota_sha256
; //SHA-256 of SLOT A ROM.
84 * SHA-256 of slot A XML (empty string if none).
86 std::string slotaxml_sha256
; //SHA-256 of SLOT A XML.
88 * SHA-256 of slot B ROM (empty string if none).
90 std::string slotb_sha256
; //SHA-256 of SLOT B ROM.
92 * SHA-256 of slot B XML (empty string if none).
94 std::string slotbxml_sha256
; //SHA-256 of SLOT B XML.
96 * Authors of the run, first in each pair is full name, second is nickname.
98 std::vector
<std::pair
<std::string
, std::string
>> authors
;
100 * Contents of SRAM on time of initial powerup.
102 std::map
<std::string
, std::vector
<char>> movie_sram
;
104 * True if savestate, false if movie.
108 * Contents of SRAM on time of savestate (if is_savestate is true).
110 std::map
<std::string
, std::vector
<char>> sram
;
112 * Core savestate (if is_savestate is true).
114 std::vector
<char> savestate
; //Savestate to load (if is_savestate is true).
116 * Host memory (if is_savestate is true).
118 std::vector
<char> host_memory
;
120 * Screenshot (if is_savestate is true).
122 std::vector
<char> screenshot
;
124 * State of movie code (if is_savestate is true).
126 std::vector
<char> movie_state
;
128 * Input for each (sub)frame.
130 std::vector
<controls_t
> input
; //Input for each frame.
133 * Get number of frames in movie.
135 * returns: Number of frames.
137 uint64_t get_frame_count() throw();
140 * Get length of the movie
142 * returns: Length of the movie in nanoseconds.
144 uint64_t get_movie_length() throw();