TMS-5220 & Arcade Speech ROMS

discussion of beeb/electron applications, languages, utils and educational s/w
Post Reply
User avatar
GadgetUK164
Posts: 59
Joined: Sat Jun 23, 2018 3:59 pm
Contact:

TMS-5220 & Arcade Speech ROMS

Post by GadgetUK164 » Thu Jul 05, 2018 7:05 pm

I apologise if this has already been asked, but I wondered if anyone had taken the speech ROMs from Star Wars, Empire Strikes Back, Return of the Jedi, Paper Boy, Gauntlet (the list goes on...) which also use the TMS-5220, and tried feeding the TMS-5220 on the beeb with the data?

I've started looking at this and it seems feasible. On the arcade boards it looks like the data is fed 8 bits at a time through a 6532 - direct from the ROM. Most look to use a 6809 to address the ROM, and then just connect it through to the TMS-5220. I've seen there are commands that seem to support that method, I just wondered if anyone has already done it?

EDIT: I suspect Tricky has done a similar if not identical thing with AstroBlaster - listening to the speech in that just now, it feels like it has arcade origins - although that could just be because of how the TMS-5220 sounds. It's awesome though, it really is! I've got to get Starwars speech on this for sure.

If I get the ROM data, dump it to SWRAM, then start the CPU feeding from the SWRAM - I think it would work? Beyond that, maybe sticking some SW screenshots or something to make it into a kind of demo maybe? Or hack some of the games to add the arcade sounds in - problem there is CPU needed to feed the 5220 would mean a pause at the point in the game. But would be cool none the less...
Last edited by GadgetUK164 on Thu Jul 05, 2018 7:12 pm, edited 1 time in total.
Retro Gaming Mods & Repairs - My YouTube Channel - https://www.youtube.com/GadgetUK164

User avatar
tricky
Posts: 2850
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by tricky » Thu Jul 05, 2018 7:34 pm

For AstroBlaster, I took the samples pack that MAME used to use and encoded it for the tms5220 using an old winXP program.

I can't remember if I posted the disk image (copyright and all that) but I did post a recording of me playing back the starwars samples on one of my beebs in this thread.
I haven't tried the others, but adding these to the existing Star Wars game for the beeb is on a long list of things to do.

There is a thread on AtariAge where I got the list of addresses for the Star Wars samples and a link to a couple of new encoding packages (python and Mac) but I can't run them.

EDIT: The tms speech is very memory efficient and it doesn't take long to write a few bytes (less than 16) to the 5220's fifo every 20ms or so.
If you fancy adding the speech to Star Wars I won't be disappointed as I may never get to it.
Last edited by tricky on Thu Jul 05, 2018 7:37 pm, edited 1 time in total.

User avatar
GadgetUK164
Posts: 59
Joined: Sat Jun 23, 2018 3:59 pm
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by GadgetUK164 » Thu Jul 05, 2018 7:53 pm

Wow, brilliant!!! So it is possible for sure! The hard bit there would be hacking the existing games (well - for me it would lol). I can see why you thought about starting a new game instead. So much to get my head around though - I've written a 6502 emulator (back in 2000 ish) and dabbled a bit with the 6502 from time to time, so maybe I could start by just getting my beeb working with the speech ROMs. You say you got the addresses for them - that's part of the challenge, and working out which chips are the speech ROMS (without owning an actual SW PCB). I took a look at the MAME drivers but couldnt find what I was looking for, but I did find a set of conversion instructions which handily listed the sound ROM part numbers - they match 2 of the files in my MAME set. So I may start with ESB roms I think.

The TMS-5220 is a lovely chip - surprised the beeb had this designed in, was it there on rev 1 boards? Very cool!
Retro Gaming Mods & Repairs - My YouTube Channel - https://www.youtube.com/GadgetUK164

User avatar
tricky
Posts: 2850
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by tricky » Thu Jul 05, 2018 8:04 pm

I just had a look at the start of the "speech" ROM for StarWars and it looks like the addresses are stored in the beginning of the ROM (mapped at 0x4000), so it is probably worth checking the ESB etc for a similar structure.
Image
This seems (off by one in places) to match the data from AtariAge.

Code: Select all

.speak_data
{
	EQUW &4062 - &4000 + BEGIN ; 419B          ; use the force luke
	EQUW &419C - &4000 + BEGIN ; 4240          ; remember
	EQUW &4241 - &4000 + BEGIN ; 42FB          ; i'm on the leader
	EQUW &42FC - &4000 + BEGIN ; 4435          ; the force is strong with this one
...
EDIT: PS It is a shame they removed the socket for the Master and Compact.
PPS I think you can send data to the speech chip with the BASIC SOUND command as well as playing words from the original serial ROMs.
Attachments
ROM_header.png
Last edited by tricky on Thu Jul 05, 2018 8:06 pm, edited 2 times in total.

User avatar
GadgetUK164
Posts: 59
Joined: Sat Jun 23, 2018 3:59 pm
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by GadgetUK164 » Thu Jul 05, 2018 8:11 pm

Thanks!!! That's a great help =D
Untitled1.jpg
Retro Gaming Mods & Repairs - My YouTube Channel - https://www.youtube.com/GadgetUK164

User avatar
GadgetUK164
Posts: 59
Joined: Sat Jun 23, 2018 3:59 pm
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by GadgetUK164 » Thu Jul 05, 2018 8:22 pm

Ah - I perhaps didn't explain what I meant! I plan to do what you are suggesting - feed the data via the CPU!

The ROM chip is special in that it seems to pass the data to 5220 via serial (very few connections between the 5220 and the ROM). But as you say - it has a "speak external" mode where you can litterally just spoon feed the bytes. I just need to load the speech data into SWRAM (once I work out how lol - everything is new to me on the beeb), and have the CPU just pass the 2 commands to init the 5220, and put it in external mode, then read the bytes (at the appropriate time - guessing there's an ready bit somewhere). In theory that should work! Would be cool though, just hearing the beeb play that. Then once done for one game - there's a tonne of Atari arcade games using the same system (Road Blasters, Road Runner, Return of the Jedi).

EDIT: To clarify - the way the speech is done on the Atari arcade boards is via the 6809 feeding the bytes. The ROMs don't connect to the 5220 like the 6100 does in the beeb.

EDIT2: The other interesting thing I noticed - may or may not be correct. I noticed that for one of the speech ROMS on starwars, the databus was flipped through one port of the 6532. Not sure if that was matched in the ROM, or whether it was a protection attempt to confuse anyone looking at it.
Last edited by GadgetUK164 on Thu Jul 05, 2018 8:31 pm, edited 2 times in total.
Retro Gaming Mods & Repairs - My YouTube Channel - https://www.youtube.com/GadgetUK164

User avatar
GadgetUK164
Posts: 59
Joined: Sat Jun 23, 2018 3:59 pm
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by GadgetUK164 » Thu Jul 05, 2018 8:33 pm

tricky wrote:
Thu Jul 05, 2018 8:04 pm
I just had a look at the start of the "speech" ROM for StarWars and it looks like the addresses are stored in the beginning of the ROM (mapped at 0x4000), so it is probably worth checking the ESB etc for a similar structure.
Image
This seems (off by one in places) to match the data from AtariAge.

Code: Select all

.speak_data
{
	EQUW &4062 - &4000 + BEGIN ; 419B          ; use the force luke
	EQUW &419C - &4000 + BEGIN ; 4240          ; remember
	EQUW &4241 - &4000 + BEGIN ; 42FB          ; i'm on the leader
	EQUW &42FC - &4000 + BEGIN ; 4435          ; the force is strong with this one
...
EDIT: PS It is a shame they removed the socket for the Master and Compact.
PPS I think you can send data to the speech chip with the BASIC SOUND command as well as playing words from the original serial ROMs.
Can you remember if the speech data was in the same chip - or a different ROM? And are those addresses absolute from the start of that ROM or offset?
Retro Gaming Mods & Repairs - My YouTube Channel - https://www.youtube.com/GadgetUK164

User avatar
tricky
Posts: 2850
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by tricky » Thu Jul 05, 2018 8:41 pm

The addresses are absolute, but the ROM is mapped at 0x4000.
EDIT: That is the speech data ROM.

I hadn't looked at the Atari code, but I assumed that the CPU did the work as the serial ROMs are a bit special!

For just playing the speech, you can load it into ordinary RAM, maybe need MODE 7 first.
I haven't looked at the way you can use the BASIC SOUND command to feed bytes, but I thought it might be a good place to start as it probably does the synchronisation for you.

Part of the speech upgrade on some of the mother boards is to cut two tracks and swap them over (READY and interupt - IIRC).
As I only have one 6100, I haven't bothered doing this on my boards as it is quite simple to detect which way it is wired and check for the appropriate bit yourself.

I have PM'd you a link to my source, which does this, although I may be the only one with the signals crossed!

I later found that the Computer Concepts Speech ROMs also do this check, so I assume that they were expecting DIY speech chips to not have modified boards.

If you were planning a video about beeb speech, you might like to take a look as they have intonation, text-to-speech and sort of singing!
Last edited by tricky on Thu Jul 05, 2018 8:42 pm, edited 2 times in total.

User avatar
tricky
Posts: 2850
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by tricky » Fri Jul 06, 2018 7:12 am

This thread seems to have my beebem findings and patches.

User avatar
GadgetUK164
Posts: 59
Joined: Sat Jun 23, 2018 3:59 pm
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by GadgetUK164 » Fri Jul 06, 2018 2:48 pm

Thanks! That's invaluable! =D I see now what you meant - the problem with those 2 connections flipped on <= rev 4 boards. Very interesting!
Retro Gaming Mods & Repairs - My YouTube Channel - https://www.youtube.com/GadgetUK164

User avatar
GadgetUK164
Posts: 59
Joined: Sat Jun 23, 2018 3:59 pm
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by GadgetUK164 » Fri Jul 06, 2018 4:34 pm

Thanks to your help, I got the Empire Strikes Back samples playing fine on the beeb =D I 've also just worked out where the sound data is in the Return of the Jedi ROMs, but not sure where the offset / size data is stored (presumed another ROM). With some manual fudgery I could extract the jedi samples too.
Retro Gaming Mods & Repairs - My YouTube Channel - https://www.youtube.com/GadgetUK164

User avatar
tricky
Posts: 2850
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by tricky » Fri Jul 06, 2018 10:38 pm

You could also parse the instructions to find the stop, or get the emulator to tell you.

User avatar
GadgetUK164
Posts: 59
Joined: Sat Jun 23, 2018 3:59 pm
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by GadgetUK164 » Sun Jul 08, 2018 10:43 pm

tricky wrote:
Fri Jul 06, 2018 10:38 pm
You could also parse the instructions to find the stop, or get the emulator to tell you.
Thanks, I did wonder about that but wasn't sure there was a stop / start type syntax. But apparently there is... I might have a go with that approach! Otherwise its a case of trying to dissassemble other ROMS to try and slowily work out where the addresses are stored. I got some paperboy samples working too! Any expert beeb hackers out there fancy hacking paperboy to add these arcade samples in?

I guess hacking them in via sideways RAM might not be that trivial, some interupt or something would be needed perhaps or at least a call in the right places in the game to start the sounds and stream the data etc. Could be a nightmare on some games - time dependent code etc. Out of my capability for the moment - I need to work out how the hell the graphics works on the BBC next I think, but I cannot see me going anywhere with modding existing games yet. Maybe adding the sounds into a menu or something with some artwork from the games might be interesting - if I can work out a few things.
Retro Gaming Mods & Repairs - My YouTube Channel - https://www.youtube.com/GadgetUK164

User avatar
tricky
Posts: 2850
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by tricky » Mon Jul 09, 2018 6:17 am

There is a program called image2bbc (I think) that runs on windows and outputs a file that can be *LOADed into screen memory on a beeb. (By DreamlandFantasy iirc).
There are a few people on here who have modded beeb games.
When I was writing my emulators for circus, ripcord, sprint and warlords that run on the beeb, I looked for writes to the sound hardware in a disassembler, or with breakpoints in mame. It still takes a while!
There is also a program for converting bitmaps to mode 7 (written by bitshifters iirc).
Do you get this involved with all the systems that you come across ?

User avatar
GadgetUK164
Posts: 59
Joined: Sat Jun 23, 2018 3:59 pm
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by GadgetUK164 » Mon Jul 09, 2018 7:01 pm

Thanks
tricky wrote:
Mon Jul 09, 2018 6:17 am
There is a program called image2bbc (I think) that runs on windows and outputs a file that can be *LOADed into screen memory on a beeb. (By DreamlandFantasy iirc).
There are a few people on here who have modded beeb games.
When I was writing my emulators for circus, ripcord, sprint and warlords that run on the beeb, I looked for writes to the sound hardware in a disassembler, or with breakpoints in mame. It still takes a while!
There is also a program for converting bitmaps to mode 7 (written by bitshifters iirc).
Do you get this involved with all the systems that you come across ?
Thanks, I will check it out! I tend to tinker with most system I get, but anything with a 6502 I tend to dig a bit deeper lol. I got Return of the Jedi samples working too this evening. I just cannot find 3 or 4 of them atm, even with parsing I found it problematic. Close to all of them being there though, so that will complete the trillogy =D
Retro Gaming Mods & Repairs - My YouTube Channel - https://www.youtube.com/GadgetUK164

RobC
Posts: 2324
Joined: Sat Sep 01, 2007 9:41 pm
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by RobC » Mon Jul 09, 2018 8:53 pm

I think this would be awesome if it could be done. There's always a thrill when a game uses the speech upgrade and to use it in such an authentic way would be brilliant.

User avatar
GadgetUK164
Posts: 59
Joined: Sat Jun 23, 2018 3:59 pm
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by GadgetUK164 » Sat Jul 14, 2018 9:56 am

I've uploaded a video on this - thanks to Tricky providing the ASM routine for playing samples from the starwars ROM.

https://www.youtube.com/watch?v=OfZrqc3Zc7Q
Retro Gaming Mods & Repairs - My YouTube Channel - https://www.youtube.com/GadgetUK164

User avatar
tricky
Posts: 2850
Joined: Tue Jun 21, 2011 8:25 am
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by tricky » Sat Jul 14, 2018 11:42 am

Great video, shame its 25Hz, but I guess 99% of the content is fine and 99% of people wouldn't notice the 1% wasn't at 50Hz anyway ;)

User avatar
Elminster
Posts: 3137
Joined: Wed Jun 20, 2012 8:09 am
Location: Essex, UK
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by Elminster » Sat Jul 14, 2018 12:38 pm

People need to stop doing YouTube video’s as I spend all day watching them :oops:

Watched first 5 mins but had to go shopping. I do have a sprow speech kit in one of my beeb’s somewhere, not tried Simon’s remake.

User avatar
marcusjambler
Posts: 450
Joined: Mon May 22, 2017 11:20 am
Location: Bradford
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by marcusjambler » Sat Jul 14, 2018 4:00 pm

Interesting stuff =D>

retromarky
Posts: 1
Joined: Wed May 23, 2018 11:11 pm
Contact:

Re: TMS-5220 & Arcade Speech ROMS

Post by retromarky » Tue Aug 07, 2018 7:23 pm

Hey Mr. G
RetroMarky here
I have the same speech chip set as you on my beeb. Was wondering after watching your video, could I get a copy of the code you acquired so I can play the star wars samples please?

Thanks in advance
RM

Post Reply