top | item 36992335

Nuked-MD-FPGA – Emulating Sega Mega Drive chipset using decapped chips photos

242 points| retro_guy | 2 years ago |github.com | reply

90 comments

order
[+] JohnBooty|2 years ago|reply
Very interesting.

I'm curious if there are any specific shortcomings with modern Genesis/Megadrive emulation that spurred this, or if this is just a pure "for the love of the pursuit" effort.

I'm not sure of the exact state of the art, but I know that getting sound emulation perfectly right for the Genesis/MegaDrive has been a tricky issue over the years, even for Sega themselves. Though, my (loose) understanding is that the issue is moreso with getting the analog bits sounding right rather than the digital bits.

[+] MegaDeKay|2 years ago|reply
You should look into MDFourier. "MDFourier is an open source software solution created to compare audio signatures and generate a series of graphs that show how they differ." The Genesis was one of the primary targets for this software, and for that reason I believe that Genesis sound emulation is very accurate.

https://junkerhq.net/MDFourier/

Genesis sound emulation is indeed tricky because there were multiple variants of the sound hardware in the Genesis over the years. Some emulators model multiple variants.

https://www.reddit.com/r/emulation/comments/104tgvs/sega_gen...

[+] mcronce|2 years ago|reply
I can't speak to the Genesis specifically, but in general software emulation introduces tiny inaccuracies, in the form of missed inputs (because of things like context switches - it's important to note that, while these old consoles were hilariously slow compared with modern hardware, they were single-threaded), slightly incorrect emulation speed, things like that.

For most people, myself included, this doesn't matter at all.

For people looking for an extremely "pure" original experience, this is the closest you can get to original hardware - which is getting both more expensive and lower quality with time.

For the competitive speedrunning scene, incorrect emulation speed is a non-starter in some categories, and dropped inputs are a huge problem when they happen.

[+] CSMastermind|2 years ago|reply
> I know that getting sound emulation perfectly right for the Genesis/MegaDrive has been a tricky issue over the years, even for Sega themselves

I would definitely be curious to know why - the emulation of Genesis is notably behind most other video game consoles but I always assumed this was because of less interest and not because of any unique technical challenges.

[+] joshspankit|2 years ago|reply
While there is some amount of software emulators “it’s not quite right”-ness, this is more spurred by the general availability of FPGAs with enough resources to “become” older consoles like the Genesis/MegaDrive.
[+] tails4e|2 years ago|reply
Is the RTL autogenerated from the chip images? I looked at one file 68k.v and the variable names remind me of a decompiler.
[+] lprib|2 years ago|reply
It's probably hand written but they didn't reverse engineer the purpose of each wire, only the netlist. Some of them are labeled, eg `irdbus_normal`.
[+] qingcharles|2 years ago|reply
I wondered the same thing. Otherwise that is a lot of code to write. The type of code that will cook your brain very quickly.
[+] jareklupinski|2 years ago|reply
guessing since the 68k and z80 cores are not specific to the genesis, they may have used another implementation (maybe https://github.com/nukeykt/Nuked-MD ?)

the genesis "specific" ym* cores look a lot more "authored"; commit history shows more activity around those files too

but thats just a guess... something that can generate verilog from chip images would be pretty cool...

[+] mg794613|2 years ago|reply
What is a good fpga starter board that's big enough to load this? It's not obvious from the repo as a complete novice in fpga land.
[+] mikepavone|2 years ago|reply
The author is targeting the DE-10 Nano which is also used in MiSTer setups so that's probably the best choice
[+] FirmwareBurner|2 years ago|reply
AFAIK, an FPGA board is not enough, you also need the "compiled netlist" from the Verilog files, clock configuration and routing info, tailored to the specific FPGA/board you choose.
[+] vmladenov|2 years ago|reply
I’m curious how this compares to Analogue’s implementation for their Mega Sg.
[+] mikepavone|2 years ago|reply
Analogue hasn't given a lot of detail about how they developed the Mega Sg, but to the extent that they did any reverse engineering beyond what the emulation community had already done they seem to have used similar techniques. At one point they had an identical compat bug as in my software emulator (order that bytes were updated in VRAM was swapped causing a single-frame glitch in the bike shop of one of the Road Rash games). I don't think they were using my code as a reference, but it does suggest use of similar documentation sources or similar reverse engineering techniques.

By contrast, this is the first effort (well second if you consider the nukeykt's initial C version) to try and recreate the entire system from analysis of silicon die photos. If you just want to enjoy some old games the difference is probably not particularly important, but Nuked-MD-FPGA is already passing some tests that the Mega SG does not. The screenshot in the lower right corner of the "Progress" section is a timing torture test ROM that the Mega SG fails at least 40 subtests for (I say at least because the results I've seen for Mega SG are from an earlier version of the ROM with fewer subtests).

[+] DrNosferatu|2 years ago|reply
Will it run on the MiSTer?

or included in that project(?) providing MiSTer for any FPGA?

[+] yakkityyak|2 years ago|reply
Very cool. I suppose this means someone could wire this to MiSTer or Analogue Pocket, or are they lacking the correct fpga requirements?
[+] agg23|2 years ago|reply
They will both likely come in the coming weeks, based on what the creator wants and general enthusiasm. Since it hasn't been wired up to a top, the ports would likely be fairly simple.
[+] rbanffy|2 years ago|reply
I wonder how interesting the Genesis VDP would be for a retrocomputer project. Is there a good detailed doc for software development? I looked around and there isn’t much I the most obvious places and formats.
[+] city41|2 years ago|reply
This was also done by Furrtek for the Neo Geo FPGA core for the MiSTer project.
[+] genjii931|2 years ago|reply
Wasn't the Genesis dev machine a Sharp x68000?
[+] gbraad|2 years ago|reply
perhaps among some (never heard this before), but I know people who used Amigas and Deluxe Paint.