Package: skoolkit
SkoolKit is a collection of utilities that can be used to disassemble aSpectrumgame (or indeed any piece of Spectrum software written in machine
code) into a format known as askoolfile. Then, from thisskoolfile, you
can use SkoolKit to create a browsable disassembly in HTML format, or a
re-assemblable disassembly in assembly language. So theskoolfile is - from
start to finish as you develop it by organising and annotating the code - the
common ‘source’ for both the reader-friendly HTML version of the disassembly,
and the developer- and assembler-friendly version of the disassembly.FeaturesWith SkoolKit you can:usesna2ctl.pyto generate acontrol file(an attempt to identify
routines and data blocks by static analysis) from a snapshot (SNA, SZX or
Z80) or raw memory fileenablesna2ctl.pyto generate a much better control file that more reliably
distinguishes code from data by using a code execution map produced by an
emulatorusesna2skool.pyalong with this control file to produce a disassembly of a
snapshot or raw memory fileadd annotations to this disassembly (or the control file) as you discover the
purpose of each routine and data blockuseskool2html.pyto convert a disassembly into a bunch of HTML files (with
annotations in place, and the operands of CALL and JP instructions converted
into hyperlinks)useskool2asm.pyto convert a disassembly into an assembler source file
(also with annotations in place)useskool2ctl.pyto convert a disassembly back into a control file (with
annotations retained)useskool2bin.pyto convert a disassembly into a raw memory fileusetap2sna.pyto convert a TAP or TZX file into a ‘pristine’ Z80 or SZX
snapshotusesnapinfo.pyto analyse a snapshot or raw memory file and list the BASIC
program it contains, show register values, produce a call graph, find tile
graphic data, find text, or find sequences of arbitrary byte valuesusetrace.pyto trace the execution of machine code in a snapshot or raw
memory fileusetapinfo.pyto analyse the blocks in a TAP or TZX file, and list the
BASIC program it containsusebin2tap.pyto convert a snapshot or raw memory file into a TAP fileusebin2sna.pyto convert a raw memory file into a Z80 or SZX snapshotusesnapmod.pyto modify the register values or memory contents in a Z80 or
SZX snapshotusesna2img.pyto convert graphic data in a disassembly, SCR file, snapshot
or raw memory file into a PNG imageIn an HTML disassembly produced byskool2html.pyyou can also:use theimage macrosto build still and animated PNG images from graphic
datause the#AUDIOmacro to build WAV files for sound effects and tunesuse the#Rmacro in annotations to create hyperlinks between routines and
data blocks that refer to each otheruse[Bug:*],[Fact:*]and[Poke:*]sections in a ref file to neatly
render lists of bugs, trivia and POKEs on separate pagesFor a demonstration of SkoolKit’s capabilities, take a look at the complete
disassemblies ofSkool Daze,Back to Skool,Contact Sam Cruise,Manic Miner,Jet Set WillyandHungry Horace.Quick start guideSkoolKit includes fairly detaileddocumentation, but if you want to get up and
running quickly, here goes.To convert a SNA, Z80 or SZX snapshot of a Spectrum game into askoolfile
(so that it can be converted into HTML or assembly language):$ sna2skool.py game.z80 > game.skoolTo split the disassembly up into code and data blocks, you’ll need acontrol file.To turn thisskoolfile into an HTML disassembly:$ skool2html.py game.skoolTo turn it into a file that can be fed to an assembler:$ skool2asm.py game.skool > game.asm