Another electronics wizard wrote the code to emulate the sound hardware on a PIC. For example, someone entirely disassembled the 24K bytes of Z80 code from its ROMs ( 1, 2, 3) to the point of being able to find the root cause and fix the famous bug that made the alien bees stop firing after a while. Galaga’s popularity meant that there has been a great deal of low-level hacking over the years. Luckily, besides MAME, there are a numbers of sources for this info in the Internet. All the pieces must be connected as they were in their circuit board and for this we need to find detailed information about the original schematics. To play Galaga we need to emulate the workings of all its components. There was one just to handle the graphics effects of the star-field in the background, others were used to to render the graphics, to manage the input controls and to produce the sound effects. In Galaga the interrupt handler managed a vector of commands with a jump table, so the main CPU could invoke a procedure on one of the other processors simply by setting the index of a command in a location in shared memory and signaling an interrupt.īeside the main CPUs there were a number of custom chips, dedicated to different functions. There was a form of inter-processor communication based on interrupts: Z80 handles maskable interrupts by executing an interrupt handler located at a fixed address in the ROM. Other ROMs contained the graphics (sprites and a tiles) and the audio waveforms used to generate sound effects. There were three Z80 8-bit processors, which shared the same address space and RAM, but executed each a different program, stored in a set of different ROMs. The following picture presents a high-level view of the Galaga hardware: The machineīut let’s start from the beginning: how did an arcade machine from the 80s work? And how difficult is it to emulate it? But more recently I discovered the wonderful world of Emscripten and I wondered: how difficult can be to make the engine REALLY PORTABLE, compiling it to JavaScript and targeting HTML5? And can JavaScript run fast enough to emulate an arcade machine? It’s what we are going to discover! In this blog post I’ll present a few technical notes on this toy project, a small journey from the initial idea to the final HTML5 implementation. I was just doing for a single game what MAME has done better for thousands of games. #Galaga nes mac emulator windowsAfter that I quickly ported the code from C# to C++ (even to see what the speed-up could be) and made it run as a WinRT app, more recently converted into a UWP app for Windows 10. For this reason I chose to use first Silverlight as host, a platform that looked very promising at the time. #Galaga nes mac emulator softwareMy initial goal was to have something running on a browser, so not tied to the Windows platform, and to learn something about software emulation and virtual machines in the process. Of course I knew that MAME and MESS already existed, and I snooped through its sources to find out how that machine actually worked. By emulation I don’t mean writing a game “just like” Galaga (which would not be a trivial task, anyway) but really emulating the hardware of that old arcade machine in all its details: the original ISA we want to emulate is those of the old Z80 processor and the program we want to run is the one stored in the original ROMs. #Galaga nes mac emulator movieOne of the scenes that made the 1983 movie “Wargames” endearing to me is the one where the main character, David (Matthew Broderick) plays Galaga before going to school, and not even the presence of the beautiful classmate Jennifer (Ally Sheedy) can really distract him from his game… □Ī few years ago I must have had really too much free time, so I engaged in the toy project of writing an emulator for the Galaga arcade machine. When I was a kid I must have spent so many coins to play that game that I could probably drive a Ferrari, today, had I better invested them. Galaga was a very popular arcade in the ‘80s.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |