Oversimulated
SkoolKit 8.8 has been released. To get a copy, please head over to the download page, the Python Package Index, the Ubuntu PPA, or the Fedora copr repo.
Arriving hot on the heels of SkoolKit 8.7, 8.8 is a minor update with just a few (but important) changes, chief among them being an improvement in the performance of the Z80 instruction set simulator. (Yes, strap in for some more simulator-related discussion.)
Now, the simulator’s performance (i.e. speed) does depend to some extent on
what the code it is simulating actually does, so allow me to give some concrete
examples comparing 8.7 and 8.8 to illustrate the improvement. First, everyone’s
favourite (OK, perhaps just my favourite) application of the simulator:
tap2sna.py --sim-load
(in this case operating on a TZX file for Skool Daze).
Second: running the z80doc tests in Patrik Rak’s
z80test suite. And third: expanding an
#AUDIO
macro to generate a WAV file of the Manic Miner theme tune (which runs
to 20.25s). Here are the numbers showing the performance of 8.7 and 8.8 on my
PC using Python 3.11:
- 2m20s (8.7) v. 0m35s (8.8) -
tap2sna.py --sim-load skooldaze.tzx sd.z80
- 2m42s (8.7) v. 0m56s (8.8) - z80doc tests
- 7.56s (8.7) v. 2.98s (8.8) -
#AUDIO4(blue-danube.wav)(34351,34358)
Still on the subject of --sim-load
, that option now also performs any call
,
move
, poke
and sysvars
operations specified by the --ram
option, in
case you want to modify the pristine memory contents - no judgement! - before
writing the Z80 snapshot.
Naturally, this improvement in simulator performance also means that the #SIM
macro is now faster, and so too is the #TSTATES
macro (when it uses the
simulator to execute instructions, that is).
The final bit of simulator-related news is that 8.8 has a new command:
trace.py
. I had originally planned to squeeze this into 8.7, but it didn’t
quite make it into that already jam-packed release. Anyway, trace.py
uses the
simulator to run machine code in a 48K memory snapshot, optionally showing the
instructions executed and register values along the way. It can also compute
the delays between speaker flips, in case you ever wanted to manually supply
the delays
parameter to an #AUDIO
macro (which might be desirable if the
code in question takes a long time to simulate).
Speaking of the #AUDIO
macro (again), or more specifically the
[AudioWriter]
section that controls WAV file creation: the MaxAmplitude
parameter has been removed. Its default value was 65536, and roughly speaking
it determined the ‘rectangularity’ of the waveform produced when converting
delays into samples. But some experiments with low-frequency sounds made it
clear that a better default value is ∞ (infinity), for maximum rectangularity
and therefore similarity to the sound of a real Spectrum. Leaving
MaxAmplitude
around just so WAV files can be made to sound less Spectrum-like
seems pointless, so out it goes.
And that’s all the news. At this point I would usually direct readers to the changelog for details on any changes not described here, but this time there are no changes not described here, so, well, don’t bother. Just fire up a copy of 8.8 and get simulating.