mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-02-23 22:52:34 +01:00
byuu says: With any luck, this will be the final WIP before v095. If all looks good, this will be identical to v095. But if we hit some major issues, I'll try and fix those first. The most notable part of this release is probably Jonas Quinn's fix for the unmapped regions of the GBA memory map. This allows games like Mario & Luigi and Zelda: Minish Cap to (hopefully) be fully playable now. icarus now supports my game database, so all games I've dumped will be emulated with bit-perfect memory maps and native-language game titles.
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
ImportDialog::ImportDialog() {
|
|
importDialog = this;
|
|
|
|
onClose([&] {
|
|
stopButton.setEnabled(false).setText("Stopping ...");
|
|
abort = true;
|
|
});
|
|
layout.setMargin(5);
|
|
stopButton.setText("Stop").onActivate([&] { doClose(); });
|
|
|
|
setTitle("icarus - Importing ...");
|
|
setSize({480, layout.minimumSize().height()});
|
|
setCentered();
|
|
}
|
|
|
|
auto ImportDialog::run(lstring locations) -> void {
|
|
abort = false;
|
|
errors.reset();
|
|
unsigned position = 0;
|
|
|
|
setVisible(true);
|
|
for(auto& location : locations) {
|
|
auto name = nall::basename(location);
|
|
|
|
if(abort) {
|
|
errors.append(string{"[", name, "] aborted"});
|
|
continue;
|
|
}
|
|
|
|
statusLabel.setText(name);
|
|
double progress = 100.0 * (double)position++ / (double)locations.size() + 0.5;
|
|
progressBar.setPosition((unsigned)progress);
|
|
Application::processEvents();
|
|
|
|
if(!icarus.import(location)) {
|
|
errors.append(string{"[", name, "] ", icarus.error()});
|
|
}
|
|
}
|
|
setVisible(false);
|
|
|
|
if(errors) {
|
|
string message{"Import completed, but with ", errors.size(), " error", errors.size() ? "s" : "", ". View log?"};
|
|
if(MessageDialog().setTitle("icarus").setText(message).question() == "Yes") {
|
|
errorDialog->show(errors.merge("\n"));
|
|
} else {
|
|
scanDialog->show();
|
|
}
|
|
} else {
|
|
MessageDialog().setTitle("icarus").setText("Import completed successfully.").information();
|
|
scanDialog->show();
|
|
}
|
|
}
|