mirror of https://github.com/bsnes-emu/bsnes.git
Update to v076r04 release.
byuu says: Changelog: - fixed Sufami Turbo ROM and RAM mapping bugs - more paths work, definitely need to clean up parameter names and enum typenames now I had to cheat just a bit on the ST SRAM. For now, I am specifying the RAM size in the XML file. The base XML isn't supposed to know about the slots though. What I need to do is write an ST header parser to get actual RAM sizes, and then from there generate an ST-specific XML file (like I do for the Game Boy) to specify this info. Would also be nice for some BS-X info. Added NECDSP, MSU1 and Serial paths. This eliminates SNES::Cartridge::basename.
This commit is contained in:
parent
6c4e3ec790
commit
8b7dd89059
|
@ -362,7 +362,7 @@ SNESCartridge::SNESCartridge(const uint8_t *data, unsigned size) {
|
||||||
xml << " <map mode='linear' address='20-3f:8000-ffff'/>\n";
|
xml << " <map mode='linear' address='20-3f:8000-ffff'/>\n";
|
||||||
xml << " <map mode='linear' address='a0-bf:8000-ffff'/>\n";
|
xml << " <map mode='linear' address='a0-bf:8000-ffff'/>\n";
|
||||||
xml << " </rom>\n";
|
xml << " </rom>\n";
|
||||||
xml << " <ram>\n";
|
xml << " <ram size='20000'>\n";
|
||||||
xml << " <map mode='linear' address='60-63:8000-ffff'/>\n";
|
xml << " <map mode='linear' address='60-63:8000-ffff'/>\n";
|
||||||
xml << " <map mode='linear' address='e0-e3:8000-ffff'/>\n";
|
xml << " <map mode='linear' address='e0-e3:8000-ffff'/>\n";
|
||||||
xml << " </ram>\n";
|
xml << " </ram>\n";
|
||||||
|
@ -372,7 +372,7 @@ SNESCartridge::SNESCartridge(const uint8_t *data, unsigned size) {
|
||||||
xml << " <map mode='linear' address='40-5f:8000-ffff'/>\n";
|
xml << " <map mode='linear' address='40-5f:8000-ffff'/>\n";
|
||||||
xml << " <map mode='linear' address='c0-df:8000-ffff'/>\n";
|
xml << " <map mode='linear' address='c0-df:8000-ffff'/>\n";
|
||||||
xml << " </rom>\n";
|
xml << " </rom>\n";
|
||||||
xml << " <ram>\n";
|
xml << " <ram size='20000'>\n";
|
||||||
xml << " <map mode='linear' address='70-73:8000-ffff'/>\n";
|
xml << " <map mode='linear' address='70-73:8000-ffff'/>\n";
|
||||||
xml << " <map mode='linear' address='f0-f3:8000-ffff'/>\n";
|
xml << " <map mode='linear' address='f0-f3:8000-ffff'/>\n";
|
||||||
xml << " </ram>\n";
|
xml << " </ram>\n";
|
||||||
|
|
|
@ -19,15 +19,15 @@ public:
|
||||||
SufamiTurboA,
|
SufamiTurboA,
|
||||||
SufamiTurboB,
|
SufamiTurboB,
|
||||||
GameBoy,
|
GameBoy,
|
||||||
|
|
||||||
|
NECDSP,
|
||||||
|
MSU1,
|
||||||
|
Serial,
|
||||||
};
|
};
|
||||||
|
|
||||||
MappedRAM rom;
|
MappedRAM rom;
|
||||||
MappedRAM ram;
|
MappedRAM ram;
|
||||||
|
|
||||||
//assigned externally to point to file-system datafiles (msu1 and serial)
|
|
||||||
//example: "/path/to/filename.sfc" would set this to "/path/to/filename"
|
|
||||||
readwrite<string> basename;
|
|
||||||
|
|
||||||
readonly<bool> loaded;
|
readonly<bool> loaded;
|
||||||
readonly<unsigned> crc32;
|
readonly<unsigned> crc32;
|
||||||
readonly<string> sha256;
|
readonly<string> sha256;
|
||||||
|
|
|
@ -274,7 +274,7 @@ void Cartridge::xml_parse_necdsp(xml_element &root) {
|
||||||
unsigned filesize = promsize * 3 + dromsize * 2;
|
unsigned filesize = promsize * 3 + dromsize * 2;
|
||||||
|
|
||||||
file fp;
|
file fp;
|
||||||
if(fp.open(string(dir(basename()), program), file::mode::read)) {
|
if(fp.open(system.interface->path(Slot::NECDSP, program), file::mode::read)) {
|
||||||
if(fp.size() == filesize) {
|
if(fp.size() == filesize) {
|
||||||
for(unsigned n = 0; n < promsize; n++) necdsp.programROM[n] = fp.readm(3);
|
for(unsigned n = 0; n < promsize; n++) necdsp.programROM[n] = fp.readm(3);
|
||||||
for(unsigned n = 0; n < dromsize; n++) necdsp.dataROM[n] = fp.readm(2);
|
for(unsigned n = 0; n < dromsize; n++) necdsp.dataROM[n] = fp.readm(2);
|
||||||
|
@ -328,7 +328,7 @@ void Cartridge::xml_parse_necdsp(xml_element &root) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(program == "") {
|
if(programhash == "") {
|
||||||
system.interface->message({ "Warning: NEC DSP program ", program, " is missing." });
|
system.interface->message({ "Warning: NEC DSP program ", program, " is missing." });
|
||||||
} else if(sha256 != "" && sha256 != programhash) {
|
} else if(sha256 != "" && sha256 != programhash) {
|
||||||
system.interface->message({
|
system.interface->message({
|
||||||
|
@ -405,10 +405,17 @@ void Cartridge::xml_parse_sufamiturbo(xml_element &root) {
|
||||||
if(attr.name == "offset") m.offset = hex(attr.content);
|
if(attr.name == "offset") m.offset = hex(attr.content);
|
||||||
if(attr.name == "size") m.size = hex(attr.content);
|
if(attr.name == "size") m.size = hex(attr.content);
|
||||||
}
|
}
|
||||||
if(memory.size() > 0) mapping.append(m);
|
if(m.size == 0) m.size = memory.size();
|
||||||
|
if(m.size) mapping.append(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if(slot.name == "ram") {
|
} else if(slot.name == "ram") {
|
||||||
|
unsigned ram_size = 0;
|
||||||
|
|
||||||
|
foreach(attr, slot.attribute) {
|
||||||
|
if(attr.name == "size") ram_size = hex(attr.content);
|
||||||
|
}
|
||||||
|
|
||||||
foreach(leaf, slot.element) {
|
foreach(leaf, slot.element) {
|
||||||
if(leaf.name == "map") {
|
if(leaf.name == "map") {
|
||||||
Memory &memory = slotid == 0 ? sufamiturbo.slotA.ram : sufamiturbo.slotB.ram;
|
Memory &memory = slotid == 0 ? sufamiturbo.slotA.ram : sufamiturbo.slotB.ram;
|
||||||
|
@ -419,7 +426,8 @@ void Cartridge::xml_parse_sufamiturbo(xml_element &root) {
|
||||||
if(attr.name == "offset") m.offset = hex(attr.content);
|
if(attr.name == "offset") m.offset = hex(attr.content);
|
||||||
if(attr.name == "size") m.size = hex(attr.content);
|
if(attr.name == "size") m.size = hex(attr.content);
|
||||||
}
|
}
|
||||||
if(memory.size() > 0) mapping.append(m);
|
if(m.size == 0) m.size = ram_size;
|
||||||
|
if(m.size) mapping.append(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ void MSU1::init() {
|
||||||
|
|
||||||
void MSU1::load() {
|
void MSU1::load() {
|
||||||
if(datafile.open()) datafile.close();
|
if(datafile.open()) datafile.close();
|
||||||
datafile.open(string(cartridge.basename(), ".msu"), file::mode::read);
|
datafile.open(system.interface->path(Cartridge::Slot::MSU1, ".msu"), file::mode::read);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MSU1::unload() {
|
void MSU1::unload() {
|
||||||
|
@ -133,7 +133,7 @@ void MSU1::mmio_write(unsigned addr, uint8 data) {
|
||||||
if(addr == 0x2005) {
|
if(addr == 0x2005) {
|
||||||
mmio.audio_track = (mmio.audio_track & 0x00ff) | (data << 8);
|
mmio.audio_track = (mmio.audio_track & 0x00ff) | (data << 8);
|
||||||
if(audiofile.open()) audiofile.close();
|
if(audiofile.open()) audiofile.close();
|
||||||
if(audiofile.open(string(cartridge.basename(), "-", (unsigned)mmio.audio_track, ".pcm"), file::mode::read)) {
|
if(audiofile.open(system.interface->path(Cartridge::Slot::MSU1, { "-", (unsigned)mmio.audio_track, ".pcm" }), file::mode::read)) {
|
||||||
uint32 header = audiofile.readm(4);
|
uint32 header = audiofile.readm(4);
|
||||||
if(header != 0x4d535531) { //verify 'MSU1' header
|
if(header != 0x4d535531) { //verify 'MSU1' header
|
||||||
audiofile.close();
|
audiofile.close();
|
||||||
|
|
|
@ -16,12 +16,12 @@ void MSU1::serialize(serializer &s) {
|
||||||
s.integer(mmio.audio_play);
|
s.integer(mmio.audio_play);
|
||||||
|
|
||||||
if(datafile.open()) datafile.close();
|
if(datafile.open()) datafile.close();
|
||||||
if(datafile.open(string(cartridge.basename(), ".msu"), file::mode::read)) {
|
if(datafile.open(system.interface->path(Cartridge::Slot::MSU1, ".msu"), file::mode::read)) {
|
||||||
datafile.seek(mmio.data_offset);
|
datafile.seek(mmio.data_offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(audiofile.open()) audiofile.close();
|
if(audiofile.open()) audiofile.close();
|
||||||
if(audiofile.open(string(cartridge.basename(), "-", (unsigned)mmio.audio_track, ".pcm"), file::mode::read)) {
|
if(audiofile.open(system.interface->path(Cartridge::Slot::MSU1, { "-", (unsigned)mmio.audio_track, ".pcm" }), file::mode::read)) {
|
||||||
audiofile.seek(mmio.audio_offset);
|
audiofile.seek(mmio.audio_offset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,8 +79,9 @@ void Serial::init() {
|
||||||
|
|
||||||
void Serial::load() {
|
void Serial::load() {
|
||||||
if(opened()) close();
|
if(opened()) close();
|
||||||
string name = notdir(cartridge.basename());
|
string basename = system.interface->path(Cartridge::Slot::Serial, "");
|
||||||
string path = dir(cartridge.basename());
|
string name = notdir(basename);
|
||||||
|
string path = dir(basename);
|
||||||
if(open(name, path)) {
|
if(open(name, path)) {
|
||||||
baudrate = sym("snesserial_baudrate");
|
baudrate = sym("snesserial_baudrate");
|
||||||
flowcontrol = sym("snesserial_flowcontrol");
|
flowcontrol = sym("snesserial_flowcontrol");
|
||||||
|
|
|
@ -11,13 +11,13 @@ void SufamiTurbo::load() {
|
||||||
slotB.ram.map(allocate<uint8>(128 * 1024, 0xff), 128 * 1024);
|
slotB.ram.map(allocate<uint8>(128 * 1024, 0xff), 128 * 1024);
|
||||||
|
|
||||||
if(slotA.rom.data()) {
|
if(slotA.rom.data()) {
|
||||||
cartridge.nvram.append({ "srm", slotA.ram.data(), slotA.ram.size(), Cartridge::Slot::SufamiTurboA });
|
cartridge.nvram.append({ "sts", slotA.ram.data(), slotA.ram.size(), Cartridge::Slot::SufamiTurboA });
|
||||||
} else {
|
} else {
|
||||||
slotA.rom.map(allocate<uint8>(128 * 1024, 0xff), 128 * 1024);
|
slotA.rom.map(allocate<uint8>(128 * 1024, 0xff), 128 * 1024);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(slotB.rom.data()) {
|
if(slotB.rom.data()) {
|
||||||
cartridge.nvram.append({ "srm", slotB.ram.data(), slotB.ram.size(), Cartridge::Slot::SufamiTurboB });
|
cartridge.nvram.append({ "sts", slotB.ram.data(), slotB.ram.size(), Cartridge::Slot::SufamiTurboB });
|
||||||
} else {
|
} else {
|
||||||
slotB.rom.map(allocate<uint8>(128 * 1024, 0xff), 128 * 1024);
|
slotB.rom.map(allocate<uint8>(128 * 1024, 0xff), 128 * 1024);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,4 +6,5 @@ public:
|
||||||
virtual int16_t input_poll(bool port, Input::Device device, unsigned index, unsigned id) { return 0; }
|
virtual int16_t input_poll(bool port, Input::Device device, unsigned index, unsigned id) { return 0; }
|
||||||
|
|
||||||
virtual void message(const string &text) { print(text, "\n"); }
|
virtual void message(const string &text) { print(text, "\n"); }
|
||||||
|
virtual string path(Cartridge::Slot slot, const string &path) { return path; };
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
namespace SNES {
|
namespace SNES {
|
||||||
namespace Info {
|
namespace Info {
|
||||||
static const char Name[] = "bsnes";
|
static const char Name[] = "bsnes";
|
||||||
static const char Version[] = "076.03";
|
static const char Version[] = "076.04";
|
||||||
static const unsigned SerializerVersion = 18;
|
static const unsigned SerializerVersion = 18;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -132,6 +132,7 @@ namespace SNES {
|
||||||
#include <snes/chip/chip.hpp>
|
#include <snes/chip/chip.hpp>
|
||||||
#include <snes/cartridge/cartridge.hpp>
|
#include <snes/cartridge/cartridge.hpp>
|
||||||
#include <snes/cheat/cheat.hpp>
|
#include <snes/cheat/cheat.hpp>
|
||||||
|
#include <snes/interface/interface.hpp>
|
||||||
|
|
||||||
#include <snes/memory/memory-inline.hpp>
|
#include <snes/memory/memory-inline.hpp>
|
||||||
#include <snes/ppu/counter/counter-inline.hpp>
|
#include <snes/ppu/counter/counter-inline.hpp>
|
||||||
|
|
|
@ -2,6 +2,7 @@ class Interface;
|
||||||
|
|
||||||
class System : property<System> {
|
class System : property<System> {
|
||||||
public:
|
public:
|
||||||
|
Interface *interface;
|
||||||
enum class Region : unsigned { NTSC = 0, PAL = 1, Autodetect = 2 };
|
enum class Region : unsigned { NTSC = 0, PAL = 1, Autodetect = 2 };
|
||||||
enum class ExpansionPortDevice : unsigned { None = 0, BSX = 1 };
|
enum class ExpansionPortDevice : unsigned { None = 0, BSX = 1 };
|
||||||
|
|
||||||
|
@ -31,7 +32,6 @@ public:
|
||||||
System();
|
System();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Interface *interface;
|
|
||||||
void runthreadtosave();
|
void runthreadtosave();
|
||||||
|
|
||||||
void serialize(serializer&);
|
void serialize(serializer&);
|
||||||
|
@ -50,7 +50,6 @@ private:
|
||||||
|
|
||||||
#include <snes/config/config.hpp>
|
#include <snes/config/config.hpp>
|
||||||
#include <snes/debugger/debugger.hpp>
|
#include <snes/debugger/debugger.hpp>
|
||||||
#include <snes/interface/interface.hpp>
|
|
||||||
#include <snes/scheduler/scheduler.hpp>
|
#include <snes/scheduler/scheduler.hpp>
|
||||||
|
|
||||||
extern System system;
|
extern System system;
|
||||||
|
|
|
@ -4,7 +4,7 @@ Cartridge cartridge;
|
||||||
bool Cartridge::loadNormal(const char *basename) {
|
bool Cartridge::loadNormal(const char *basename) {
|
||||||
unload();
|
unload();
|
||||||
if(loadCartridge(SNES::cartridge.rom, baseXML, basename) == false) return false;
|
if(loadCartridge(SNES::cartridge.rom, baseXML, basename) == false) return false;
|
||||||
SNES::cartridge.basename = baseName = nall::basename(basename);
|
baseName = nall::basename(basename);
|
||||||
SNES::cartridge.load(SNES::Cartridge::Mode::Normal, { baseXML });
|
SNES::cartridge.load(SNES::Cartridge::Mode::Normal, { baseXML });
|
||||||
foreach(memory, SNES::cartridge.nvram) loadMemory(memory);
|
foreach(memory, SNES::cartridge.nvram) loadMemory(memory);
|
||||||
utility.cartridgeLoaded();
|
utility.cartridgeLoaded();
|
||||||
|
@ -15,7 +15,7 @@ bool Cartridge::loadBsxSlotted(const char *basename, const char *slotname) {
|
||||||
unload();
|
unload();
|
||||||
if(loadCartridge(SNES::cartridge.rom, baseXML, basename) == false) return false;
|
if(loadCartridge(SNES::cartridge.rom, baseXML, basename) == false) return false;
|
||||||
loadCartridge(SNES::bsxflash.memory, bsxXML, slotname);
|
loadCartridge(SNES::bsxflash.memory, bsxXML, slotname);
|
||||||
SNES::cartridge.basename = baseName = nall::basename(basename);
|
baseName = nall::basename(basename);
|
||||||
bsxName = nall::basename(slotname);
|
bsxName = nall::basename(slotname);
|
||||||
SNES::cartridge.load(SNES::Cartridge::Mode::BsxSlotted, { baseXML, bsxXML });
|
SNES::cartridge.load(SNES::Cartridge::Mode::BsxSlotted, { baseXML, bsxXML });
|
||||||
foreach(memory, SNES::cartridge.nvram) loadMemory(memory);
|
foreach(memory, SNES::cartridge.nvram) loadMemory(memory);
|
||||||
|
@ -27,7 +27,7 @@ bool Cartridge::loadBsx(const char *basename, const char *slotname) {
|
||||||
unload();
|
unload();
|
||||||
if(loadCartridge(SNES::cartridge.rom, baseXML, basename) == false) return false;
|
if(loadCartridge(SNES::cartridge.rom, baseXML, basename) == false) return false;
|
||||||
loadCartridge(SNES::bsxflash.memory, bsxXML, slotname);
|
loadCartridge(SNES::bsxflash.memory, bsxXML, slotname);
|
||||||
SNES::cartridge.basename = baseName = nall::basename(basename);
|
baseName = nall::basename(basename);
|
||||||
bsxName = nall::basename(slotname);
|
bsxName = nall::basename(slotname);
|
||||||
SNES::cartridge.load(SNES::Cartridge::Mode::Bsx, { baseXML, bsxXML });
|
SNES::cartridge.load(SNES::Cartridge::Mode::Bsx, { baseXML, bsxXML });
|
||||||
foreach(memory, SNES::cartridge.nvram) loadMemory(memory);
|
foreach(memory, SNES::cartridge.nvram) loadMemory(memory);
|
||||||
|
@ -40,7 +40,7 @@ bool Cartridge::loadSufamiTurbo(const char *basename, const char *slotAname, con
|
||||||
if(loadCartridge(SNES::cartridge.rom, baseXML, basename) == false) return false;
|
if(loadCartridge(SNES::cartridge.rom, baseXML, basename) == false) return false;
|
||||||
loadCartridge(SNES::sufamiturbo.slotA.rom, sufamiTurboAXML, slotAname);
|
loadCartridge(SNES::sufamiturbo.slotA.rom, sufamiTurboAXML, slotAname);
|
||||||
loadCartridge(SNES::sufamiturbo.slotB.rom, sufamiTurboBXML, slotBname);
|
loadCartridge(SNES::sufamiturbo.slotB.rom, sufamiTurboBXML, slotBname);
|
||||||
SNES::cartridge.basename = baseName = nall::basename(basename);
|
baseName = nall::basename(basename);
|
||||||
sufamiTurboAName = nall::basename(slotAname);
|
sufamiTurboAName = nall::basename(slotAname);
|
||||||
sufamiTurboBName = nall::basename(slotBname);
|
sufamiTurboBName = nall::basename(slotBname);
|
||||||
SNES::cartridge.load(SNES::Cartridge::Mode::SufamiTurbo, { baseXML, sufamiTurboAXML, sufamiTurboBXML });
|
SNES::cartridge.load(SNES::Cartridge::Mode::SufamiTurbo, { baseXML, sufamiTurboAXML, sufamiTurboBXML });
|
||||||
|
@ -68,7 +68,7 @@ bool Cartridge::loadSuperGameBoy(const char *basename, const char *slotname) {
|
||||||
GameBoy::cartridge.load(info.xml, data, size);
|
GameBoy::cartridge.load(info.xml, data, size);
|
||||||
if(data) delete[] data;
|
if(data) delete[] data;
|
||||||
|
|
||||||
SNES::cartridge.basename = baseName = nall::basename(basename);
|
baseName = nall::basename(basename);
|
||||||
gameBoyName = nall::basename(slotname);
|
gameBoyName = nall::basename(slotname);
|
||||||
SNES::cartridge.load(SNES::Cartridge::Mode::SuperGameBoy, { baseXML, "" });
|
SNES::cartridge.load(SNES::Cartridge::Mode::SuperGameBoy, { baseXML, "" });
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ void Console::write(const string &text, bool echo) {
|
||||||
|
|
||||||
void Console::tracerEnable(bool state) {
|
void Console::tracerEnable(bool state) {
|
||||||
if(state == true) {
|
if(state == true) {
|
||||||
logfile.open(path.load(SNES::Cartridge::Slot::Cartridge, "log"), file::mode::write);
|
logfile.open(path.load(SNES::Cartridge::Slot::Base, "log"), file::mode::write);
|
||||||
} else {
|
} else {
|
||||||
logfile.close();
|
logfile.close();
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,3 +137,7 @@ int16_t Interface::input_poll(bool port, SNES::Input::Device device, unsigned in
|
||||||
void Interface::message(const string &text) {
|
void Interface::message(const string &text) {
|
||||||
MessageWindow::information(mainWindow, text);
|
MessageWindow::information(mainWindow, text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string Interface::path(SNES::Cartridge::Slot slot, const string &pathname) {
|
||||||
|
return ::path.load(slot, pathname);
|
||||||
|
}
|
||||||
|
|
|
@ -21,6 +21,7 @@ struct Interface : public SNES::Interface {
|
||||||
int16_t input_poll(bool port, SNES::Input::Device device, unsigned index, unsigned id);
|
int16_t input_poll(bool port, SNES::Input::Device device, unsigned index, unsigned id);
|
||||||
|
|
||||||
void message(const string &text);
|
void message(const string &text);
|
||||||
|
string path(SNES::Cartridge::Slot slot, const string &path);
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Palette palette;
|
extern Palette palette;
|
||||||
|
|
|
@ -62,14 +62,24 @@ string Path::load(SNES::Cartridge::Slot slot, const string &type, const string &
|
||||||
case SNES::Cartridge::Slot::SufamiTurboA: romPath = cartridge.sufamiTurboAName; break;
|
case SNES::Cartridge::Slot::SufamiTurboA: romPath = cartridge.sufamiTurboAName; break;
|
||||||
case SNES::Cartridge::Slot::SufamiTurboB: romPath = cartridge.sufamiTurboBName; break;
|
case SNES::Cartridge::Slot::SufamiTurboB: romPath = cartridge.sufamiTurboBName; break;
|
||||||
case SNES::Cartridge::Slot::GameBoy: romPath = cartridge.gameBoyName; break;
|
case SNES::Cartridge::Slot::GameBoy: romPath = cartridge.gameBoyName; break;
|
||||||
|
|
||||||
|
case SNES::Cartridge::Slot::NECDSP: romPath = cartridge.baseName; break;
|
||||||
|
case SNES::Cartridge::Slot::MSU1: romPath = cartridge.baseName; break;
|
||||||
|
case SNES::Cartridge::Slot::Serial: romPath = cartridge.baseName; break;
|
||||||
}
|
}
|
||||||
|
|
||||||
string path = romPath;
|
string path = romPath;
|
||||||
|
if(slot == SNES::Cartridge::Slot::NECDSP && necdsp != "") path = necdsp;
|
||||||
|
if(slot == SNES::Cartridge::Slot::MSU1 && msu1 != "") path = string(msu1, notdir(path));
|
||||||
|
if(slot == SNES::Cartridge::Slot::Serial && serial != "") path = string(serial, notdir(path));
|
||||||
|
|
||||||
if(type == "srm" && srm != "") path = string(srm, notdir(path));
|
if(type == "srm" && srm != "") path = string(srm, notdir(path));
|
||||||
if(type == "bsp" && srm != "") path = string(srm, notdir(path));
|
if(type == "bsp" && bsp != "") path = string(bsp, notdir(path));
|
||||||
if(type == "bss" && srm != "") path = string(srm, notdir(path));
|
if(type == "bss" && bss != "") path = string(bss, notdir(path));
|
||||||
if(type == "sav" && srm != "") path = string(srm, notdir(path));
|
if(type == "sts" && sts != "") path = string(sts, notdir(path));
|
||||||
|
if(type == "sav" && sav != "") path = string(sav, notdir(path));
|
||||||
if(type == "rtc" && rtc != "") path = string(rtc, notdir(path));
|
if(type == "rtc" && rtc != "") path = string(rtc, notdir(path));
|
||||||
|
|
||||||
if(type == "bsa" && bsa != "") path = string(bsa, notdir(path));
|
if(type == "bsa" && bsa != "") path = string(bsa, notdir(path));
|
||||||
if(type == "bst" && bst != "") path = string(bst, notdir(path));
|
if(type == "bst" && bst != "") path = string(bst, notdir(path));
|
||||||
if(type == "cht" && cht != "") path = string(cht, notdir(path));
|
if(type == "cht" && cht != "") path = string(cht, notdir(path));
|
||||||
|
@ -95,6 +105,10 @@ string Path::load(SNES::Cartridge::Slot slot, const string &type, const string &
|
||||||
path = string(dir(base), path);
|
path = string(dir(base), path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(slot == SNES::Cartridge::Slot::NECDSP) return { dir(path), type };
|
||||||
|
if(slot == SNES::Cartridge::Slot::MSU1) return { path, type };
|
||||||
|
if(slot == SNES::Cartridge::Slot::Serial) return { path, type };
|
||||||
|
|
||||||
return { path, suffix, ".", type };
|
return { path, suffix, ".", type };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,8 +133,16 @@ Path::Path() {
|
||||||
attach(sufamiTurboBios = "", "sufamiTurboBios");
|
attach(sufamiTurboBios = "", "sufamiTurboBios");
|
||||||
attach(superGameBoyBios = "", "superGameBoyBios");
|
attach(superGameBoyBios = "", "superGameBoyBios");
|
||||||
|
|
||||||
|
attach(necdsp = "", "necdsp");
|
||||||
|
attach(msu1 = "", "msu1");
|
||||||
|
attach(serial = "", "serial");
|
||||||
|
|
||||||
attach(srm = "", "srm");
|
attach(srm = "", "srm");
|
||||||
attach(rtc = "", "rtc");
|
attach(rtc = "", "rtc");
|
||||||
|
attach(bss = "", "bss");
|
||||||
|
attach(bsp = "", "bsp");
|
||||||
|
attach(sts = "", "sts");
|
||||||
|
attach(sav = "", "sav");
|
||||||
|
|
||||||
attach(bsa = "", "bsa");
|
attach(bsa = "", "bsa");
|
||||||
attach(bst = "", "bst");
|
attach(bst = "", "bst");
|
||||||
|
|
|
@ -14,8 +14,16 @@ struct Path : public configuration {
|
||||||
string sufamiTurboBios;
|
string sufamiTurboBios;
|
||||||
string superGameBoyBios;
|
string superGameBoyBios;
|
||||||
|
|
||||||
|
string necdsp;
|
||||||
|
string msu1;
|
||||||
|
string serial;
|
||||||
|
|
||||||
string srm;
|
string srm;
|
||||||
string rtc;
|
string rtc;
|
||||||
|
string bss;
|
||||||
|
string bsp;
|
||||||
|
string sts;
|
||||||
|
string sav;
|
||||||
|
|
||||||
string bsa;
|
string bsa;
|
||||||
string bst;
|
string bst;
|
||||||
|
|
Loading…
Reference in New Issue