PSG corregido y presentación JT89

Responder
Avatar de Usuario
jotego
Mensajes: 158
Registrado: 11 May 2016, 23:45
Ubicación: Valencia
Contactar:

PSG corregido y presentación JT89

Mensaje por jotego » 10 Mar 2017, 11:33

Había copiado el PSG (sn76489) de Papilio para el sonido PSG de la Megadrive. Y al usarlo me topé con algunos problemas:
  • Escalado de volumen incorrecto. Usa -3dB en vez de -2dB por paso.
  • La frecuencia del generador de ruido tiene varios fallos para los distintos modos de funcionamiento
  • La señal para reiniciar el ruido en cada escritura no existe
  • El generador de ruido tiene un fallo que le hace funcionar a ráfagas
  • Falta el circuito que previene el generador de ruido de bloquearse
Y también necesitaba esto:
  • Señal de salida con signo, sin componente en DC. O sea, cuando el canal está silenciado la salida es cero. Cuando está activo es un pulso entre +amplitud y -amplitud.
  • Usa un sólo reloj para todos los registros, con una entrada de clken así no hace falta añadir constraints para relojes internos. El original sí lo necesita y casi seguro que nadie las pone. Luego vienen las sorpresas :veoestrellas:
  • Canales de salida sumados pero también separados. Los separados vienen muy bien para pasarlos al interpolador del sigma-delta y que se sumen mientras se interpola. (Esto da para otra entrada que ya haré...)
He hecho un nuevo core de sn76489 en Verilog que tiene las correcciones y las mejoras: el JT89. De momento lo he probado someramente con la Megadrive y está funcionando bien. Aunque en los próximos días igual toco alguna cosita antes de darlo por bueno.

Si lo metéis en el core de Master System me daréis una alegría... A mí y a los usuarios.
Última edición por jotego el 10 Mar 2017, 20:09, editado 1 vez en total.

Avatar de Usuario
Quest
Mensajes: 900
Registrado: 27 Sep 2015, 00:20

Re: PSG corregido y presentación JT89

Mensaje por Quest » 10 Mar 2017, 11:41

Gracias Jotego, precisamente el mes pasado estuve buscando un core alternativo para el PSG de la SMS porque precisamente me encontré con los problemas que comentas. La implementación no era buena. Parcheé algunas partes para conseguir un pitch correcto y aun así estaba metiendo ruido incluso sin ser supuestamente activado.

Sin duda me voy a poner a revisar el tuyo inmediatamente para incorporarlo. Era algo que hacía falta.

Gracias de nuevo.
http://www.zxuno.com
ZX-Uno · Clon de ordenador ZX Spectrum basado en FPGA

Avatar de Usuario
DistWave
Mensajes: 183
Registrado: 14 Oct 2015, 19:24
Ubicación: Zaragoza

Re: PSG corregido y presentación JT89

Mensaje por DistWave » 10 Mar 2017, 12:18

Yo también lo voy a probar, metiéndolo en el core de PC/XT con el audio Tandy :silbando:
Mil gracias!

Avatar de Usuario
jotego
Mensajes: 158
Registrado: 11 May 2016, 23:45
Ubicación: Valencia
Contactar:

Re: PSG corregido y presentación JT89

Mensaje por jotego » 10 Mar 2017, 14:26

Me alegro mucho de que vaya a encontrar uso tan rápido en el ZX-UNO.

Si encontráis algún problema podéis escribirlo en la sección issues de github (aquí) Me comprometo a pulirlo todo.

Avatar de Usuario
jotego
Mensajes: 158
Registrado: 11 May 2016, 23:45
Ubicación: Valencia
Contactar:

Re: PSG corregido y presentación JT89

Mensaje por jotego » 08 Dic 2018, 22:20

Últimamente he estado revisando este core y lo he dejado bien pulido. Ahora es el que se usa en el FPGAgen, junto con el jt12. He hecho un pull request para que se use en el core de Master System de MiST. He hecho muchas correcciones:

-Clock enable bien generado en el flanco negativo
-Filtro paso bajo para eliminar bordes abruptos
-Tabla de volumen de 2dB correcta (usando 20*log10, y no 10*log10) y con buena resolución
-Varias pequeñas funciones que deberían mejorar la precisión según lo documentado por la red
-Ruído generado a la frecuencia correcta

En el core de Megadrive se nota bastante la mejora, sobre todo cuando los juegos hacen barridos de volumen. El de Master System de MiST usaba el mismo core viejo de PSG así que la mejora debería ser notable también.

PiyoTaro
Mensajes: 12
Registrado: 27 Sep 2018, 21:18

Re: PSG corrected and presentation JT89

Mensaje por PiyoTaro » 09 Dic 2018, 09:07

About "DCSG" (name in English Wikipedia) core. It is said that just changed the volume scale to logarithm, but please also consider reproducing the noise generator.

It is reported as EN-Wikipedia article that the algorithm of noise generator is different between TI original and SEGA clone.
In GAME GEAR, some registers are changed to support stereo output.
https://en.wikipedia.org/wiki/Texas_Ins ... successors

In JP-Wikipedia, the article states that "Duty ratio of channel 3 can be changed by setting a noise generator, the pitch will shift by a semitone". (I think it is an example in the Sega Master System)
https://ja.wikipedia.org/wiki/Programma ... 5%E6%A7%98
https://translate.google.co.jp/translat ... _Generator

Postscript.
Are you interested in "WSG" such as Konami's SCC and PCEngine?
I think that it is interesting if there is a device that can change the sound of old game from square wave to sawtooth etc. by replacing with PSG (AY). :concascos:

Avatar de Usuario
jotego
Mensajes: 158
Registrado: 11 May 2016, 23:45
Ubicación: Valencia
Contactar:

Re: PSG corrected and presentation JT89

Mensaje por jotego » 19 Ene 2019, 08:54

PiyoTaro escribió:About "DCSG" (name in English Wikipedia) core. It is said that just changed the volume scale to logarithm, but please also consider reproducing the noise generator.

It is reported as EN-Wikipedia article that the algorithm of noise generator is different between TI original and SEGA clone.
In GAME GEAR, some registers are changed to support stereo output.
https://en.wikipedia.org/wiki/Texas_Ins ... successors

In JP-Wikipedia, the article states that "Duty ratio of channel 3 can be changed by setting a noise generator, the pitch will shift by a semitone". (I think it is an example in the Sega Master System)
https://ja.wikipedia.org/wiki/Programma ... 5%E6%A7%98
https://translate.google.co.jp/translat ... _Generator

Postscript.
Are you interested in "WSG" such as Konami's SCC and PCEngine?
I think that it is interesting if there is a device that can change the sound of old game from square wave to sawtooth etc. by replacing with PSG (AY). :concascos:
I think I have noise correctly implemented... in the SEGA way. As the core is to be used in Megadrive/Master System cores.

I think WSG is what the Japanese called Hakei-memory. It is a nice idea that worked very well. The arcade Nemesis uses it too.

PiyoTaro
Mensajes: 12
Registrado: 27 Sep 2018, 21:18

Re: PSG corregido y presentación JT89

Mensaje por PiyoTaro » 19 Ene 2019, 12:57

There are several kinds of Konami "SCC" sound chips, but those adopted for game cartridges of MSX have 5 channels "Reproduce with 1 cycle of waveforms with 8 bits 32 samples".
Also, with NEC's PC engine ("TurboGraphics" in the United States), you can use up to 6 channels of "1 cycle 5 bit 32 samples" sound.

---
About SCC, I have posted to the "ZXSpectrum Next Official Forum".

About the implementation of FM Sound of ZXNext, the circuit size of "SID" was too large to be drowned. Also, it was an answer that "OPN software core" can not be adopted.
However, it seems that the development of the core is still continuing from the debate of the Official Facebook, so I would like to propose not only the Sprite but also the extension of the music function.
Is there a small synthesizer core compared to OPLL (or Konami VRC7) or SID?

When I heard a lot of past C64 soundtracks, even if there are no filters or ring modulator, if you can select some preset waveforms close to the basic waveform (sawtooth wave, triangular wave etc.), a sound similar to SID I thought that I could make it.
Approach to further simplify the function of SID. For example, you can create something like a synthesizer by choosing the waveform shape for each half cycle of the output waveform, or designating the duty ratio of the output waveform.
The merit of adopting the synthesizer chip is that it is possible to "change the timbre over time", but it can also be reproduced by playing one part with multiple sound sources.
Since "AY-3-891x" has the upper bit of the register fixed to "0", I think that the function can be extended. I posted such a thing on the official forum of ZXNext.

"Turbo sound", AY is adopted. Would it be possible to adopt the waveform memory sound?
Add 6ch * 32 samples = 192 waveform memories to the SAA 1099 like register map. I think that it may be possible to sacrifice "noise generator" and "hardware envelope function".

Also, if Konami "SCC" is reproduced by FPGA, how big can it be realized by the circuit size compared to OPLL and SID?

Responder