ZX-ECUTOR for the SAM Coupe
Posted: Mon Mar 09, 2020 11:29 am
Hi!
This is the most recent piece of Z80 assembly programming I've done in a couple of years, for a project that combines both hardware and software - to make an interface on the SAM Coupe that let's it run ZX ROM Cartridges that were produced way back in 1983 for the ZX Spectrum.
The ROM Cartridges were an ill-fated idea by Sinclair Research, with only 10 commercial titles produced on cartridge in 1983. An extra interface was required for your ZX Spectrum to use it and although the port was added to 4 (I think) different interfaces from several companies it really did not take off, however the cartridges are a bit of a curiosity which is why I wanted to add support to the SAM.

What my code does is display a splash screen so you can select how to run the ROM cartridge - either directly, where the SAM will access it as uncontended memory at it's full 6MHz speed, or copy the cartridge to RAM and run it from there (as we're in the ZX Spectrum screen mode - MODE 1 - there's extra contention automatically added to slow the Z80 down closer to the speed of a ZX Spectrum, it works out about 3.8MHz).
The title screen is using some tricks, I use the line interrupt register to trigger interrupts at various vertical points on the screen display to change some of the palette colours. This achieves a border effect for the colour strips at different positions in the left and right border areas, as well as cycling the colours on the selected option on screen to create the multicoloured thin stripes, which scroll upwards a pixel every frame.

Once selected it'll clear the screen, set up the memory, palette and screen mode to configure the SAM to effectively be like a ZX Spectrum, then run the cartridge code.
This code runs from a flash memory chip on my little interface that adds the cartridge port. I still program 'old school', using an assembler on the SAM itself. (COMET Assembler), none of this modern PC cross-assembler m'larky

Colin.
This is the most recent piece of Z80 assembly programming I've done in a couple of years, for a project that combines both hardware and software - to make an interface on the SAM Coupe that let's it run ZX ROM Cartridges that were produced way back in 1983 for the ZX Spectrum.
The ROM Cartridges were an ill-fated idea by Sinclair Research, with only 10 commercial titles produced on cartridge in 1983. An extra interface was required for your ZX Spectrum to use it and although the port was added to 4 (I think) different interfaces from several companies it really did not take off, however the cartridges are a bit of a curiosity which is why I wanted to add support to the SAM.

What my code does is display a splash screen so you can select how to run the ROM cartridge - either directly, where the SAM will access it as uncontended memory at it's full 6MHz speed, or copy the cartridge to RAM and run it from there (as we're in the ZX Spectrum screen mode - MODE 1 - there's extra contention automatically added to slow the Z80 down closer to the speed of a ZX Spectrum, it works out about 3.8MHz).
The title screen is using some tricks, I use the line interrupt register to trigger interrupts at various vertical points on the screen display to change some of the palette colours. This achieves a border effect for the colour strips at different positions in the left and right border areas, as well as cycling the colours on the selected option on screen to create the multicoloured thin stripes, which scroll upwards a pixel every frame.

Once selected it'll clear the screen, set up the memory, palette and screen mode to configure the SAM to effectively be like a ZX Spectrum, then run the cartridge code.
This code runs from a flash memory chip on my little interface that adds the cartridge port. I still program 'old school', using an assembler on the SAM itself. (COMET Assembler), none of this modern PC cross-assembler m'larky


Colin.