Konami 053260 schematics release
🕑 Added 2023-03-22 10:23:04 +0000 UTCWork on the Konami 053260 "KDSC" sound chip is finally done !
The traced overlay, schematics, and some infos on Toshiba logic cells are here: https://github.com/furrtek/VGChips/tree/master/Konami/053260
The sad thing with gate array chips that do N similar things, is that most of the logic must be traced N times.
In a structured ASIC, channels could be contained in clearly delimited individual blocks and the visual similarity would make my work much easier. It wasn't the case here ;)
The 053260 can either run on its own, or in conjunction with one or two YM2151. In the latter case, both chips receive the same clock and the 053260 mixes the YM2151's output with its own.
For synchronization, Konami didn't use the common reset line but one of the YM2151's latch outputs for the supposed DAC, therefore continuously maintaining sync instead of just jamming it once at startup and relying on the shared main clock.
I guess they didn't trust the YM2151 to always be exactly in the same state after reset...
About a third of the die is dedicated to translating linear sample values to and from the YM2151's 13-bit floating point format.
Because of how the YM2151 operates internally, it outputs a stream of 13-bit floating point values instead of simpler 16-bit linear ones (that would be used for I2S for example). That's why, like other Yamaha FM chips, it had to be coupled with a dedicated DAC which could handle this special format, in this case a YM3012.
The 053260's own channels are generated in a sequential way and mixed by accumulating values with saturation. There's a single signed 7*7bit multiplier block used to scale values according to channels volume and panning settings.
All 4 channels are copies of each other except channel 0, which has additionnal logic inserted for the ROM readback function which is used during the game's power-on CRC self test.
Apart from providing lots of information about Toshiba gate arrays of that time (useful for future projects...) and allowing to see how things worked at the clock cycle level, reverse-engineering this chip revealed only a few discoveries useful for high-level emulation:
- 4 undocumented bits, one for each channel allowing to play samples in reverse. Not sure if any game used this.
- 4 undocumented bits, one for each channel indicating when a channel has reached the end of the sample. Would allow a game to know when a looping channel has restarted. Same thing, not sure if any game used this.
- Confirmation of the presence of two mute bits.
- Exact stereo pan volume calculation.
For lower-level emulation:
- ROM sharing configuration pins. One Konami game, Over Drive, actually uses two 053260 but only has a single ROM space for samples.
MAME's source notes that the only difference seen between the two chips on the game's schematics is the state at which the "ST1" pin is set. It turns out that this pin is used to define which ROM access "time slot" the chip will use, allowing multiple 053260 to share the same ROM.
It also became evident that the "ST2" further expanded this to allow up to four 053260, which would have been roughly equivalent to what the SegaPCM 315-5248 could do on its own. Apparently Konami never released any game with four chips.
And finally:
- Test modes. The undocumented register 0x2B is used to enable various test functions, which aren't of any use outside of quality control. Unlike other chips that use physical pins for this, these are fully controlable by software, meaning that if the game program crashed in a way that caused a non-zero write to this register, bus fights and physical damage could occur.
In the end, how the 053260 works is pretty straightforward. Channels are basically variable-rate counters used to read samples inone of two possible formats, they're multiplied by volume and panning parameters, mixed together with the YM2151's stream, and the result is sent out to be converted into analog signals.
The really surprising part is how much logic was dedicated to handling the YM floating point format. One could wonder if it was worth using so much die space for something that could have been done with a few passive components after the DACs. Maybe the advantage of only using a single YM3012 DAC justified this.
With the 051316, this concludes my last Konami reverse-engineering project.
As always, thank you all VERY much for your support, be it financial or not :)
Now let's get that TMNT core working !
Comments
GadgetUK
Wow, just wow!!!
Tony Shadwick
Holy cow that is some work. O_o