don't click here

Could you theoretically build a MegaDrive/Genesis?

Discussion in 'General Sega Discussion' started by Sofox, Nov 23, 2014.

  1. Sofox

    Sofox

    Member
    In college, we learned assembly programming on Motorolla 68k chips, and were told they were very common and easy to get. I later learned that they used the same chip in the MegaDrive, which was kinda exciting, but also confronted me with the notion that the MegaDrive's "brain" was actually a common off-the-shelf component. The console didn't run fairy dust, or ancient magic, it was just straightforward hardware. Anyway, I was wondering, if the main processor is common, could all the chips used in a MegaDrive be obtained? And if they could, does that mean someone could actually build their own working MegaDrive, that would theoretically work better than any othe form of emulation since it's using original hardware?
     
  2. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    Many of the parts in the MD are off-the-shelf:

    • CPUs: Motorola 68000, Zilog Z80
    • RAM: 2x 32Kx8 DRAM (68000), 1x 8Kx8 SRAM (Z80)
    • VRAM: 2x 64Kx4 VRAM (not sure of the specific type)
    • FM sound: Yamaha YM2612 (it's technically off-the-shelf, but good luck finding one)
    • PSG sound: TI SN76489 (technically part of the VDP, but could be implemented separately)
    • Video encoder: Sony CXA1145 or CXA1645 (there's a number of similar parts available)
    What's more difficult are the parts that were custom-designed for the Mega Drive:

    • VDP: Sega 315-5313 (YM7101)
    • Bus Arbiter (various chips depending on model)
    The VDP is a Sega/Yamaha custom part, and as far as I know, it wasn't sold by itself. (It was used on several arcade boards, though.)

    The bus arbiter chip(s) tie the whole system together, and make it possible for both the 68000 and Z80 to read the cartridge at (almost) the same time. It also provides the logic for halting and resetting the Z80 so the 68000 can access Z80 RAM, and provides pin remapping for the Power Base Converter. (The cartridge slot pinout changes significantly when using the PBC, since the Z80 has full control of the system instead of the 68000.)

    What would be possible is using off-the-shelf parts for most of the system, and then reimplementing the VDP and bus arbiter logic in VHDL or Verilog using an FPGA (or CPLD). This requires significant reverse-engineering and low-level knowledge of how both parts work.

    As for accuracy, most of the known emulation issues revolve around YM2612 and VDP emulation. Using an original YM2612 would fix that problem, but the YM2612 wasn't really popular outside of the Mega Drive, so sourcing parts will be a challenge. Reimplementing the VDP in hardware (using an FPGA or CPLD) makes it easier to be cycle-accurate than emulation, since there's no emulation overhead, but that requires getting the design exactly right.
     
  3. Mr Lange

    Mr Lange

    A wise guy eh. I know how to DEAL with wise guys. Member
    1,286
    11
    18
    The Land of Waldos
    Sonic Utopia, Sonic Overture
    *LIGHTS THE TECHOKAMI BEACON*
     
  4. Sofox

    Sofox

    Member
    Whao, thanks for that informative post GerbilSoft.

    So it seems like it's possible, but it comes down to reverse engineering a couple of chips accurately. Is this a difficult task?
     
  5. Flygon

    Flygon

    Member
    Just a quick mention from memory, this has actually been done, sorta. There was a topic on this at SpritesMind a few years back. They basically cobbled it together from a combination of off the shelf parts, and the parts they couldn't source did come from an actual Mega Drive. Not 100% built from scratch, but enough so. I'm not sure I recall how successful they were, however, beyond the "Stuff boots and runs" step.

    If anyone can find the topic, it'd be pretty cool.
     
  6. Sofox

    Sofox

    Member
    I found this: http://gendev.spritesmind.net/forum/viewtopic.php?t=746
    Also, his most recent showing it is here (though it's from a while back): http://www.youtube.com/watch?v=ilzKiW21T9Y

    Seems he took a good shot at implementing the VDP and got a few games running.