10/17/2021 at 13:08 •
When I ordered the new PCB for Y Ddraig, I also ordered some additional expansion card PCBs. A couple of these I had made previously and just moved the design from Proteus to KiCAD and making a few changes to the design. Others were new boards and will be interesting to get up and running.
The boards are a mix of graphics, sound and peripheral devices. There's 3 graphics boards based on the TMS9918A, V9958 and the V9990 chips. Two sound boards based on the YM2151 and the YM2612 and some periperals boards for a floppy disk controller using the WD37C65C, Ethernet using the RTL8019AS and a joystick interface for Sega Megadrive (Genesis for the US) controllers.
One of the reasons I changed Y Ddraig from a single board computer to using expansion slots was to be able to experiment with some of these old chips and this is the first of many that I'm testing.
The first board I chose to start with was the TMS9918 video controller. While it's lacking in capability compared to some newer solutions, I wanted to try something with this chip as it was used in the Colecovision which I had a kid, a console that my brother and I spent many hours playing as kids. It was also used in
I chose to use the TMS9918A for this rather the TMS9929A PAL version as it directly outputs composite directly, and most TVs can handle NTSC these days.
The TMS9918A is capable of a 256x192 pixel display with a 15 colour palette. It has 16K of video memory and 4 different video modes.
From the Sega Retro site:
There are 4 different screen modes available in the TMS9918A (as mentioned before, the TMS9918 lacks mode Graphic II):
Mode 0 (Text): 40×24 characters monochrome. As the display is 256 pixels width, the character set is only 6 pixels wide. This mode doesn't support sprites, nor a separate border color setting.
Mode 1 (Graphic 1): 32×24 characters (256×192 bitmap), where for each 8 characters in the character set the foreground and background color can be set. The chars "0"-"7" for example all have the same attributes.
Mode 2 (Graphic 2): 32×24 characters (256×192 bitmap), with a 2-color limitation for each 8 pixel wide line inside a character.
Mode 3 (Multicolor): 64×48 mode, very blocky and rarely used. Each 'pixel' can have its own color defined though, hence the name. Its sprites still have the same resolution as in screen modes 1 and 2.
The TMS9918 has a fixed 16-color palette (actually 15 colors + transparent).
The TMS9918A was designed to use DRAM, but I have used the design by Leonardo Miliani that allows SRAM to be used instead.
Bring up the board went well in some ways but initially I had nothing on the composite output. Mistake on the footprint for the connector meant that the signal and ground were swapped. I made up a simple cable that swapped the signals and i managed to get a signal on the monitor.
I wrote a couple of simple test program just to make sure that the board was working correctly. One to write something to the screen in text mode and a simple test of the graphics mode.
It would be nice to get something better running on the board before I move on to the next one but at this point I can call it a success.
09/07/2021 at 15:26 •
There are 4 expansion slots on the board.
Each slot is using a 64-pin DIN 41612 connector. The connector supply data, address and some common bus signals as well as power to each of the boards.
There are also 2 select signals for each slot, all access for each slot is memory mapped on on the address bus.
One is a 256-byte range that is designed for register access or control and a 1-Megabyte range for accessing data. For example, on the VGA card the control of the card if done through the registers, but if needed direct access to the VRAM can be done through the data range.
The signals for the expansion slot are:
- Power supplies available are +5V, +3.3V, +12V -12V, GND and a +5V Standby voltage from the ATX power supply.
- D0 to D15 data lines.
- A1 to A19 address lines.
- Slot select signals CS_REG and CS_DATA.
- 68000 Bus signals AS, LDS, UDS, R/W, RESET, VMA, VPA and E.
- CPU clock.
- Presence detect signal, pulled low when board is connected to bus.
- Bus response signals.
- IRQ - Active low interrupt for each slot (1-3, no interrupt on slot 4).
- DTACK - Active low acknowledge for bus access.
- BERR - Bus error can be generated for illegal access.
09/01/2021 at 18:34 •
While I’ve been working on some different expansion card designs, some previously tested but all have been redesigned using KiCAD, so will post updates on them appropriately. One I have been working on and is now in a state I’m happy with is the VGA card.
The card is an FPGA based board. I’ve got a couple of boards in development that use some of the old (and fun) video chips, but I also wanted something that can be used with more modern displays.
I needed to find a suitable FPGA to use. BGA packages are common, but I’ve never designed for one of those, and when it comes to hand soldering QFP is much easier. For the design I picked the Spartan XC6SLX9 which is available in a QFP part. A few extra pins on the device would have been nicer but was a trade-off between using a BGA or something I could ed by hand.
The plan is to have a VDP that works in a similar manner to how some of the old Video chips worked. Most of the control of the video will be done through control registers and will allow setting of the screen mode, palette data and some hardware accelerated drawing functions. The board will 00also allow direct access to the Video RAM by the CPU so that data in RAM to give a bit of access on read-modify-write cycles.
- The board has 2 Megabytes of SRAM available which will be used as the Video RAM.
- The VGA output has 4-bits per colour available giving a total of 4096 colours.
- The video resolution is planned to be a “high-res” 640x480 mode and a “game” resolution of 320x240 which will still be output as 640x480.
- 80x30 text mode
- Hardware acceleration
- Line drawing
- Filled rectangles
- Bitmap mode with text overlay
These are still early days for the VGA card and there are more features planned. I’m also looking at a new version of the card using a Spartan-3 part which has a higher pin count. This will allow me to work around some of the limitations I encountered with the Sparten-6 and offer a higher colour depth as well.
I created a small demonstration video for the current capabilities of the card.