Modifying the ZX Spectrum and Timex TC 2048/2068 to Run 128K Software

ZX Land #06

Upgrade to 128K

The modification of SINCLAIR ZX SPECTRUM and TIMEX TC 2048 / TC 2068 computers was developed to enable their owners to use software for 128K versions. The SPECTRUM 128K +2 was chosen as the model to emulate: it is the most widely used and, in our opinion, the “most successful” of the entire family.

As we know, the machines in question are based on the eight-bit Z80 processor, whose address space is 64 kB. Another important feature is that the address space is divided into two parts:

  1. Accessible only to the CPU (“fast” memory)
    (0 kB–16 kB; 32 kB–64 kB)
  2. Shared between the CPU and the ULA (“slow” memory)
    (16 kB–32 kB)

In the first area, the processor operates independently, without interference from the ULA. In the second, there is a conflict over access to memory (RAM), which is resolved in the processor’s disfavor (its clock is stopped). This happens so that the image generator (ULA) can operate smoothly, without producing any “garbage” on our monitor screen.

The information we have so far points to two problems involved in handling 128 kB of memory:

  1. Increasing the CPU’s addressing capabilities
  2. Resolving a more complex conflict over access to RAM (the need to take more signals into account)

The first problem was solved by dividing RAM into eight 16 kB banks and mapping one of them into the address range from C000h to FFFFh. This is done using bits B0–B2 of an additional port at address 7FFDh (32765), which is also used to switch the ROM and the video bank.

The solution to the second problem—the most important one when it comes to this modification—is to expand the “logic” of the ULA. The manufacturer of the ZX 128 naturally used a new, specially designed chip. In the proposed solution, this is achieved by using something like a prosthesis for the old, reliable ULA.

A detailed description of how to carry out the modification is beyond the scope of this article. It should be noted, however, that doing it yourself is a fairly ambitious undertaking, recommended only for hobbyists with good equipment and considerable experience in “electronic tinkering.” Unfortunately, when replacing a significant number of integrated circuits, there is a fairly serious risk of damaging the printed circuit board or causing some other damage. This is especially important in the case of the ZX, whose upgrade takes more time and causes more problems during testing.

In addition to expanding the RAM to 128 kB, we get the enhanced “Plus Two” operating system, which fits in a 32 kB ROM divided into two banks that can be switched alternately into the standard 0–16 kB address range (selected by the “ROM” bit in the control port). An AY 3-8910/12 sound generator can optionally be added. The enhanced BASIC in the 128k model includes commands for generating simple sounds. Most games use the full capabilities of the AY chip.

The RAM expansion involves replacing the chips in the “slow” memory area, from 16 kB to 64 kB, and in the “fast” memory area, from 32 kB to 64 kB. This solution provides 4 fast banks (even-numbered) and 4 slow banks (odd-numbered), divided just as in the original SPECTRUM 128k +2.

Bank 5 is mapped to the 16–32 kB area. By default, the ULA reads this bank for display (more precisely, its first 6912 bytes), but the “VIDEO” bit in the control port allows the contents of bank 7 to be displayed. Bank 2 is permanently mapped to the 32–48 kB area. The 48–64 kB area is a window providing access to the banks. Bits B0–B2 (set to 0 after reset) contain the number of the bank mapped into this area. Interestingly, banks 5 and 2 can also be mapped here—that is, the second and third “quarters” of memory. In that case, all operations on the memory area from 49152 to 65535 will be equivalent to operations in the 16–32 kB area (bank 5) or the 32–48 kB area (bank 2).

To ensure compatibility with the older model, access to the control port can be disabled by setting the PROTECT bit to 1. This restores the 48k model, in which the control port does not exist.

Bits of the control port (7FFDh, i.e. 32765):

b0,b1,b2 - B0,B1,B2: number of the bank
                      available in the
                      processor window
b3       - VIDEO  0-ULA bank 5
                  1-ULA bank 7
b4       - ROM    0-ROM H (128k)
                  1-ROM L (48k)
b5       - PROTECT
                  0-port enabled
                  1-no access to the port
b6,b7    - unused
********************************
ZX SPECTRUM 128k +2 memory map
********************************

 64k FFFFh --------------------
           !  0 !1!2!3!4!5!6!7!
 48k C000h --------------------
           !  2 !
 32k 8000h ------         -----
           !  5 !         !5!7!
 16k 4000h -----------    -----
           !ROML!ROMH!     ULA
  0k 0000h -----------
             CPU
********************************

Note!

This modification does not include installation of the CENTRONICS or MIDI interface (as on the original +2). As you might easily guess, the cassette recorder is not installed either.

The modified computer is not compatible with the FDD disk drive. In this case, the FDD interface must also be modified!

If there is enough interest in the subject, the authors of the modification may decide to publish a complete description, along with a schematic and instructions for self-assembly. (There are still some boards available for the complete modification—that is, including the AY chip.)

Paweł Gawroński

Share your thoughts about the article