Installing and using SkoolKit

Requirements

SkoolKit requires Python 2.x, version 2.5 or later. (SkoolKit has not been tested with Python 3.x; it almost certainly will not work.) If you’re running Linux or one of the BSDs, you probably already have Python installed. If you’re running Windows, you can get Python here.

In addition to the stock Python distribution, SkoolKit also requires one of the following image-processing libraries:

Either one will do. gdmodule seems to be slower than PIL, but it creates smaller image files. gdmodule is available in Debian, Ubuntu, openSUSE and Mandriva as python-gd; it is apparently not packaged for Fedora. It is also available in FreeBSD and NetBSD as graphics/py-gd, and in OpenBSD as py-gd. PIL is available in Debian, Ubuntu, openSUSE, Mandriva and Fedora as python-imaging. It is also available in FreeBSD and NetBSD as graphics/py-imaging, and in OpenBSD as py-Imaging. Windows users will probably want to use PIL, since it has downloads readily available.

SkoolKit will use gdmodule in preference to PIL if it is available.

Linux/BSD v. Windows command line

Throughout this documentation, commands that must be entered in a terminal window (‘Command Prompt’ in Windows) are shown on a line beginning with a dollar sign ($), like this:

$ ./some-script.py some arguments

On Linux/BSD, the commands may be entered exactly as they are shown (without the dollar sign, of course). On Windows, the dot-slash (./) prefix should be omitted. (The dot-slash prefix may also be omitted on Linux/BSD if you have the current working directory in your PATH, but that is not the norm.)

Generating the HTML disassemblies

To generate the HTML version of the Skool Disassemblies, use the skool2html.py script. Open a terminal window, change to the directory containing SkoolKit, and enter this command:

$ ./skool2html.py skool-disassemblies

A few seconds later (or minutes, depending on the speed of your machine), the HTML version of the Skool Disassemblies will be ready in the skool-disassemblies subdirectory (which will have been created if it didn’t already exist).

skool2html.py supports many options; run it with no arguments to see a list:

-V       Show SkoolKit version number and exit
-q       Be quiet
-s       Write Skool Daze files only
-b       Write Back to Skool files only
-f FILE  Use FILE instead of sd.skool or bts.skool
-wX      Write only these files, where X is one or more of:
           b = Bugs
           C = Changelog
           c = Character buffers
           d = Disassembly files
           G = Game status buffer
           g = Graphics files
           h = Home page
           I = Disassembly index (minimal)
           i = Disassembly index (full)
           k = Keypress table
           L = Lessons and personal timetable index
           l = Load code
           m = Memory maps
           p = Pokes
           S = Startup code
           s = Save code
           t = Trivia
           y = Glossary

So, to write only the disassembly files and memory maps for Skool Daze:

$ ./skool2html.py -s -wdm skool-disassemblies

Generating ASM files

To generate ASM files for Skool Daze or Back to Skool, use the skool2asm.py script. Open a terminal window, change to the directory containing SkoolKit, and enter this command:

$ ./skool2asm.py src/sd.skool > sd.asm

A few seconds later, an ASM file for Skool Daze will be ready: sd.asm.

To create an ASM file for Back to Skool:

$ ./skool2asm.py src/bts.skool > bts.asm

skool2asm.py supports many options; run it with no arguments to see a list:

-q   Be quiet (don't show timings)
-v   Be verbose (show instruction substitutions)
-w   Suppress warnings
-e   Write processed lines to stderr (implies -w)
-d   Use CR+LF to end lines (default line terminator is LF)
-t   Use tab to indent instructions (default indentation is 2 spaces)
-l   Use lower case (default is upper case, e.g. 'LD A,(HL)')
-iN  Set instruction field width to N (default=23)
-fN  Apply fixes:
       N=0: None (default)
       N=1: @ofix only
       N=2: @ofix and @bfix
       N=3: @ofix, @bfix and @rfix (implies -r)
-c   Create default labels for unlabelled instructions
-s   Use safe substitutions (@ssub)
-r   Use relocatability substitutions too (@rsub) (implies -f1)

See ASM modes and directives for a description of the @ssub and @rsub substitution modes, and the @ofix, @bfix and @rfix bugfix modes.

Table Of Contents

Previous topic

What is SkoolKit?

Next topic

Disassembly DIY