mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-10-05 10:04:50 +02:00
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 >_>
60 lines
1.7 KiB
C++
60 lines
1.7 KiB
C++
#ifndef EMULATOR_HPP
|
|
#define EMULATOR_HPP
|
|
|
|
#include <nall/nall.hpp>
|
|
#include <nall/dsp.hpp>
|
|
using namespace nall;
|
|
|
|
namespace Emulator {
|
|
static const string Name = "higan";
|
|
static const string Version = "095.04";
|
|
static const string Author = "byuu";
|
|
static const string License = "GPLv3";
|
|
static const string Website = "http://byuu.org/";
|
|
|
|
#if defined(PROFILE_ACCURACY)
|
|
static const string Profile = "Accuracy";
|
|
#elif defined(PROFILE_BALANCED)
|
|
static const string Profile = "Balanced";
|
|
#elif defined(PROFILE_PERFORMANCE)
|
|
static const string Profile = "Performance";
|
|
#endif
|
|
}
|
|
|
|
#include "interface.hpp"
|
|
|
|
//debugging function hook:
|
|
//no overhead (and no debugger invocation) if not compiled with -DDEBUGGER
|
|
//wraps testing of function to allow invocation without a defined callback
|
|
template<typename T> struct hook;
|
|
template<typename R, typename... P> struct hook<R (P...)> {
|
|
function<R (P...)> callback;
|
|
|
|
auto operator()(P... p) const -> R {
|
|
#if defined(DEBUGGER)
|
|
if(callback) return callback(forward<P>(p)...);
|
|
#endif
|
|
return R();
|
|
}
|
|
|
|
hook() {}
|
|
hook(const hook& hook) { callback = hook.callback; }
|
|
hook(void* function) { callback = function; }
|
|
hook(auto (*function)(P...) -> R) { callback = function; }
|
|
template<typename C> hook(auto (C::*function)(P...) -> R, C* object) { callback = {function, object}; }
|
|
template<typename C> hook(auto (C::*function)(P...) const -> R, C* object) { callback = {function, object}; }
|
|
template<typename L> hook(const L& function) { callback = function; }
|
|
|
|
auto operator=(const hook& source) -> hook& { callback = source.callback; return *this; }
|
|
};
|
|
|
|
#if defined(DEBUGGER)
|
|
#define privileged public
|
|
#else
|
|
#define privileged private
|
|
#endif
|
|
|
|
using varuint = varuint_t<uint>;
|
|
|
|
#endif
|