Allow on_input to veto/force system controls (including reset line)
[lsnes.git] / include / lua / lua.hpp
blobe3f6bd253a407d8555fb1299913934ae46235225
1 #ifndef _lua__hpp__included__
2 #define _lua__hpp__included__
4 #include "core/controllerframe.hpp"
5 #include "core/keymapper.hpp"
6 #include "core/movie.hpp"
7 #include "library/framebuffer.hpp"
8 #include "library/lua-framebuffer.hpp"
10 void init_lua(bool soft = false) throw();
11 void quit_lua() throw();
12 void lua_callback_do_paint(struct lua_render_context* ctx, bool non_synthethic) throw();
13 void lua_callback_do_video(struct lua_render_context* ctx) throw();
14 void lua_callback_do_input(controller_frame& data, bool subframe) throw();
15 void lua_callback_do_reset() throw();
16 void lua_callback_do_frame() throw();
17 void lua_callback_do_frame_emulated() throw();
18 void lua_callback_do_rewind() throw();
19 void lua_callback_do_readwrite() throw();
20 void lua_callback_startup() throw();
21 void lua_callback_do_idle() throw();
22 void lua_callback_do_timer() throw();
23 void lua_callback_pre_load(const std::string& name) throw();
24 void lua_callback_err_load(const std::string& name) throw();
25 void lua_callback_post_load(const std::string& name, bool was_state) throw();
26 void lua_callback_pre_save(const std::string& name, bool is_state) throw();
27 void lua_callback_err_save(const std::string& name) throw();
28 void lua_callback_post_save(const std::string& name, bool is_state) throw();
29 void lua_callback_snoop_input(uint32_t port, uint32_t controller, uint32_t index, short value) throw();
30 void lua_callback_quit() throw();
31 void lua_callback_keyhook(const std::string& key, keyboard_key& p) throw();
32 void lua_callback_do_unsafe_rewind(const std::vector<char>& save, uint64_t secs, uint64_t ssecs, movie& mov, void* u);
33 bool lua_callback_do_button(uint32_t port, uint32_t controller, uint32_t index, const char* type);
35 #define LUA_TIMED_HOOK_IDLE 0
36 #define LUA_TIMED_HOOK_TIMER 1
38 uint64_t lua_timed_hook(int timer) throw();
40 extern bool lua_requests_repaint;
41 extern bool lua_requests_subframe_paint;
43 #endif