ss_int24_t and ss_uint24_t are integers
[lsnes.git] / include / core / moviedata.hpp
blob11e9b153e98aec21b4ff5d08dfb1be7d76e96aa4
1 #ifndef _moviedata__hpp__included__
2 #define _moviedata__hpp__included__
4 #include "core/emustatus.hpp"
5 #include "core/moviefile.hpp"
6 #include "core/movie.hpp"
7 #include "library/rrdata.hpp"
9 //Load state, always switch to Readwrite.
10 #define LOAD_STATE_RW 0
11 //Load state, never switch to Readwrite.
12 #define LOAD_STATE_RO 1
13 //Load state, don't muck with movie data.
14 #define LOAD_STATE_PRESERVE 2
15 //Load state, ignoring the actual state.
16 #define LOAD_STATE_MOVIE 3
17 //Load state, switch to readwrite if previously there and loaded state is at the end.
18 #define LOAD_STATE_DEFAULT 4
19 //Load state, switch to readwrite if previously there.
20 #define LOAD_STATE_CURRENT 5
21 //No load state, rewind movie to start.
22 #define LOAD_STATE_BEGINNING 6
23 //No load state, reload ROM.
24 #define LOAD_STATE_ROMRELOAD 7
25 //Load state, loading everything, switch to readwrite if loaded state is at the end.
26 #define LOAD_STATE_INITIAL 8
27 //Load state, along with all branches, switch to readwrite if loaded state is at the end.
28 #define LOAD_STATE_ALLBRANCH 9
30 #define SAVE_STATE 0
31 #define SAVE_MOVIE 1
33 std::string resolve_relative_path(const std::string& path);
34 std::pair<std::string, std::string> split_author(const std::string& author) throw(std::bad_alloc,
35 std::runtime_error);
37 void do_save_state(const std::string& filename, int binary) throw(std::bad_alloc, std::runtime_error);
38 void do_save_movie(const std::string& filename, int binary) throw(std::bad_alloc, std::runtime_error);
39 void do_load_rom() throw(std::bad_alloc, std::runtime_error);
40 void do_load_rewind() throw(std::bad_alloc, std::runtime_error);
41 void do_load_state(struct moviefile& _movie, int lmode, bool& used);
42 bool do_load_state(const std::string& filename, int lmode);
43 std::string translate_name_mprefix(std::string original, int& binary, int save);
45 extern std::string last_save;
47 /**
48 * Restore the actual core state from quicksave. Only call in rewind callback.
50 * Parameter state: The state to restore.
51 * Parameter secs: The seconds counter.
52 * Parameter ssecs: The subsecond counter.
54 void mainloop_restore_state(const dynamic_state& state);
56 std::string get_mprefix_for_project();
57 void set_mprefix_for_project(const std::string& pfx);
58 void set_mprefix_for_project(const std::string& prjid, const std::string& pfx);
60 class rrdata
62 public:
63 rrdata();
64 rrdata_set::instance operator()();
65 static std::string filename(const std::string& projectid);
66 private:
67 bool init;
68 rrdata_set::instance next;
71 #endif