From 130d598ec91d3bc2676dfafcef7c712939509864 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Mon, 17 Jul 2017 19:52:54 -0400 Subject: [PATCH] Corrected some minor out-of-style breaks, and ensured that the name of ZX81 files is returned. --- Storage/Data/ZX8081.cpp | 3 +++ Storage/Data/ZX8081.hpp | 2 +- Storage/Tape/Parsers/ZX8081.cpp | 9 +++------ 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Storage/Data/ZX8081.cpp b/Storage/Data/ZX8081.cpp index 836c85dde..d706dfc4b 100644 --- a/Storage/Data/ZX8081.cpp +++ b/Storage/Data/ZX8081.cpp @@ -50,8 +50,10 @@ static std::shared_ptr ZX81FileFromData(const std::vector &data) // Look for a file name. size_t data_pointer = 0; + std::vector name_data; int c = 11; while(c < data.size() && c--) { + name_data.push_back(data[data_pointer] & 0x3f); if(data[data_pointer] & 0x80) break; data_pointer++; } @@ -80,6 +82,7 @@ static std::shared_ptr ZX81FileFromData(const std::vector &data) // TODO: check that the line numbers declared above exist (?) std::shared_ptr file(new File); + file->name = StringFromData(name_data, true); file->data = data; file->isZX81 = true; return file; diff --git a/Storage/Data/ZX8081.hpp b/Storage/Data/ZX8081.hpp index 148479556..780cc8a15 100644 --- a/Storage/Data/ZX8081.hpp +++ b/Storage/Data/ZX8081.hpp @@ -19,7 +19,7 @@ namespace ZX8081 { struct File { std::vector data; - std::string name; + std::wstring name; bool isZX81; }; diff --git a/Storage/Tape/Parsers/ZX8081.cpp b/Storage/Tape/Parsers/ZX8081.cpp index 336ccdb46..d131d07cd 100644 --- a/Storage/Tape/Parsers/ZX8081.cpp +++ b/Storage/Tape/Parsers/ZX8081.cpp @@ -29,14 +29,11 @@ void Parser::post_pulse() { if(pulse_time > expected_gap_length * 1.25f) { push_wave(WaveType::LongGap); - } - else if(pulse_time > expected_pulse_length * 1.25f) { + } else if(pulse_time > expected_pulse_length * 1.25f) { push_wave(WaveType::Gap); - } - else if(pulse_time >= expected_pulse_length * 0.75f && pulse_time <= expected_pulse_length * 1.25f) { + } else if(pulse_time >= expected_pulse_length * 0.75f && pulse_time <= expected_pulse_length * 1.25f) { push_wave(WaveType::Pulse); - } - else { + } else { push_wave(WaveType::Unrecognised); } }