mirror of
https://github.com/TomHarte/CLK.git
synced 2024-09-29 16:55:59 +00:00
Ensures 'new' overrides default selection; doesn't try to propagate multiple files if machines won't take them.
This commit is contained in:
parent
23aa7ea85f
commit
eef7868199
@ -58,7 +58,7 @@
|
|||||||
</CommandLineArgument>
|
</CommandLineArgument>
|
||||||
<CommandLineArgument
|
<CommandLineArgument
|
||||||
argument = "--new=amstradcpc"
|
argument = "--new=amstradcpc"
|
||||||
isEnabled = "YES">
|
isEnabled = "NO">
|
||||||
</CommandLineArgument>
|
</CommandLineArgument>
|
||||||
<CommandLineArgument
|
<CommandLineArgument
|
||||||
argument = ""/Users/thomasharte/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Soft/ColecoVision/Galaxian (1983)(Atari).col""
|
argument = ""/Users/thomasharte/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Soft/ColecoVision/Galaxian (1983)(Atari).col""
|
||||||
@ -74,11 +74,11 @@
|
|||||||
</CommandLineArgument>
|
</CommandLineArgument>
|
||||||
<CommandLineArgument
|
<CommandLineArgument
|
||||||
argument = ""/Users/thomasharte/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Soft/Amstrad CPC/Amstrad CPC [TOSEC]/Amstrad CPC - Applications - [DSK] (TOSEC-v2011-08-31_CM)/Tasword (1984)(Tasman Software).dsk""
|
argument = ""/Users/thomasharte/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Soft/Amstrad CPC/Amstrad CPC [TOSEC]/Amstrad CPC - Applications - [DSK] (TOSEC-v2011-08-31_CM)/Tasword (1984)(Tasman Software).dsk""
|
||||||
isEnabled = "NO">
|
isEnabled = "YES">
|
||||||
</CommandLineArgument>
|
</CommandLineArgument>
|
||||||
<CommandLineArgument
|
<CommandLineArgument
|
||||||
argument = ""/Users/thomasharte/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Soft/Amstrad CPC/Robocop.dsk""
|
argument = ""/Users/thomasharte/Library/Mobile Documents/com~apple~CloudDocs/Desktop/Soft/Amstrad CPC/Robocop.dsk""
|
||||||
isEnabled = "NO">
|
isEnabled = "YES">
|
||||||
</CommandLineArgument>
|
</CommandLineArgument>
|
||||||
<CommandLineArgument
|
<CommandLineArgument
|
||||||
argument = "--speed=5"
|
argument = "--speed=5"
|
||||||
|
@ -585,14 +585,6 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
// Determine the machine for the supplied file, if any, or from --new.
|
// Determine the machine for the supplied file, if any, or from --new.
|
||||||
Analyser::Static::TargetList targets;
|
Analyser::Static::TargetList targets;
|
||||||
if(!arguments.file_names.empty()) {
|
|
||||||
// Take the first file name that actually implies a machine.
|
|
||||||
auto file_name = arguments.file_names.begin();
|
|
||||||
while(file_name != arguments.file_names.end() && targets.empty()) {
|
|
||||||
targets = Analyser::Static::GetTargets(*file_name);
|
|
||||||
++file_name;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const auto new_argument = arguments.selections.find("new");
|
const auto new_argument = arguments.selections.find("new");
|
||||||
std::string long_machine_name;
|
std::string long_machine_name;
|
||||||
@ -618,6 +610,13 @@ int main(int argc, char *argv[]) {
|
|||||||
std::unique_ptr<Analyser::Static::Target> tgt = std::move(targets_by_machine[long_machine_name]);
|
std::unique_ptr<Analyser::Static::Target> tgt = std::move(targets_by_machine[long_machine_name]);
|
||||||
targets.push_back(std::move(tgt));
|
targets.push_back(std::move(tgt));
|
||||||
}
|
}
|
||||||
|
} else if(!arguments.file_names.empty()) {
|
||||||
|
// Take the first file name that actually implies a machine.
|
||||||
|
auto file_name = arguments.file_names.begin();
|
||||||
|
while(file_name != arguments.file_names.end() && targets.empty()) {
|
||||||
|
targets = Analyser::Static::GetTargets(*file_name);
|
||||||
|
++file_name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(targets.empty()) {
|
if(targets.empty()) {
|
||||||
@ -765,12 +764,17 @@ int main(int argc, char *argv[]) {
|
|||||||
machine_runner.machine = machine.get();
|
machine_runner.machine = machine.get();
|
||||||
machine_runner.machine_mutex = &machine_mutex;
|
machine_runner.machine_mutex = &machine_mutex;
|
||||||
|
|
||||||
// Ensure all media is inserted.
|
// Ensure all media is inserted, if this machine accepts it.
|
||||||
Analyser::Static::Media media;
|
{
|
||||||
for(const auto &file_name: arguments.file_names) {
|
auto media_target = machine->media_target();
|
||||||
media += Analyser::Static::GetMedia(file_name);
|
if(media_target) {
|
||||||
|
Analyser::Static::Media media;
|
||||||
|
for(const auto &file_name: arguments.file_names) {
|
||||||
|
media += Analyser::Static::GetMedia(file_name);
|
||||||
|
}
|
||||||
|
media_target->insert_media(media);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
machine->media_target()->insert_media(media);
|
|
||||||
|
|
||||||
// Attempt to set up video and audio.
|
// Attempt to set up video and audio.
|
||||||
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
|
if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user