1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-11-23 03:32:32 +00:00

Centralised resetting of tape files within the static analyser, having implemented it patchily.

This commit is contained in:
Thomas Harte 2017-05-06 22:19:08 -04:00
parent 2edf73908c
commit 1f56e85f6d
3 changed files with 8 additions and 4 deletions

View File

@ -74,9 +74,7 @@ void StaticAnalyser::Acorn::AddTargets(
// if there are any tapes, attempt to get data from the first
if(tapes.size() > 0) {
std::shared_ptr<Storage::Tape::Tape> tape = tapes.front();
tape->reset();
std::list<File> files = GetFiles(tape);
tape->reset();
// continue if there are any files
if(files.size()) {

View File

@ -15,7 +15,6 @@ std::list<File> StaticAnalyser::Oric::GetFiles(const std::shared_ptr<Storage::Ta
std::list<File> files;
Storage::Tape::Oric::Parser parser;
tape->reset();
while(!tape->is_at_end()) {
// sync to next lead-in, check that it's one of three 0x16s
bool is_fast = parser.sync_and_get_encoding_speed(tape);
@ -81,7 +80,6 @@ std::list<File> StaticAnalyser::Oric::GetFiles(const std::shared_ptr<Storage::Ta
files.push_back(new_file);
}
}
tape->reset();
return files;
}

View File

@ -128,5 +128,13 @@ std::list<Target> StaticAnalyser::GetTargets(const char *file_name)
free(lowercase_extension);
}
// Reset any tapes to their initial position
for(auto target : targets) {
for(auto tape : target.tapes) {
tape->reset();
}
}
return targets;
}