MDFS::Software.Spectrum.Harston Search

JGH ROM for ZX Spectrum

JGHROM.zip 65K
v0.75 03-Oct-2004
This is a modified version of the ZX Spectrum ROM that I wrote in 1984-1985. I hand assembled it and poked the values into an image in memory before blowing it to EPROM. The source code consisted of lots of pieces of paper! In 2003 I typed up all the scraps of paper into proper source code and fixed a couple of outstanding bugs.

Bugs fixed

The standard bugs are fixed: NMI (now vectors via &5C80) - CHR$8 - CHR$9 - INKEY#0 - CLOSE# - SCREEN$ - scroll?/press a key - "x"+STR$y - -65536 - Divide bit34 - SKIP_CONS writing to ROM - scrolling writing to ROM - dec_to_fp inaccuracy - colours select screen - INPUT uses stream 1.

Modifications

Spaces removed from token table - Out of range colour/tab/at ignored - "Nonsense in BASIC" is now "Mistake" - Character token entry - Starts with CAPS set, white on black

Extensions

  • "P" channel ZX Printer routines replaced with Centronics port on 251
  • "C" channel writes raw data to Centronics port
  • CALL <address>
  • Port 253/249 checked for ASCII keyboard input
  • CAT[#n] to catalogue tape
  • SAVE s$ CODE start,length[,extra[,reload[,type]]]
  • OPEN# can select any non-Interface 1 channel
  • Hex input with &xxxx
  • Hex output with PRINT~ and STR$~
  • Standard entry block to extra routines
  • Machine code can be run from tape or microdrive with *filename or RUN s$
  • CHR$12 performs a CLS
  • Standard error message if RST &08 out of range with no Interface 1 persent.

    Additions in version 0.70

    In version 0.60 if the line PRINT INK 2 is entered the tokeniser incorrectly converts this to PRINT IN K 2. This can be worked around by entering INK 2<ENTER> then adding the PRINT command. Thanks to Phillip Kendall for pointing this out.

    Additions in version 0.71

    Added Geoff Wearmouth's bugfix for DEC_TO_FP which improves accuracy of decimal values. Scrolling no longer tries to write to ROM. New channel "C" and channel "P" check for BREAK.

    Additions in version 0.72

    OPEN# wasn't stepping over Interface 1 channels properly. NEW was losing channel "C" and Interface 1 wasn't closing #4 properly. Added Geoff Wearmouth's bugfixes so colours select the screen and INPUT uses stream 1.

    Additions in version 0.73

    Machine code can now be run from microdrive! On RESET, if the Interface 1 is present, drive 1 is selected, otherwise tape is selected. CHR$12 performs a CLS. RST &08 traps out of range errors.

    Additions in version 0.74

    Running machine code from tape searches silently. Running checks if exec=&FFFF and enters at the load address instead.

    Additions in version 0.75

    Low level hex output code correctly outputs "0" when printing zero with no leading characters.

    Some of the files can be browsed here:
    Docs/txt 14K Documentation, including details of how to call the extra routines from user programs.
    Patch/lst 69K Assembly listing of the patch code.
    Patch/src 38K Source code, written in BBC BASIC Z80 assembler.
    ROMInfo 2K Initial documentation from back in 1985.
    JGHSpec 16K ROM image patched to use on Speculator.

    The Spectrum ROM is copyright Amstrad. Amstrad have kindly given their permission for the redistribution of their copyrighted material but retain that copyright. The extra code is copyright J.G.Harston and may be redistributed, and may be extracted and used in other code, with attribution.