If initsram/initstate points to LSS file, pull the matching member
[lsnes.git] / include / core / moviefile-common.hpp
blobc1c4b0c175845e2ea3094ba1d2c8a09d34e3e369
1 #ifndef _moviefile_common__hpp__included__
2 #define _moviefile_common__hpp__included__
4 #include "core/moviefile.hpp"
5 #define DEFAULT_RTC_SECOND 1000000000ULL
6 #define DEFAULT_RTC_SUBSECOND 0ULL
8 template<typename target>
9 static void moviefile_write_settings(target& w, const std::map<std::string, std::string>& settings,
10 core_setting_group& sgroup, std::function<void(target& w, const std::string& name,
11 const std::string& value)> writefn)
13 for(auto i : settings) {
14 if(!sgroup.settings.count(i.first))
15 continue;
16 if(sgroup.settings.find(i.first)->second.dflt == i.second)
17 continue;
18 writefn(w, i.first, i.second);
22 struct moviefile_branch_extractor_text : public moviefile::branch_extractor
24 moviefile_branch_extractor_text(const std::string& filename);
25 ~moviefile_branch_extractor_text();
26 std::set<std::string> enumerate();
27 void read(const std::string& name, portctrl::frame_vector& v);
28 private:
29 zip::reader z;
32 struct moviefile_branch_extractor_binary : public moviefile::branch_extractor
34 moviefile_branch_extractor_binary(const std::string& filename);
35 ~moviefile_branch_extractor_binary();
36 std::set<std::string> enumerate();
37 void read(const std::string& name, portctrl::frame_vector& v);
38 private:
39 int s;
42 struct moviefile_sram_extractor_text : public moviefile::sram_extractor
44 moviefile_sram_extractor_text(const std::string& filename);
45 ~moviefile_sram_extractor_text();
46 std::set<std::string> enumerate();
47 void read(const std::string& name, std::vector<char>& v);
48 private:
49 zip::reader z;
52 struct moviefile_sram_extractor_binary : public moviefile::sram_extractor
54 moviefile_sram_extractor_binary(const std::string& filename);
55 ~moviefile_sram_extractor_binary();
56 std::set<std::string> enumerate();
57 void read(const std::string& name, std::vector<char>& v);
58 private:
59 int s;
63 #endif