Lua: Fix type confusion between signed and unsigned
[lsnes.git] / include / interface / callbacks.hpp
blob7150cd064874017359906be91cabb3d0da1756ff
1 #ifndef _interface__callbacks__hpp__included__
2 #define _interface__callbacks__hpp__included__
4 #include <cstdint>
5 #include <string>
6 #include <list>
7 #include "library/framebuffer.hpp"
9 /**
10 * Callbacks emulator binding can use.
12 struct emucore_callbacks
14 public:
15 virtual ~emucore_callbacks() throw();
16 /**
17 * Get input from specified control.
19 virtual int16_t get_input(unsigned port, unsigned index, unsigned control) = 0;
20 /**
21 * Set input for specified control. Only works in readwrite mode.
23 * Returns the actual input value used.
25 virtual int16_t set_input(unsigned port, unsigned index, unsigned control, int16_t value) = 0;
26 /**
27 * Notifies about latch. Only called on some systems.
29 virtual void notify_latch(std::list<std::string>& l) = 0;
30 /**
31 * Tick the RTC timer.
33 virtual void timer_tick(uint32_t increment, uint32_t per_second) = 0;
34 /**
35 * Get path for firmware.
37 virtual std::string get_firmware_path() = 0;
38 /**
39 * Get the base filename for ROM.
41 virtual std::string get_base_path() = 0;
42 /**
43 * Get current RTC time.
45 virtual time_t get_time() = 0;
46 /**
47 * Get the RNG seed to use.
49 virtual time_t get_randomseed() = 0;
50 /**
51 * Output a frame. Call once for each call to emulate().
53 virtual void output_frame(framebuffer::raw& screen, uint32_t fps_n, uint32_t fps_d) = 0;
54 /**
55 * Notify that action states have been updated.
57 virtual void action_state_updated() = 0;
58 /**
59 * Notify that memory address has been read.
61 virtual void memory_read(uint64_t addr, uint64_t value) = 0;
62 /**
63 * Notify that memory address is about to be written.
65 virtual void memory_write(uint64_t addr, uint64_t value) = 0;
66 /**
67 * Notify that memory address is about to be executed.
69 virtual void memory_execute(uint64_t addr, uint64_t proc) = 0;
70 /**
71 * Notify trace event.
73 virtual void memory_trace(uint64_t proc, const char* str, bool insn) = 0;
76 extern struct emucore_callbacks* ecore_callbacks;
78 #endif