TMS9918 Video chip implemented in FPGA w/VGA out
avsa242
Posts: 454
Not sure if anyone else reads slashdot but thought others might find this particular article interesting, given the fascination (I share it!) with implementing retro video or audio chips, or sometimes a system in its entirety:
http://hardware.slashdot.org/story/12/02/11/2035226/tms9918a-retro-video-chip-reimplemented-in-fpga-with-vga-out
I can't personally recommend the commentary on slashdot itself (I find the discussions there be among the most hostile or at least adolescent on the internet), rather the links provided in the article.
It instantly reminded me of some of the talented people here who have implemented many old sound synths in software on the prop, and video drivers to emulate or resemble retro computers or game consoles. I couldn't help but think that someone here would be able to accomplish this very same thing on a propeller (or a work-alike).
Anyways, thought maybe someone that used to own or still owns one of the systems that uses this chip might be interested.
Cheers,
Jesse
http://hardware.slashdot.org/story/12/02/11/2035226/tms9918a-retro-video-chip-reimplemented-in-fpga-with-vga-out
I can't personally recommend the commentary on slashdot itself (I find the discussions there be among the most hostile or at least adolescent on the internet), rather the links provided in the article.
It instantly reminded me of some of the talented people here who have implemented many old sound synths in software on the prop, and video drivers to emulate or resemble retro computers or game consoles. I couldn't help but think that someone here would be able to accomplish this very same thing on a propeller (or a work-alike).
Anyways, thought maybe someone that used to own or still owns one of the systems that uses this chip might be interested.
Cheers,
Jesse
Comments
-phar
http://forums.parallax.com/showthread.php?131793-C3-platform-emulation-fan-site&highlight=c3+emulation
He has already got a partly working TMS9918 emulation running. I think he will be able to squeeze it into a single cog with sprites.
/Johannes
Our friend Coley tossed out a quick comment on Atari Age. The discussion there is linked from /. and is recommended, if you are curious about how it came about.
I appreciate being mentioned here, and if anyone wants to discuss anything about the 9918A VDP, just let me know. I don't think I could do the design in 1 cog though, or even 2, but I have not messed with the propeller enough to speak intelligently about it.
Matthew
Granted the TI-99/4a was being produced before I was born, but this was the first computer that the grandparents deemed "safe" for me to use.
So I've logged a lot of hours staring at the graphics output...
One simple question is the colors... is there any rhyme or reason to the color palette index (0-15) versus the color shown onscreen?
I've never put too much thought into it and just looked up the colors from a table.
Does your hardware design still use and refresh the external DRAM, or is it all handled inside?
Have any official schematics or block diagrams ever been released for the 9918A?
Did anything about the 9918A jump out as "clever" or amazing... sort of an a-ha, so that's why they did what they did sort of thing? Is there a lot of magic going on, or is it kind of brain-dead simple?
Is there any sort of tricks like changing the video mode mid-scan or changing colors or sprite indexes or something that you've come across in your testing?
Obviously you've tested the design a lot... Does it run Parsec? Do you think you could get the NTSC rainbowing working? (kind of a joke, but kind of serious... sometimes the imperfection is what makes it memorable).
Emulating a 9918 would be good so that a bit more retro could be had.
I believe the colors were chosen to do some basic shading. You will notice there are 3 shares of red, and two of most others. If you look at the Konami games for the MSX1, you can really see how far you can take this. I never liked or understood the 9918A palette until I saw the Konami games. I still don't like the palette, but it is impressive what can be done with it.
No, the original DRAM goes unused. I use the FPGA's internal block RAM for everything. This was simpler and faster, and allowed me more flexibility.
The TI TMS9918A (making sure you didn't mean F18A)? Absolutely. TI's datasheet is generally available all over the Internet. There is a ton 3rd part info too, and Karl Guttag (on of the original designers of the 9918A) gave me an interview and answered pretty much all of my questions about the 9918A. It was really cool to talk to him!
Oh yeah, tons of "ah ha" moments. And sadly, no one to share them with. Doing stuff like this seems to be a very isolated kind of thing. I really enjoy the hardware side of things now, more than software, and it is very neat to work through a problem like that and come to the same realizations that the original designers did. I can see how and why they did a lot of things they did, and why things work the way they do.
I don't know about brain-dead simple. It is all very simple at a low level, working with flip-flop and gates, but you build those up in to rather complicated systems. Really the hardest thing, at least for me, is timing. It is *always* timing. And one of the coolest things is how everything is happening in parallel. It really gives you a different perspective on things that is totally different than programming. Programming is linear, even with multiple cores and such these days, it is still only parallel at a macro level (i.e. threads and such). FPGA and hardware circuits are parallel at the micro level, and to me you get a lot more out of it that way. I think software design could take a few lessons from gate-level hardware design.
Not really with the 9918A. The systems that it was used in were not generally fast enough to take advantage of those sorts of tricks, and those that were had to guess at it since the 9918A did not have any scanline interrupt output. You get a frame interrupt, that's pretty much it. I'm not saying it can't be done though, I'm sure there are examples of software out there that use such tricks.
Of course. :-) Parsec was one of the first games I tested. Personally I don't really like it though, and games like Popeye and Pacman push the VDP harder. And on the MSX1, almost all the games they have blow away anything the 99/4A ever hard. Sadly, TI killed their own system with their software policies.
It was on my list, and I even have some pads on the board for support components (external transistor, etc.), however, it is too complicated. I *know* analog electronics, but that is a lot different than *designing* analog electronics. There is a bit of voodoo in there, and experience goes a LONG way IMO. I thought it would be cool to have the F18A put out the original NTSC signal as well as the VGA, but after 3 weeks of just trying to get the output signal levels right, I gave up. Not to mention the totally different timing requirements would have complicated the HDL.
The BASIC and Extended BASIC (XB) on the 99/4A were written in GPL (not related to anything modern), which was an internal interpreted language on the 99/4A. So, BASIC and XB were *double* interpreted, which made them the slowest in the industry. Sadly, TI managed to take a fast 16-bit CPU and cripple it over and over in the 99/4A design. To get any kind of speed from the 99/4A you really had to use assembly (which was the second computer language I learned.)
http://en.wikipedia.org/wiki/List_of_8-bit_computer_hardware_palettes