mirror of
https://github.com/TomHarte/CLK.git
synced 2025-04-09 00:37:27 +00:00
Fixes: individual static analysers reset tapes, for potential successors. The ZX81 file analyser no longer overruns its buffer upon receiving a file that is shorter than 11 bytes.
This commit is contained in:
parent
f09fe30af5
commit
33d16ae0cd
@ -75,6 +75,7 @@ void StaticAnalyser::Acorn::AddTargets(
|
||||
if(tapes.size() > 0) {
|
||||
std::shared_ptr<Storage::Tape::Tape> tape = tapes.front();
|
||||
std::list<File> files = GetFiles(tape);
|
||||
tape->reset();
|
||||
|
||||
// continue if there are any files
|
||||
if(files.size()) {
|
||||
|
@ -68,6 +68,7 @@ void StaticAnalyser::Commodore::AddTargets(
|
||||
// check tapes
|
||||
for(auto &tape : tapes) {
|
||||
std::list<File> tape_files = GetFiles(tape);
|
||||
tape->reset();
|
||||
if(tape_files.size()) {
|
||||
files.splice(files.end(), tape_files);
|
||||
target.tapes = tapes;
|
||||
|
@ -84,8 +84,9 @@ void StaticAnalyser::Oric::AddTargets(
|
||||
int basic10_votes = 0;
|
||||
int basic11_votes = 0;
|
||||
|
||||
for(auto tape : tapes) {
|
||||
for(auto &tape : tapes) {
|
||||
std::list<File> tape_files = GetFiles(tape);
|
||||
tape->reset();
|
||||
if(tape_files.size()) {
|
||||
for(auto file : tape_files) {
|
||||
if(file.data_type == File::MachineCode) {
|
||||
|
@ -35,6 +35,7 @@ void StaticAnalyser::ZX8081::AddTargets(
|
||||
|
||||
if(!tapes.empty()) {
|
||||
std::vector<Storage::Data::ZX8081::File> files = GetFiles(tapes.front());
|
||||
tapes.front()->reset();
|
||||
if(!files.empty()) {
|
||||
StaticAnalyser::Target target;
|
||||
target.machine = Target::ZX8081;
|
||||
|
@ -51,7 +51,7 @@ static std::shared_ptr<File> ZX81FileFromData(const std::vector<uint8_t> &data)
|
||||
// Look for a file name.
|
||||
size_t data_pointer = 0;
|
||||
int c = 11;
|
||||
while(c--) {
|
||||
while(c < data.size() && c--) {
|
||||
if(data[data_pointer] & 0x80) break;
|
||||
data_pointer++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user