The skool files (sd.skool, bts.skool and the others) contain some directives that are processed during the parsing phase. These ‘skool directives’ are described in the following subsections.
These directives are used to define a section of a skool file that should be parsed in Back to Skool mode but ignored in Skool Daze mode (!bts+begin, !bts+end), or vice versa (!sd+begin, !sd+end).
For example (in load.skool):
; !sd+begin
23809 LD HL,23551 ; {INK 6: PAPER 2
*23812 LD (HL),22 ;
; !sd+end
; !bts+begin
23809 LD HL,23551 ; {INK 1: PAPER 1
*23812 LD (HL),9 ;
; !bts+end
The result here is that in Skool Daze mode only these lines are processed:
23809 LD HL,23551 ; {INK 6: PAPER 2
*23812 LD (HL),22 ;
whereas in Back to Skool mode only these lines are processed:
23809 LD HL,23551 ; {INK 1: PAPER 1
*23812 LD (HL),9 ;
The !defb directive defines bytes to be inserted into the memory snapshot for the skool file being parsed. This is used in sd.skool to define the bytes for the routines that occupy the space for the unused animatory states 104-126 and 232-254, so that those animatory states will not appear blank on the ‘Animatory states’ page.
For example:
c44919 LD DE,46572 ;
44922 CP 200 ; Reset the carry flag if the animatory state is >= #AS200
; (i.e. if we're dealing with a teacher)
44924 JP 45429 ;
; !defb=44919:17,236,181,254,200,195,117,177
The !defb directive is required here because the parser (in skoolparser.py) will only convert the DEFB, DEFW, DEFM and DEFS assembler directives into a sequence of bytes; it does not convert assembly language instructions into the equivalent byte values (it is not a Z80 assembler).
The !refs directive is used to define empty entries that will not appear in the memory map for the skool file being parsed, but which JR, JP and CALL instructions should be hyperlinked to (because they are defined in some other skool file).
For example (in start.skool):
!refs=26880
This defines an empty entry for the routine at 26880 in Skool Daze, so that any JR, JP and CALL instruction with 26880 as the operand can be hyperlinked to the entry for that routine (which is defined in sd.skool). Further down in start.skool we see:
!refs=20709,21746,21920
which defines empty entries for the routines at 20709, 21746 and 21920 in Back to Skool.