domingo, 21 de agosto de 2016


I have been designing a ZX Spectrum Cartridge "clone" for a while (case, board and silicon skirt), to be able to make new software releases or replace original damaged cartridges. I always liked the fact that these cartridges were small and had a sleek look.
However, Cartridges have a nasty limitation, which is the hard coded limit to 16KBytes. In fact it's a limitation imposed by ZX Spectrum inner workings and how ROMCS control line works, which can be used to disable internal ZX Spectrum ROM, which has 16KBytes, hence the size limit.

This new Cartridge, will have up to (128K, 256K or 512K Bytes), paged in 16KB blocks into the same address space as ZX ROM.
This will allow this cartridge to work as a replacement for multiples of 16KB ROMs, or eventually, as a fast application snapshot loader, so that larger than 16KB applications can be loaded by using several 16KB Banks.
Another important factor in the design, is to be able to quickly switch banks, in order to use the cartridge as ROM data bank, for an application larger than 48KB or 128KB. This allows for larger games or levels to be included, without ever needing to use a tape deck or similar serial loading.

However, due to limited Bus Address control lines available at ROM Cartridge slot, several hurdles had to be overcome, since we need to send at least bank switch commands to it, but no Read (RD) or Write (WR) control lines are available (see available control lines on the right, in green when compared with regular Z80 CPU control lines for opcode fetch.
So after several brainstorming sessions, I developed a method to trigger these commands, by manipulating the address lines into a specific sequence, that is almost impossible for a regular program to generate in normal operation.

It basically consists, in managing to output the same exact address 3 times in sequence, which is usually impossible, since each Z80 fetch instruction cycle (M1 cycle), always outputs a refresh address in between. So at most, two consecutive addresses could happen, in normal operation. But with some very specific trickery one can manage to output these 3 consecutive addresses.

So after validating this idea, it was time to make some simulations, and find some digital logic that would accomplish this mechanism.
On the right is an example of a simulation to validate the bank mechanism with a few test cycles.
It tests, regular Reading of addresses from ROM and RAM, the trigger mechanism for setting a Bank and also a another mechanism to allow writing to the Flash Memory being used as Cartridge ROM.

All that was left to do was to implement a suitable PCB (last image).
To make this a reality, able to fit inside the very small ZX Spectrum original Cartridge case, all components had to be SMD and low profile variant (TSOP and TSSOP).

1 comentário:

  1. Engenhoso!
    Estás efetivamente a expandir a memória do Spectrum para cima dos 128KB, com um "hack" bem elegante!