Update to v098r03 release.
byuu says:
It took several hours, but I've rebuilt much of the SNES' bus memory
mapping architecture.
The new design unifies the cartridge string-based mapping
("00-3f,80-bf:8000-ffff") and internal bus.map calls. The map() function
now has an accompanying unmap() function, and instead of a fixed 256
callbacks, it'll scan to find the first available slot. unmap() will
free slots up when zero addresses reference a given slot.
The controllers and expansion port are now both entirely dynamic.
Instead of load/unload/power/reset, they only have the constructor
(power/reset/load) and destructor (unload). What this means is you can
now dynamically change even expansion port devices after the system is
loaded.
Note that this is incredibly dangerous and stupid, but ... oh well. The
whole point of this was for 21fx. There's no way to change the expansion
port device prior to loading a game, but if the 21fx isn't active, then
the reset vector hijack won't work. Now you can load a 21fx game, change
the expansion port device, and simply reset the system to active the
device.
The unification of design between controller port devices and expansion
port devices is nice, and overall this results in a reduction of code
(all of the Mapping stuff in Cartridge is gone, replaced with direct bus
mapping.) And there's always the potential to expand this system more in
the future now.
The big missing feature right now is the ability to push/pop mappings.
So if you look at how the 21fx does the reset vector, you might vomit
a little bit. But ... it works.
Also changed exit(0) to _exit(0) in the POSIX version of nall::execute.
[The _exit(0) thing is an attempt to make higan not crash when it tries
to launch icarus and it's not on $PATH. The theory is that higan forks,
then the child tries to exec icarus and fails, so it exits, all the
unique_ptrs clean up their resources and tell the X server to free
things the parent process is still using. Calling _exit() prevents
destructors from running, and seems to prevent the problem. -Ed.]
2016-04-09 10:21:18 +00:00
|
|
|
struct SuperDisc : Expansion {
|
|
|
|
SuperDisc();
|
|
|
|
~SuperDisc();
|
|
|
|
|
2016-03-08 11:34:00 +00:00
|
|
|
static auto Enter() -> void;
|
|
|
|
auto main() -> void;
|
|
|
|
|
2016-03-02 11:19:33 +00:00
|
|
|
auto read(uint24 addr, uint8 data) -> uint8;
|
|
|
|
auto write(uint24 addr, uint8 data) -> void;
|
|
|
|
|
2016-03-10 10:35:48 +00:00
|
|
|
//nec.cpp
|
|
|
|
auto necPollIRQ() -> uint8;
|
|
|
|
auto necReadData() -> uint8;
|
|
|
|
auto necWriteCommand(uint4 data) -> void;
|
|
|
|
|
|
|
|
//sony.cpp
|
|
|
|
auto sonyPollIRQ() -> uint8;
|
|
|
|
auto sonyReadData() -> uint8;
|
|
|
|
auto sonyWriteCommand(uint8 data) -> void;
|
|
|
|
auto sonyWriteData(uint8 data) -> void;
|
|
|
|
|
2016-03-02 11:19:33 +00:00
|
|
|
private:
|
2016-03-10 10:35:48 +00:00
|
|
|
struct Registers {
|
|
|
|
uint8 irqEnable;
|
|
|
|
} r;
|
|
|
|
|
|
|
|
//NEC
|
|
|
|
struct NEC {
|
|
|
|
vector<uint4> command;
|
|
|
|
uint8 data;
|
|
|
|
} nec;
|
|
|
|
|
|
|
|
//Sony
|
|
|
|
struct Sony {
|
|
|
|
uint8 command;
|
|
|
|
uint8 data;
|
|
|
|
} sony;
|
2016-03-02 11:19:33 +00:00
|
|
|
};
|