Shop OBEX P1 Docs P2 Docs Learn Events
TMS9918 Video chip implemented in FPGA w/VGA out — Parallax Forums

TMS9918 Video chip implemented in FPGA w/VGA out

avsa242avsa242 Posts: 454
edited 2012-02-13 09:05 in Propeller 1
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

Comments

  • Pharseid380Pharseid380 Posts: 26
    edited 2012-02-12 12:23
    I had a TI 99 which used that chip back in the day. As opposed to the integer-only BASIC's which were common back then, it had a floating point only BASIC. If I remember correctly, without memory expansion, it stored its programs in video memory. Despite all that, it was fairly fast, I remember being disappointed when I "upgraded" to my first PC.

    -phar
  • Ahle2Ahle2 Posts: 1,179
    edited 2012-02-12 13:31
    Digimorf is working on a SC-3000 emulator for the Propeller C3 platform.
    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
  • potatoheadpotatohead Posts: 10,261
    edited 2012-02-12 13:35
    A single COG? That will be a very sweet driver, if he does that.

    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.
  • Ahle2Ahle2 Posts: 1,179
    edited 2012-02-12 13:56
    Well, two cogs if you count the "el pixel pusher diente"! :)
  • Matthew HagertyMatthew Hagerty Posts: 8
    edited 2012-02-12 17:11
    I actually started the implementation using a propeller chip! I have a handful of them sitting on my bench right now. I bought them at the same time as my FPGA devboard and I guess I started messing with the FPGA first. Right now I am very interested in the hardware side, and rather disenchanted with software for the first time since 1983...

    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
  • whickerwhicker Posts: 749
    edited 2012-02-12 22:01
    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).
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2012-02-13 02:45
    I was given a TI-99 back in the nineties and looked forwards to the power of a 16 bit proc, but I was shocked at how slow it was. That was compared to Z80 stuff I had too. I think I ended up gutting it and building a Basic52 (8052) board into the case. It was about the same throughput and did what I wanted, but without the pretty colours.

    Emulating a 9918 would be good so that a bit more retro could be had.
  • LeonLeon Posts: 7,620
    edited 2012-02-13 03:02
    I was involved in a project once that used the TI 9995 (similar to the chip used in the TI-99 but intended for embedded applications), with three of them operating in parallel connected to a Z80. The 9995s were used for number-crunching (one for each axis of a 3D optical tracking system) and the Z80 was used for I/O. The 9995 was the fastest thing we could find at the time for doing the 16-bit integer calculations that we required.
  • Matthew HagertyMatthew Hagerty Posts: 8
    edited 2012-02-13 08:53
    whicker wrote: »
    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.

    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.
    whicker wrote: »
    Does your hardware design still use and refresh the external DRAM, or is it all handled inside?

    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.
    whicker wrote: »
    Have any official schematics or block diagrams ever been released for the 9918A?

    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!
    whicker wrote: »
    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?

    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.
    whicker wrote: »
    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?

    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.
    whicker wrote: »
    Obviously you've tested the design a lot... Does it run Parsec?

    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.
    whicker wrote: »
    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).

    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.
  • Matthew HagertyMatthew Hagerty Posts: 8
    edited 2012-02-13 08:58
    I was given a TI-99 back in the nineties and looked forwards to the power of a 16 bit proc, but I was shocked at how slow it was.

    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.)
  • Ahle2Ahle2 Posts: 1,179
    edited 2012-02-13 09:05
    Here is an interesting comparison of different old computers graphics capabilities.
    http://en.wikipedia.org/wiki/List_of_8-bit_computer_hardware_palettes



Sign In or Register to comment.