mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-14 11:24:31 +02:00
Update to v076r02 release.
byuu says: Changelog: - fixed a crashing bug when you toggle a cheat code and then load a save state - added paths.cfg - bsnes now remembers the most recent path per file-type, like bsnes/Qt used to do - re-added -s to Linux linker flags - fixed crash with libsnes/SGB XML parsing
This commit is contained in:
@@ -25,7 +25,7 @@ flags := $(flags) $(foreach o,$(call strupper,$(options)),-D$o)
|
|||||||
|
|
||||||
# platform
|
# platform
|
||||||
ifeq ($(platform),x)
|
ifeq ($(platform),x)
|
||||||
link += -ldl -lX11 -lXext
|
link += -s -ldl -lX11 -lXext
|
||||||
else ifeq ($(platform),osx)
|
else ifeq ($(platform),osx)
|
||||||
else ifeq ($(platform),win)
|
else ifeq ($(platform),win)
|
||||||
link += -mwindows
|
link += -mwindows
|
||||||
|
@@ -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.01";
|
static const char Version[] = "076.02";
|
||||||
static const unsigned SerializerVersion = 18;
|
static const unsigned SerializerVersion = 18;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -123,6 +123,7 @@ void System::load() {
|
|||||||
if(cartridge.has_serial()) serial.load();
|
if(cartridge.has_serial()) serial.load();
|
||||||
|
|
||||||
serialize_init();
|
serialize_init();
|
||||||
|
cheat.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void System::unload() {
|
void System::unload() {
|
||||||
@@ -185,8 +186,6 @@ void System::power() {
|
|||||||
if(cartridge.has_serial()) cpu.coprocessors.append(&serial);
|
if(cartridge.has_serial()) cpu.coprocessors.append(&serial);
|
||||||
|
|
||||||
scheduler.init();
|
scheduler.init();
|
||||||
cheat.init();
|
|
||||||
|
|
||||||
input.update();
|
input.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,8 +221,6 @@ void System::reset() {
|
|||||||
if(cartridge.has_serial()) cpu.coprocessors.append(&serial);
|
if(cartridge.has_serial()) cpu.coprocessors.append(&serial);
|
||||||
|
|
||||||
scheduler.init();
|
scheduler.init();
|
||||||
cheat.init();
|
|
||||||
|
|
||||||
input.port_set_device(0, config.controller_port1);
|
input.port_set_device(0, config.controller_port1);
|
||||||
input.port_set_device(1, config.controller_port2);
|
input.port_set_device(1, config.controller_port2);
|
||||||
input.update();
|
input.update();
|
||||||
|
@@ -181,7 +181,7 @@ bool snes_load_cartridge_super_game_boy(
|
|||||||
string xmlrom = (rom_xml && *rom_xml) ? string(rom_xml) : SNESCartridge(rom_data, rom_size).xmlMemoryMap;
|
string xmlrom = (rom_xml && *rom_xml) ? string(rom_xml) : SNESCartridge(rom_data, rom_size).xmlMemoryMap;
|
||||||
if(dmg_data) {
|
if(dmg_data) {
|
||||||
string xmldmg = (dmg_xml && *dmg_xml) ? string(dmg_xml) : GameBoyCartridge(dmg_data, dmg_size).xml;
|
string xmldmg = (dmg_xml && *dmg_xml) ? string(dmg_xml) : GameBoyCartridge(dmg_data, dmg_size).xml;
|
||||||
GameBoy::cartridge.load(dmg_xml, dmg_data, dmg_size);
|
GameBoy::cartridge.load(xmldmg, dmg_data, dmg_size);
|
||||||
}
|
}
|
||||||
SNES::cartridge.load(SNES::Cartridge::Mode::SuperGameBoy, { xmlrom, "" });
|
SNES::cartridge.load(SNES::Cartridge::Mode::SuperGameBoy, { xmlrom, "" });
|
||||||
SNES::system.power();
|
SNES::system.power();
|
||||||
|
@@ -9,11 +9,6 @@ void Configuration::save() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Configuration::create() {
|
void Configuration::create() {
|
||||||
attach(path.current = "", "path.current");
|
|
||||||
attach(path.satellaviewBios = "", "path.satellaviewBios");
|
|
||||||
attach(path.sufamiTurboBios = "", "path.sufamiTurboBios");
|
|
||||||
attach(path.superGameBoyBios = "", "path.superGameBoyBios");
|
|
||||||
|
|
||||||
attach(video.driver = "", "video.driver");
|
attach(video.driver = "", "video.driver");
|
||||||
attach(video.synchronize = false, "video.synchronize");
|
attach(video.synchronize = false, "video.synchronize");
|
||||||
attach(video.smooth = true, "video.smooth");
|
attach(video.smooth = true, "video.smooth");
|
||||||
|
@@ -1,13 +1,4 @@
|
|||||||
struct Configuration : public configuration {
|
struct Configuration : public configuration {
|
||||||
struct Path {
|
|
||||||
string base;
|
|
||||||
string user;
|
|
||||||
string current;
|
|
||||||
string satellaviewBios;
|
|
||||||
string sufamiTurboBios;
|
|
||||||
string superGameBoyBios;
|
|
||||||
} path;
|
|
||||||
|
|
||||||
struct Video {
|
struct Video {
|
||||||
string driver;
|
string driver;
|
||||||
bool synchronize;
|
bool synchronize;
|
||||||
|
@@ -30,31 +30,38 @@ void FileBrowser::create() {
|
|||||||
|
|
||||||
void FileBrowser::fileOpen(FileBrowser::Mode requestedMode, function<void (string)> requestedCallback) {
|
void FileBrowser::fileOpen(FileBrowser::Mode requestedMode, function<void (string)> requestedCallback) {
|
||||||
callback = requestedCallback;
|
callback = requestedCallback;
|
||||||
if(mode == requestedMode && folder == config.path.current) {
|
|
||||||
setVisible();
|
|
||||||
contentsBox.setFocused();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//if(mode == requestedMode && folder == config.path.current) {
|
||||||
|
// setVisible();
|
||||||
|
// contentsBox.setFocused();
|
||||||
|
// return;
|
||||||
|
//}
|
||||||
|
|
||||||
|
setVisible(false);
|
||||||
filters.reset();
|
filters.reset();
|
||||||
|
|
||||||
switch(mode = requestedMode) {
|
switch(mode = requestedMode) {
|
||||||
case Mode::Cartridge: {
|
case Mode::Cartridge: {
|
||||||
setTitle("Load Cartridge");
|
setTitle("Load Cartridge");
|
||||||
|
folderPath = "sfc";
|
||||||
filters.append(".sfc");
|
filters.append(".sfc");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Mode::Satellaview: {
|
case Mode::Satellaview: {
|
||||||
setTitle("Load Satellaview Cartridge");
|
setTitle("Load Satellaview Cartridge");
|
||||||
|
folderPath = "bs";
|
||||||
filters.append(".bs");
|
filters.append(".bs");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Mode::SufamiTurbo: {
|
case Mode::SufamiTurbo: {
|
||||||
setTitle("Load Sufami Turbo Cartridge");
|
setTitle("Load Sufami Turbo Cartridge");
|
||||||
|
folderPath = "st";
|
||||||
filters.append(".st");
|
filters.append(".st");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Mode::GameBoy: {
|
case Mode::GameBoy: {
|
||||||
setTitle("Load Game Boy Cartridge");
|
setTitle("Load Game Boy Cartridge");
|
||||||
|
folderPath = "gb";
|
||||||
filters.append(".gb");
|
filters.append(".gb");
|
||||||
filters.append(".gbc");
|
filters.append(".gbc");
|
||||||
filters.append(".sgb");
|
filters.append(".sgb");
|
||||||
@@ -62,18 +69,19 @@ void FileBrowser::fileOpen(FileBrowser::Mode requestedMode, function<void (strin
|
|||||||
}
|
}
|
||||||
case Mode::Filter: {
|
case Mode::Filter: {
|
||||||
setTitle("Load Video Filter");
|
setTitle("Load Video Filter");
|
||||||
|
folderPath = "filter";
|
||||||
filters.append(".filter");
|
filters.append(".filter");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Mode::Shader: {
|
case Mode::Shader: {
|
||||||
setTitle("Load Pixel Shader");
|
setTitle("Load Pixel Shader");
|
||||||
|
folderPath = "shader";
|
||||||
filters.append(".shader");
|
filters.append(".shader");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setVisible(false);
|
setFolder(path.load(folderPath));
|
||||||
setFolder(config.path.current);
|
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
contentsBox.setFocused();
|
contentsBox.setFocused();
|
||||||
}
|
}
|
||||||
@@ -144,6 +152,6 @@ string FileBrowser::cartridgeFolder(const string &pathname) {
|
|||||||
|
|
||||||
void FileBrowser::loadFile(const string &filename) {
|
void FileBrowser::loadFile(const string &filename) {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
config.path.current = folder;
|
path.save(folderPath, folder);
|
||||||
if(callback) callback(filename);
|
if(callback) callback(filename);
|
||||||
}
|
}
|
||||||
|
@@ -15,6 +15,7 @@ private:
|
|||||||
string folder;
|
string folder;
|
||||||
lstring filters;
|
lstring filters;
|
||||||
lstring contents;
|
lstring contents;
|
||||||
|
string folderPath;
|
||||||
|
|
||||||
void folderBrowse();
|
void folderBrowse();
|
||||||
void folderUp();
|
void folderUp();
|
||||||
|
@@ -55,7 +55,7 @@ void SingleSlotLoader::loadCartridgeBsxSlotted() {
|
|||||||
void SingleSlotLoader::loadCartridgeBsx() {
|
void SingleSlotLoader::loadCartridgeBsx() {
|
||||||
mode = Mode::Bsx;
|
mode = Mode::Bsx;
|
||||||
setTitle("Load BS-X Cartridge");
|
setTitle("Load BS-X Cartridge");
|
||||||
basePath.setText(config.path.satellaviewBios);
|
basePath.setText(path.satellaviewBios);
|
||||||
slotPath.setText("");
|
slotPath.setText("");
|
||||||
setVisible();
|
setVisible();
|
||||||
okButton.setFocused();
|
okButton.setFocused();
|
||||||
@@ -64,7 +64,7 @@ void SingleSlotLoader::loadCartridgeBsx() {
|
|||||||
void SingleSlotLoader::loadCartridgeSuperGameBoy() {
|
void SingleSlotLoader::loadCartridgeSuperGameBoy() {
|
||||||
mode = Mode::SuperGameBoy;
|
mode = Mode::SuperGameBoy;
|
||||||
setTitle("Load Super Game Boy cartridge");
|
setTitle("Load Super Game Boy cartridge");
|
||||||
basePath.setText(config.path.superGameBoyBios);
|
basePath.setText(path.superGameBoyBios);
|
||||||
slotPath.setText("");
|
slotPath.setText("");
|
||||||
setVisible();
|
setVisible();
|
||||||
okButton.setFocused();
|
okButton.setFocused();
|
||||||
@@ -79,12 +79,12 @@ void SingleSlotLoader::load() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Mode::Bsx: {
|
case Mode::Bsx: {
|
||||||
config.path.satellaviewBios = basePath.text();
|
path.satellaviewBios = basePath.text();
|
||||||
cartridge.loadBsx(basePath.text(), slotPath.text());
|
cartridge.loadBsx(basePath.text(), slotPath.text());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Mode::SuperGameBoy: {
|
case Mode::SuperGameBoy: {
|
||||||
config.path.superGameBoyBios = basePath.text();
|
path.superGameBoyBios = basePath.text();
|
||||||
cartridge.loadSuperGameBoy(basePath.text(), slotPath.text());
|
cartridge.loadSuperGameBoy(basePath.text(), slotPath.text());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -147,7 +147,7 @@ void DoubleSlotLoader::create() {
|
|||||||
|
|
||||||
void DoubleSlotLoader::loadCartridgeSufamiTurbo() {
|
void DoubleSlotLoader::loadCartridgeSufamiTurbo() {
|
||||||
setTitle("Load Sufami Turbo Cartridge");
|
setTitle("Load Sufami Turbo Cartridge");
|
||||||
basePath.setText(config.path.sufamiTurboBios);
|
basePath.setText(path.sufamiTurboBios);
|
||||||
slotAPath.setText("");
|
slotAPath.setText("");
|
||||||
slotBPath.setText("");
|
slotBPath.setText("");
|
||||||
setVisible();
|
setVisible();
|
||||||
@@ -156,6 +156,6 @@ void DoubleSlotLoader::loadCartridgeSufamiTurbo() {
|
|||||||
|
|
||||||
void DoubleSlotLoader::load() {
|
void DoubleSlotLoader::load() {
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
config.path.sufamiTurboBios = basePath.text();
|
path.sufamiTurboBios = basePath.text();
|
||||||
cartridge.loadSufamiTurbo(basePath.text(), slotAPath.text(), slotBPath.text());
|
cartridge.loadSufamiTurbo(basePath.text(), slotAPath.text(), slotBPath.text());
|
||||||
}
|
}
|
||||||
|
@@ -10,12 +10,14 @@ void Application::main(int argc, char **argv) {
|
|||||||
config.create();
|
config.create();
|
||||||
inputMapper.create();
|
inputMapper.create();
|
||||||
|
|
||||||
config.path.base = dir(realpath(argv[0]));
|
path.base = dir(realpath(argv[0]));
|
||||||
config.path.user = userpath();
|
path.user = userpath();
|
||||||
|
path.load();
|
||||||
|
path.save();
|
||||||
|
|
||||||
config.load();
|
config.load();
|
||||||
config.save();
|
config.save();
|
||||||
if(config.path.current == "") config.path.current = config.path.base;
|
|
||||||
inputMapper.bind();
|
inputMapper.bind();
|
||||||
|
|
||||||
#if defined(PLATFORM_WIN)
|
#if defined(PLATFORM_WIN)
|
||||||
@@ -133,6 +135,8 @@ void Application::main(int argc, char **argv) {
|
|||||||
foreach(window, windows) window->setVisible(false);
|
foreach(window, windows) window->setVisible(false);
|
||||||
OS::processEvents();
|
OS::processEvents();
|
||||||
SNES::system.term();
|
SNES::system.term();
|
||||||
|
|
||||||
|
path.save();
|
||||||
config.save();
|
config.save();
|
||||||
|
|
||||||
video.term();
|
video.term();
|
||||||
|
@@ -2,10 +2,10 @@
|
|||||||
Path path;
|
Path path;
|
||||||
|
|
||||||
string Path::home(const string &filename) {
|
string Path::home(const string &filename) {
|
||||||
string path = { config.path.base, filename };
|
string path = { base, filename };
|
||||||
if(file::exists(path)) return path;
|
if(file::exists(path)) return path;
|
||||||
|
|
||||||
path = config.path.user;
|
path = user;
|
||||||
#if defined(PLATFORM_X) || defined(PLATFORM_OSX)
|
#if defined(PLATFORM_X) || defined(PLATFORM_OSX)
|
||||||
path.append(".config/");
|
path.append(".config/");
|
||||||
mkdir(path, 0755);
|
mkdir(path, 0755);
|
||||||
@@ -18,3 +18,60 @@ string Path::home(const string &filename) {
|
|||||||
path.append(filename);
|
path.append(filename);
|
||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
string Path::load(const string &path) {
|
||||||
|
string value;
|
||||||
|
|
||||||
|
if(path == "sfc") value = sfc;
|
||||||
|
if(path == "bs") value = bs;
|
||||||
|
if(path == "st") value = st;
|
||||||
|
if(path == "gb") value = gb;
|
||||||
|
|
||||||
|
if(path == "filter") value = filter;
|
||||||
|
if(path == "shader") value = shader;
|
||||||
|
|
||||||
|
if(value.beginswith(":")) value.ltrim<1>(":");
|
||||||
|
if(value == "") value = base;
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Path::save(const string &path, const string &value) {
|
||||||
|
string *output = 0;
|
||||||
|
|
||||||
|
if(path == "sfc") output = &sfc;
|
||||||
|
if(path == "bs") output = &bs;
|
||||||
|
if(path == "st") output = &st;
|
||||||
|
if(path == "gb") output = &gb;
|
||||||
|
|
||||||
|
if(path == "filter") output = &filter;
|
||||||
|
if(path == "shader") output = &shader;
|
||||||
|
|
||||||
|
if(output) {
|
||||||
|
string &s = *output;
|
||||||
|
if(s.beginswith(":") == false && s != "") return;
|
||||||
|
s = { ":", value };
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void Path::load() {
|
||||||
|
configuration::load(home("paths.cfg"));
|
||||||
|
}
|
||||||
|
|
||||||
|
void Path::save() {
|
||||||
|
configuration::save(home("paths.cfg"));
|
||||||
|
}
|
||||||
|
|
||||||
|
Path::Path() {
|
||||||
|
attach(sfc = "", "sfc");
|
||||||
|
attach(bs = "", "bs");
|
||||||
|
attach(st = "", "st");
|
||||||
|
attach(gb = "", "gb");
|
||||||
|
|
||||||
|
attach(filter = "", "filter");
|
||||||
|
attach(shader = "", "shader");
|
||||||
|
|
||||||
|
attach(satellaviewBios = "", "satellaviewBios");
|
||||||
|
attach(sufamiTurboBios = "", "sufamiTurboBios");
|
||||||
|
attach(superGameBoyBios = "", "superGameBoyBios");
|
||||||
|
}
|
||||||
|
@@ -1,5 +1,27 @@
|
|||||||
struct Path {
|
struct Path : public configuration {
|
||||||
|
string user;
|
||||||
|
string base;
|
||||||
|
|
||||||
|
string sfc;
|
||||||
|
string bs;
|
||||||
|
string st;
|
||||||
|
string gb;
|
||||||
|
|
||||||
|
string filter;
|
||||||
|
string shader;
|
||||||
|
|
||||||
|
string satellaviewBios;
|
||||||
|
string sufamiTurboBios;
|
||||||
|
string superGameBoyBios;
|
||||||
|
|
||||||
string home(const string &filename);
|
string home(const string &filename);
|
||||||
|
string load(const string &path);
|
||||||
|
void save(const string &path, const string &value);
|
||||||
|
|
||||||
|
void load();
|
||||||
|
void save();
|
||||||
|
|
||||||
|
Path();
|
||||||
};
|
};
|
||||||
|
|
||||||
extern Path path;
|
extern Path path;
|
||||||
|
Reference in New Issue
Block a user