mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-10-05 05:21:51 +02:00
Update to v095r04 release.
Changelog: - S-SMP core code style updated - S-SMP loads reset vector from IPLROM ($fffe-ffff) - sfc/base => sfc/expansion - system/input => system/device - added expansion/eBoot (simulation of defparam's SNES-Boot device) - expansion port device can now be selected from Super Famicom menu option - improved GBA MROM/SRAM reading endrift's memory test is up to 1388/1552. Note: I added the expansion port devices to the same group as controller ports. I also had to move "None" to the top of the list. Before v096, I am going to have to add caching of port selections to the configuration file, check the proper default item in the system menu, and remove the items with no mappings from the input configuration window. Lots of work >_>
This commit is contained in:
@@ -6,8 +6,8 @@ namespace Emulator {
|
||||
struct Interface {
|
||||
struct Information {
|
||||
string name;
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
uint width;
|
||||
uint height;
|
||||
bool overscan;
|
||||
double aspectRatio;
|
||||
bool resettable;
|
||||
@@ -18,7 +18,7 @@ struct Interface {
|
||||
} information;
|
||||
|
||||
struct Media {
|
||||
unsigned id;
|
||||
uint id;
|
||||
string name;
|
||||
string type;
|
||||
bool bootable; //false for cartridge slots (eg Sufami Turbo cartridges)
|
||||
@@ -26,52 +26,52 @@ struct Interface {
|
||||
vector<Media> media;
|
||||
|
||||
struct Device {
|
||||
unsigned id;
|
||||
unsigned portmask;
|
||||
uint id;
|
||||
uint portmask;
|
||||
string name;
|
||||
struct Input {
|
||||
unsigned id;
|
||||
unsigned type; //0 = digital, 1 = analog (relative), 2 = rumble
|
||||
uint id;
|
||||
uint type; //0 = digital, 1 = analog (relative), 2 = rumble
|
||||
string name;
|
||||
uintptr_t guid; //user data field
|
||||
};
|
||||
vector<Input> input;
|
||||
vector<unsigned> order;
|
||||
vector<uint> order;
|
||||
};
|
||||
|
||||
struct Port {
|
||||
unsigned id;
|
||||
uint id;
|
||||
string name;
|
||||
vector<Device> device;
|
||||
};
|
||||
vector<Port> port;
|
||||
|
||||
struct Bind {
|
||||
virtual auto loadRequest(unsigned, string, string, bool) -> void {}
|
||||
virtual auto loadRequest(unsigned, string, bool) -> void {}
|
||||
virtual auto saveRequest(unsigned, string) -> void {}
|
||||
virtual auto videoColor(unsigned, uint16_t, uint16_t, uint16_t, uint16_t) -> uint32_t { return 0u; }
|
||||
virtual auto videoRefresh(const uint32_t*, const uint32_t*, unsigned, unsigned, unsigned) -> void {}
|
||||
virtual auto audioSample(int16_t, int16_t) -> void {}
|
||||
virtual auto inputPoll(unsigned, unsigned, unsigned) -> int16_t { return 0; }
|
||||
virtual auto inputRumble(unsigned, unsigned, unsigned, bool) -> void {}
|
||||
virtual auto dipSettings(const Markup::Node&) -> unsigned { return 0; }
|
||||
virtual auto path(unsigned) -> string { return ""; }
|
||||
virtual auto loadRequest(uint, string, string, bool) -> void {}
|
||||
virtual auto loadRequest(uint, string, bool) -> void {}
|
||||
virtual auto saveRequest(uint, string) -> void {}
|
||||
virtual auto videoColor(uint, uint16, uint16, uint16, uint16) -> uint32 { return 0u; }
|
||||
virtual auto videoRefresh(const uint32*, const uint32*, uint, uint, uint) -> void {}
|
||||
virtual auto audioSample(int16, int16) -> void {}
|
||||
virtual auto inputPoll(uint, uint, uint) -> int16 { return 0; }
|
||||
virtual auto inputRumble(uint, uint, uint, bool) -> void {}
|
||||
virtual auto dipSettings(const Markup::Node&) -> uint { return 0; }
|
||||
virtual auto path(uint) -> string { return ""; }
|
||||
virtual auto notify(string text) -> void { print(text, "\n"); }
|
||||
};
|
||||
Bind* bind = nullptr;
|
||||
|
||||
//callback bindings (provided by user interface)
|
||||
auto loadRequest(unsigned id, string name, string type, bool required) -> void { return bind->loadRequest(id, name, type, required); }
|
||||
auto loadRequest(unsigned id, string path, bool required) -> void { return bind->loadRequest(id, path, required); }
|
||||
auto saveRequest(unsigned id, string path) -> void { return bind->saveRequest(id, path); }
|
||||
auto videoColor(unsigned source, uint16_t alpha, uint16_t red, uint16_t green, uint16_t blue) -> uint32_t { return bind->videoColor(source, alpha, red, green, blue); }
|
||||
auto videoRefresh(const uint32_t* palette, const uint32_t* data, unsigned pitch, unsigned width, unsigned height) -> void { return bind->videoRefresh(palette, data, pitch, width, height); }
|
||||
auto audioSample(int16_t lsample, int16_t rsample) -> void { return bind->audioSample(lsample, rsample); }
|
||||
auto inputPoll(unsigned port, unsigned device, unsigned input) -> int16_t { return bind->inputPoll(port, device, input); }
|
||||
auto inputRumble(unsigned port, unsigned device, unsigned input, bool enable) -> void { return bind->inputRumble(port, device, input, enable); }
|
||||
auto dipSettings(const Markup::Node& node) -> unsigned { return bind->dipSettings(node); }
|
||||
auto path(unsigned group) -> string { return bind->path(group); }
|
||||
auto loadRequest(uint id, string name, string type, bool required) -> void { return bind->loadRequest(id, name, type, required); }
|
||||
auto loadRequest(uint id, string path, bool required) -> void { return bind->loadRequest(id, path, required); }
|
||||
auto saveRequest(uint id, string path) -> void { return bind->saveRequest(id, path); }
|
||||
auto videoColor(uint source, uint16 alpha, uint16 red, uint16 green, uint16 blue) -> uint32 { return bind->videoColor(source, alpha, red, green, blue); }
|
||||
auto videoRefresh(const uint32* palette, const uint32* data, uint pitch, uint width, uint height) -> void { return bind->videoRefresh(palette, data, pitch, width, height); }
|
||||
auto audioSample(int16 lsample, int16 rsample) -> void { return bind->audioSample(lsample, rsample); }
|
||||
auto inputPoll(uint port, uint device, uint input) -> int16 { return bind->inputPoll(port, device, input); }
|
||||
auto inputRumble(uint port, uint device, uint input, bool enable) -> void { return bind->inputRumble(port, device, input, enable); }
|
||||
auto dipSettings(const Markup::Node& node) -> uint { return bind->dipSettings(node); }
|
||||
auto path(uint group) -> string { return bind->path(group); }
|
||||
template<typename... P> auto notify(P&&... p) -> void { return bind->notify({forward<P>(p)...}); }
|
||||
|
||||
//information
|
||||
@@ -82,15 +82,15 @@ struct Interface {
|
||||
//media interface
|
||||
virtual auto loaded() -> bool { return false; }
|
||||
virtual auto sha256() -> string { return ""; }
|
||||
virtual auto group(unsigned id) -> unsigned = 0;
|
||||
virtual auto load(unsigned id) -> void {}
|
||||
virtual auto group(uint id) -> uint = 0;
|
||||
virtual auto load(uint id) -> void {}
|
||||
virtual auto save() -> void {}
|
||||
virtual auto load(unsigned id, const stream& memory) -> void {}
|
||||
virtual auto save(unsigned id, const stream& memory) -> void {}
|
||||
virtual auto load(uint id, const stream& memory) -> void {}
|
||||
virtual auto save(uint id, const stream& memory) -> void {}
|
||||
virtual auto unload() -> void {}
|
||||
|
||||
//system interface
|
||||
virtual auto connect(unsigned port, unsigned device) -> void {}
|
||||
virtual auto connect(uint port, uint device) -> void {}
|
||||
virtual auto power() -> void {}
|
||||
virtual auto reset() -> void {}
|
||||
virtual auto run() -> void {}
|
||||
@@ -107,7 +107,7 @@ struct Interface {
|
||||
virtual auto cheatSet(const lstring& = lstring{}) -> void {}
|
||||
|
||||
//utility functions
|
||||
enum class PaletteMode : unsigned { Literal, Channel, Standard, Emulation };
|
||||
enum class PaletteMode : uint { Literal, Channel, Standard, Emulation };
|
||||
virtual auto paletteUpdate(PaletteMode mode) -> void {}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user