Loading routine "cores": Difference between revisions

Jump to navigation Jump to search
Document Search Loader.
(Document the Paul Owens loader.)
(Document Search Loader.)
Line 120: Line 120:


Again just a one-byte change from the ROM loader, replacing the <code>RET NC</code> with Alkatraz's <code>RET Z</code>.
Again just a one-byte change from the ROM loader, replacing the <code>RET NC</code> with Alkatraz's <code>RET Z</code>.
=== Search Loader ===
Used by Digital Integration in some of their games, for example [https://spectrumcomputing.co.uk/index.php?cat=96&id=305 ATF] and [https://spectrumcomputing.co.uk/index.php?cat=96&id=5317 Tomahawk].
LD-SAMPLE  INC B
            RET Z
            LD A,00
            IN A,(FE)
            XOR C
            AND 40
            RET C
            NOP
            JR Z,LD-SAMPLE
The first loader which is actually non-trivially different from the ROM loader. The changes here:
* Setting the high byte of the <code>IN</code> to be zero - this causes every keyboard half-row to be read. This is unimportant as all five low bits are masked out later.
* Dropping the <code>RRA</code> of the ROM loader - as we're not checking for any keys being pressed, no need to shift the byte around. This means the EAR bit stays in bit 6 rather than being shifted to bit 5 so the <code>AND</code> changes as well.
* The <code>RET C</code> is a no-op as <code>AND</code> explicitly clears the carry flag.
This code has fairly obviously been constructed to have exactly the same runtime as the ROM code, which explains the always failing <code>RET C</code> and <code>NOP</code> (which replaces the <code>RRA</code> of the ROM routine). All the variants which replace the <code>RET NC</code> with a <code>NOP</code> or similar actually have a different runtime as a failing conditional <code>RET</code> is the ''only'' Z80 instruction which takes 5 t-states.
49

edits

Navigation menu