visrealm Posted June 7 Share Posted June 7 (edited) Hi all, Very excited to share a quick video showing off my new project. A drop-in replacement for the TMS9918A using a $4 Raspberry Pi Pico. So chuffed with this, I had to record a quick-and-dirty video (I'm puffing a bit due to the excitement). Here's the (unlisted) video recorded just after the first power-on. The hardware supports 12-bit VGA. Although, currently, I'm only implementing the original TMS9918A, I could certainly look into implementing some F18A features in the future. As always, I'll be sharing all source code and details on GitHub soon enough. If you're interested in this, you can follow me there: https://github.com/visrealm Cheers! Compatibile devices (Tested on as at 2024-09-15) Texas Instruments TI-99/4A (NTSC and PAL) Texas Instruments TI-99/4QI ColecoVision (NTSC and PAL) Coleco ADAM (NTSC) MSX Casio PV-7 Toshiba HX-21 NABU Personal Computer Powertran Cortex Sega SC-3000 Sord M5 Tomy Pyuuta Homebrews: Troy Schrapel's HBC-56 Stuart Connor's TM990 John Winans' Z80-Retro Incompatibile devices None (so far) Update 2024-06-10 GitHub repository for this project is now public: https://github.com/visrealm/pico9918 Here's a full run-through of the awesome "Don't mess with Texas" mega demo with the PICO9918 v0.2 prototype in my TI-99/4A. Update 2024-06-11 Had a number of people asking about 80 column mode support, so I thought I should give that a go: Update 2024-06-25 I have just released the Gerbers for the PICO9918 PCB v0.3. I've been running tests continuously for a week or so on this revision and it is working great. I've been thinking about how to go about getting this tested on more machines as I've only tested on two TI-99/4A's (PAL and NTSC) and my HBC-56. I might produce a few of these to send out to those who are willing and able to try it on a wider range of machines. Let me know if you're interested in this. Note: This PCB revision is not representative of the final release which will be a single board without the need to the piggy-backed Pi Pico board. However, v0.3 is fully functional. If you're a tinkerer or early-adopter type, go ahead and give it a go. If not, I suggest waiting. Update 2024-07-12 PCBs for v0.4 (the single board RP2040 version) have arrived. Still waiting on parts to assemble the first board. Given these are my first PCB using an RP2040 directly, I won't be too surprised if there are issues. In other news, I've been busy working to improve the read response time. My v0.3.0 firmware has a read request response time of ~200ns. This is out of spec for the TMS9918A's published 150ns max response time, but works perfectly fine on a TI-99 due to it using the very slow GROMCLK. I spent a long time trying to get this number down, but couldn't using the GPIO interrupt method I was using. So, decided to change the approach to use PIOs to handle the VDP <-> CPU interface instead. The results are seriously impressive. I've had to run the PIOs are quarter speed to get within spec of the real chip. Update 2024-07-18 Forum member @aotta built his own PICO9918 v0.3 from the published Gerbers and tested on his Colecovision. Update 2024-07-20 PICO9918 v0.4 PCB (single-board with integrated RP2040) tested and working: Update 2024-08-19 PICO9918 v1.0 boards have arrived! These will be made available for purchase soon. Update 2024-08-23 The first batch of PICO9918's are ready for sale. Check them out on Tindie: PICO9918 from Troy Schrapel on Tindie or from Arcade Shopper. Update 2024-09-08 Work on supporting more F18A features is well under way with @JasonACT having written the TMS9900 GPU core in Arm (Thumb) assembly and @visrealm working on the rendering. Here's a short demo video showing the F18A support progress to date. Edited September 18 by visrealm 20 8 Quote Link to comment Share on other sites More sharing options...
Hans23 Posted June 7 Share Posted June 7 This is awesome, congratulations! Would you share the hardware description, i.e. how the Pico needs to be wired up? Did you try doing away without level converters? The Pico is not officially 5V tolerant, but inofficially said to work just fine with getting 5V inputs. 1 Quote Link to comment Share on other sites More sharing options...
visrealm Posted June 7 Author Share Posted June 7 6 minutes ago, Hans23 said: This is awesome, congratulations! Would you share the hardware description, i.e. how the Pico needs to be wired up? Did you try doing away without level converters? The Pico is not officially 5V tolerant, but inofficially said to work just fine with getting 5V inputs. Thanks, Hans. To be on the safe side and ensure compatibility, I am using level shifting logic. For dedicated inputs (CSW, CSR, MODE), I'm just using a 74LVC245 transceiver. These are 3.3V, but have 5V tolerant inputs. For dedicated outputs (INT, GROMCLK and CPUCLK) I'm using a 74HC08 (I needed the and gate for something else anyway) and driving its inputs with the Pico's 3.3V IO signals - that works fine and the outputs are 5V. For I/O lines (CD0-7), I'm using [Pico <-> 74LVC245 <-> 74HC245 <-> the outside world ]. All up, there are 4 ICs. I haven't tried without. I think for the cost of a few 74-series ICs, it's worth doing it right. 5 Quote Link to comment Share on other sites More sharing options...
artrag Posted June 7 Share Posted June 7 How nice! I love this kind of perversions 😁 You could easily emulate the whole TI99/4a in the same board😝 3 Quote Link to comment Share on other sites More sharing options...
visrealm Posted June 7 Author Share Posted June 7 1 minute ago, artrag said: How nice! I love this kind of perversions 😁 You could easily emulate the whole TI99/4a in the same board😝 That's actually how this idea started. I used a Pi Pico to emulate my homebrew computer which is a 4MHz 65C02 + TMS9918A + dual AY-3-8910 audio. visrealm/pico-56: The HBC-56 (65C02/TMS9918A/AY-3-8910 retro computer) fully emulated on a Raspberry Pi Pico (github.com) Then I thought... I bet I could just use my TMS9918A library and create a replacement TMS9918A. Sure enough... turns out I could 8 1 Quote Link to comment Share on other sites More sharing options...
Gary from OPA Posted June 7 Share Posted June 7 Good job. Looking forward to seeing more info. This could work on the Colecovision ADAM and MSX and NABU systems as well. 5 Quote Link to comment Share on other sites More sharing options...
Duewester Posted June 7 Share Posted June 7 The Pico is such an awesome piece of kit, I have several running vga output and have wondered at the logistics of making it a 9918 replacement. And boom! Here it is. This is so awesome. Now, somebody needs to get started on making a keyboard interface with one. 6 Quote Link to comment Share on other sites More sharing options...
visrealm Posted June 7 Author Share Posted June 7 Thanks all! Thought I'd give it something decent to chew on. Here's my PICO9918 running the "Don't mess with Texas" mega demo by Desire. Very happy with this result. Cheers 11 1 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted June 7 Share Posted June 7 This is awesome. I like that the code is written in C, making it reachable to people without FPGA knowledge. Maybe I could make my own F18A with more RAM? How much of the Pico's internal RAM are you using? 3 Quote Link to comment Share on other sites More sharing options...
visrealm Posted June 7 Author Share Posted June 7 39 minutes ago, Asmusr said: This is awesome. I like that the code is written in C, making it reachable to people without FPGA knowledge. Maybe I could make my own F18A with more RAM? How much of the Pico's internal RAM are you using? I'll likely add support for F18A-like features soon. Currently using very little RAM. Primarily the 16KB VRAM and 1KB for 2x 16bit scanline buffers. Plus some performance critical code. Bugger all. 3 Quote Link to comment Share on other sites More sharing options...
Gary from OPA Posted June 7 Share Posted June 7 (edited) I wonder if possible v9938 features could be done. Is there enough ram for 192k? Could performance be increased if need be by writing more code in assembly? What about using one of the newer Pico that have a HDMI output available, I think it does 320 resolution at least. At least first thing would be nice to add is basic 80 column mode like how the f18a does it. That shouldn't be too hard and still keeps it within the 16kb vram as well and not really any need for added vdp registers either. Finally, have you also added the undocumented 9918 modes that are explained in the Karl technical papers like the half bitmap mode? Edited June 7 by Gary from OPA 6 Quote Link to comment Share on other sites More sharing options...
jrhodes Posted June 7 Share Posted June 7 (edited) 12 hours ago, artrag said: How nice! I love this kind of perversions 😁 You see, i knew we were a bunch of perverts around here , gotta indulge those retro kinks! Edited June 7 by jrhodes 2 Quote Link to comment Share on other sites More sharing options...
visrealm Posted June 8 Author Share Posted June 8 8 hours ago, Gary from OPA said: I wonder if possible v9938 features could be done. Is there enough ram for 192k? Could performance be increased if need be by writing more code in assembly? What about using one of the newer Pico that have a HDMI output available, I think it does 320 resolution at least. At least first thing would be nice to add is basic 80 column mode like how the f18a does it. That shouldn't be too hard and still keeps it within the 16kb vram as well and not really any need for added vdp registers either. Finally, have you also added the undocumented 9918 modes that are explained in the Karl technical papers like the half bitmap mode? The Pi Pico has 264KB of RAM, so I think 192K could be do-able... Just. Depends how much code we need in RAM. Assembly might help, but GCC is pretty darn good at generating ARM assembly for the RP2040. Performance could certainly be improved by making my TMS9918 library more Pi Pico friendly. Currently, it's quite generic and was originally written for my Desktop homebrew computer emulator. Later ported to Web (WASM), then the Pico with very few actual code changes, so wasn't designed with embedded systems in mind. My Pi Pico VGA implementation (written from scratch as well) has been tested up to 1024x768. I find for the TMS9918A, 640x480 works well with doubled pixels - 800x600 also works really well with tripled pixels, resulting in a slightly smaller border. I haven't looked into the DVI/HDMI output options yet. 80 column text would certainly be doable. Other F18A features could also be added relatively easily. Not sure about the virtual 9900 "GPU" - I haven't looked into the 9900 that much yet and have so far written all of my emulation libraries myself to gain a deeper understanding of whatever it is I'm emulating. I haven't added support for the undocumented display modes. 5 Quote Link to comment Share on other sites More sharing options...
visrealm Posted June 8 Author Share Posted June 8 Hmm. I'm unable to edit the original post... But for anyone interested, here's the initial GitHub repo: visrealm/pico9918: A replacement for a TMS9918/TMS9929 powered by a Raspberry Pi Pico with VGA output (github.com) 3 2 Quote Link to comment Share on other sites More sharing options...
Gary from OPA Posted June 8 Share Posted June 8 32 minutes ago, visrealm said: Hmm. I'm unable to edit the original post... But for anyone interested, here's the initial GitHub repo: visrealm/pico9918: A replacement for a TMS9918/TMS9929 powered by a Raspberry Pi Pico with VGA output (github.com) If you get a moderator to move this thread into the sub forum for development work then you should be able to edit the first post at any time. 2 1 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted June 8 Share Posted June 8 13 hours ago, Gary from OPA said: Finally, have you also added the undocumented 9918 modes that are explained in the Karl technical papers like the half bitmap mode? Half bitmap mode is obtained by address masking, and that seems to work fine on the PICO9918 since the megademo is running. The undocumented modes are bitmap-text mode, bitmap-multicolor mode, and the illegal text-multicolor mode. I haven't seen any software using either of those modes. 5 Quote Link to comment Share on other sites More sharing options...
visrealm Posted June 8 Author Share Posted June 8 23 hours ago, Hans23 said: This is awesome, congratulations! Would you share the hardware description, i.e. how the Pico needs to be wired up? Did you try doing away without level converters? The Pico is not officially 5V tolerant, but inofficially said to work just fine with getting 5V inputs. The schematic is now available in my repo: pico9918/pcb/schematic_v0_3.png at master · visrealm/pico9918 (github.com) Added here too: 3 1 Quote Link to comment Share on other sites More sharing options...
visrealm Posted June 8 Author Share Posted June 8 3 minutes ago, Asmusr said: Half bitmap mode is obtained by address masking, and that seems to work fine on the PICO9918 since the megademo is running. The undocumented modes are bitmap-text mode, bitmap-multicolor mode, and the illegal text-multicolor mode. I haven't seen any software using either of those modes. Thanks, Rasmus I was actually a little surprised the entire megademo worked. My TMS9918A library hasn't really had much of a workout before that, given I've only ever used it for my homebrew HBC-56 which has relatively basic software. 2 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted June 8 Share Posted June 8 (edited) 7 hours ago, Asmusr said: Half bitmap mode is obtained by address masking, and that seems to work fine on the PICO9918 since the megademo is running. The undocumented modes are bitmap-text mode, bitmap-multicolor mode, and the illegal text-multicolor mode. I haven't seen any software using either of those modes. TI Forth and all of the fbForths have two bitmap-text modes: SPLIT (bottom third of screen is text—used by the 64-column editor) and SPLIT2 (top sixth of screen is text). [Note: As explained by @Asmusr in a post below, these two modes are manipulations of the bitmap mode rather than using both text and bitmap modes simultaneously.] ...lee Edited June 8 by Lee Stewart correction 2 Quote Link to comment Share on other sites More sharing options...
visrealm Posted June 8 Author Share Posted June 8 2 hours ago, Lee Stewart said: TI Forth and all of the fbForths have two bitmap-text modes: SPLIT (bottom third of screen is text—used by the 64-column editor) and SPLIT2 (top sixth of screen is text). ...lee Changing display modes mid-frame is no problem. The megademo shows that. 2 Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted June 8 Share Posted June 8 Still somewhat partial to using COMPOSITE video... ...with these little, 12 volt, 1080i, monitors. Quote Link to comment Share on other sites More sharing options...
Asmusr Posted June 8 Share Posted June 8 2 hours ago, Lee Stewart said: TI Forth and all of the fbForths have two bitmap-text modes: SPLIT (bottom third of screen is text—used by the 64-column editor) and SPLIT2 (top sixth of screen is text). ...lee Isn't that just bitmap mode where you arrange the name table (screen image table) for drawing bitmap graphics on part of the screen and text on another? The undocumented bitmap-text mode is obtained by enabling bitmap mode and text mode at the same time. You get a mode where you can draw different, monochrome, 6-pixels wide characters anywhere on the screen. This would save some VDP RAM if you want to draw bitmap graphics but don't need the colors, put the calculation of pixel addresses with 6-pixels wide characters is more complicated. 3 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted June 8 Share Posted June 8 1 hour ago, Asmusr said: Isn't that just bitmap mode where you arrange the name table (screen image table) for drawing bitmap graphics on part of the screen and text on another? Indeed, it is. ...lee 1 Quote Link to comment Share on other sites More sharing options...
artrag Posted June 8 Share Posted June 8 11 hours ago, Asmusr said: Half bitmap mode is obtained by address masking, and that seems to work fine on the PICO9918 since the megademo is running. The undocumented modes are bitmap-text mode, bitmap-multicolor mode, and the illegal text-multicolor mode. I haven't seen any software using either of those modes. https://www.unige.ch/medecine/nouspikel/ti99/tms9918a.htm#Illegal modes Quote Link to comment Share on other sites More sharing options...
visrealm Posted June 10 Author Share Posted June 10 On 6/8/2024 at 3:46 PM, Gary from OPA said: If you get a moderator to move this thread into the sub forum for development work then you should be able to edit the first post at any time. I think I should do this. How do I find a moderator? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.