Pobtastic / Skoolkit / First Steps

Created Fri, 21 Feb 2025 22:34:50 +0000 Modified Wed, 20 Aug 2025 22:05:19 +0000
399 Words 2 min

Introduction

A lot of people like to start with a control file generated from a playback file, but I prefer to try and figure it out all from scratch. Not for any particular reason - just that, I like to work from the entrypoint and not make any assumptions about where the data/ code is and uncover it as I go along.

The very first thing I always do is to mess around with the ./sources/game.ref file (spikyharold.ref in this case) and work out where the logo should come from.

Disassembly of the loading screen
The disassembly page showing the loading screen.

This one is pretty easy, as the logo is right there on the loading screen. It’s unfortunately a manual trial and error process, but thankfully it’s usually very easy to target:

[Game]
Game=Spiky Harold
Logo=#SCR$02,$04,$05,$18,$06,$4000,$5800(/images/logo)
Spiky Harold Logo
The logo cut out from the loading screen.

This will now appear on every generated page.

Game Entry Point

Now, let’s tidy up the GameEntryPoint:

c $5B2D Game Entry Point
@ $5B2D label=GameEntryPoint

This is a bit short, so let’s rename it as an “alias”, and given everything below is a NOP just mark the next part as data for now:

c $5B2D Game Entry Point Alias
@ $5B2D label=GameEntryPointAlias
  $5B2D,$03 Jump to #R$84D0.

b $5B30

Then, we can disassemble the address we just jumped to, and make this the new GameEntryPoint:

c $84D0 Game Entry Point
@ $84D0 label=GameEntryPoint
  $84D0,$03 Set the border to #INK$00.
  $84D3,$05 #HTML(Write #COLOUR$47 to <a rel="noopener nofollow" href="https://skoolkit.ca/disassemblies/rom/hex/asm/5C8D.html">ATTR_P</a>.)
  $84D8,$02 #REGa=#N$02.
  $84DA,$03 #HTML(Call <a rel="noopener nofollow" href="https://skoolkit.ca/disassemblies/rom/hex/asm/1601.html">CHAN_OPEN</a>.)
  $84DD,$03 #HTML(Call <a rel="noopener nofollow" href="https://skoolkit.ca/disassemblies/rom/hex/asm/0D6B.html">CLS</a>.)
  $84E0,$06 #HTML(Write #R$ECE0(#N$EBE0) to <a rel="noopener nofollow" href="https://skoolkit.ca/disassemblies/rom/hex/asm/5C36.html">CHARS</a>.)
  $84E6,$06 Write #R$67AC to #R$84F5.
  $84EC,$03 Call #R$8FC3.
  $84EF,$03 Call #R$90AA.
  $84F2,$03 Jump to #R$85C0.

Some Things To Note:

  • c indicates a code block
  • Any jumps or calls to addresses in ZX Spectrum ROM can either be hardcoded, or … as I’ve done here, linked out to the Skoolkit ROM disassembly
  • If the routine is writing to CHARS then the “real” address of the font is at +$0100 - this is why I’ve taken the actual value in the code of $EBE0 but linked to $ECE0
  • Using the custom macros I’ve defined in the game.ref file:
    • If a colour byte is $00-$07 then use #INK to reference it (outputs only the colour name)
    • Anything else which is a colour can use #COLOUR (outputs both the PAPER/ INK/ BRIGHT/ FLASH information)