💦 CREATE AND FUCK YOUR OWN AI CUMSLUT 🔥 TRY NOW ♥
Create AI Cumsluts 💦
May 12, 2020

Emulators inside FPGA cores!

(español abajo)
We are all in here because we want accuracy. We want no lag. We want the original speed. We even want the original glitches! And FPGA is the technology that provides it. FPGA allows you to make digital hardware at an affordable price. But what if I told you that you have used an emulator without knowing!
Here's the deal: you can fit any kind of circuit in an FPGA and that includes of course CPUs. We are used to having Z80 and 68000 CPUs synthesized inside. But some cores out there have invited an extra Z80. What for? It runs a Yamaha OPL3 emulator. Yes, there is an emulator inside some cores!
Of course, an emulated Yamaha OPL3 is better than no Yamaha at all. But can this work? Well, as long as it keeps the interface of the original chip, the rest of the system will not notice it. If the CPU speed is fast enough and the emulator code is written with care, you could get virtually identical input and output signals in the interface to those of a hardware implementation. Is that the case for the OPL3 core? I don't think so.
The OPL3 uses MAME's source code for OPL3. This code does not process signals in the same way as the original hardware and will have different output delays and glitches than the original. Not only that, but there is also a queue for commands that arrive to the OPL3 so the Z80 will not miss them when it is struggling to catch up. So commands will not be processed at the same time than in the original hardware.
Don't take me wrong. I think the author of this sound core made a very good engineering job. He put something together very quickly. And it works. But even if this core was achieving correct input and output signals at the right time... I would still prefer to have a hardware solution. But maybe that's just me.
(español)
Te compraste tu FPGA. Le has dicho adiós a la emulación. Eres el más chulo del barrio. Pues no. Te han dado por gato liebre. ¡Mamá, hay un emulador en mi FPGA!
Pues sí, algunos cores que hay por ahí tienen dentro una CPU invitada por la puerta trasera: un Z80 cuya misión es ejecutar código de MAME. ¿Cómo lo ves?
Esto viene de que alguien queria tener un OPL3 y pensó que la manera más fácil era compilar el código de MAME para Z80 y meterlo en la FPGA. Es una solución rápida y no es tan sencillo como parece. Creo que es un buen trabajo de ingeniería pero, a mí me falta algo con eso.
Y es que aunque mantiene la interfaz eléctrica con el resto del sistema, por dentro funciona muy diferente. Aparte de lo obvio, hay dentro una cola de comandos. Cuando el sistema escribe datos al OPL3 este los guarda en una cola y los va leyendo conforme el Z80 puede porque... no le da la vida para más.
Resumiendo, es un buen trabajo de ingeniería y esta técnica puede resultar útil si se emplea con más atención a respetar los tiempos. Pero aun así, yo me sigo quedando con la solución hardware. Llamadme romántico.

Comments (20)

r
rsn8887 · June 12, 2020

Which cores use this OPL3 emulation?

K
Keith F. Kelly · May 16, 2020

The only exception I might approve of would be implementing a nice sample-based MIDI tone bank in an FPGA-ized CPU for pairing with relevant computer cores that supported using external MIDI devices for superior game music and/or composition software. x86, AtariST, and Sharp X68000 all come to mind.

J
Jordi · May 20, 2020

it might be fun to have a wavetable synthesis like Aztech sound cards running on Windows 95 for Packard Bell. That wavetable made duke nukem song really powerful.

J
Jo Tomiyori · May 14, 2020

Thank you for the very interesting article! :)

S
Sami Ullah · May 13, 2020

Great topic !!!

J
Jordi · May 13, 2020

una de las cosas que más noto (a parte del lag) con la megadrive original VS emulador es justamente el sonido de la música. NO suenan igual en emuladores. El core de mister diría que eso precisamente lo hace en FPGA porque no noto esa diferencia.

J
JOTEGO · May 13, 2020

El sonido de la Megadrive en el core de la MiSTer lo hice yo. 😉

b
bakayoyo · May 13, 2020

Just out of curiosity, why isn't the de-10 ARM processor used for the emulation of the OPL3?

J
JOTEGO · May 13, 2020

Delegating part of the work to an emulator inside the ARM has been in the mind of some people for sometime. That's not easy either. The ARM running an operating system is even less predictable than the Z80 used here. The Z80 solution is at least portable to other FPGA platforms

E
EkDor · May 12, 2020

Would like to see MiSTer remain as close to hardware as possible. Mame already exists for such mixing and blending. I appreciate all the years of work by so many for mame and related software emulations. But for those of us embracing fpga close to hardware I would think we want to stay close to it. As close as we can. No disrespect to those that have laid previous work; but we can’t evolve if we don’t accept change which is built on those foundations. In my short experience software emulation is not usable compared to the fpga solution .

n
nullobject · May 12, 2020

I saw your comment on twitter, thanks for explaining the situation. I would obviously prefer to use an accurate FM core in Rygar, but I don’t have the skills to reverse-engineer a real chip. How difficult do you think it would be, based on the other chips you have done? I’m happy to start looking into it.

J
JOTEGO · May 13, 2020

It's a lot of work actually

R
Ruben Blanco · May 12, 2020

👏👏👏👏 Explicando las cosas como son.

J
Juan Sandoval Jr · May 12, 2020

Jose, ya me la daba de guapo en el barrio, 😂 muy buen post

s
sylvain guego · May 12, 2020

thanks for the information ! but what are those horrible cores that use an emulated Yamaha OPL3 ?

J
JOTEGO · May 12, 2020

The system cores are good. It's just a component they have which can be improved.

p
patamar4 · May 12, 2020

That's why I saw a comment in the rygar 👀

J
Jeruro · May 12, 2020

ao486?

O
Oscar Laguna Garcia · May 12, 2020

Mójate y dinos algún core en donde ocurra esto, jajaja! Saludos.

J
JOTEGO · May 12, 2020

El de PC