YM2610: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
mNo edit summary
mNo edit summary
Line 2: Line 2:


The YM2610 is a sound synthesis and playback chip made by Yamaha, which is used in all versions of the NeoGeo hardware.
The YM2610 is a sound synthesis and playback chip made by Yamaha, which is used in all versions of the NeoGeo hardware.
It was later merged with the Z80 subsystem in the [[NEO-YSA]] and [[NEO-YSA2]] chips, used on some versions of the NeoGeo CD, CDZ and on [[ROM-Only boards]].
It was later merged with the [[Z80]] subsystem in the [[NEO-YSA]] and [[NEO-YSA2]] chips, which are used on some versions of the NeoGeo CD, [[CDZ]] and on [[ROM-Only boards]].


The chip's analog output is only the SSG's output. The FM and ADPCM sounds are sent digitally to the [[YM3016]] DAC and mixed before amplification.
The chip relies on a [[YM3016]] external DAC (Digital to Analog Converter) chip for the FM and ADPCM sounds. The only direct analog output is for the SSG sounds. Both analog outputs are then mixed together before amplification.
 
== Z80 CPU interface ==
 
The YM2610 is programmed through two pair of "ports": A and B. They're usually called Address A, Data A, Address B, Data B.
They're respectively linked to the Z80's ports 4, 5, 6 and 7.
 
* Port A (Z80 ports 4 and 5) concerns the SSG, ADPCM-B, and FM channels 1 and 2.
* Port B (Z80 ports 6 and 7) concerns the ADPCM-A, and FM channels 3 and 4.
* Data A (Z80 port 5) can also be read ?
 
The Z80's A0 and A1 lines are directly connected to the YM2610's A0 and A1 inputs. A2 informs the [[NEO-D0]] chip that the I/O request is for the YM2610.
 
==Multiplexed PCM bus==
 
ADPCM-A ROM addressing:
*SDRMPX low to high: SDRAD0~SDRAD7 are set to address bits 0~7, SDRA8,SDRA9 are set to bits 8~9, (SDRA20~SDRA23 are set to bits 20~23 ?)
*SDRMPX high to low: SDRAD0~SDRAD7 are set to address bits 10~17, SDRA8,SDRA9 are set to bits 18~19, SDRA20~SDRA23 are set to bits 20~23
 
ADPCM-B ROM addressing:
*SDPMPX low to high: SDPAD0~SDPAD7 are set to address bits 0~7, SDPA8~SDPA11 are set to bits 8~11
*SDPMPX high to low: SDPAD0~SDPAD7 are set to address bits 12~19, SDPA8~SDPA11 are set to bits 20~23
 
24 bits = 16MiB ADPCM ROMs Max.
 
==Pinout==
 
[[File:Ym2610_pinout.png]]


== Sound generation parts ==
== Sound generation parts ==
Line 50: Line 23:
See [[YM2610 registers#FM|YM2610 registers: FM]]
See [[YM2610 registers#FM|YM2610 registers: FM]]


=== ADPCM ===
=== ADPCM (Adaptive Differential Pulse-Code Modulation) ===
APDCM playback allows sampled sounds stored in the [[V ROM]]s or [[PCM file]]s to be played. It's used for anything that can't be easily synthesized like voices, percussions and wind instruments.
APDCM playback allows sampled sounds stored in the [[V ROM]]s or [[PCM file]]s to be played. It's used for anything that can't be easily synthesized like voices, percussions and wind instruments.


The ADPCM-A part has 6 channels, with a fixed playback frequency of '''18.5kHz'''. Samples can be any size from 256 bytes to 1MiB, by 256 bytes steps. Audio is compressed as 4bit per sample and played back as 12bit.  Samples cannot cross 1MB pages i.e. top 4 bits of end address should be equal to the start address.
The ADPCM-A part has '''6 channels''', and a '''fixed''' playback frequency of: 8MHz (main clock) / 12 (prescaler) / 6 clocks per access / 6 channels = '''18.5185kHz'''.
 
Audio is compressed as 4bit per sample and played back as 12bit.
 
The ADPCM-B part only has '''1 channel''', but the playback frequency can be changed from '''1.85kHz''' to: 18.5185 * 3 (1 access every 2 ADPCM-A channel access max) = '''55.555kHz'''.
 
Audio is compressed as 4bit per sample and played back as 16bit.


The ADPCM-B part only has 1 channel, but the playback frequency can be changed. Audio is compressed as 4bit per sample and played back as 16bit.
Samples can be any size from '''256 bytes to 1MiB, by 256 bytes steps'''. '''Samples cannot cross 1MB pages''' (the 4 MSBs of the end address should be equal to the start address).


See [[YM2610 registers#ADPCM-A|YM2610 registers: ADPCM-A]] and [[YM2610 registers#ADPCM-B|ADPCM-B]]
See [[YM2610 registers#ADPCM-A|YM2610 registers: ADPCM-A]] and [[YM2610 registers#ADPCM-B|ADPCM-B]]
==CPU communication==
See [[Z80/YM2610 interface]].
==Multiplexed PCM bus==
[[File:Ym2610_pinout.png|right|256px]]
Access to the V ROMs are made via partly multiplexed buses.
The {{Sig|SDRMPX|SDRMPX}} and {{Sig|SDPMPX|SDPMPX}} signals are used to drive latches or the [[PCM]] chip in [[cartridge boards|cartridges]] to demultiplex data. When {{Sig|SDROE|SDROE}} or {{Sig|SDPOE|SDPOE}} goes low, SDRAD* and SDPAD* are tristated so that the V ROMs can output data.
*SDRA* for ADPCM-A
{|class="wikitable"
!SDRMPX
!colspan="8"|SDRAD*
!colspan="6"|SDRA*
|-
|
!0
!1
!2
!3
!4
!5
!6
!7
!8
!9
!20
!21
!22
!23
|-
|Low to high
|0
|1
|2
|3
|4
|5
|6
|7
|8
|9
|?
|?
|?
|?
|-
|High to low
|10
|11
|12
|13
|14
|15
|16
|17
|18
|19
|20
|21
|22
|23
|}
*SDPA* for ADPCM-B
{|class="wikitable"
!SDPMPX
!colspan="8"|SDPAD*
!colspan="6"|SDPA*
|-
|
!0
!1
!2
!3
!4
!5
!6
!7
!8
!9
!10
!11
|-
|Low to high
|0
|1
|2
|3
|4
|5
|6
|7
|8
|9
|10
|11
|-
|High to low
|12
|13
|14
|15
|16
|17
|18
|19
|20
|21
|22
|23
|}
24 bits allows for 16MiB max V ROMs (without bankswitching).


== Trivia ==
== Trivia ==


*[[Viewpoint]] uses a lot of sampled drum loops and voice samples for BG music.
*A lot of games have several recordings of the same instrument playing different notes, rather than having only one sample and change the ADPCM-B playback frequency to vary its pitch. (Trumpet in [[Viewpoint]], electric guitar in [[Super Sidekicks]]). Why ?
*A lot of games have several recordings of the same instrument playing different notes, rather than having only one sample and changing the ADPCM-B playback frequency to change its pitch. (Trumpet in Viewpoint, electric guitar in Super Sidekicks). Why ?
*Nazca's [[sound driver]]s are able to use the SSG channels for music playback. (Maybe all can ?)
*Nazca's [[sound driver]]s are able to use the SSG channels for music playback. (Maybe all can ?)



Revision as of 08:31, 7 January 2013

YM2610 chip

The YM2610 is a sound synthesis and playback chip made by Yamaha, which is used in all versions of the NeoGeo hardware. It was later merged with the Z80 subsystem in the NEO-YSA and NEO-YSA2 chips, which are used on some versions of the NeoGeo CD, CDZ and on ROM-Only boards.

The chip relies on a YM3016 external DAC (Digital to Analog Converter) chip for the FM and ADPCM sounds. The only direct analog output is for the SSG sounds. Both analog outputs are then mixed together before amplification.

Sound generation parts

Sound can come from 3 different generators, each having their own channel(s): SSG, FM synthesis and ADPCM playback.

SSG (Simple Sound Generator)

Given its limited capacities, the SSG is more often used for simple sound effects (coin sound, cursors in menus...) rather than music.

The SSG has 3 square wave channels with programmable frequency, and a LFSR noise channel, all with programmable amplitude. An unique enveloppe generator with predefined shapes can also be linked to the SSG's channels amplitudes.

See YM2610 registers: SSG

FM (Frequency Modulation)

The FM part has 4 channels, each having their own parametrable operators, panning and amplitude. It's the most used way of producing music in games.

See YM2610 registers: FM

ADPCM (Adaptive Differential Pulse-Code Modulation)

APDCM playback allows sampled sounds stored in the V ROMs or PCM files to be played. It's used for anything that can't be easily synthesized like voices, percussions and wind instruments.

The ADPCM-A part has 6 channels, and a fixed playback frequency of: 8MHz (main clock) / 12 (prescaler) / 6 clocks per access / 6 channels = 18.5185kHz.

Audio is compressed as 4bit per sample and played back as 12bit.

The ADPCM-B part only has 1 channel, but the playback frequency can be changed from 1.85kHz to: 18.5185 * 3 (1 access every 2 ADPCM-A channel access max) = 55.555kHz.

Audio is compressed as 4bit per sample and played back as 16bit.

Samples can be any size from 256 bytes to 1MiB, by 256 bytes steps. Samples cannot cross 1MB pages (the 4 MSBs of the end address should be equal to the start address).

See YM2610 registers: ADPCM-A and ADPCM-B

CPU communication

See Z80/YM2610 interface.

Multiplexed PCM bus

Access to the V ROMs are made via partly multiplexed buses.

The SDRMPX and SDPMPX signals are used to drive latches or the PCM chip in cartridges to demultiplex data. When SDROE or SDPOE goes low, SDRAD* and SDPAD* are tristated so that the V ROMs can output data.

  • SDRA* for ADPCM-A
SDRMPX SDRAD* SDRA*
0 1 2 3 4 5 6 7 8 9 20 21 22 23
Low to high 0 1 2 3 4 5 6 7 8 9 ? ? ? ?
High to low 10 11 12 13 14 15 16 17 18 19 20 21 22 23
  • SDPA* for ADPCM-B
SDPMPX SDPAD* SDPA*
0 1 2 3 4 5 6 7 8 9 10 11
Low to high 0 1 2 3 4 5 6 7 8 9 10 11
High to low 12 13 14 15 16 17 18 19 20 21 22 23

24 bits allows for 16MiB max V ROMs (without bankswitching).

Trivia

  • A lot of games have several recordings of the same instrument playing different notes, rather than having only one sample and change the ADPCM-B playback frequency to vary its pitch. (Trumpet in Viewpoint, electric guitar in Super Sidekicks). Why ?
  • Nazca's sound drivers are able to use the SSG channels for music playback. (Maybe all can ?)

Datasheet

Incomplete/translated datasheet: [YM2610.pdf]