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); } }