1 #ifndef _moviefile__hpp__included__
2 #define _moviefile__hpp__included__
8 #include "controllerframe.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 * Force loading as corrupt.
48 * What is the ROM type and region?
60 * Emulator Core version string.
62 std::string coreversion
;
68 * Project ID (used to identify if two movies are from the same project).
70 std::string projectid
;
72 * Rerecord count (only saved).
74 std::string rerecords
;
76 * SHA-256 of main ROM (empty string if none).
78 std::string rom_sha256
; //SHA-256 of main ROM.
80 * SHA-256 of main ROM XML (empty string if none).
82 std::string romxml_sha256
; //SHA-256 of main ROM XML.
84 * SHA-256 of slot A ROM (empty string if none).
86 std::string slota_sha256
; //SHA-256 of SLOT A ROM.
88 * SHA-256 of slot A XML (empty string if none).
90 std::string slotaxml_sha256
; //SHA-256 of SLOT A XML.
92 * SHA-256 of slot B ROM (empty string if none).
94 std::string slotb_sha256
; //SHA-256 of SLOT B ROM.
96 * SHA-256 of slot B XML (empty string if none).
98 std::string slotbxml_sha256
; //SHA-256 of SLOT B XML.
100 * Authors of the run, first in each pair is full name, second is nickname.
102 std::vector
<std::pair
<std::string
, std::string
>> authors
;
104 * Contents of SRAM on time of initial powerup.
106 std::map
<std::string
, std::vector
<char>> movie_sram
;
108 * True if savestate, false if movie.
112 * Contents of SRAM on time of savestate (if is_savestate is true).
114 std::map
<std::string
, std::vector
<char>> sram
;
116 * Core savestate (if is_savestate is true).
118 std::vector
<char> savestate
; //Savestate to load (if is_savestate is true).
120 * Host memory (if is_savestate is true).
122 std::vector
<char> host_memory
;
124 * Screenshot (if is_savestate is true).
126 std::vector
<char> screenshot
;
128 * Current frame (if is_savestate is true).
132 * Number of lagged frames (if is_savestate is true).
134 uint64_t lagged_frames
;
136 * Poll counters (if is_savestate is true).
138 std::vector
<uint32_t> pollcounters
;
142 std::vector
<char> c_rrdata
;
144 * Input for each (sub)frame.
146 controller_frame_vector input
; //Input for each frame.
148 * Current RTC second.
152 * Current RTC subsecond.
154 int64_t rtc_subsecond
;
156 * Movie starting RTC second.
158 int64_t movie_rtc_second
;
160 * Movie starting RTC subsecond.
162 int64_t movie_rtc_subsecond
;
165 * Get number of frames in movie.
167 * returns: Number of frames.
169 uint64_t get_frame_count() throw();
172 * Get length of the movie
174 * parameter framebias: Number of frames to subtract.
175 * returns: Length of the movie in nanoseconds.
177 uint64_t get_movie_length(uint64_t framebias
= 0) throw();