mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-26 08:49:37 +00:00
Centralised resetting of tape files within the static analyser, having implemented it patchily.
This commit is contained in:
parent
2edf73908c
commit
1f56e85f6d
@ -74,9 +74,7 @@ void StaticAnalyser::Acorn::AddTargets(
|
|||||||
// if there are any tapes, attempt to get data from the first
|
// if there are any tapes, attempt to get data from the first
|
||||||
if(tapes.size() > 0) {
|
if(tapes.size() > 0) {
|
||||||
std::shared_ptr<Storage::Tape::Tape> tape = tapes.front();
|
std::shared_ptr<Storage::Tape::Tape> tape = tapes.front();
|
||||||
tape->reset();
|
|
||||||
std::list<File> files = GetFiles(tape);
|
std::list<File> files = GetFiles(tape);
|
||||||
tape->reset();
|
|
||||||
|
|
||||||
// continue if there are any files
|
// continue if there are any files
|
||||||
if(files.size()) {
|
if(files.size()) {
|
||||||
|
@ -15,7 +15,6 @@ std::list<File> StaticAnalyser::Oric::GetFiles(const std::shared_ptr<Storage::Ta
|
|||||||
std::list<File> files;
|
std::list<File> files;
|
||||||
Storage::Tape::Oric::Parser parser;
|
Storage::Tape::Oric::Parser parser;
|
||||||
|
|
||||||
tape->reset();
|
|
||||||
while(!tape->is_at_end()) {
|
while(!tape->is_at_end()) {
|
||||||
// sync to next lead-in, check that it's one of three 0x16s
|
// sync to next lead-in, check that it's one of three 0x16s
|
||||||
bool is_fast = parser.sync_and_get_encoding_speed(tape);
|
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);
|
files.push_back(new_file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tape->reset();
|
|
||||||
|
|
||||||
return files;
|
return files;
|
||||||
}
|
}
|
||||||
|
@ -128,5 +128,13 @@ std::list<Target> StaticAnalyser::GetTargets(const char *file_name)
|
|||||||
|
|
||||||
free(lowercase_extension);
|
free(lowercase_extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset any tapes to their initial position
|
||||||
|
for(auto target : targets) {
|
||||||
|
for(auto tape : target.tapes) {
|
||||||
|
tape->reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return targets;
|
return targets;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user