Using the beebs TMS5220 Speech chip without a ROM

bbc/electron apps, languages, utils, educational progs, demos + more
Post Reply
User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Sat Jun 27, 2015 8:51 pm

Ok, one post, three questions:

Does anyone know of any reason you can't just add a TMS5220 to a beeb without a TMS6100 ROM (with the other mods as required) and drive it directly?

Does anyone know of any games that use the speech chip, but with their own data instead of the supplied Kenneth Kendall ROM?

Has anyone tried using the beebs speech system without the serial ROM?

I ask as I have just ordered a TMS5220 and am planning on adding better speech to my AstroBlaster game. I know it would be less work to buy one of Sprow's speech upgrades (if they are still available), but wanted to try without!

User avatar
jgharston
Posts: 4008
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by jgharston » Sat Jun 27, 2015 9:26 pm

tricky wrote:Does anyone know of any reason you can't just add a TMS5220 to a beeb without a TMS6100 ROM (with the other mods as required) and drive it directly?
You can build phoneme data in memory and point to that to speak it. I don't have my Speech manual to hand, but the information is in there.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Sat Jun 27, 2015 11:58 pm

Thanks, it looked like you could, but would need to send the data 4 bits at a time, with a timer or maybe just the speech interrupt.

RobC
Posts: 2899
Joined: Sat Sep 01, 2007 10:41 pm
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by RobC » Sun Jun 28, 2015 8:56 am

Don't know of any games that did this but can't see any reason why it shouldn't work without the 6100 if you feed the data from memory. However, if it does need the PHROM, I should have a spare somewhere (or at least know where to get them for a reasonable price).

Can't remember whether we've discussed this before but I contacted Sprow a while back and here's what he said about how to encode the speech data:
You need to get a copy of "QBoxPro" which has a mode which is to output in TMS5220 (or one of its close cousins) vocoder format. The software is a bit ropey as it's for 16 bit Windows, but if you're gentle it worked on WinXP - I think some of the menus didn't redraw properly and you have to make sure it's all short path names with "8.3" filenames.

It took mono (WAV?) file input and output the result, which I then stitched together manually using the PHROM information in the Speech System User Guide.

The sound bites PHROM is available to download
http://www.sprow.co.uk/bbc/hardware/spe ... tbites.txt
http://www.sprow.co.uk/bbc/hardware/spe ... mbites.zip
All the best,

Rob

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Sun Jun 28, 2015 11:32 am

Thanks, I did try qBoxPro, but could only get it to work with the supplied WAVs, any 8KHz Mono one that I created were rejected. I think it might be related to the headers, but haven't had time to check.

EDIT: I have found a program called SOX http://sox.sourceforge.net/ that converts to WAV files that QBOX can read.
Last edited by tricky on Sun Jul 12, 2015 10:08 am, edited 1 time in total.

User avatar
jgharston
Posts: 4008
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by jgharston » Sun Jun 28, 2015 11:51 am

tricky wrote:Thanks, it looked like you could, but would need to send the data 4 bits at a time, with a timer or maybe just the speech interrupt.
No, you use SOUND &FF00 (or -256) and SOUND &FF60 (or -160).

You build up the data in memory, then send it to the Speech system with SOUND -160 to inititialise the Speech system, then SOUND -256 to send the data:

SOUND -160,data%!0,0,0
FOR offset%=2 TO end-1 STEP 2
SOUND -256,data%!offset%,0,0
NEXT offset%

You can also use the Speech system OSBYTEs to send the data directly:

A%=&9F:Y%=&60:CALL OSBYTE:REM Reset speech system
FOR offset%=0 TO end-1
Y%=data%?offset%:CALL OSBYTE:REM Send data to Speech, A%=&9F from earlier
NEXT offset%

or

LDA #&9F:LDY #&60:JSR OSBYTE:\ Reset speech system
LDX #0
.loop
LDY data%,X:JSR OSBYTE:\ Send byte to Speech, nb A=&9F from earlier
INX:CPX #end:BNE loop

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_

User avatar
retroclinic
Posts: 3037
Joined: Thu Jul 03, 2008 2:22 pm
Location: East Riding of Yorkshire
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by retroclinic » Wed Jul 01, 2015 5:20 pm

Doesn't the Computer Concepts Speech ROM (not to be confused with the Superior software SPEECH! one) talk directly to the 5220? Does it need a 6100 in there as well?

Mark.
Image

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Wed Jul 01, 2015 7:29 pm

Thanks, that looks really helpful, I'll give it a try later.

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Wed Jul 01, 2015 10:10 pm

Does anyone know if the rom I'd available?


User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Thu Jul 02, 2015 10:34 pm

I thought I would give it a try in beebem as my chips haven't arrived yet.
BeebEm 4.03 supports the speech chip and works with the SOUND -1,,, commands fine.
For CCSpeech, you need to *SPON and then press BREAK, at which point the emulated beeb just gets stuck in the speech rom waiting for SysViaRegB to not be what is in A, which is &31.
Does anyone know if that speech rom works, and if so, why it doesn't work with beebem403, or even if it does work with a real beeb.

EDIT: This is dues to beebem not simulating the READY delays and the CC SPEECH ROM relying on them to avoid the circuit board mod pre v4 circuit boards - more later.
Last edited by tricky on Sun Jul 12, 2015 10:10 am, edited 1 time in total.

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Thu Jul 02, 2015 11:46 pm

I have found TEXT TO SPEECH 1.01, which seems to be a slightly more advanced version, but this also hangs the emulated beeb. I have also checked the ROM against a few other sources and they are all identical - I guess they may have all come from the same original.

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Fri Jul 03, 2015 8:19 pm

CC Speech seems to work with the CC Text-to-speech in beebem as long as you *TEXON
[BREAK]
Sound|Speech On/Off (turn it off to un-hang the emulated beeb)
Sound|Speech On/Off (turn it on, now speech works but is a little temperamental)

EDIT: and keep turning it off and on when it gets stuck. If I get some time, I will try to fix it - that is if I can work out where the problem is.

User avatar
DutchAcorn
Posts: 2217
Joined: Fri Mar 21, 2014 9:56 am
Location: Maarn, Netherlands
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by DutchAcorn » Sat Jul 04, 2015 4:15 pm

tricky wrote:I thought I would give it a try in beebem as my chips haven't arrived yet.
BeebEm 4.03 supports the speech chip and works with the SOUND -1,,, commands fine.
For CCSpeech, you need to *SPON and then press BREAK, at which point the emulated beeb just gets stuck in the speech rom waiting for SysViaRegB to not be what is in A, which is &31.
Does anyone know if that speech rom works, and if so, why it doesn't work with beebem403, or even if it does work with a real beeb.
Just tried this in a real beeb and that seems to work fine. Finally a use for my TMS5220 chip :D (my TMS6100 rom is faulty).
Paul

Image

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Sun Jul 05, 2015 5:00 pm

When AstroBlaster has speech, you will have two ;)

I have found what looks like one bug in beebem403, it looks like the speech ready and speech interrupt bits are swapped in the system via. Swapping them seems to stop *UTTER from hanging the emulated system, but not hanging on break after a *SPON, I suspect that is due to the speech interrupt flag not being connected to T2, but haven't looked yet.

EDIT: This seems to be because pre v4 circuit boards had these two pins swapped, something that is fixed with track cutting and soldering during a speech upgrade.
Last edited by tricky on Sun Jul 12, 2015 10:11 am, edited 1 time in total.

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Sun Jul 05, 2015 10:46 pm

Does anyone know roughly how long it takes for the TMS5220 to read / write?
TTS ROM &8047...

Code: Select all

     SEI
     LDA     #0
     STA     SysViaDDRA    ; SysViaRegA all bits read
     LDA     #1
     STA     SysViaRegB    ; enable read on speech
     LDA     SysViaRegB    ; b6 speech ready, b7 speech interrupt
.wait_for_change           ; probably expects ready to be 0 (goes lo?hi 100ns after RS/WS)
     CMP     SysViaRegB    ; (waiting for data to stablise or for interrupt)
                           ; either READY will go back or INT will clear or both!
     BEQ     wait_for_change
     EOR     SysViaRegB    ; what changed
     STA     &9F4          ; store diff in RegB for ANDing later
The docs say 100ns (0.2 of a cycle?) after enabling !RS or !WS, the READY state changes and then waits until the data on its data port stabilises before allowing the CPU to continue, but as !READY is connected to the SysVia, I guess the code here is waiting for it to change back, "allowing" the CPU to continue.
I may be wrong and it might be waiting for !INT to signal, I guess I can disassemble the OS and see what SOUND -1... does or just wait for inspiration.

EDIT: This seems to be waiting for the READY status to change but doesn't know if the READY and INT maybe swapped due to running on a pre v4 circuit board that hasn't been modified as part of an official speech upgrade.
Last edited by tricky on Sun Jul 12, 2015 10:15 am, edited 1 time in total.

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Fri Jul 10, 2015 9:03 am

Does anyone know what the difference is between a tms5220 and a tms5220NL?
I have found docs for both, but can't SD a difference and no dock uses both names.

User avatar
1024MAK
Posts: 9988
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by 1024MAK » Fri Jul 10, 2015 11:15 am

tricky wrote:Does anyone know what the difference is between a tms5220 and a tms5220NL?
I have found docs for both, but can't SD a difference and no dock uses both names.
Sometimes a 'N' suffix simply means a plastic DIL packaged chip. But this varies between different semiconductor manufacturers.

Mark

User avatar
1024MAK
Posts: 9988
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by 1024MAK » Fri Jul 10, 2015 11:33 am

The meaning of 'N' here...

Mark

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Fri Jul 10, 2015 6:08 pm

Thanks Mark, I didn't really get the connection other than all chips were plastic and all had an N suffix.

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Fri Jul 10, 2015 6:30 pm

Sorry Mark, I'm missing something, all the chips have an N suffix and ask are plastic, but I can't find a key. I'll try at home on the PC.

User avatar
1024MAK
Posts: 9988
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by 1024MAK » Fri Jul 10, 2015 8:44 pm

There are many different chip packages. DIL chips are sometimes available in ceramic packages. In this case, 'N' most likely means a plastic DIL packaged chip.

But, as I said, different manufacturers use different symbols. So 'N' may mean something different for some chip types.

In the link I gave in my earlier post, only DIL plastic types are shown. If you want the whole list, let me know and I will search again for the web page for all current TI types.

Mark

User avatar
1024MAK
Posts: 9988
Joined: Mon Apr 18, 2011 5:46 pm
Location: Looking forward to summer in Somerset, UK...
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by 1024MAK » Fri Jul 10, 2015 9:19 pm


User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Sat Jul 11, 2015 11:13 pm

Thanks for all the help, I now have a working speech chip in one of my beebs. I haven't programmed an EPROM for it yet, but have managed to get a WAV converted and played it on my beeb.
Currently there are a couple of niggles; the VRn seems to have a dead-spot from about 90% speed to 110% speed, it only plays with interrupts disabled and it locks up after one play, so I do have more work to do, but I am pleased so far.
Keep an eye out for speech enabled AstroBlaster.

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Sun Jul 12, 2015 11:05 am

Here are a few things I have found add added as EDIT:s above, collected here to save re-reading the whole thread.

I have found a program called SOX http://sox.sourceforge.net/ that converts sample rate and sample size to WAV files that QBOX can read.

Pre issue 4 boards have speech READY and INT pins swapped on their way to the system VIA, something that is "fixed" by a dealer installing the official speech upgrade and cutting and joining a couple of tracks.

Beebem does not emulate READY, which should be set for a short period after setting RS (read select) or WS (write select). Beebem also emulates the unmodified READY/INT connections. I plan to change these and submit the changes to Mike to see if he wants to add them to his "old" version; if not, I will try to get permission to distribute a new version with TMS5220 support.

The Computer Concepts speech ROM uses the READY behaviour to allow it to auto-detect which way round the signals are and run on any issue board with or without the official mods. It seems to hang on boot because the READY state doesn't change, although it is possible that it is the INT state as it seems to work after boot if the signals are swapped.

User avatar
tricky
Posts: 4353
Joined: Tue Jun 21, 2011 9:25 am
Contact:

Re: Using the beebs TMS5220 Speech chip without a ROM

Post by tricky » Sun Jul 19, 2015 6:48 pm

I have been playing with speech today and this is what I have so far for AstroBlaster. Some of the words/phrases are a bit off, but if anyone can do better, I would be greatful. These should play on any beeb with a speech chip as it doesn't need or use the ROM. I would be greatful if anyone with a chip could try them as I only have speech in my un-modded (READY/INT swapped) issue 4 with no ROM and would like to know if what I have so far works on all systems.

Run the image and then theses keys should "speak" the phrases:

Code: Select all

0  Alert                          
1  Critical                       
2  Eight                          
3  Exercise Extreme Caution         
4  Extra Fuel                      
5  Fighter Pilots Needed In Sector Wars
6  Five                           
7  Four                           
8  Fuel Status                     
9  Invader In Sector                
a  Laser                          
b  Marginal                       
c  Nine                           
d  One                            
e  Operational                    
f  Out Of Fuel                      
g  Overheated                     
h  Play Astro Blaster               
i  Player                         
j  Play Over                       
k  Remaining                      
l  Seven                          
m  Ship                           
n  Ships                          
o  Six                            
p  Temperature                    
q  Ten                            
r  Three                          
s  To Battle Station                
t  Two                            
u  Warp Activated                  
v  Zero
There is one more phrase in the game that I know of, but it is "Prepare for docking maneuvers" and as I ran out of room, that isn't used.
I have no idea how I will find space to add them all, but I'll give it a go.

I have also added a windows version of beebem that should play the speech, although not very well. Please PM me if you want the modified beebem source.
Attachments
BeebEm-speech.zip
The original shows as a virus, so this may to0 - if worried, don't use it.
(275.2 KiB) Downloaded 74 times
speech-test.zip
test of speech for tms5220 for AstroBlaster
(9.85 KiB) Downloaded 81 times

Post Reply

Return to “8-bit acorn software: other”