A breakthrough, leading to more demos running

A project log for Emulated TMS9918A using RP2040/DVI

An attempt to make an RC2014 module that emulates the TMS chip, with crisp DVI output and some additional RC2014 functionality

shiela-dixonShiela Dixon 08/10/2023 at 21:540 Comments

It's been a while since I made any progress hardware-wise. I've spent a lot of time recently doing bits and pieces of other things while waiting for components for the latest version of the video board.  Components that were actually sitting in my cart and not checked out! D'oh!

Anyway, now in possession of the latest version of the board and the components to populate it, naturally it didn't work and I had to do some troubleshooting and bodging. 

But long story short, it now works, and my scheme to implement the status register (or at least one bit of it) has worked!

The TMS chip has several registers but only one can be read, the status register. One bit is very important, it's set when the picture reaches the vertical blank, and is reset when the register is read. 

This is very useful. J B Langston's library contains a TmsProbe function which detects a TMS video card and by reading this register (a read to reset the bit, then a wait, then a read again to see whether it's been set).  Many programs use this for timing and to make sure that they do the drawing in the vertical blank.

Implementing this register (or at least that particular bit) is thus very important. (Incidentally, the rest of the register has to do with sprite collision and the 'fifth sprite', ie indicating whether more than four sprites appear on a single scanline, and if so, the number of the fifth.)

I haven't managed to make a RP2040 respond quickly enough to a port read on a 7Mhz computer, so a bit of logic is required. 

Happily that's working (after a spell of several other projects not working, this took me by surprise) and so I can now run a number of the RC2014 TMS examples, if not all of them. 

Here is the plasma demo (by J B Langston, based on a Petscii version by Cruzer/Camelot) running perfectly and looking sharper than I've seen it before. 

.. and here's the Nyan Cat demo. This uses the status register for the timing and to make sure the drawing is done in the vblank, so now this is nice and solid (which it wasn't when I ran this before using simple delays).