james1095

CVSD decoder

7 posts in this topic

While exploring video and pinball sound boards I came across the CVSD decoder used to play compressed speech samples in the early 80s. I found a fairly good explanation of how these work here

but I haven't found any existing HDL. Has anyone here experimented with this? Surely the tristate output and external capacitor that Jeri used could be implemented in the HDL producing an output to be fed to a DAC.

Share this post


Link to post
Share on other sites

i'm probably missing some important point here but the decoder is a lot simpler if you don't intend to replace an actual physical part.

mame sources (as usual for any extinct piece of hardware) have a good example in c 

https://github.com/mamedev/mame/blob/master/src/devices/sound/hc55516.cpp

 

This actually looks like a nice distraction from real life work, i'll try to cook up an example if i can figure out how to use 

the ieee proposed fixed point package included in ISE ...

Share this post


Link to post
Share on other sites

Cool, I'll have a look at the MAME source, I always forget about that.

 

I've been working with the sound board code from the Robotron project. It's the same sound board used in all of the Williams video games as well as the the System 4 through System 7 pinball machines. For some reason about half the sound ROMs require a jumper setting that inverts address bit 11 of the sound ROM. Speech is a separate board that plugs into a header on the sound board. It contains ROM that connects to the CPU address and data lines and address decoding and then it receives speech clock and data from the PIA and passes that through a HC-55516 CSVD decoder. The code was wrong and had the speech clock and data signals (which are unused in Robotron) connected to inputs on the PIA rather than outputs. I've fixed that and added the speech ROMs and decoding and testing with the Sinistar ROMs and now I get reasonable looking signals on the speech clock and data lines when I triggger a speech sample but my initial attempt at decoding was not successful.

 

I've been planning on posting the rest of the code soon, currently I've been working with Altera Quartus since it's so much easier to work with ROMs and can load hex files directly rather than requiring a 3rd party tool to convert them to vhdl. It should be very straightforward to get it working on the Papilio though.

Share this post


Link to post
Share on other sites

You can actually load Hex files in ise too :)

Please do share the fixes whenever happy with them.

Its probably not possible to fit sinistars speech decoding + the sinistar specific video logic into a lx9 of papilio Duo but pipistrello's lx45 should have enough floor space.

Share this post


Link to post
Share on other sites

Would you mind cluing me in on how? I have not found any way to import ROM into block RAM without using MikeJ's Romgen which works fine, but it's another step to deal with. I've been steadily progressing but I'm still very much an amateur and have no formal FPGA or digital design education.

 

I've got a DE2 that ought to fit everything, but for the time being I've been having fun with the sound boards. I hooked up a PS/2 decoder with the scancode fed to the sound board input so I can hit keys on a keyboard to play sounds. I did the Gottlieb MA-55 used in the early System 80 pins too, still need to port that to Xilinx and then I'll post it too. If one needed a replacement sound board for a Williams pinball machine or video game it could be done easily with a cheap FPGA. I've got the sound board without speech ROMs fit in a $18 Cyclone II board taking around 50% of the resources. With external ROM speech could be included, most of this stuff is memory-bound rather than running out of logic blocks. Indeed I've got Galaxian running fine on one of those cheap Cyclone II boards (slightly smaller than a Papilio 250k) with an external flash ROM to hold the program ROM.

 

I'll attach the sound board core with the changes I made in the current state in case anyone else wants to work on it since I hate it when people say "I'll publish the code eventually" and then never do. I'll finish cleaning things up on this end and post the whole project once I've tidied it up and ported it to the Papilio. If you can implement a CVSD decoder then all the pieces to the puzzle will be there. I think that part is beyond my current abilities although I did get the shift register and logic to detect 3 in a row working.

robotron_sound.vhd

Share this post


Link to post
Share on other sites

Re hex files in ISE: In Verilog you can use $readmemh(...) to read a file of hexadecimal text.  ISE reads that in at build time.  It may not be as convenient as programs which insert the data into the bitstream after build, but I haven't tried those.

 

Its input file is not the same as Intel HEX files.  It's a really limited format, hardly more than just a sequence of hexadecimal numbers one per line.

 

mkarlsson gives an example in this recent thread: http://forum.gadgetfactory.net/index.php?/topic/2494-coe-file-embedded-in-bit-file/

Share this post


Link to post
Share on other sites

That still seems like a pain compared to how it works in Quartus. When I want to load a hex file, I simply double click the ROM instance in the project manager and it opens in the wizard. Click through a few pages to the one that lets you assign contents and then select the hex file and click finish. Recompile and the new ROM contents are loaded, it's super easy and fairly intuitive.

 

Xilinx ISE allows you to do something similar, but only offers the choice of .coe or .mem, which I find odd since .bin and intel hex are defacto standards that have been around for decades. There are other things I like better about ISE though, which is one reason I've been using both side by side rather than settling on one or the other.

 

Anyway back to the sound board, my initial attempt at getting it running on the Papilio didn't work, surprising since the Robotron project I got it from was Xilinx based. I probably just made a dumb error somewhere, I'll have to play with it a bit more. I've been working on the more primitive System 4 sound board too and when I finish that I'll tackle the Bally hardware. At that point I'll have all the major early solid state pinball sound boards used up through the late 80s.

 

The speech is the big challenge on all of the fancier ones though. Gottlieb used the SC-01a phonem speech synthesizer, Williams the CSVD decoder, and Bally used the TMS5200 LPC decoder. All of the real ICs are long out of production and hard to find/expensive and I haven't found softcores for any of them.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now