Actually call on_reset callback
[lsnes.git] / include / core / moviedata.hpp
blob45c218ffe45e9a827ceb12fbe2bb2cdb316de6bc
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);
36 void do_save_state(const std::string& filename, int binary);
37 void do_save_movie(const std::string& filename, int binary);
38 void do_load_rom();
39 void do_load_rewind();
40 void do_load_state(struct moviefile& _movie, int lmode, bool& used);
41 bool do_load_state(const std::string& filename, int lmode);
42 std::string translate_name_mprefix(std::string original, int& binary, int save);
44 extern std::string last_save;
46 /**
47 * Restore the actual core state from quicksave. Only call in rewind callback.
49 * Parameter state: The state to restore.
50 * Parameter secs: The seconds counter.
51 * Parameter ssecs: The subsecond counter.
53 void mainloop_restore_state(const dynamic_state& state);
55 std::string get_mprefix_for_project();
56 void set_mprefix_for_project(const std::string& pfx);
57 void set_mprefix_for_project(const std::string& prjid, const std::string& pfx);
59 class rrdata
61 public:
62 rrdata();
63 rrdata_set::instance operator()();
64 static std::string filename(const std::string& projectid);
65 private:
66 bool init;
67 rrdata_set::instance next;
70 #endif