Showing posts with label turbo outrun. Show all posts
Showing posts with label turbo outrun. Show all posts

Saturday, February 29, 2020

Bringing Turbo OutRun Audio to OutRun: Rush A Difficulty

Following Camino’s optimization, I performed a similar treatment on Cruising Line, the remaining 3DS track. I reduced the track’s filesize from 24K to 9K using a similar set of techniques. Cruising Line does not suffer from the quantization issues that plagued Camino, which made the process a little easier and yielded even better results. So far so good and there was plenty of ROM space left to stuff with additional music! The next Enhanced Edition will contain three new audio tracks, which is an amazing result.

Originally, I considered bringing the new Switch music into the fold: Radiation and Step On Beat. However, from a subjective point of view, neither of these tracks are particularly great. I felt like they didn’t sit harmoniously with the existing music, and I wasn’t prepared to spend many weeks optimizing music I didn’t love.

Turbo OutRun - A prime example of what happens when you don't understand your own product.

Instead, I turned to another reference point in the OutRun universe - Turbo OutRun. Whilst Turbo OutRun is arguably a disappointing sequel, the soundtrack is impressive. In particular, Yasuhiro Takagi’s ‘Rush a difficulty’, which is an upbeat number that wouldn’t sound out of place in the original game. As an aside, Takagi went on to become sound director for Shenmue II, before moving to the Yakuza series.

Listen: Rush A Difficulty
Terrible Name. Amazing Track.

Turbo OutRun runs on the same hardware as its predecessor so, on the surface, the idea of converting the music might appear simple. Being a hand-crafted piece of MML, we wouldn’t need to worry about the rigorous optimization process required by the 3DS audio. However, the audio engine embedded in the Z80 program code isn’t identical. Between OutRun and Turbo OutRun Sega added a number of improvements to the engine. Firstly, an extra 3 PCM channels can be utilized by music, bringing the overall number of simultaneous samples to 8, bolstered by the usual 8 FM channels. (On OutRun, these 3 channels are strictly reserved for sound effects and can’t be used by music.) Secondly, samples can be played at different pitches. Let’s say the composer took a sample of an electric guitar chord, this could be triggered at different pitches and replayed like an instrument. AfterBurner used this functionality to great effect with its guitar-laden riffs. Whilst the samples are 8-bit, and relatively lo-fi compared with clean Yamaha FM patches, they add depth and grit to the overall mixdown when used wisely. In order to backport the music to OutRun, considerable changes would be needed.

So, the Turbo OutRun engine uses additional channels and manipulates sample pitch intelligently. It was time to decompile the necessary sections of Turbo OutRun’s Z80 code to start analyzing the raw music data. A starting point was the PCM channels, as we potentially needed to remove or remap the extra ones. It was immediately clear that 2 PCM channels were permanently disabled. Interestingly, the disabled channels contained an early draft or a guitar riff for the tune that sounded unfinished when reactivated. This was good news, as it meant there was only one extra channel of audio to worry about. The extra channel contained a sampled driven slap-bass line. Converting this back to OutRun would be problematic. It would involve finding space for the slap-bass sample in the, almost full, sample ROMs and backporting the pitch manipulation code. Plus there wasn’t a spare PCM channel to use anyway, so this was a non-starter.

The bass line was an essential ingredient of the track - it sounded sparse without it. I decided to recreate the bassline as a YM patch/instrument. CMonkey had the great idea of sourcing a patch from a Megadrive rendition of Rush a Difficulty. The patch wasn’t perfect, but proved a good starting point for further manipulation. I used the VOPM plugin, which emulates the Yamaha 2151 chip, to modify the patch further, before converting the data back to the format required by the OutRun engine.

VOPM Plugin. Spend ages fiddling with knobs

A YM patch will never sound as beefy as a sample, but it’s not a bad compromise. I replaced a, sparsely used, existing YM channel that didn’t contain a strong lead with the bassline.

Audio Comparison

The next hurdle was remapping the track’s percussion. The Turbo OutRun music utilises a different set of drum samples. Now, we could theoretically replace all six sample EPROMs on the PCB with larger ones to include these new drums, and solder the corresponding jumper. But at a practical level, this seems like a big ask on the poor user just for the drums on a single track! Most of the Turbo OutRun drums have an equivalent in OutRun - kick drum, snare, hi-hats, tom-toms etc. Whilst the OutRun drumset doesn’t contain as much reverb, this seemed like a sensible compromise for now.The only one that’s missing is the cowbell, which I mapped to a wood rim instead.

One final change was needed. The entire Turbo OutRun engine runs at a different timing value to OutRun. To work in OutRun, the engine needs to be temporarily patched to the Turbo value, but only whilst the music is playing. I have a temporary fix for now, which will need to be improved before release. So finally, the track is successfully converted. The main differences are: remapped drum samples, the sampled bassline replaced with a YM patch, with the resulting loss of a single YM channel.


So there we have it. A different challenge to optimizing the 3DS music that entailed rewriting existing tooling, decompiling the Turbo OutRun audio engine and converting the MML data and commands to an older format.

I’d also like to thank cmonkey, without his assistance this would have taken much longer. When working on a project of this nature it's invaluable to have someone to bounce ideas off, challenge your assumptions, and sometimes make you feel (unintentionally) ridiculous. I've been incredibly lucky to find someone who understands the Sega audio engine as well as he does, and I wish I could say more than, "thanks buddy!"

Monday, June 12, 2017

Turbo OutRun PCB Fix Log

Purchased this OutRun boardset from the states. It was sold as faulty. The seller included some free food, which kept me happy whilst I stared at the black screen it presented me with on boot.



First thing I did was to verify an EPROM with RomIdent. This showed this was actually an OutRun boardset converted to Turbo OutRun.

I then tested the 2 boards against a known good set, and found the lower video PCB to completely working. Fantastic! This saved me building the interconnects that ColinD kindly sent me this time round.



I swapped the security FD1094 processor with a vanilla 68000. I programmed some decrypted ROMs.

I was greeted with the following screen.



Progress, but this was a bit of a red herring. It crashed immediately after this screen. In fact, this screen was an addition of the Japanese decrypted roms I'd happened to use. It's possible that the security processor was still working, but I'll go back and check that later.

I dug out the schematics and found an LS244 with dead outputs @ IC83. This was part of the sub CPU memory addressing. I socketed it and swapped it out, but it didn't make the game boot, although the logic probe showed its pins were doing something at least.

At this point I decided I wasn't going to change any more components without better diagnostic information. I'm slow at desoldering, so shotgunning stuff wasn't a good idea.

I used the OutRun SDK, created by Alex, to code a test tool for OutRun. Alex had already started work on the tool and I made some further modifications. My theory was that I needed a minimal piece of software to test as much of the hardware as possible. The problem with the on-board tests on OutRun, is that they require most of the PCB to already be working in order to use them. So they are mostly useless.

I spent a couple of nights changing the tool so that it would test the 4 Main CPU SRAMS, the 4 Sub CPU SRAMs, Tile RAM, Text RAM, Palette RAM and Sprite RAM.

The tests that Alex had included were far more rigorous than OutRun's onboard tests, with separate address bus and data bus tests.

Screenshot from MAME below, excuse the horrible palette (it's really setup for OutRun not Turbo OutRun)



I programmed this to the boardset and got the following:



The program reported the Sub CPU RAM @ IC 73 was bad.

I also verified that the ICs reported by the program were correct by glitching some of the SRAMs whilst it ran.

After hours of swearing and desoldering (mostly due to the ground plane) I'd removed the offending SRAM and socketed the IC.



Personally, I find these boards an arse to work with. I have a lot of respect for Mark at Retroclinic now.

At this point, the test gave me a different error because the SRAM was completely missing. Promising!



Inserted a replacement SRAM and BOOM - all OK!



Change the EPROMs back to the game and we have attract mode with sound:


Saturday, September 10, 2011

Turbo OutRun Boardset

I picked up a Turbo OutRun boardset this week. Unlike OutRun, Sega decided to mount the board in a protective cage. The cage has its own internal wiring as shown below. 


The board was in very good condition, it didn't look the cage had ever been opened. The original serial (or selial) stickers were intact:



The board is still fitted with its original FD1094 suicide processor. I'm shocked that some of these are still working 22 years on! The white sticker on the processor reads: SEGA 317-0106.


Here's a closeup of the connections, for my own reference:


And here we have it running on the wiring harness made by RetroClinic. I took the board out of the cage to plug it in.