Technical articleArtículo técnico

Introduction to Mega Drive AudioIntroducción al audio de Mega Drive

A broad map of the Mega Drive audio system, sound chips, drivers, and data flow.Un mapa general del sistema de audio de Mega Drive, chips de sonido, drivers y flujo de datos.

PublishedPublicado

September 22, 202622 de septiembre de 2026

UpdatedActualizado

September 25, 202625 de septiembre de 2026

DifficultyDificultad

BeginnerInicial

Reading timeTiempo de lectura

6 min read6 min de lectura

The sound system at a glanceEl sistema de sonido de un vistazo

Mega Drive sound combines an FM synthesizer, a PSG and software that controls them. The Yamaha YM2612 provides six FM channels with four operators per channel. The PSG provides three square-wave tone channels and one noise channel. Their outputs contribute to the console's audio; an instrument in a song is not necessarily a recorded sample.El sonido de Mega Drive combina un sintetizador FM, un PSG y software que los controla. El Yamaha YM2612 proporciona seis canales FM con cuatro operadores por canal. El PSG aporta tres canales de tono de onda cuadrada y uno de ruido. Sus salidas contribuyen al audio de la consola; un instrumento de una canción no es necesariamente una muestra grabada.

Think of three layers: stored music and sound-effect data, a driver interpreting that data, and writes to the sound hardware. The chips do not understand a game's song IDs, track pointers or the way notes are stored in a sequence. The driver interprets that information and turns it into instructions for the chips.Piensa en tres capas: los datos de música y efectos, el driver que los interpreta y las órdenes que llegan a los chips de sonido. Los chips no entienden los identificadores de canciones, los punteros de pistas ni cómo están guardadas las notas de una melodía. El driver interpreta esa información y la convierte en instrucciones para los chips.

FM instrumentsInstrumentos FM

An FM instrument is defined by parameters such as operator envelopes, frequency relationships and how operators are connected. A driver changes pitch, level and key state over time to play notes. Editing an instrument definition is different from replacing an audio recording.Un instrumento FM se define mediante parámetros como envolventes de operadores, relaciones de frecuencia y conexiones entre operadores. El driver cambia tono, nivel y estado de activación para reproducir notas. Editar la definición de un instrumento es distinto de sustituir una grabación.

Channels are limited and may be shared between music and effects. A sound effect can temporarily take over a channel, so a missing note during gameplay may reflect a driver's priority policy rather than corrupt song data. Instrument tables and sequence commands differ between drivers.Los canales son limitados y pueden compartirse entre música y efectos. Un efecto puede ocupar temporalmente un canal, de modo que una nota ausente durante el juego puede reflejar la política de prioridades del driver y no datos musicales corruptos. Las tablas de instrumentos y órdenes de secuencia cambian entre drivers.

PSG tones and noiseTonos y ruido PSG

The PSG generates simple tones and noise that can supplement FM voices, provide percussion or create effects. Software controls tone periods and attenuation. A smaller tone period generally means a higher pitch; a larger attenuation value means a quieter output. Noise can use fixed clock selections or a rate derived from tone channel 3.El PSG genera tonos simples y ruido que pueden complementar voces FM, aportar percusión o crear efectos. El software controla períodos de tono y atenuación. Un período menor normalmente produce un tono más agudo; una atenuación mayor produce menor volumen. El ruido puede utilizar selecciones de reloj fijas o un ritmo derivado del canal de tono 3.

When the noise rate depends on tone channel 3, changing that channel's frequency also changes the noise. Before editing a pitch or volume value, check whether the instruction controls the PSG or FM: they use different settings.Cuando el ruido depende del canal de tono 3, cambiar la frecuencia de ese canal también modifica el ruido. Antes de editar un valor de tono o volumen, comprueba si la instrucción controla el PSG o la síntesis FM: sus ajustes son diferentes.

DAC playback and samplesReproducción DAC y muestras

The YM2612 can use its sixth channel for DAC sample playback instead of that channel's normal FM output. Software feeds 8-bit sample values to the DAC data register. This is not an extra independent seventh FM channel, nor a hardware player that automatically understands WAV files.El YM2612 puede utilizar su sexto canal para reproducir muestras por DAC en lugar de la salida FM normal de ese canal. El software envía valores de muestra de 8 bits al registro de datos DAC. No es un séptimo canal FM independiente ni un reproductor que entienda automáticamente archivos WAV.

A driver can decode compressed samples or mix several software voices before producing the stream sent to the DAC. Sample rate, encoding, length, looping and update timing belong to the driver and resource format. Replacing bytes without checking these properties can alter pitch, truncate playback or make the driver read beyond the resource.Un driver puede decodificar muestras comprimidas o mezclar varias voces por software antes de producir el flujo enviado al DAC. Frecuencia de muestreo, codificación, longitud, bucle y tiempos de actualización dependen del driver y del formato. Sustituir bytes sin comprobarlo puede cambiar el tono, cortar la reproducción o provocar lecturas fuera del recurso.

The 68000, Z80 and driverEl 68000, el Z80 y el driver

Many games run substantial sound-driver code on the Z80 and send requests from the 68000 through shared memory or command structures. Other arrangements exist, including work handled by the 68000. There is no single mandatory driver architecture for all Mega Drive games.Muchos juegos ejecutan gran parte del driver en el Z80 y envían peticiones desde el 68000 mediante memoria compartida o estructuras de órdenes. Existen otras distribuciones, incluido trabajo realizado por el 68000. No hay una arquitectura única obligatoria para todos los juegos de Mega Drive.

For example, pressing a button in a menu may make the game send a sound ID to the driver. The driver uses it to find the notes or sample to play, then sends the necessary instructions to the sound chips. That ID is not necessarily a ROM address: to locate the sound, follow how the driver looks it up in its resource table.Por ejemplo, al pulsar un botón en un menú, el juego puede enviar al driver el identificador del sonido que debe reproducir. El driver lo utiliza para buscar las notas o la muestra de audio y después envía las instrucciones necesarias a los chips. Ese identificador no tiene por qué ser una dirección de la ROM: para localizar el sonido, hay que seguir cómo lo busca el driver en su tabla de recursos.

Investigating one soundInvestigar un sonido

Start with a sound you can easily play again: the beep when moving through a menu, a referee's whistle or a voice heard at the start of a race. Note which version of the game you are using and when the sound plays, so you can return to the same point while investigating it.Empieza por un sonido que puedas escuchar varias veces sin dificultad: el pitido al moverte por un menú, el silbato del árbitro o una voz al comenzar una carrera. Anota qué versión del juego estás usando y en qué momento suena, para poder volver al mismo punto mientras lo investigas.

If your emulator lets you mute individual sound channels, turn them off one at a time and listen for the sound to disappear. This helps you work out whether it comes from FM synthesis, the PSG or a sample played through the DAC. It is a useful first clue, although it does not yet tell you where the sound is stored in the ROM.Si el emulador permite silenciar canales de sonido por separado, desactívalos uno a uno y escucha cuándo desaparece el sonido que buscas. Así puedes empezar a distinguir si procede de la síntesis FM, del PSG o de una muestra reproducida por el DAC. Es una primera pista útil, aunque todavía no te dice dónde está guardado en la ROM.

The next step takes some debugger work: find the instruction or command that triggers the sound and follow how the sound driver handles it. The aim is to locate the data it reads, which might be a sequence of notes, an instrument definition or a sample. A log of sound-chip writes can help explain how the sound is produced, but it does not directly reveal how those source data are organized in the game.El siguiente paso requiere trabajar con el depurador: localizar la instrucción u orden que hace sonar ese efecto y seguir cómo la procesa el driver de sonido. Lo que buscas son los datos que lee, ya sean una secuencia de notas, la definición de un instrumento o una muestra de audio. Un registro de las escrituras a los chips puede ayudarte a entender cómo se produce el sonido, pero no muestra directamente cómo están organizados esos datos dentro del juego.

Once you have located the data, make a small change on a copy of the ROM and listen to the result. Try it both on its own and alongside music or other effects, since they may share channels. If the game supports PAL and NTSC, check both: some drivers depend on the video frame rate, which can affect music tempo or playback timing.Cuando hayas localizado los datos, haz un cambio pequeño en una copia de la ROM y escucha el resultado. Pruébalo tanto por separado como junto a la música y otros efectos, porque pueden compartir canales. Si el juego admite PAL y NTSC, comprueba ambos modos: algunos drivers dependen de la frecuencia de vídeo, lo que puede afectar al tempo de la música o a los tiempos de reproducción.

ReferencesReferencias

SGDK: YM2612 register accessSGDK: PSG tone, attenuation and noiseSGDK XGM2: one example of a software sound driver