More making core functions into methods
[lsnes.git] / include / core / emucore.hpp
blob0379469ace294ceff0695495e61354e86e3e79a0
1 #ifndef _emucore__hpp__included__
2 #define _emucore__hpp__included__
4 #include <map>
5 #include <list>
6 #include <cstdlib>
7 #include <string>
8 #include <set>
9 #include <vector>
10 #include "library/framebuffer.hpp"
11 #include "library/controller-data.hpp"
12 #include "interface/romtype.hpp"
15 //Get set of SRAMs.
16 std::set<std::string> get_sram_set();
17 //Valid port types.
18 extern port_type* core_port_types[];
19 //Emulator core.
20 extern core_core* emulator_core;
22 //Callbacks.
23 struct emucore_callbacks
25 public:
26 virtual ~emucore_callbacks() throw();
27 //Get the input for specified control.
28 virtual int16_t get_input(unsigned port, unsigned index, unsigned control) = 0;
29 //Set the input for specified control (used for system controls, only works in readwrite mode).
30 //Returns the actual value of control (may differ if in readonly mode).
31 virtual int16_t set_input(unsigned port, unsigned index, unsigned control, int16_t value) = 0;
32 //Do timer tick.
33 virtual void timer_tick(uint32_t increment, uint32_t per_second) = 0;
34 //Get the firmware path.
35 virtual std::string get_firmware_path() = 0;
36 //Get the base path.
37 virtual std::string get_base_path() = 0;
38 //Get the current time.
39 virtual time_t get_time() = 0;
40 //Get random seed.
41 virtual time_t get_randomseed() = 0;
42 //Output frame.
43 virtual void output_frame(framebuffer_raw& screen, uint32_t fps_n, uint32_t fps_d) = 0;
46 extern struct emucore_callbacks* ecore_callbacks;
48 //A VMA.
49 struct vma_info
51 std::string name;
52 uint64_t base;
53 uint64_t size;
54 void* backing_ram;
55 bool readonly;
56 bool native_endian;
57 uint8_t (*iospace_rw)(uint64_t offset, uint8_t data, bool write);
60 std::list<vma_info> get_vma_list();
62 #endif