Skip to content
ISSUE NO. 049
REPAIR SPECTRUM 128 ZX SPECTRUM

ZX SPECTRUM 128 PAGING AND THE HAL

How the 128 pages its RAM and ROM, the HAL bug that crashes some games, and the Unrainer that fixes it.

lostretrotapes · 29 Nov 2026 · 2 min read

The Z80 can only see 64K at once, so the 128 pages its memory: writing to port 7FFD chooses which 16K RAM bank appears at the top of memory, which ROM is visible, and which bank the screen comes from. Two chips do the work: a 74LS174 latch that holds the value written to the port, and IC29, a HAL10H8 programmable logic chip that decodes it. On the grey +2 the HAL is IC7, an Amstrad 40061; on the +2A, +2B and +3 all of this is inside the gate array.

The HAL bug

The HAL doesn’t tell reads from writes, so reading port 7FFD has the same effect as writing to it, and pages in whatever happens to be on the data bus. Most software never reads the port, but some does, and crashes. PRINT IN 32765 crashes a machine with the original HAL. The same flaw is behind the “snow” some games show on the 128 and grey +2.

The fix is an “Unrainer”: a GAL16V8 programmed to replace the HAL, which goes in its socket, plus one wire from the socket’s pin 11 to the Z80’s pin 28 (/RFSH).

Signs of a paging fault

  • 48 BASIC works but the 128 menu or 128 BASIC doesn’t
  • 128K games crash where 48K ones run
  • a diagnostic ROM’s paging test failing: ZX Diagnostics flags these as PAL, HAL or ULA faults

Check the latch’s outputs just after a reset: they should all be low. Then the HAL, the ROM and each RAM bank.

Back to the Spectrum 128 overview.

Thanks for reading