In your 0xFACE

By | January 1, 2018

@keep it realSkoolKit 6.2 has been released. As always, copies are available from the download page, the Python Package Index, the Ubuntu PPA, and the Fedora copr repo.

Back in SkoolKit 2.0.6, you may remember, support for hexadecimal numbers began to appear, with control files being the first to allow numbers in either base 10 or base 16. Since then, hexadecimal has established a firm foothold as a first class number base in SkoolKit’s feature set: 2.1.1 saw skool2asm.py and skool2html.py gain the ability to convert a disassembly to hexadecimal, and in 4.3 it became possible to render address anchors and disassembly page filenames in hexadecimal. Today, 6.2 continues that tradition by adding support for hexadecimal numbers to SkoolKit’s command options wherever an address, byte, length, step, offset or range limit value is expected. So, for example, you can now do stuff like this:

$ sna2skool.py --start 0x8000 --end 0xf800 game.z80 > game.skool
$ snapmod.py --poke 0x9f43,0xff --reg pc=0xc33f game.z80 hacked.z80

In other command-related news, bin2sna.py has picked up the --reg and --state options (for setting the value of a register or hardware state attribute). And sna2img.py can now read a binary (raw memory) file when the --binary option is used, and with a specific origin address when the --org option is used. And skool2asm.py, skool2html.py and sna2skool.py all now sport the --show-config option (for showing configuration parameter values).

Enough about commands. Among the ASM directives, @nolabel is now processed in HTML mode. (This change should have been made back in SkoolKit 3.4 – when support was added for labels in HTML mode – but better late than never.) And the @keep directive is now also applied to instructions that have been replaced by an @isub, @ssub or @rsub directive. This change could affect the output of skool2asm.py on an existing disassembly, preventing the substitution of a label for an address in @isub, @ssub or @rsub mode. For example, in SkoolKit 6.1 and earlier, the instruction at 31898 below would be replaced by LD DE,31861%256*256+62 in @ssub mode, and then ‘31861’ would be replaced by a label (if there is one) because the @keep directive is not applied in @ssub mode:

@ssub=LD DE,31861%256*256+62
@keep
 31898 LD DE,30014

But in 6.2, this @keep directive (originally intended to prevent a label from being substituted for the value ‘30014’) is applied in @ssub mode, and prevents a label from being substituted for ‘31861’. The fix is to use the @keep directive’s new ability to specify the values to keep:

@ssub=LD DE,31861%256*256+62
@keep=30014
 31898 LD DE,30014

Now, in @ssub mode, ‘31861’ will be replaced by a label, as desired.

And that’s it for the main new features in this release. For details of all the other changes, the changelog is at your service.

Horace and the disassembly

By | December 5, 2017

Arriving just in time for Christmas, a new disassembly has just been added to the gallery here at skoolkit.ca: The complete Hungry Horace RAM disassembly.

This disassembly began life as a bare-bones control file back in SkoolKit 4.1.1 (version 20140920), and was recently ‘completed’ by adding annotations to all the routines, data blocks and text blocks. There are no ‘Bugs’, ‘Pokes’ or ‘Trivia’ pages yet, but you can expect them to appear in the next update.

Of course, the disassembly is also available in downloadable form, and a hexadecimal version can be browsed at GitHub too. There’s never been a better time to find out what makes Horace and the park guards tick!

Skool files to screenshots

By | September 3, 2017

SkoolKit 6.1SkoolKit 6.1 has been released. As is the custom on occasions like this, copies are available from the download page, the Python Package Index, the Ubuntu PPA, and the Fedora copr repo.

The main new feature in this release is support for changing the default behaviour of skool2asm.py, skool2html.py and sna2kool.py via a configuration file: skoolkit.ini. For example, if you always use the --hex option with skool2asm.py, you could place the configuration parameter Base=16 in the [skool2asm] section in skoolkit.ini, and save some time by never having to type --hex on the skool2asm.py command line again. But what if you want to run skool2asm.py without the implied --hex option once in a while? That’s where the new --ini option comes in: just run skool2asm.py --ini Base=0 and it will override the Base=16 parameter in skoolkit.ini.

One other benefit of having configuration in skoolkit.ini is that you can now define, via various parameters, the format of the comments that sna2skool.py uses to list the callers of entry points in routines when generating a skool file from a control file, and also the format of the titles it uses for untitled blocks. As far as I’m aware, this removes the last bit of hard coded text from the SkoolKit codebase, and leaves it to the discretion of the user to define.

Next up comes support for arithmetic expressions in instruction operands when converting base and assembling. For example, in earlier versions, LD A,32768/256 would be (partially) converted to LD A,$8000/256 when the --hex option of skool2asm.py or skool2html.py was used, but now it is fully converted to LD A,$8000/$100. Also in earlier versions, skool2bin.py would fail to assemble LD A,32768/256, but now it handles such instructions just fine.

And finally among the noteworthy new features, sna2img.py can now read skool files. This means that if you’ve mislaid the snapshot that you originally used to generate your skool file, you need not worry: sna2img.py can automatically build a snapshot from your skool file on the fly so that you don’t have to.

For details of all the other changes and bugs fixed in this release, check the changelog. After that, go grab a copy of 6.1, create your ideal skoolkit.ini, and enjoy the brevity of all your skool2asm.py, skool2html.py and sna2kool.py commands from here on out.