1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-12-23 05:29:23 +00:00

Corrected some minor out-of-style breaks, and ensured that the name of ZX81 files is returned.

This commit is contained in:
Thomas Harte 2017-07-17 19:52:54 -04:00
parent 0350925c1e
commit 130d598ec9
3 changed files with 7 additions and 7 deletions

View File

@ -50,8 +50,10 @@ static std::shared_ptr<File> ZX81FileFromData(const std::vector<uint8_t> &data)
// Look for a file name.
size_t data_pointer = 0;
std::vector<uint8_t> 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<File> ZX81FileFromData(const std::vector<uint8_t> &data)
// TODO: check that the line numbers declared above exist (?)
std::shared_ptr<File> file(new File);
file->name = StringFromData(name_data, true);
file->data = data;
file->isZX81 = true;
return file;

View File

@ -19,7 +19,7 @@ namespace ZX8081 {
struct File {
std::vector<uint8_t> data;
std::string name;
std::wstring name;
bool isZX81;
};

View File

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