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:
- RGB /composite Sync, can drive Euro Scart input on the TV with this cable,
- industry standard VGA mode (compatible with 640x480, timing-wise).
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)
- Attiila Grósz who I worked with on the Primo Emulators before
- Gábor Orvos, who pushed (and inspired) me to implement this core on the MiST
Links and references:
[Home | FPGA development]