// Detect It Easy: detection rule file
// Author: BJNFNE <bjnfne@web.de>

// https://github.com/BJNFNE/DEV7/blob/master/tools/BCD1Creator/BCD1Creator.cpp
// https://wiki.scummvm.org/index.php?title=Gob/DEV7_Information#BCD1_Format
meta("format", "BCD1");

function detect() {
    if (Binary.compare("'[ENVIINFO]'")) {
        var name = Binary.getString(11, 4).trim();

        if (/^[A-Za-z0]{4}$/.test(name)) {
            if (X.isVerbose()) sOptions = name;
            bDetected = true;
        }
    } else if (Binary.compare("'[AppliInfo]'")) {
        var name = Binary.getString(13, 4).trim();

        if (/^[A-Za-z]{4}$/.test(name)) {
            if (X.isVerbose()) sOptions = name;
            bDetected = true;
        }
    }

    return result();
}