Update to v106 release.

byuu says:

Changelog (since v105tr1):

Changelog:

  - added Emulation/AutoSaveMemory/Interval setting to specify number of
    seconds between auto-saves
  - added Game Notes tool
  - added 64 new SNES PAL games to the icarus preservation database

The Games Notes tool is a new feature that gives you a blank text box to
enter notes about a game that you're playing: so you can write down
things like level select codes for games with save RAM, combo moves, or
whatever other information you'd like quick and easy access to.

This is kind of an experiment. Ideally, we'd wanna allow more
personalized information, drawings, etc. But hey, let's try it out and
see what people think.
This commit is contained in:
Tim Allen 2017-11-19 23:05:02 +11:00
parent 3ec08cebbe
commit b55783c322
12 changed files with 830 additions and 21 deletions

View File

@ -12,7 +12,7 @@ using namespace nall;
namespace Emulator {
static const string Name = "higan";
static const string Version = "105.01";
static const string Version = "106";
static const string Author = "byuu";
static const string License = "GPLv3";
static const string Website = "https://byuu.org/";

View File

@ -56,7 +56,8 @@ Settings::Settings() {
set("Input/FocusLoss/Pause", false);
set("Input/FocusLoss/AllowInput", false);
set("Emulation/AutoSaveRAM", true);
set("Emulation/AutoSaveMemory/Enable", true);
set("Emulation/AutoSaveMemory/Interval", 30);
set("Crashed", false);
}

View File

@ -134,6 +134,7 @@ Presentation::Presentation() {
cheatEditor.setText("Cheat Editor ...").onActivate([&] { toolsManager->show(0); });
stateManager.setText("State Manager ...").onActivate([&] { toolsManager->show(1); });
manifestViewer.setText("Manifest Viewer ...").onActivate([&] { toolsManager->show(2); });
gameNotes.setText("Game Notes ...").onActivate([&] { toolsManager->show(3); });
helpMenu.setText("Help");
documentation.setText("Documentation ...").onActivate([&] {

View File

@ -67,6 +67,7 @@ struct Presentation : Window {
MenuItem cheatEditor{&toolsMenu};
MenuItem stateManager{&toolsMenu};
MenuItem manifestViewer{&toolsMenu};
MenuItem gameNotes{&toolsMenu};
Menu helpMenu{&menuBar};
MenuItem documentation{&helpMenu};
MenuItem credits{&helpMenu};

View File

@ -39,6 +39,7 @@ auto Program::loadMedium(Emulator::Interface& interface, const Emulator::Interfa
toolsManager->cheatEditor.loadCheats();
toolsManager->stateManager.doRefresh();
toolsManager->manifestViewer.doRefresh();
toolsManager->gameNotes.loadNotes();
}
auto Program::unloadMedium() -> void {
@ -46,6 +47,7 @@ auto Program::unloadMedium() -> void {
presentation->clearViewport();
toolsManager->cheatEditor.saveCheats();
toolsManager->gameNotes.saveNotes();
emulator->unload();
emulator = nullptr;
mediumPaths.reset();

View File

@ -90,9 +90,9 @@ auto Program::main() -> void {
}
emulator->run();
if(settings["Emulation/AutoSaveRAM"].boolean()) {
if(settings["Emulation/AutoSaveMemory/Enable"].boolean()) {
time_t currentTime = time(nullptr);
if(currentTime - autoSaveTime >= 5) {
if(currentTime - autoSaveTime >= settings["Emulation/AutoSaveMemory/Interval"].natural()) {
autoSaveTime = currentTime;
emulator->save();
}

View File

@ -45,7 +45,7 @@ AdvancedSettings::AdvancedSettings(TabFrame* parent) : TabFrameItem(parent) {
});
otherLabel.setText("Other").setFont(Font().setBold());
autoSaveRAM.setText("Auto-Save RAM Periodically").setChecked(settings["Emulation/AutoSaveRAM"].boolean()).onToggle([&] {
settings["Emulation/AutoSaveRAM"].setValue(autoSaveRAM.checked());
autoSaveMemory.setText("Auto-Save Memory Periodically").setChecked(settings["Emulation/AutoSaveMemory/Enable"].boolean()).onToggle([&] {
settings["Emulation/AutoSaveMemory/Enable"].setValue(autoSaveMemory.checked());
});
}

View File

@ -142,7 +142,7 @@ struct AdvancedSettings : TabFrameItem {
Button libraryChange{&libraryLayout, Size{0, 0}};
CheckLabel ignoreManifests{&layout, Size{~0, 0}};
Label otherLabel{&layout, Size{~0, 0}, 2};
CheckLabel autoSaveRAM{&layout, Size{~0, 0}};
CheckLabel autoSaveMemory{&layout, Size{~0, 0}};
};
struct SettingsManager : Window {

View File

@ -0,0 +1,22 @@
GameNotes::GameNotes(TabFrame* parent) : TabFrameItem(parent) {
setIcon(Icon::Emblem::Text);
setText("Game Notes");
layout.setMargin(5);
notes.setWordWrap(false).setFont(Font().setFamily(Font::Mono));
}
auto GameNotes::loadNotes() -> void {
auto contents = string::read({program->mediumPaths(1), "higan/notes.txt"});
notes.setText(contents);
}
auto GameNotes::saveNotes() -> void {
auto contents = notes.text();
if(contents) {
directory::create({program->mediumPaths(1), "higan/"});
file::write({program->mediumPaths(1), "higan/notes.txt"}, contents);
} else {
file::remove({program->mediumPaths(1), "higan/notes.txt"});
}
}

View File

@ -3,6 +3,7 @@
#include "cheat-editor.cpp"
#include "state-manager.cpp"
#include "manifest-viewer.cpp"
#include "game-notes.cpp"
unique_pointer<CheatDatabase> cheatDatabase;
unique_pointer<ToolsManager> toolsManager;

View File

@ -84,6 +84,15 @@ struct ManifestViewer : TabFrameItem {
TextEdit manifestView{&layout, Size{~0, ~0}};
};
struct GameNotes : TabFrameItem {
GameNotes(TabFrame*);
auto loadNotes() -> void;
auto saveNotes() -> void;
VerticalLayout layout{this};
TextEdit notes{&layout, Size{~0, ~0}};
};
struct ToolsManager : Window {
ToolsManager();
auto show(uint tool) -> void;
@ -93,6 +102,7 @@ struct ToolsManager : Window {
CheatEditor cheatEditor{&panel};
StateManager stateManager{&panel};
ManifestViewer manifestViewer{&panel};
GameNotes gameNotes{&panel};
};
extern unique_pointer<CheatDatabase> cheatDatabase;

File diff suppressed because it is too large Load Diff