Skip to content

Commit

Permalink
v110
Browse files Browse the repository at this point in the history
Final release.
  • Loading branch information
byuu committed Mar 20, 2020
1 parent c45c82e commit 483c578
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 11 deletions.
4 changes: 2 additions & 2 deletions higan/GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#target := higan
target := byuu
target := higan
#target := byuu
build := performance
openmp := false
local := true
Expand Down
2 changes: 1 addition & 1 deletion higan/emulator/emulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace higan {

namespace higan {
static const string Name = "higan";
static const string Version = "109.4";
static const string Version = "110";
static const string Copyright = "byuu";
static const string License = "GPLv3";
static const string Website = "https://byuu.org";
Expand Down
13 changes: 8 additions & 5 deletions higan/pce/cartridge/cartridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ auto Cartridge::unload() -> void {
port = {};
}

//most PC Engine HuCards lack save RAM on them due to the card size and cost savings.
//the PC Engine CD adds 2KB of backup RAM that some HuCard games can use for saves.
//however, all games must share this small amount of RAM.
//since this is an emulator, we can make this process nicer by storing BRAM per-game.

auto Cartridge::connect(Node::Peripheral with) -> void {
node = Node::append<Node::Peripheral>(port, with, interface->name());
node->setManifest([&] { return information.manifest; });
Expand All @@ -48,6 +43,10 @@ auto Cartridge::connect(Node::Peripheral with) -> void {
if(!board) board = new Board::Interface;
board->load(document);

if(auto fp = platform->open(node, "save.ram", File::Read)) {
pcd.bram.load(fp);
}

power();
}

Expand All @@ -61,6 +60,10 @@ auto Cartridge::save() -> void {
if(!node) return;
auto document = BML::unserialize(information.manifest);
board->save(document);

if(auto fp = platform->open(node, "save.ram", File::Write)) {
pcd.bram.save(fp);
}
}

auto Cartridge::power() -> void {
Expand Down
2 changes: 1 addition & 1 deletion higan/target-byuu/byuu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace ruby {

namespace byuu {
static const string Name = "byuu";
static const string Version = "3.4";
static const string Version = "4";
static const string Copyright = "byuu";
static const string License = "GPLv3";
static const string Website = "https://byuu.org";
Expand Down
4 changes: 2 additions & 2 deletions higan/target-byuu/program/platform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ auto Program::event(higan::Event event) -> void {

auto Program::log(string_view message) -> void {
if(!traceLogger.fp) {
string datetime = chrono::local::datetime().replace("-", "").replace(":", "").replace(" ", "-");
string location = {Location::notsuffix(emulator->game.location), "-", datetime, ".log"};
auto datetime = chrono::local::datetime().replace("-", "").replace(":", "").replace(" ", "-");
auto location = emulator->locate({emulator->game.location, "-", datetime, ".log"}, ".log", settings.paths.traces);
traceLogger.fp.open(location, file::mode::write);
}
traceLogger.fp.print(message);
Expand Down
22 changes: 22 additions & 0 deletions higan/target-byuu/settings/paths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,22 @@ auto PathSettings::construct() -> void {
refresh();
});

tracesLabel.setText("Trace Logs").setFont(Font().setBold());
tracesPath.setEditable(false);
tracesAssign.setText("Assign ...").onActivate([&] {
BrowserDialog dialog;
dialog.setTitle("Select Traces Path");
dialog.setPath(Path::desktop());
if(auto location = program.selectFolder(dialog)) {
settings.paths.traces = location;
refresh();
}
});
tracesReset.setText("Reset").onActivate([&] {
settings.paths.traces = "";
refresh();
});

firmwareLabel.setText("DSP Firmware").setFont(Font().setBold());
firmwarePath.setEditable(false);
firmwareAssign.setText("Assign ...").onActivate([&] {
Expand Down Expand Up @@ -66,6 +82,12 @@ auto PathSettings::refresh() -> void {
patchesPath.setText("(same as game path)").setForegroundColor({80, 80, 80});
}

if(settings.paths.traces) {
tracesPath.setText(settings.paths.traces).setForegroundColor();
} else {
tracesPath.setText("(same as game path)").setForegroundColor({80, 80, 80});
}

if(settings.paths.firmware) {
firmwarePath.setText(settings.paths.firmware).setForegroundColor();
} else {
Expand Down
1 change: 1 addition & 0 deletions higan/target-byuu/settings/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ auto Settings::process(bool load) -> void {

bind(string, "Paths/Saves", paths.saves);
bind(string, "Paths/Patches", paths.patches);
bind(string, "Paths/Traces", paths.traces);
bind(string, "Paths/Firmware", paths.firmware);

for(uint index : range(9)) {
Expand Down
6 changes: 6 additions & 0 deletions higan/target-byuu/settings/settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ struct Settings : Markup::Node {
struct Paths {
string saves;
string patches;
string traces;
string firmware;
} paths;

Expand Down Expand Up @@ -211,6 +212,11 @@ struct PathSettings : VerticalLayout {
LineEdit patchesPath{&patchesLayout, Size{~0, 0}};
Button patchesAssign{&patchesLayout, Size{80, 0}};
Button patchesReset{&patchesLayout, Size{80, 0}};
Label tracesLabel{this, Size{~0, 0}, 2};
HorizontalLayout tracesLayout{this, Size{~0, 0}};
LineEdit tracesPath{&tracesLayout, Size{~0, 0}};
Button tracesAssign{&tracesLayout, Size{80, 0}};
Button tracesReset{&tracesLayout, Size{80, 0}};
Label firmwareLabel{this, Size{~0, 0}, 2};
HorizontalLayout firmwareLayout{this, Size{~0, 0}};
LineEdit firmwarePath{&firmwareLayout, Size{~0, 0}};
Expand Down

0 comments on commit 483c578

Please sign in to comment.