Add an IFID - KVonGit/zil-stuff GitHub Wiki
<CONSTANT IFID-ARRAY <PTABLE (STRING) "UUID://XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX//">>
So, if your IFID (from somewhere like https://www.tads.org/ifidgen/ifidgen) is BEDC298A-459B-4E03-8DC3-CCF3693ED243
:
<CONSTANT IFID-ARRAY
<PTABLE (STRING) "UUID://BEDC298A-459B-4E03-8DC3-CCF3693ED243//">
>
Have the game figure its own babel
style IFID using the release, serial, and checksum.
If I run babel -blorb ./s5.zil ./s5.iFiction
on the game I use in this example, that outputs the file ZCODE-1-250813-F497.zblorb
The following will use the game's RELEASEID, SERIAL, and calculate the checksum to print that same IFID in the modified V-VERSION routine.
;" 0 1 2 3 4 5 6 7 8 9 A B C D E F"
;"48 49 50 51 52 53 54 55 56 57 65 66 67 68 69 70"
;"
> <ASCII 48>
!\0
> <ASCII 49>
!\1
> <ASCII 50>
!\2
> <ASCII 51>
!\3
> <ASCII 52>
!\4
> <ASCII 53>
!\5
> <ASCII 54>
!\6
> <ASCII 55>
!\7
> <ASCII 56>
!\8
> <ASCII 57>
!\9
> <ASCII 65>
!\A
> <ASCII 66>
!\B
> <ASCII 67>
!\C
> <ASCII 68>
!\D
> <ASCII 69>
!\E
> <ASCII 70>
!\F
"
<ROUTINE HEX-DIGIT (I)
<COND
(<OR <G? .I 15><L? .I 0>>;"ERROR, JUST RETURN 0"
<RETURN 0>
)
(<L? .I 10>
<RETURN <+ 48 .I>>
)
(ELSE
<RETURN <+ 55 .I>>
)
>
>
;"How to Convert Decimal to Hexadecimal https://www.youtube.com/watch?v=QJW6qnfhC70"
<ROUTINE PRINT-HEX-BYTE (VAL "AUX" HI LO)
<SET HI </ .VAL 16>>
<SET LO <MOD .VAL 16>>
<PRINTC <HEX-DIGIT .HI>>
<PRINTC <HEX-DIGIT .LO>>
>
<ROUTINE V-VERSION ()
<PRINT-GAME-BANNER>
<TELL "Release ">
<PRINTN <BAND <LOWCORE RELEASEID> *3777*>>
<TELL " / Serial number ">
<LOWCORE-TABLE SERIAL 6 PRINTC>
<TELL %<STRING " / " ,ZIL-VERSION " lib " ,ZILLIB-VERSION>>
<TELL "|IFID ZCODE-">
<PRINTN <BAND <LOWCORE RELEASEID> *3777*>>
<TELL "-"><LOWCORE-TABLE SERIAL 6 PRINTC>
<TELL "-"><PRINT-HEX-BYTE <GETB 0 28>>
<PRINT-HEX-BYTE <GETB 0 29>>
<CRLF>
>