Lua: Fix type confusion between signed and unsigned
[lsnes.git] / include / core / emustatus.hpp
blob550a85b57079ac55d90dbf4aec1faff64c65956e
1 #ifndef _emustatus__hpp__included__
2 #define _emustatus__hpp__included__
4 #include <stdexcept>
5 #include <string>
6 #include <set>
7 #include <map>
8 #include "library/command.hpp"
9 #include "library/triplebuffer.hpp"
11 class movie_logic;
12 class project_state;
13 class voice_commentary;
14 class emulator_runmode;
15 class master_dumper;
16 class save_jukebox;
17 class slotinfo_cache;
18 class framerate_regulator;
19 class controller_state;
20 class multitrack_edit;
21 class lua_state;
22 class loaded_rom;
23 class memwatch_set;
24 class emulator_dispatch;
26 struct _lsnes_status
28 const static int pause_none; //pause: No pause.
29 const static int pause_normal; //pause: Normal pause.
30 const static int pause_break; //pause: Break pause.
31 const static uint64_t subframe_savepoint; //subframe: Point of save.
32 const static uint64_t subframe_video; //subframe: Point of video output.
34 bool valid;
35 bool movie_valid; //The movie state variables are valid?
36 uint64_t curframe; //Current frame number.
37 uint64_t length; //Movie length.
38 uint64_t lag; //Lag counter.
39 uint64_t subframe; //Subframe number.
40 bool dumping; //Video dump active.
41 unsigned speed; //Speed%
42 bool saveslot_valid; //Save slot number/info valid.
43 uint64_t saveslot; //Save slot number.
44 std::u32string slotinfo; //Save slot info.
45 bool branch_valid; //Branch info valid?
46 std::u32string branch; //Current branch.
47 bool mbranch_valid; //Movie branch info valid?
48 std::u32string mbranch; //Current movie branch.
49 std::u32string macros; //Currently active macros.
50 int pause; //Pause mode.
51 char mode; //Movie mode: C:Corrupt, R:Readwrite, P:Readonly, F:Finished.
52 bool rtc_valid; //RTC time valid?
53 std::u32string rtc; //RTC time.
54 std::vector<std::u32string> inputs; //Input display.
55 std::map<std::string, std::u32string> mvars; //Memory watches.
56 std::map<std::string, std::u32string> lvars; //Lua variables.
59 struct slotinfo_cache
61 slotinfo_cache(movie_logic& _mlogic, command::group& _cmd);
62 std::string get(const std::string& _filename);
63 void flush(const std::string& _filename);
64 void flush();
65 private:
66 std::map<std::string, std::string> cache;
67 movie_logic& mlogic;
68 command::group& cmd;
69 command::_fnptr<> flushcmd;
72 struct status_updater
74 public:
75 status_updater(project_state& _project, movie_logic& _mlogic, voice_commentary& _commentary,
76 triplebuffer::triplebuffer<_lsnes_status>& _status, emulator_runmode& _runmode, master_dumper& _mdumper,
77 save_jukebox& _jukebox, slotinfo_cache& _slotcache, framerate_regulator& _framerate,
78 controller_state& _controls, multitrack_edit& _mteditor, lua_state& _lua2, loaded_rom& _rom,
79 memwatch_set& _mwatch, emulator_dispatch& _dispatch);
80 void update();
81 private:
82 project_state& project;
83 movie_logic& mlogic;
84 voice_commentary& commentary;
85 triplebuffer::triplebuffer<_lsnes_status>& status;
86 emulator_runmode& runmode;
87 master_dumper& mdumper;
88 save_jukebox& jukebox;
89 slotinfo_cache& slotcache;
90 framerate_regulator& framerate;
91 controller_state& controls;
92 multitrack_edit& mteditor;
93 lua_state& lua2;
94 loaded_rom& rom;
95 memwatch_set& mwatch;
96 emulator_dispatch& dispatch;
99 #endif