From 388b13698094ab0d58e8bcd758e8a33375211acb Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sun, 21 Mar 2021 20:31:09 -0400 Subject: [PATCH] Relaxes test for a valid TAP. --- Storage/Tape/Formats/ZXSpectrumTAP.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/Storage/Tape/Formats/ZXSpectrumTAP.cpp b/Storage/Tape/Formats/ZXSpectrumTAP.cpp index d97341ad2..080dcba11 100644 --- a/Storage/Tape/Formats/ZXSpectrumTAP.cpp +++ b/Storage/Tape/Formats/ZXSpectrumTAP.cpp @@ -22,19 +22,15 @@ ZXSpectrumTAP::ZXSpectrumTAP(const std::string &file_name) : file_(file_name) { // Check for a continuous series of blocks through to - // file end, alternating header and data. - uint8_t next_block_type = 0x00; + // exactly file end. + // + // To consider: could also check those blocks of type 0 + // and type ff for valid checksums? while(true) { const uint16_t block_length = file_.get16le(); - const uint8_t block_type = file_.get8(); if(file_.eof()) throw ErrorNotZXSpectrumTAP; - if(block_type != next_block_type) { - throw ErrorNotZXSpectrumTAP; - } - next_block_type ^= 0xff; - - file_.seek(block_length - 1, SEEK_CUR); + file_.seek(block_length, SEEK_CUR); if(file_.tell() == file_.stats().st_size) break; }