Muestra las diferencias entre dos versiones de la página.
Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
tutorial_de_ensamblador_sonido [10/10/2010 01:42] 93.156.171.149 |
tutorial_de_ensamblador_sonido [10/10/2010 11:39] 93.156.171.149 |
||
---|---|---|---|
Línea 30: | Línea 30: | ||
Vamos a ver a continuación los registros del sistema de sonido y sus funciones: | Vamos a ver a continuación los registros del sistema de sonido y sus funciones: | ||
- | == Canal 1 - Tono y portamento == | + | ==== Canal 1 - Tono y portamento ==== |
===$FF10 - NR10 - Registro de portamento del canal 1(R/W)=== | ===$FF10 - NR10 - Registro de portamento del canal 1(R/W)=== | ||
Línea 96: | Línea 96: | ||
- | == Canal 2 - Tono == | + | ==== Canal 2 - Tono ==== |
Este canal funciona exactamente igual que el 1, pero no tiene un registro de portamento. | Este canal funciona exactamente igual que el 1, pero no tiene un registro de portamento. | ||
- | ===FF16 - NR21 - Channel 2 Sound Length/Wave Pattern Duty (R/W)=== | + | ===$FF16 - NR21 - Canal 2 Longitud/Ciclo de trabajo (R/W)=== |
- | Bit 7-6 - Wave Pattern Duty (Read/Write) | + | Bit 7-6 - Ciclo de trabajo (R/W) |
- | Bit 5-0 - Sound length data (Write Only) (t1: 0-63) | + | Bit 5-0 - Longitud (R) (t1: 0-63) |
- | Wave Duty: | + | Ciclo de trabajo: |
00: 12.5% ( _-------_-------_------- ) | 00: 12.5% ( _-------_-------_------- ) | ||
Línea 112: | Línea 112: | ||
11: 75% ( ______--______--______-- ) | 11: 75% ( ______--______--______-- ) | ||
- | Sound Length = (64-t1)*(1/256) seconds | + | Longitud = (64-t1)*(1/256) segundos |
- | The Length value is used only if Bit 6 in NR24 is set. | + | La longitud solo se utiliza si el Bit 6 en NR14 está a uno. |
- | ===FF17 - NR22 - Channel 2 Volume Envelope (R/W)=== | + | ===$FF17 - NR22 - Canal 2 Envolvente (R/W)=== |
- | Bit 7-4 - Initial Volume of envelope (0-0Fh) (0=No Sound) | + | Bit 7-4 - Volumen inicial de la envolvente (0-0Fh) (0=Sin sonido) |
- | Bit 3 - Envelope Direction (0=Decrease, 1=Increase) | + | Bit 3 - Dirección de la envolvente (0=Decrece, 1=Crece) |
- | Bit 2-0 - Number of envelope sweep (n: 0-7) | + | Bit 2-0 - Periodo (n: 0-7) |
- | (If zero, stop envelope operation.) | + | (si es cero, la envolvente no actua.) |
- | Length of 1 step = n*(1/64) seconds | + | Longitud de un paso = n*(1/64) segundos |
- | FF18 - NR23 - Channel 2 Frequency lo data (W) | + | ===$FF18 - NR23 - Canal 2 - Frecuencia (lo) (W)=== |
- | Frequency's lower 8 bits of 11 bit data (x). | + | |
- | Next 3 bits are in NR24 ($FF19). | + | |
- | ===FF19 - NR24 - Channel 2 Frequency hi data (R/W)=== | + | 8 bits bajos de los 11 bit de la frecuencia (x). |
+ | Los siguientes 3 bits están en NR24 ($FF19) | ||
- | Bit 7 - Initial (1=Restart Sound) (Write Only) | + | ===$FF19 - NR24 - Canal 2 - Frecuencia (hi) (R/W)=== |
- | Bit 6 - Counter/consecutive selection (Read/Write) | + | |
- | (1=Stop output when length in NR21 expires) | + | |
- | Bit 2-0 - Frequency's higher 3 bits (x) (Write Only) | + | |
- | Frequency = 131072/(2048-x) Hz | + | Bit 7 - Disparador (1=Reinicia el sonido) (W) |
+ | Bit 6 - Activa o desactiva la longitud (R/W) | ||
+ | (1=Detiene el sonido cuando alcanza la longitud en NR21) | ||
+ | Bit 2-0 - 3 bits altos de la frecuencia (x) (W) | ||
+ | Frecuencia = 131072/(2048-x) Hz | ||
- | == Sound Channel 3 - Wave Output == | + | ==== Canal 3 - Onda programable ==== |
- | This channel can be used to output digital sound, the length of the sample buffer (Wave RAM) is limited to 32 digits. This sound channel can be also used to output normal tones when initializing the Wave RAM by a square wave. This channel doesn't have a volume envelope register. | + | Este canal se puede usar para reproducir sonido digital, pero la longitud del buffer de samples (RAM de onda) Está limitada a 32 valores de 4 Bits. Se podria usar este canal para sacar notas normales si inicicalizamos la memoria de onda con los valores de una onda cuadrada. No dispone de control de envolvente. |
- | ===FF1A - NR30 - Channel 3 Sound on/off (R/W)=== | + | ===$FF1A - NR30 - Canal 3 on/off (R/W)=== |
- | Bit 7 - Sound Channel 3 Off (0=Stop, 1=Playback) (Read/Write) | + | Bit 7 - Apaga o enciende el canal (0=Detenido, 1=Reproduce) (R/W) |
- | ===FF1B - NR31 - Channel 3 Sound Length=== | + | ===$FF1B - NR31 - Canal 3 - Longitud=== |
- | Bit 7-0 - Sound length (t1: 0 - 255) | + | Bit 7-0 - Longitud (t1: 0 - 255) |
- | Sound Length = (256-t1)*(1/256) seconds | + | Longitud = (256-t1)*(1/256) segundos. |
- | This value is used only if Bit 6 in NR34 is set. | + | Este valor sólo se usa si el bit 6 de NR34 está a uno. |
- | ===FF1C - NR32 - Channel 3 Select output level (R/W)=== | + | ===$FF1C - NR32 - Canal 3 - Nivel de salida (R/W)=== |
- | Bit 6-5 - Select output level (Read/Write) | + | Bit 6-5 - Seleccionar volumen de la salida (R/W) |
- | Possible Output levels are: | + | Posibles valores son: |
- | 0: Mute (No sound) | + | 00: Apagado (sin sonido) |
- | 1: 100% Volume (Produce Wave Pattern RAM Data as it is) | + | 01: 100% Volumen (Datos de la RAM de onda tal cual) |
- | 2: 50% Volume (Produce Wave Pattern RAM data shifted once to the right) | + | 10: 50% Volumen (Datos de la RAM de onda desplazados una vez a la derecha) |
- | 3: 25% Volume (Produce Wave Pattern RAM data shifted twice to the right) | + | 11: 25% Volumen (Datos de la RAM de onda desplazados dos veces a la derecha) |
- | ===FF1D - NR33 - Channel 3 Frequency's lower data (W)=== | + | ===$FF1D - NR33 - Canal 3 - Frecuencia (lo) (W)=== |
- | Lower 8 bits of an 11 bit frequency (x). | + | 8 bits bajos de la frecuencia del canal(x). |
- | ===FF1E - NR34 - Channel 3 Frequency's higher data (R/W)=== | + | ===$FF1E - NR34 - Canal 3 - Frecuencia (hi) (R/W)=== |
- | Bit 7 - Initial (1=Restart Sound) (Write Only) | + | Bit 7 - Disparador (1=Reinicia el sonido) (W) |
- | Bit 6 - Counter/consecutive selection (Read/Write) | + | Bit 6 - Activa o desactiva la longitud (R/W) |
- | (1=Stop output when length in NR31 expires) | + | (1=Detiene el sonido cuando alcanza la longitud en NR11) |
- | Bit 2-0 - Frequency's higher 3 bits (x) (Write Only) | + | Bit 2-0 - 3 bits altos de la frecuencia (x) (W) |
- | Frequency = 4194304/(64*(2048-x)) Hz = 65536/(2048-x) Hz | + | Frecuencia = 131072/(2048-x) Hz |
- | ===FF30-FF3F - Wave Pattern RAM=== | + | ===$FF30-$FF3F - Memoria de onda=== |
- | Contents - Waveform storage for arbitrary sound data | + | Contiene los valores para la generación de la onda. |
- | This storage area holds 32 4-bit samples that are played back upper 4 bits first. | + | Esta memoria se organiza en 32 valores de 4 bit que se reproducen con los 4 bits altos en primer lugar. |
+ | ==== Canal 4 - Ruido ==== | ||
- | == Sound Channel 4 - Noise == | + | Este canal se usa para reproducir ruido blanco. Esto se logra variando la amplitud aleatoriamente dada una frecuencia. Dependiendo de la frecuencia, el ruido parecerá más "duro" o "blando". |
- | This channel is used to output white noise. This is done by randomly switching the amplitude between high and low at a given frequency. Depending on the frequency the noise will appear 'harder' or 'softer'. | + | También se puede influenciar la salida del generador de números aleatorios, permitiendo menos variación y asi una salida de tono casi normal. |
- | It is also possible to influence the function of the random generator, so the that the output becomes more regular, resulting in a limited ability to output Tone instead of Noise. | + | ===$FF20 - NR41 - Canal 4 - Longitud (R/W)=== |
- | ===FF20 - NR41 - Channel 4 Sound Length (R/W)=== | + | Bit 5-0 - Longitud (R) (t1: 0-63) |
- | Bit 5-0 - Sound length data (t1: 0-63) | + | Longitud = (64-t1)*(1/256) segundos |
+ | La longitud solo se utiliza si el Bit 6 en NR44 está a uno. | ||
- | Sound Length = (64-t1)*(1/256) seconds | + | ===$FF21 - NR42 - Canal 4 - Envolvente (R/W)=== |
- | The Length value is used only if Bit 6 in NR44 is set. | + | |
- | ===FF21 - NR42 - Channel 4 Volume Envelope (R/W)=== | + | Bit 7-4 - Volumen inicial de la envolvente (0-0Fh) (0=Sin sonido) |
+ | Bit 3 - Dirección de la envolvente (0=Decrece, 1=Crece) | ||
+ | Bit 2-0 - Periodo (n: 0-7) | ||
+ | (si es cero, la envolvente no actua.) | ||
- | Bit 7-4 - Initial Volume of envelope (0-0Fh) (0=No Sound) | + | Longitud de un paso = n*(1/64) segundos |
- | Bit 3 - Envelope Direction (0=Decrease, 1=Increase) | + | |
- | Bit 2-0 - Number of envelope sweep (n: 0-7) | + | |
- | (If zero, stop envelope operation.) | + | |
- | Length of 1 step = n*(1/64) seconds | + | ===$FF22 - NR43 - Canal 4 - Contador polinómico (R/W)=== |
+ | La amplitud se cambia aleatoriamente entre alto y bajo a la frecuencia dada. Una frecuencia alta hará el ruido más "suave". | ||
+ | Cuando el bit 3 está a uno, la salida es más regular, y algunas frecuencias suenan más como tono que como ruido. | ||
- | ===FF22 - NR43 - Channel 4 Polynomial Counter (R/W)=== | + | Bit 7-4 - Frecuencia del reloj de desplazamiento (s) |
- | The amplitude is randomly switched between high and low at the given frequency. A higher frequency will make the noise to appear 'softer'. | + | Bit 3 - Longitud del contador (0=15 bits, 1=7 bits) |
- | When Bit 3 is set, the output will become more regular, and some frequencies will sound more like Tone than Noise. | + | Bit 2-0 - Radio de división de las frecuencias (r) |
- | Bit 7-4 - Shift Clock Frequency (s) | + | Frecuencia = 524288 Hz / r / 2^(s+1) ; Para r=0, se comporta como si r=0.5 |
- | Bit 3 - Counter Step/Width (0=15 bits, 1=7 bits) | + | |
- | Bit 2-0 - Dividing Ratio of Frequencies (r) | + | |
- | Frequency = 524288 Hz / r / 2^(s+1) ;For r=0 assume r=0.5 instead | + | ===$FF23 - NR44 - Channel 4 - Contador; Disparador (R/W)=== |
- | ===FF23 - NR44 - Channel 4 Counter/consecutive; Inital (R/W)=== | + | Bit 7 - Disparador (1=Reinicia el sonido) (W) |
+ | Bit 6 - Activa o desactiva la longitud (R/W) | ||
+ | (1=Detiene el sonido cuando alcanza la longitud en NR21) | ||
- | Bit 7 - Initial (1=Restart Sound) (Write Only) | + | ==== Registros de control generales del sonido ==== |
- | Bit 6 - Counter/consecutive selection (Read/Write) | + | |
- | (1=Stop output when length in NR41 expires) | + | |
+ | ===$FF24 - NR50 - Control de volumen / 5º Canal (R/W)=== | ||
+ | Los bits de volumen controlan el Volumen principal de las salidas izquierda y derecha. | ||
+ | Bit 7 - Vin sale por SO2 (1=activado) | ||
+ | Bit 6-4 - Volumen de SO2 (0-7) | ||
+ | Bit 3 - Vin sale por SO1 (1=Activado) | ||
+ | Bit 2-0 - Volumen de SO1 (0-7) | ||
- | == Sound Control Registers == | + | La señal Vin viene del bus del cartucho, permitiendo a hardware externo en este, añadir un quinto canal a los cuatro internos de la GameBoy. |
- | ===FF24 - NR50 - Channel control / ON-OFF / Volume (R/W)=== | + | ===$FF25 - NR51 - Selección de salida de cada canal (R/W)=== |
- | The volume bits specify the "Master Volume" for Left/Right sound output. | + | |
- | Bit 7 - Output Vin to SO2 terminal (1=Enable) | + | Nos permite enviar cada canal a la salida izquierda o derecha (o a ambas o ninguna). |
- | Bit 6-4 - SO2 output level (volume) (0-7) | + | |
- | Bit 3 - Output Vin to SO1 terminal (1=Enable) | + | |
- | Bit 2-0 - SO1 output level (volume) (0-7) | + | |
- | + | ||
- | The Vin signal is received from the game cartridge bus, allowing external hardware in the cartridge to supply a fifth sound channel, additionally to the gameboys internal four channels. As far as I know this feature isn't used by any existing games. | + | |
- | + | ||
- | ===FF25 - NR51 - Selection of Sound output terminal (R/W)=== | + | |
- | + | ||
- | Bit 7 - Output sound 4 to SO2 terminal | + | |
- | Bit 6 - Output sound 3 to SO2 terminal | + | |
- | Bit 5 - Output sound 2 to SO2 terminal | + | |
- | Bit 4 - Output sound 1 to SO2 terminal | + | |
- | Bit 3 - Output sound 4 to SO1 terminal | + | |
- | Bit 2 - Output sound 3 to SO1 terminal | + | |
- | Bit 1 - Output sound 2 to SO1 terminal | + | |
- | Bit 0 - Output sound 1 to SO1 terminal | + | |
+ | Bit 7 - Canal 4 a la salida SO2 | ||
+ | Bit 6 - Canal 3 a la salida SO2 | ||
+ | Bit 5 - Canal 2 a la salida SO2 | ||
+ | Bit 4 - Canal 1 a la salida SO2 | ||
+ | Bit 3 - Canal 4 a la salida SO1 | ||
+ | Bit 2 - Canal 3 a la salida SO1 | ||
+ | Bit 1 - Canal 2 a la salida SO1 | ||
+ | Bit 0 - Canal 1 a la salida SO1 | ||
===$FF26 - NR52 - Sonido Encendido/Apagado=== | ===$FF26 - NR52 - Sonido Encendido/Apagado=== | ||
Línea 258: | Línea 256: | ||
Los Bits 0-3 de este registro, son sólamente bits de estátus, escribir en ellos no activa o desactiva el sonido de esos canales. Estos flags se ponen a uno cuando se activa el flag "Disparador" del canal (Bit 7 en NR14-NR44), el flag permanece a uno mientras dure la longitud del sonido (si está activa). Una envolvente que ha hecho bajar la amplitud a cero, no desactivaria este flag. | Los Bits 0-3 de este registro, son sólamente bits de estátus, escribir en ellos no activa o desactiva el sonido de esos canales. Estos flags se ponen a uno cuando se activa el flag "Disparador" del canal (Bit 7 en NR14-NR44), el flag permanece a uno mientras dure la longitud del sonido (si está activa). Una envolvente que ha hecho bajar la amplitud a cero, no desactivaria este flag. | ||
+ | |||
+ |