Sections in the ref files may contain macros that will be expanded before rendering. The ref file macros recognised by SkoolKit are described in the following subsections.
The :: macro is used to include the contents of another section in the current section.
For example (in sd.ref and bts.ref):
[Bug:waitingForEinstein:Waiting for EINSTEIN]
::Bug-WaitingForEinstein
This will copy the contents of the section named Bug-WaitingForEinstein (defined in skool.ref) into the current section.
The bts: macro is expanded only in Back to Skool mode; in Skool Daze mode it is replaced with an empty string. Conversely, the sd: macro is expanded only in Skool Daze mode; in Back to Skool mode it is replaced with an empty string.
For example (in skool.ref):
A character will be moved if bit 7 of byte ${sd:122}${bts:29} of his buffer is ${sd:re}set
In Skool Daze mode, this expands to:
A character will be moved if bit 7 of byte 122 of his buffer is reset
But in Back to Skool mode, it expands to:
A character will be moved if bit 7 of byte 29 of his buffer is set
The f: macro expands to a filename path computed from the names of variables in the FileInfo object (defined in skoolhtml.py).
For example (in changelog.ref):
<a class="link" href="${f:sd_dir/playarea_tiles}">Skool Daze</a>
Here, ${f:sd_dir/playarea_tiles} expands to the path of the ‘Play area tiles’ page in the Skool Daze disassembly, defined by the sd_dir and playarea_tiles variables of the FileInfo object.
The f: macro can also be used to call methods of the FileInfo object. For example (in changelog.ref):
...see Skool Daze command list <a class="link" href="${f:sd_dir/asm_path/asm_fname(64939)}">202</a>
Here, ${f:sd_dir/asm_path/asm_fname(64939)} expands to the path of the file containing the disassembly of the data block at 64939 in the Skool Daze disassembly; that path is defined by the following elements:
The v: macro expands to the value of a game variable (defined in the [Game] section of sd.ref or bts.ref).
For example (in skool.ref):
[Glossary:SRB]
Screen refresh buffer at #R${v:SRBAddress}
Here, ${v:SRBAddress} expands to the value of the game variable SRBAddress (defined as ‘32524’ in the [Game] section in sd.ref, and as ‘32512’ in the [Game] section in bts.ref).