1 #ifndef _interface__callbacks__hpp__included__
2 #define _interface__callbacks__hpp__included__
7 #include "library/framebuffer.hpp"
10 * Callbacks emulator binding can use.
12 struct emucore_callbacks
15 virtual ~emucore_callbacks() throw();
17 * Get input from specified control.
19 virtual int16_t get_input(unsigned port
, unsigned index
, unsigned control
) = 0;
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;
27 * Notifies about latch. Only called on some systems.
29 virtual void notify_latch(std::list
<std::string
>& l
) = 0;
33 virtual void timer_tick(uint32_t increment
, uint32_t per_second
) = 0;
35 * Get path for firmware.
37 virtual std::string
get_firmware_path() = 0;
39 * Get the base filename for ROM.
41 virtual std::string
get_base_path() = 0;
43 * Get current RTC time.
45 virtual time_t get_time() = 0;
47 * Get the RNG seed to use.
49 virtual time_t get_randomseed() = 0;
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;
55 * Notify that action states have been updated.
57 virtual void action_state_updated() = 0;
59 * Notify that memory address has been read.
61 virtual void memory_read(uint64_t addr
, uint64_t value
) = 0;
63 * Notify that memory address is about to be written.
65 virtual void memory_write(uint64_t addr
, uint64_t value
) = 0;
67 * Notify that memory address is about to be executed.
69 virtual void memory_execute(uint64_t addr
, uint64_t proc
) = 0;
73 virtual void memory_trace(uint64_t proc
, const char* str
, bool insn
) = 0;
76 extern struct emucore_callbacks
* ecore_callbacks
;