Messenger

From Sinclair Wiki
Jump to navigation Jump to search

The Messenger is an interface that was produced by SAM Computers Ltd for the ZX Spectrum, that allows snapshots to be transferred to/from a SAM Coupé.

The user can load/save snapshots on the Coupé for transfer, or run programs directly on the Coupé in Spectrum compatibility mode. Screenshots can also be transferred in either direction, or loaded and saved from the Coupé.

The Messenger does not support programs for the 128K, as the Coupé itself cannot run them, although it can be used with a 128K machine running in 48K mode.

The interface provides a facility to transfer the Spectrum ROM to the Coupé, as this could not be legally distributed with the the Messenger's companion software for the Coupé at the time. The code to transfer the ROM overwrites 16400 bytes (0x4000 + 16) of memory in the Spectrum at address 32768 (0x8000), so care should be taken with this feature, so as to avoid corrupting anything of importance.

The device plugs into the Coupé's MIDI/network port at one end, and the ZX Spectrum's expansion bus on the other.

Interruption of running software works by means of a break (non-maskable interrupt, or NMI) button on both machines. Due to the unreliability of the Coupé's built-in break button, and as it is not possible to deliver the NMI signal through the SAM's MIDI/network port, a card was provided to plug in to the Coupé's expansion bus to provide a superior break button. As the Spectrum lacks a break button, one is included as part of the Messenger itself.

Snapshots saved by the Messenger include a copy of the ROM, patched with the companion software's NMI service routine (nmi.spx) and a small NMI wrapper routine (066.spx) loaded at address 0x0066, which saves AF and immediately jumps to the main NMI routine. The snapshot format is otherwise identical to that of the DISCiPLE and +D, but with registers saved within the ROM area rather than in the directory entry for the file. As such, it is a relatively simple process to convert DISCiPLE and +D snapshots into Messenger format and vice-versa.

In addition to 066.spx and nmi.spx, companion software for the Coupé includes code.spx which contains routines for communicating with the Spectrum through the Messenger interface, a menu screen named scrn.spx, and a simple basic program named auto.spx to load the menu screen and machine code programs into RAM, and to call upon them as required by the user.

The Messenger 1.1 includes an 8k×8 static RAM and an 8k×8 EPROM, although only around 0.5 KiB of code is included, and only the low 256 bytes of RAM are used.

The Messenger ROM and RAM is paged out by writing to port 0x77, and paged in by reading from port 0x77. More precisely, paging is triggered by I/O to ports where A7=0, A4=1, A3=0, and A1=1, i.e. (port & 0x009a) == 0x0012. It is also paged in automatically upon execution of addresses 0x0066 and 0x0067. The serial port is accessible through most significant bit of port 0xff6f, for both sending and receiving. More precisely, the serial port is accessed through I/O ports where A7=0, A4=0, A3=1 and A1=1, i.e. (port & 0x209a) == 0x000a. Serial port I/O can be accessed regardless of whether the ROM and RAM are paged in.

Miguel Angel Rodríguez Jódar has produced a schematic of the interface, and has worked with Velesoft to produce a JEDEC file with equations for the Messenger's GAL.

Programs with Messenger snapshots support

  • There is a patch for libspectrum to implement support for loading from Messenger snapshots, although this lacks support for saving Messenger snapshots.
  • There is also Miguel Angel Rodríguez Jódar's sna2p, prebuilt as a Windows command line program, but distributed with corresponding C source code for building on other platforms. Note that this is licensed under the GPL v3 but contains a hardcoded copy of SAMCo's nmi.spx and 066.spx files, for which the GPL v3 does not apply.

External links