mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-24 15:12:23 +01:00
byuu says (in the public announcement): Not a large changelog this time, sorry. This release is mostly to fix the SA-1 issue, and to get some real-world testing of the new scheduler model. Most of the work in the past month has gone into writing a 68000 CPU core; yet it's still only about half-way finished. Changelog (since the previous release): - fixed SNES SA-1 IRQ regression (fixes Super Mario RPG level-up screen) - new scheduler for all emulator cores (precision of 2^-127) - icarus database adds nine new SNES games - added Input/Frequency to settings file (allows simulation of latency) byuu says (in the WIP forum): Changelog: - in 32-bit mode, Thread uses uint64\_t with 2^-63 time units (10^-7 precision in the worst case) - nearly ten times the precision of an attosecond - in 64-bit mode, Thread uses uint128\_t with 2^-127 time units (10^-26 precision in the worst case) - far more accurate than yoctoseconds; almost closing in on planck time Note: a quartz crystal is accurate to 10^-4 or 10^-5. A cesium fountain atomic clock is accurate to 10^-15. So ... yeah. 2^-63 was perfectly fine; but there was no speed penalty whatsoever for using uint128\_t in 64-bit mode, so why not?
72 lines
2.0 KiB
C++
72 lines
2.0 KiB
C++
struct InputMapping {
|
|
auto bind() -> void;
|
|
auto bind(shared_pointer<HID::Device> device, uint group, uint input, int16 oldValue, int16 newValue) -> bool;
|
|
auto poll() -> int16;
|
|
auto rumble(bool enable) -> void;
|
|
auto unbind() -> void;
|
|
|
|
auto isDigital() const -> bool { return type == 0; }
|
|
auto isAnalog() const -> bool { return type == 1; }
|
|
auto isRumble() const -> bool { return type == 2; }
|
|
|
|
auto assignmentName() -> string;
|
|
auto deviceName() -> string;
|
|
|
|
string path; //configuration file key path
|
|
string name; //input name (human readable)
|
|
uint type = 0;
|
|
string assignment = "None";
|
|
shared_pointer<HID::Device> device;
|
|
uint group = 0;
|
|
uint input = 0;
|
|
enum class Qualifier : uint { None, Lo, Hi, Rumble } qualifier = Qualifier::None;
|
|
};
|
|
|
|
struct InputHotkey : InputMapping {
|
|
function<auto () -> void> press;
|
|
function<auto () -> void> release;
|
|
|
|
int16 state = 0;
|
|
};
|
|
|
|
struct InputDevice {
|
|
string name;
|
|
vector<InputMapping> mappings;
|
|
};
|
|
|
|
struct InputPort {
|
|
string name;
|
|
vector<InputDevice> devices;
|
|
};
|
|
|
|
struct InputEmulator {
|
|
Emulator::Interface* interface = nullptr;
|
|
string name;
|
|
vector<InputPort> ports;
|
|
};
|
|
|
|
struct InputManager {
|
|
InputManager();
|
|
auto bind(Emulator::Interface*) -> void;
|
|
auto bind() -> void;
|
|
auto poll() -> void;
|
|
auto onChange(shared_pointer<HID::Device> device, uint group, uint input, int16_t oldValue, int16_t newValue) -> void;
|
|
auto quit() -> void;
|
|
|
|
auto findMouse() -> shared_pointer<HID::Device>;
|
|
|
|
//hotkeys.cpp
|
|
auto appendHotkeys() -> void;
|
|
auto pollHotkeys() -> void;
|
|
|
|
vector<shared_pointer<HID::Device>> devices;
|
|
vector<InputEmulator> emulators;
|
|
vector<InputHotkey*> hotkeys;
|
|
|
|
InputEmulator* emulator = nullptr; //points to InputEmulator that represents the currently active emulator
|
|
uint64 lastPoll; //time in milliseconds since last call to poll()
|
|
uint64 frequency; //minimum time in milliseconds before poll() can be called again
|
|
};
|
|
|
|
extern unique_pointer<InputManager> inputManager;
|