SkoolKit

Spectrum game disassembly toolkit

Extending the Kit

I AM A P.I.

When SkoolKit 1.0 was released (in January 2010), I hadn’t given much thought to making it useful for producing disassemblies of games other than Skool Daze and Back to Skool. Indeed, in the ‘What is SkoolKit?’ section of the documentation, I described it as ‘The Skool Disassemblies in DIY or kit form’ (hence, in case you ever wondered, the name). And many of the documented skool macros and ref file sections were specific to the Skool games, too. It wasn’t really until version 2.0 (in November 2010) that I started thinking seriously about turning SkoolKit into a generic disassembly-creating tool, and only by version 2.1 (in April 2011) had I finally got rid of all the Skool-specific stuff.

Which brings us to version 3.1, released today and available for download from the aptly named download page. Taking support for non-Skool games to the next step, SkoolKit now has a public API that can be used to extend its functionality, thus enabling you - the potential producers of Stonkers, Infection and Laser Squad disassemblies out there - to implement your own skool macros (yes, they’re still called skool macros, for old times’ sake), and read your own custom ref file sections with custom names (made up by you) for custom purposes. For more details on what’s possible and how, see the documentation on extending SkoolKit.

In other news, support for the #CALL, #REFS, #EREFS, #PUSHS, #POKES and #POPS macros in ASM mode has been added, which means that skool2asm.py won’t choke on skool files that contain them. So now the only skool macros not supported in ASM mode are the image-creating ones: #FONT, #SCR, #UDG and #UDGARRAY. Which, I hope you will agree, makes sense: it’s hard to insert an image in a plain text ASM file.

And finally, if you’ve ever considered using SkoolKit to create a Spectrum game disassembly but were put off by the sickly pastel colours in the default CSS file, then be put off no longer. SkoolKit 3.1 includes a dark theme CSS file: skoolkit-dark.css. Quite literally, it is the exact inverse of the traditional skoolkit.css. To try it out with the Manic Miner disassembly (for example), just add the following section to examples/manic_miner.ref (included with SkoolKit):

[Paths]
StyleSheet=skoolkit-dark.css

or leave the ref file as it is and use the handy new ‘-c’ option of skool2html.py when building the disassembly:

skool2html.py -c Paths/StyleSheet=skoolkit-dark.css examples/manic_miner.ref

Either way, you can now revel in the darkness.

Disassemblies 3000

Flashing K

A few weeks ago, SkoolKit 3.0 was released, bringing with it a new image library that could create PNGs somewhat faster and smaller than SkoolKit 2.x ever did. Now it’s the turn of SkoolKit 3.0.1 (available from the download page, of course), which brings with it the ability to create GIFs as well. “Why would I want to use SkoolKit to create GIFs when it can already create PNGs?” I imagine you asking. Well, in addition to plain old GIF files, SkoolKit 3.0.1 can create animated GIFs too, which are handy for capturing Spectrum screenshots that contain flashing cells. That said, if you’d prefer to create animated PNGs in APNG format (which are natively supported only by Firefox and Opera, as far as I know), SkoolKit can do that too.

To mark this inaugural animation-capable release of SkoolKit, I’ve also ported the Skool Daze, Back to Skool and Contact Sam Cruise disassemblies to SkoolKit 3 (and released those ports). In the process of porting, I replaced their boring, static loader/saver screenshots with animated GIFs that show a flashing cursor. (Exciting, eh?) In addition, I made some performance tweaks that the interested reader can now test for himself. Here are the disassembly build time stats (again, on my old but trusty development machine) for SkoolKit 3.0.1 versus SkoolKit 2.x:

Disassembly 3.0.1 2.x (PIL) 2.x (gd)
Skool Daze 4.4s 5.9s 8.0s
Back to Skool 5.1s 8.2s 12.1s
Contact Sam Cruise 12.3s 33.5s 51.5s

As you can imagine, the quality of my life has improved considerably now that I can build the CSC disassembly in only 12 seconds instead of 51, and with animated loader/saver screenshots to boot.

One more thing: SkoolKit 3.0.1 includes example control and ref files for Jet Set Willy, which now sit alongside the example control and ref files for Manic Miner (Bug Byte version). So if you want to build an unannotated disassembly of JSW in HTML or ASM format, I suggest you download 3.0.1 today.

SkoolKit 3000

SkoolKit 3.0

SkoolKit 3.0 has just been released and is available from the ever-present download page. The observant reader may notice that 3.0 is a whole major version number bump (from 2.5, in case the unobservant reader was wondering). Let me assure the observant reader, however, that the version number bump is not merely a frivolous attempt at attention-grabbing. For SkoolKit 3.0 is the first version of SkoolKit, ever, that will work with Python 3.x. So if you’re one of those people whom it pains to have a version of Python 2.x installed just so they can use SkoolKit, SkoolKit 3.0 may be the analgesic you’ve been waiting for.

In addition, SkoolKit 3.0 has its own image creation library; it no longer requires (or supports) gdmodule or PIL. This time, let me assure the concerned reader that SkoolKit is better off for this change. I have carefully optimised the library for Spectrum graphics and PNGs, with the result that it is faster and produces smaller image files than SkoolKit 2.x. For the curious, here are some stats on the build times (on my development machine) for the HTML versions of the most recent releases of the Skool Daze, Back to Skool and Contact Sam Cruise disassemblies when using SkoolKit 3.0 versus SkoolKit 2.x:

Disassembly 3.0 2.x (PIL) 2.x (gd)
Skool Daze 5.0s 5.9s 8.0s
Back to Skool 5.9s 8.2s 12.1s
Contact Sam Cruise 23.0s 33.5s 51.5s

And here are some stats on the total image file size (in bytes) for those same disassemblies:

Disassembly 3.0 2.x (PIL) 2.x (gd)
Skool Daze 261,426 1,677,213 356,037
Back to Skool 276,891 1,788,654 378,232
Contact Sam Cruise 566,702 1,767,657 719,542

I would encourage the sceptical reader to repeat these experiments and convince himself that the stats are correct, but I haven’t released versions of the Skool Daze, Back to Skool and Contact Sam Cruise disassemblies that are compatible with SkoolKit 3.0 yet. All in good time, though.

So there it is. Having rescued SkoolKit from Python 2.x-induced obsolescence, I must now get to work on 3.0.1.