Offering a few MEMPTRs

SkoolKit 10.0 has been released. To get a copy, please head over to the download page, the Python Package Index, or GitHub.
Before we get into the meat of what’s new in 10.0, a word of warning. As is
often the case with an N.0 release, there are some compatibility-breaking
changes, which you can read about in the
migration guide. In particular, the
#UDGARRAY* macro is no more, the syntax of the #AUDIO macro has had a
complete overhaul, and the #CALL, #FONT, #LINK and #UDGARRAY macros no
longer support the syntax that was deprecated in 9.x. But never fear - in
keeping with tradition, there is a migration script
(skoolkit9to10.py)
to help you get your skool files, control files and ref files ready for 10.0.
When support for simulating code execution on a 128K Spectrum was added back in SkoolKit 9.1, you might have been forgiven for thinking that it would also gain the ability to convert AY audio into a WAV file. However, you would have thought wrong. A couple of years later, though - which, as the saying goes, is better than never - SkoolKit 10.0 steps in to provide that missing functionality. So, for example, you could capture the AY speech at the beginning of Robocop with:
$ tap2sna.py -c machine=128 "Robocop - Side A.tzx" robocop.z80
$ trace.py --ay --stop 39978 robocop.z80 robocop.wav
Of course, the #AUDIO macro can now capture AY audio as well by setting its
brand new ay parameter to 1. And for those cases where you want to capture
both AY and beeper audio at the same time, you can use the --ay and
--beeper options of trace.py, or set the ay and bpr parameters of the
#AUDIO macro to 1.
In other simulator-related news, fans of MEMPTR (or WZ, as the case may be) can
rejoice in the fact that 10.0 brings full support for this often overlooked
internal register pair. It is simulated whenever memory and I/O contention are
enabled, i.e. when the --cmio option of trace.py is specified, and when the
cmio parameter of the #AUDIO, #SIM or #TSTATES macro is set to 1. In
addition, snapinfo.py now shows the value of MEMPTR in SZX snapshots, and
bin2sna.py, snapmod.py, tap2sna.py and trace.py can all set the value
of MEMPTR. tap2sna.py and trace.py can also log the value of MEMPTR via
the r[memptr] replacement field. So what does all of this mean in practice?
Well, you could, for example, now use trace.py to play
MEMPTR Snake properly. The
possibilities are truly endless.
Speaking of using trace.py to play games, that experience - still not
recommended, by the way - should be slightly less awful in 10.0 thanks to the
border area now being included in the display. It won’t show multi-colour
border effects (at least not yet), but the effect of entering ‘BORDER 0’, for
example, being distinguishable from nothing counts as progress in my book.
Obviously rzxplay.py benefits from this new feature as well.
Remember the comment generator introduced in SkoolKit 9.5? No need to apologise if you don’t. Anyway, it has been updated to handle some keyboard-reading instructions a little more intelligently. Specifically, the comment for ‘IN r,(C)’ immediately after ‘LD BC,$XXFE’, along with the comment for ‘IN A,($FE)’ immediately after ‘LD A,$XX’, now indicates the half-row of the keyboard being read when eaxctly one bit of XX is reset. Which should make it easier to spot that all-important keyboard-reading code in a freshly made skool file.
And that’s about it for the main new features in this release. For details of
the non-main new features, visit the
changelog. After that, get a
copy of 10.0 and test your mental MEMPTR-tracing skills against trace.py
running on your favourite game.

