// DIE's signature file
// Author: Arjan Onwezen
// Info: https://zdoom.org/wiki/WAD

init("format", "WAD");

function detect(bShowType, bShowVersion, bShowOptions) {
    if (Binary.compare("'IWAD'")) {
        sName = "Internal WAD file";
        sOptions = "Lump count: " + Binary.read_uint32(0x04, _LE);
        bDetected = true;
    } else if (Binary.compare("'PWAD'")) {
        sName = "Personal WAD file";
        sOptions = "Lump count: " + Binary.read_uint32(0x04, _LE);
        bDetected = true;
    }

    return result(bShowType, bShowVersion, bShowOptions);
}