MiST Primo

Primo was a not-too-complex, but well designed Hungarian computer, a typical Z80 system with a Basic Interpreter, 16K ROM and 48K RAM. The video memory was located in the end of the RAM, taking 16K. The original hardware could display an image with the resolution 256x256, but the commercial versions did not use this, so only a 256x192 resolution was available. This is the as the Spectrum's resolution, but without colours. It was a monochome machine. The CPU was clocked with 2.5 MHz (a 3.75 MHz option was there, but not used)

Primo's peripherials were the keyboard, a one-bit sound and a tape interface. Everything was accessible via I/O ports (with Z80 in and out instructions). The NMI interrupt was generated by the video circuit, synchronized to the vertical retrace (at rate 50 Hz). The video output was a non-interlaced PAL video signal, 312 raster lines.

The MiST Primo version is the same as the original Primo A64. The SDRAM holds the ROM and the RAM of the Primo, while the video memory (16K) is inside the FPGA. The internal ram is a dual-port ram, so there is no memory contention when the CPU reads or writes this area. The original Primo was a monochome machine, but the FPGA version has 16 colours RGBI output. I have added some extra video modes to this version, but I don't think anyone would use those in the future. Nevertheless, the standard Primo mode 256x192 works well with selectable colours.
Foreground, background and border colour can be set by the keys F1, F2, F3.

The core supports two video outputs: In VGA mode there is scan doubling, but the number of generated scanlines are also changed in order to make the signal compatible with the VGA standard. Normally the Primo would generate 312 scanlines (at 50Hz frame-rate), but VGA works with 60Hz rate, and uses 525 scanlines. In the implementation 262 primo lines generated, doubled, so it will be 524 lines at the end. VGA monitors should be able to use this signal. (more likely than the 50Hz non-standard signals). The side effect is that the interrupt rate goes higher to 60Hz. So the machine will be a bit faster than the original. (Which happens anyway, as there is no memory contention during the video memory access)

For loading the Primo programs I use the MiST standard way, so in the OSD menu you can select a file and load into the memory. OSD menu can be open with key F12. For make things simpler for myself, I created a new file format called Primo Memory File, which is based on the original Primo SnapShot format. Extension is .PMF. The PMF file contains the 48K RAM of the Primo, plus the registers of the Z80 CPU (saved into the stack). This file will be always 49152+2 bytes then, having the memory and the value of the SP. (I wrote a small C# .NET app for the conversion.) The bottom line is that the MiST can load and use these files.

In the OSD menu you can load PMF files, send a RESET signal, and turn on Scanlines effect for the VGA output. This switch has no effect on the RGB/Scart mode of course.

Extra registers: (were not available on the original primo, but I implemented them in the FPGA version)
$D0
bit 3..0 : Color Register C2
bit 7..4 : Border Color Register 

$D1
bit 3..0 : Color Register C0 (paper)
bit 7..4 : Color Register C1 (ink)

$D2
bit 1..0 : Video Mode 
		00 - 256x192,mono 
		01 - 256x192 with 32x24 attributes 
		10 - 8 colors mode 
		11 - 320x200x4 mode

$F0 
YM2149 sound chip address register
$F1
YM2149 sound chip data register

$F7
bit 6..0 : Speaker volume
    bit 7: yellow LED

$F8
bit 7..0 : PAGE A (256x16K pages for memory bank at $4000)

$F9
bit 7..0 : PAGE B (256x16K pages for memory bank at $8000)

$FC
bit 1..0 : CPU speed 00/11-3.5MHz 01-7MHz 10-14MHz
bit    7 : LOCK (locks all extra ports till next reset)

Images:


My MiST on my desk (case open). The cheap programmer called USB Blaster also visible


A simple basic test program


A MiST OSD menu after primo booted


Game Astro Blaster running


Game Galaxy running


Downloads:
PRIMO.RBF
PRIMO.ROM
Some games

Thanks to:
Links and references:

[Home | FPGA development]