mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-20 06:25:01 +00:00
Merge pull request #934 from TomHarte/OricTapes
Relaxes Oric .tap signature check.
This commit is contained in:
commit
96ac86a757
@ -15,9 +15,19 @@ using namespace Storage::Tape;
|
|||||||
OricTAP::OricTAP(const std::string &file_name) :
|
OricTAP::OricTAP(const std::string &file_name) :
|
||||||
file_(file_name)
|
file_(file_name)
|
||||||
{
|
{
|
||||||
// check the file signature
|
// Check for a sequence of at least three 0x16s followed by a 0x24.
|
||||||
if(!file_.check_signature("\x16\x16\x16\x24", 4))
|
while(true) {
|
||||||
|
const uint8_t next = file_.get8();
|
||||||
|
if(next != 0x16 && next != 0x24) {
|
||||||
throw ErrorNotOricTAP;
|
throw ErrorNotOricTAP;
|
||||||
|
}
|
||||||
|
if(next == 0x24) {
|
||||||
|
if(file_.tell() < 4) {
|
||||||
|
throw ErrorNotOricTAP;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// then rewind and start again
|
// then rewind and start again
|
||||||
virtual_reset();
|
virtual_reset();
|
||||||
|
Loading…
Reference in New Issue
Block a user