don't click here

Rant Mode: WHY do we have so many damn formats for SEGA Megadrive/Gen

Discussion in 'Technical Discussion' started by Travelsonic, May 18, 2017.

  1. Travelsonic

    Travelsonic

    Member
    826
    20
    18
    So, for the longest time, I was familiar with ROMS in .bin format, and Super Magic Drive format (.smd)... then I became aware of the.gen format ... then I noticed ROMs for the Megadrive/Genesis in a format called ".md" (which I assume, but correct me if I am wrong would stand for Mega Drive?)

    Why in the hell does the emulation scene need... 4 formats for SEGA Megadrive/Genesis ROMs? What am I missing here, where we made this leap in the number of extensions/formats(?) for one console's ROMs?

    EDIT: Silly me, didn't know .md went back very far
     
  2. Breadbin

    Breadbin

    Member
    23
    0
    0
    I understand where you are coming from. .BIN files would just be standard binary data files (as you find with many other roms) and has no proprietary extension. I would assume that the .SMD format is used as it would be the direct output from the Super Magic Drive device and therefore would be released as is (untampered).

    Regarding .Gen and .MD - I always assumed these were pretty much custom made extensions presumably to easily differentiate PAL / NTCS games from one another without checking the file name or header.

    Much of my post is assumptions and am 100% confident others will be better informed than me but I completely understand your rant. Personally, I would prefer everything to be in .BIN format - but that is purely preference.
     
  3. nineko

    nineko

    I am the Holy Cat Tech Member
    6,298
    475
    63
    italy
    .gen files are actually the same as .bin files internally, just with a different extension to differentiate them from other kinds of roms (like .sms and .gg are still binary files internally), since a .bin file can be anything at all per se. Not that I justify the .gen extension, I still prefer .bin, but that is the explanation you asked for. No clue about .md instead, I've never seen it, but it's probably just another binary file in a wig, so .smd is probably the only one which is a real different format internally.

    Also you can edit the topic title by editing the first post.

    edit: I typed my post with my phone, and it took me a lot of time since I hate to type on a touchscreen, so Breadbin ninja'd me, but it turns out we pretty much said the same things :)
     
  4. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I prefer .gen/.md because .bin tells you NOTHING about what the file is. Every single file on a computer is "binary" at the most basic level. Furthermore, it makes file associations weird when you associate .bin with your MD emulator, and then suddenly Windows thinks GHZ's art file, SADX's object layout files, and dozens of other totally unrelated files are all MD ROMs.
     
  5. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    .md was at one point used for some copier format, but nowadays it's used by No-Intro for plain binary MD ROMs. (It's also used for Markdown.)

    I haven't seen anything other than plain binary ROMs "in the wild" in the past few years.

    For the record: I prefer the .gen extension because .smd was already taken by the Super Magic Drive for its interleaved format and .md is used by Markdown.

    EDIT: My ROM Properties Page shell extension registers itself for .gen, .smd, .32x, .pco, .md, .bin., and .iso. The .pco extension is relatively new and is in somewhat widespread use for Pico ROM images. The last three conflict with non-MD files, but I implemented a fallback system so it doesn't cause problems.
     
  6. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,218
    965
    93
    Long-term happiness
    .md has been a file extension since waaaaaaaaaaaay back in the day, but I don't recall ever seeing one, only ever .bin and .smd. I rename .gen files back to .bin as a point of principle.
     
  7. Travelsonic

    Travelsonic

    Member
    826
    20
    18
    Didn't know they actually went back that far, having not come across any back then (and only .bin and .smd).


    I get .gen / .md so far as being descriptive, actually, that makes sense... just, I guess, feeling a little overwhelmed with the number of extensions associated with one console... lol.
     
  8. winterhell

    winterhell

    Member
    1,165
    7
    18
    Some emulators autodetect whether the file is bin or smd and people start thinking both formats are the same, and then wonder why their 'bin' doesnt work in other places.
     
  9. Jeffery Mewtamer

    Jeffery Mewtamer

    Blind Bookworm Member
    1,878
    81
    28
    I'm actually kind of surprised that there are multiple formats for Genesis roms. I figured all roms were just raw images of the original cart and the extensions just served as a way of letting users see which system a rom is for at a glance and telling Windows which program should be used to try and open the rom if it's clicked in a file manager and what file icon to give it.
     
  10. Black Squirrel

    Black Squirrel

    no reverse gear Wiki Sysop
    8,543
    2,465
    93
    Northumberland, UK
    steamboat wiki
    I seem to recall one of the older formats adding an extra header to help whatever emulators were around in the mid-1990s, but judging from the comments, that might have been for another system*. The problem stems from a lack of coordination 20 years ago and preservation not being the main priority.

    I would have course argue that ".md" > ".gen" because world > America, but even if the extension was uniform, the GoodGen and No-intro naming conventions are often extremely wrong. I still run into "Sonic and Crackers" from time to time.




    *actually as I write this I'm fairly sure it was the NES, because Nintendo were caught using some of these ROMs in their Virtual Console releases.
     
  11. ICEknight

    ICEknight

    Researcher Researcher
    Didn't SEGA use .SGD internally, at some point?

    Just go with that and rename all your .BIN, .MD and .GEN so that your ROMs look more official. =P
     
  12. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    19,218
    965
    93
    Long-term happiness
    .bin is. As for .smd, that's a result of the Super Magic Drive's bizarre way of dumping ROMs interleaved: SMD

    .md I would be all in favour for as a ROM file extension were it not for this mysterious back-in-the-day .md that I've never seen ROMs of. Also Squirrel I'm sure you're thinking of NES or SNES - Sega always included headers, Nintendo were a lot lazier about it.
     
  13. GerbilSoft

    GerbilSoft

    RickRotate'd. Administrator
    2,971
    76
    28
    USA
    rom-properties
    The reason for the different formats is copiers from the early 1990s.

    Both SMD and headered SNES ROMs have the same (or at least very similar) 512-byte header that indicates it's a copier ROM and how many disks are required. (Remember that 3.5" floppy disks could only hold 1.44 MB, so you'd need multiple disks for larger games.)

    The SNES uses an 8-bit data bus, so headered SNES ROMs don't have any other differences compared to unheadered aside from the 512-byte header.

    The Mega Drive, on the other hand, uses a 16-bit data bus. 16-bit wide RAM was either expensive or non-existent at the time, so they used 8-bit wide RAM instead. However, since the SMD bootstrap runs in Master System mode, which has an 8-bit data bus, they decided to use an interleaved format on the disk. For every 16 KB block, the first 8 KB consists of "odd" bytes, and the second 8 KB consists of "even" bytes. This allowed them to load the 8 KB blocks directly into 8-bit RAMs without having special multiplexing hardware. (The SMD switches back into MD mode once this is done.)

    Overlord: Apparently the MD extension was used by the Multi Game Doctor (references: 1, 2). IIRC, this format is basically all odd bytes at the start of the file, followed by even bytes (or vice-versa; I don't remember the specifics), without a header.

    (sidenote: Reference 2 above claims SMD has even bytes first, then odd bytes. This doesn't match what I have in ROM Properties, which was derived from ucon64's conversion...)

    EDIT: Ucon64 source reference:
    • smd_deinterleave(): https://github.com/d2au/ucon64/blob/1b7f0d17982e9ae48da3bd7417824fc13987fadc/src/backup/smd.c#L87
    • mgd_deinterleave(): https://github.com/d2au/ucon64/blob/1b7f0d17982e9ae48da3bd7417824fc13987fadc/src/backup/mgd.c#L82
    smd_deinterleave() does, in fact, show that odd bytes are the first half of the 16 KB. Maybe the odd/even reversal is caused by incorrectly numbering the first byte '1' instead of '0'?

    mgd_deinterleave() also shows odd bytes first, then even bytes.