Rebuilding today's emulators - to perfection!
It's been a great many years of classic gaming emulation. For me it began with Microsoft Arcade and the Activision 2600 ActionPacks. Those and the likes of DASarcade and Sparcade. Not forgetting Digital Eclipse's 6-pack. Or how about Mike Cuddy's Gyruss audio emulator! Anybody remember that one? Well, just having the opportunity to bring home the classic games we played as kids it a wonder in and of itself! Or perhaps you've a love for the home systems such as Intellivision or the VCS or Colecovision. Same thing. So if you're an emulator author or a rom dumper; a tip of the hat for making it all happen.
A problem
One big stink I have with all emulators is how they are architected. On one hand we have the small operations like the now-defunt PCAE and z26 that are really just about bare-bones and would run on a fast 486. Then we have huge Department-of-Defense mainframe-sized code of MAME and MESS; both of which are a big mess in and of themselves.
Considering today's i7 processors (I'm sure we said the same thing in the Pentium MMX days too) this seemingly bloated code isn't much problem nowadays. Sure bloat is inelegant but who gives a rat's ass? It runs your games and that's good enough for me. But I think we can do better. Not in shrinking shit down, but by adding to it even more!
An emulator written in the 486 days was pretty bare bones, it only got the necessary things 100% right, like the core logic of the machine being emu'd. This would be like making sure the TIA and 6507 are doing things correctly. That's a requirement. If that isn't done right, shit, games won't really work will they? Next comes the output, sound is easy and few emulators have difficulty with it. So we won't touch on that.
And yet, at the same time, I like the modular approach of MESS and MAME. All the modules, the cpu cores, the input sub-routines, the sound modules, custom logic gate arrays. All defined as libraries. All that shit. I don't fully understand the inner workings of any emulator beyond pointing it to a rom and pressing the start button. Nor do I give a shit. As far I'm concerned the flowchart can deep-six itself and I'm just as happy. Get in, start the engine and peel out!
Don't get me started on JAVA based emulators. This is all the wrong language and way too high-level to do emulator development work in. I'm not a programmer and will never have the desire to learn beyond
10 A=A+1
20 Print A
30 Goto 10
..but I can tell you from using several Java and web-based emulators that they just plain suck. I don't care how you rationalize it, I don't care if you spent 3 years making it and it won the nobel prize because it can work on a machine no more powerful than a 4004 and emulate Crysis in DosBox. Just shut up about it. It can solve world hunger too! I don't wanna hear it!
But back on point. It is the modular approach which is of interest; and we need to expand it one more step. And a monumental step it would be.
Some things we need to look at
Like all the pre-made Z-80 cores and libraries used in modern-day emulators and what not - we need a CRT core. We need a real CRT emulator. This would be one chunk of code, completely separate and independent from any existing emulator. Totally stand alone. Stand-alone-enough that if you were to run it it would either give you a display full of black and white snow or a black screen. Don't insult me by flipping between a few screens of seemingly random dots at high speed. That is just lame.
This "module" if you will, that I am describing, is a standalone bit of code that simulates to the best of its ability all the characteristics of an analog CRT assembly. This would include simulating, in-depth, the following:
1- the standard faire of analog circuitry in a real TV chassis and assembly, the amplifiers & filters
2- flyback voltage and acceleration
3- horizontal and vertical amplifiers and drivers
4- electron gun operation
5- beam sweep
6- vertical freqencies of 30Hz to 250Hz with 0.1Hz granulation
7- color subcarrier of 3.57MHz
8- horizontal freqencies of 24kHz to perhaps 500kHz, again with 0.1Hz resolution
9- variable video bandwidth, beginning at 4.5MHz ranging to some big number like 50MHz or something
10- power supply variances
11- the various CRT geometry & picture adjustments we all know and love, like H.hold V.hold, contrast, color, tint, saturation, hue, convergence, pincusion, keystone, brightness, black level, gamma, tone, H.size, V.size, linearity, sharpness, bleeding, artifacting, fringing, resolution, color separation. All these things, and more!
12- a comprehensive examination and study of a selection of perhaps 50 different aperture grilles and phosphor masks
13- the same comprehensive exam of the phosphor chemistry itself, emission rates, phosphor persistence, glow, spill, color tone.
14- the nuances of how and where the input signal degrades and is "rebuilt" or amplified and reinforced
15- magnetic field interaction in the CRT tube, especially with the deflection coils and the point where the electrons leave the gun
16- the timings of the beam movement, the sweep, the retrace, or in the case of vector monitors the x,y movements and accelerations and delays
17- the interactions of the tube as a whole with its accompanying driving circuitry
18- as a catch all, consider the analog noise, hysteresis, instability, variances, all the things that must happen to a signal coming down the wire into the set.
I believe that with this type of CRT module we could cover every game system and computer system safely and accurately. Every system that ever used glowing phosphors as a means of output. Once this massive work was completed (it could only be a team effort) it would be made available to every emulator author.
In a sense we have some of this already with the modern GPU and programming libraries like SDL, openGL, DDraw, DirectX, and others. But it is all in pieces and it doesn't address the workings of a CRT. We have the tools to *DO* these things. But none of it is packaged nicely, yet.
Why bother with this shit?
Understand that development of any emulator has to encompass game logic, I/O, memory and storage, processing, bus structure, and certainly custom chips.
A whole buncha that stuff translates nicely and cleanly into code that runs quickly and efficiently in today's systems. There's processing power to burn when you're running software originally intended for a 1MHz CPU on a chip that can give you 4,000MHz. All those things are merely translations and substitutions and different arrangements. They're just data bits in a memory cell or perhaps cruising through registers and accumulators or getting their jollies in a pop stack instruction! Ha! That's all under the hood..
A proposal
If it's one thing every emulator author needs to contend with (especially home consoles) is building up the image for display. The one thing in common back in the day was the NTSC television with it's associated RF signal cable. That was standard. Every console had to be built around that display interface. Today we have like 20 different ways to connect display devices together and 50 different resolutions. We need to simplify this. I say we get to work on engineering a CRT emulator. Write a universal module that will accept input from any emulator and simulate (you can't really emulate analog) what goes on inside the CRT and its circuitry.
This would be a separate process running on it's own cpu core. It would have a separate set of controls, just like on a real TV or arcade monitor. It would display static or a blank screen if there was no emulator attached to it.
It would eliminate having to build in TV effects to all emulators. It would make all of them (assuming they were updated) pretty much standard. It would simulate a few select brands of TV's, no need to do them all. It would be resolution independent. Just giving you the basic NTSC capability everybody had in their home at the time. It would include an arcade mode, taking into account characteristics of a variety of displays from the era. MAME does some of this. So does the newly-installed-in-Stella Blargg filter kit.
Blarrg filtering does not capture the inherent noise and shimmering of the image. Take a jewelr's loupe and go close to a real CRT. Look at all that activity going on! You've got dancing pixels, static, all kinds of analog noise, and different colors in different amounts in nearby pixels intending to be the same color. There's colors mixing with other colors. Almost a metallic quality. A visual hiss! Filtering kits, as they now stand, don't even consider this!
A CRT display simulator needs to be an entirely stand-alone module with a simple interface to whatever emulated game consoles you're playing. Let it worry about scaling and sizing and colors and phosphors and all the baggage that rolls with the display technology of yesteryear. It would provide all the distortions and imperfections by itself. Emulator authors could concentrate on game logic and getting that down pat.
I believe the CPU power of today in combination with the best graphics card can't handle this. To make it more difficult - if we're going to do this on CPU power alone, then, we'd better wait till Skylake rolls around. All this CPU power will be needed to scintillate each pixel individually and separately in a way that best replicates behavior of a real CRT.
- AtariAge Forums
- → Viewing Profile: Topics: Keatah




Send me a message
Find content
Not Telling

