lsnes/include/interface/callbacks.hpp

57 lines
1.3 KiB
C++
Raw Normal View History

#ifndef _interface__callbacks__hpp__included__
#define _interface__callbacks__hpp__included__
#include <cstdint>
#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;
/**
* 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;
2013-06-30 13:20:23 +03:00
/**
* Notify that action states have been updated.
2013-06-30 13:20:23 +03:00
*/
virtual void action_state_updated() = 0;
};
extern struct emucore_callbacks* ecore_callbacks;
2013-06-30 13:20:23 +03:00
#endif