lsnes/include/interface/callbacks.hpp
Ilari Liusvaara 1d2df8ebea Support latch notifications on SNES
This patch is so large since it adds support for passing arguments to
the Lua callback, even if SNES doesn't use those.
2013-10-27 14:41:28 +02:00

62 lines
1.4 KiB
C++

#ifndef _interface__callbacks__hpp__included__
#define _interface__callbacks__hpp__included__
#include <cstdint>
#include <string>
#include <list>
#include "library/framebuffer.hpp"
/**
* Callbacks emulator binding can use.
*/
struct emucore_callbacks
{
public:
virtual ~emucore_callbacks() throw();
/**
* Get input from specified control.
*/
virtual int16_t get_input(unsigned port, unsigned index, unsigned control) = 0;
/**
* Set input for specified control. Only works in readwrite mode.
*
* Returns the actual input value used.
*/
virtual int16_t set_input(unsigned port, unsigned index, unsigned control, int16_t value) = 0;
/**
* Notifies about latch. Only called on some systems.
*/
virtual void notify_latch(std::list<std::string>& l) = 0;
/**
* Tick the RTC timer.
*/
virtual void timer_tick(uint32_t increment, uint32_t per_second) = 0;
/**
* Get path for firmware.
*/
virtual std::string get_firmware_path() = 0;
/**
* Get the base filename for ROM.
*/
virtual std::string get_base_path() = 0;
/**
* Get current RTC time.
*/
virtual time_t get_time() = 0;
/**
* Get the RNG seed to use.
*/
virtual time_t get_randomseed() = 0;
/**
* Output a frame. Call once for each call to emulate().
*/
virtual void output_frame(framebuffer_raw& screen, uint32_t fps_n, uint32_t fps_d) = 0;
/**
* Notify that action states have been updated.
*/
virtual void action_state_updated() = 0;
};
extern struct emucore_callbacks* ecore_callbacks;
#endif