Jump to content
IGNORED

FPGA (VHDL) Source Code for V9938 Released


Gary from OPA

Recommended Posts

I know we have F18A and he busy working on MK2, but this has recently been released, it was originally for MSX, its complete reproduction of Yamaha V9938 chip in FPGA (VHDL) logic.

But, always nice to have options to use for other projects. :)

 

Quote

ESE-VDP (FPGA implementation of YAMAHA V9938)

It was made for 1-chip MSX when I was in my 20s. I publish this source code for the purpose of my memory.

License

This repository is published under CC BY-NC (Creative Commons Attribution-NonCommercial 4.0 International Public License).

本リポジトリはクリエイティブコモンズの CC BY-NC ライセンスの元に公開します。

Copyright

Copyright (C) 2000-2020 Kunihiko Ohnaka All rights reserved.

Source: --> https://github.com/kunichiko/ese-vdp

 

 

 

  • Like 7
  • Thanks 1
Link to comment
Share on other sites

48 minutes ago, Asmusr said:

Can it generate HDMI output without the need for a license? ?

hdmi output all based on other components on your fpga board. -- depends on what you going to use to place this code inside, if you going to develop your own fpga board, no you will need to buy a license, sadly nothing you can do around that it comes to about $25 per device when you do small production quality. -- if you use an existing fpga development board, which already had hdmi port on it, then that license is already been paid and part of the cost of the board when you buy it, one of reasons things like MistFPGA and other products are costly, that part of cost is buried in price tag.

 

but there is ways around it, using an existing adapter, or something that converts, its not the end of world except for those sadly with newer tv's which no longer have vga or dvi ports.

 

but besides hdmi, its good to have fpga source base that has true 9938 functions allowing all programs to work, and then you can expand from there adding in newer functions and modes.

  • Like 3
Link to comment
Share on other sites

Right, sorry, I was just trying to point out that the VHDL code is probably the least of Matthew's worries in the F18A MK2 project. Building new V9938 board for the PEB with modern video output would be cool. But as a drop in replacement for the 9918A, a v9938 wouldn't work, right, because the pin-out is very different?

  • Like 2
Link to comment
Share on other sites

11 minutes ago, Asmusr said:

Right, sorry, I was just trying to point out that the VHDL code is probably the least of Matthew's worries in the F18A MK2 project. Building new V9938 board for the PEB with modern video output would be cool. But as a drop in replacement for the 9918A, a v9938 wouldn't work, right, because the pin-out is very different?

the pin-out of real v9938 itself is different yes, but a drop-in replacement was already done by us back in the day the TI-Image-Maker fitted a v9958 with 192k ram and RGB output all within a small board that fitted into 9918a socket.

 

having the VHDL code just helps cut down development time for either Matthew if he looks at it, or for others that want to think about making their own version, or for porting the code over to other existing FPGA development boards for their own research or study, or other products, even things like the Geneve 2020 could make use of this code now in its overall design.

 

Just nice to see available to study. i plan myself to start working on few fpga projects once i finish rebuilding my own ti99 real iron equipment, i waiting for couple fully stocked PEB's to clear customs, but now with this covid problems, customs only clearing medical and food supplies, so my first parcel of 41 pounds of ti99 equipment still sitting on the dock since march 9th, sad as i wanted to do some coding, and now we in 25 day lockdown and i am bored to hell, coding would have kept me busy, but no matter i just ranting on now, in the meantime, my brain is thinking and i am researching info on 'net and coming across cool things like this project that got released earlier today! :)

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

33 minutes ago, Asmusr said:

Right, sorry, I was just trying to point out that the VHDL code is probably the least of Matthew's worries in the F18A MK2 project. Building new V9938 board for the PEB with modern video output would be cool. But as a drop in replacement for the 9918A, a v9938 wouldn't work, right, because the pin-out is very different?

It could be done similar to Gary's TIM design I would think.

Link to comment
Share on other sites

Putting a 9938 into any system designed for a 9918A will require some form of wires, cutting, soldering, extra chips, etc.  That has proven to be a non-starter for a lot of users, and if you have those skills you don't need to wait for anyone else to create a solution (you just hack it up yourself).  If I just wanted to create the F18A for myself, it would have been done a long time ago and been 100x easier.  Moving from something you do for yourself, to making a product people can buy and "just plug-in" and expect it to "just work" is something else entirely.  I'm already worried about the single audio-input wire people are going to have to do themselves on the MK2.

 

2 hours ago, Gary from OPA said:

... having the VHDL code just helps cut down development time for either Matthew if he looks at it, or for others that want to think about making their own version, ...

It does not help me really, I won't use anyone else's HDL for a few reasons.  Most HDL comes with a license that is not compatible with me or my projects.  Also, I find a lot of HDL for retro systems is not very well written, documented, or organized, and I'm surprised a lot of it even works.  A lot of what I have seen was definitely written from a "software" perspective, it is very hard to follow sometimes, and would not work if you tried to use it in a design where you were using a faster internal clock to implement more features and capability.  I find it very similar to the BASIC programs from BITD, all hacked together however necessary just to get things working.  Everyone is learning, and the HDL shows it.

 

Hardware != software, and approaching hardware with a software mindset will end in frustration, or at least very limited designs.  I made this mistake when I was learning HDL when I started the F18A back in 2011 and 2012.

 

2 hours ago, Gary from OPA said:

Just nice to see available to study.

Maybe, but the datasheet tells you most of what you need to know to do the hardware.  Video chips are pretty straight forward and they all do things the same way, mostly.

 

2 hours ago, Gary from OPA said:

... i plan myself to start working on few fpga projects once i finish rebuilding my own ti99 real iron equipment,

Very cool, go for it!  I'm more than happy to discuss anything related to the HDL, FPGAs, or otherwise.

 

My personal hang-up with the 9938 is not a lack of reference or anything like that, it is that the chip is a big hack.  The way features were crammed into the design, all the modes (ugh, modes, I hate modes...), etc., such a PITA to fuss with.  Modes are the worse since they mess with the all the video timing, and you don't have the luxury of letting the monitor change frequencies / resolutions, so you are essentially having to do video conversion as well.  Stack the lack of existing software on top of that and it just becomes frustrating to even think about working on.

 

If all anyone really wants is a stock 9938, then just get the real IC and stick it on a PCB with one of Analog Devices's converter ICs (they make a lot of nice video-converter ICs), and you should be all set.  Or just get an external video converter and stuff it in a box.  You don't need to mess with an FPGA solution to make this happen.  I also find it hard to believe that the skills to do PCB design and layout put me in a small limited group of people.  Anyone willing to put forth the time, effort, and patience can make boards and hardware.  KiCAD and OSHpark are awesome.

 

There are already ICs out there that do all the conversion and such, but they are physically large and do not fit into something like a DIP-40 package to nicely replace a legacy IC.  That is really one of the main driving forces behind the MK2.  I would *love* to be able to just use an external IC for the video conversion / generation, etc.

 

I do also have two other personal projects where I need the MK2, and one of them is my MSX2 computer.  So, some sort of 9938 functionality is probably in my future. ?  I just don't know if I can work it in with the F18A's enhancements, in a compatible way, without going crazy.

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

25 minutes ago, matthew180 said:

Very cool, go for it!  I'm more than happy to discuss anything related to the HDL, FPGAs, or otherwise.

 

I do also have two other personal projects where I need the MK2, and one of them is my MSX2 computer.  So, some sort of 9938 functionality is probably in my future. ?  I just don't know if I can work it in with the F18A's enhancements, in a compatible way, without going crazy.

 

Many thanks for your detailed reply. -- when the time comes i will discuss some things with you.

 

i love the MSX also, and big fan of their improvements and amazing projects they have done, i used to own many msx and msx2 computers, and even bought a few v9990 chips from yamaha but never got around to using them when things crashed down for everyone in late 90s.

 

You are right the v9938 is mess of new modes and such, and most of them were never really used on the ti99 anyway, but it would be nice to see, but you right a original chip with good converter could work too just would never fit within the 40pin dip that is for sure.

Link to comment
Share on other sites

just hearing about the V9938 core, I think it’s nice, because I still have warm fuzzies from the late 80s programming it. But:
 

 

Geneve2020 is intended to use real chips wherever feasible. I just got the complete soldered 9958 board back from my technician (Amanda.) 

 

But Geneve2020 will also  have an option to plug in an F18A, because that’s the new coolness and I want it to ship with an F18A only game. It will support at least two VDPs (I’m reserving 4x 8-bit bus ids for VDP) 

 

 


I’m using the FPGA only for memory mapping for MDOS and GPL, and it will be Verilog because open source IceStorm. . Oh, also the DRAM controller.,  and 16 to 8 bit bus interfaces (speech, VDP, sound) and I already did digital audio mixing to the stereo DAC. ok, a few more things. 
 

Thanks for sharing the HDL. and also I’m always recalling your TIM and SOB (though I’ve never seen one.)

 


 


 

 

  • Like 3
Link to comment
Share on other sites

3 hours ago, FarmerPotato said:

have an option to plug in an F18A

FYI, the MK2 has both mode pins so it has the capability to support the 9938 host interface.

 

Pins 11-24, 33, 34, 37, and 38 are 9918A and 5V compliant.  The others you should leave disconnected if you don't have a 3.3V system (they are direct I/O to the FPGA).  If you want the MK2's audio input capability, then connect pin-1 to a 1Vp-p line-level audio signal.  Pin 39 is the direct DAC (audio) output, and if you provide a simple voltage-divider (two 10K resistors) and low-pass filter the signal will be ~1Vp-p line-level audio out.

mk2_pinout.png

  • Like 4
Link to comment
Share on other sites

1 hour ago, matthew180 said:

FYI, the MK2 has both mode pins so it has the capability to support the 9938 host interface.

 

Pins 11-24, 33, 34, 37, and 38 are 9918A and 5V compliant.  The others you should leave disconnected if you don't have a 3.3V system (they are direct I/O to the FPGA).  If you want the MK2's audio input capability, then connect pin-1 to a 1Vp-p line-level audio signal.  Pin 39 is the direct DAC (audio) output, and if you provide a simple voltage-divider (two 10K resistors) and low-pass filter the signal will be ~1Vp-p line-level audio out.

mk2_pinout.png

In the future, do you think the HDL could include an I2S block taking digital input on IO pins? This would be 3.3V of course.  
 

The Geneve2020 FPGA (ICE40HX4K) is using a CS4344 (or similar) for stereo D/A with I2S inputs. My Verilog mixes a final I2S stream from digital emulated 76489, other sound chips and (untested) TMS5220C speech. 


it’s exciting that the Mk2 will have audio processing. I’d like to figure out how to integrate that. 
 


 

 

  • Like 2
Link to comment
Share on other sites

I don't want to hijack this thread, we should probably move this to the MK2 or Geneve2020 thread.

 

Hmmm, I2C makes me sad.  For two wires they sure made the protocol overly complicated.  I prefer a nice easy SPI bus if I have to roll my own serial I/O, or when looking for ICs that use serial interfaces.  Hardware is already hard, always look for the simplest solutions.  That said, the extra I/O on the MK2 can be used for anything, so adding some SPI or I2C (if I absolutely have to) to the MK2 HDL is certainly possible.  The question is, what would it interface with internally, i.e. what would the interface be used for?

 

I was planning on adding an SPI implementation of the VDP's host interface to the MK2 so it could be used more easily with mircocontrollers (they all seem to be on a serial interface bandwagon these days).

 

For the MK2 I used the ADCS7476 12-bit 1-MSPS ADC to convert external audio to digital, and a DAC7311 12-bit DAC to create the line-out audio.  I also learned a *lot* about analog sections and noise.  When using ADCs and DACs routing and layout become critical, as well as your power supply (you need to create separate analog and digital power).

 

Both of those ICs have SPI interfaces and they are really easy to work with.  They are also small (a requirement for any component on the MK2), 5-pin devices in an SC70-6 and TSOT23-6 package, and cheap (about $5 for the pair).  Since 1-MSPS is way more than you need for audio, I only run them at about 223-KSPS so they use less power, and I can still be sure to capture the 50KHz capability of the original 76489. ;-)

 

Since the legacy audio will get converted to digital, it will be possible to mix the original audio with any additional audio processing added to the MK2.  I also decided to go with a DAC for the output just to keep things nice and clean and better quality.  Originally I was just generating output audio with PWM, and it worked, but the DAC certainly does a much nicer job and sounds better.

mk2_audio.png

  • Like 6
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...