Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
05696 Misc. Major Always Sep 14, 2014, 05:52 Sep 14, 2014, 15:07
Tester byblo View Status Public Platform MESS (Official Binary)
Assigned To Resolution No change required OS
Status [?] Closed Driver
Version 0.154 Fixed in Version Build
Fixed in Git Commit Github Pull Request #
Summary MESS-specific 05696: Genesis, Megadrive Eur and Jap: All Megadrive games are running with the slowest machine ('megadriv' european 50Hz driver)
Description Hello.

Regardless the country of the rom, all Megadrive games are running on the European ('megadriv' driver) machine which lead to some major problems:

   - All games are running at 50Hz instead of 60Hz, which make them running +-20% slower
    (Back in the day, We Europeans, suffered already a lot about this, please stop the curse :) )

   - Some games are zone protected, and will show an denied message, for instance the 'Streets of Rage 2 (USA)' (the game checks the speed frequency and the machine country)

   - Maybe extremely rare, thus maybe not very important: Some games may need the proper machine to show the proper text ('Streets of Rage' will show Japanese text if running on a Japanese console, English on other countries)

For info, ALL (normally +99.9%) of the megadrive roms (bin format) are containing one or more country flag at the offset 496 (0x1F0), which should permit the emulator to detect their zone/country thus always run the proper machine.

Flags are:
J (Japanese)
U (USA)
E (Europa)
There are more flags (and some specific title, see code below), but these 3 should do most of the matching.

Flags can also follow each other inside a rom, or even be missing. For instance, finding 'JUE' is not rare.

Please do a rom region checker to run the proper machine at starting a megadrive game.

Currently, emulator is always running the megadrive with the 'megadriv' driver: "mess64.exe megadriv -cart sor2u"
Please run at least by default a 60Hz machine, like the 'genesis' (US) driver or the 'megadrij' (JP) driver: "mess64.exe genesis -cart sor2u" for instance.

Also, a preference order would be nice, for instance: USA (in case of U or unknown flag), then JAP (J), then EUR (E) as last choice.

Here is an informative/example code that can be used as illustrative, found at: http://code.ohloh.net/file?fid=9MWmjgGNwLMjIWLgwLTWqomKlXc&cid=yDo946zlmPg&s=

[code]
...Line 1006...
/* from Gens */
if (!memcmp(rominfo.country, "eur", 3)) country |= 8;
else if (!memcmp(rominfo.country, "EUR", 3)) country |= 8;
else if (!memcmp(rominfo.country, "jap", 3)) country |= 1;
else if (!memcmp(rominfo.country, "JAP", 3)) country |= 1;
else if (!memcmp(rominfo.country, "usa", 3)) country |= 4;
else if (!memcmp(rominfo.country, "USA", 3)) country |= 4;
else
{
s32 i;
char c;

    /* look for each characters */
    for(i = 0; i < 4; i++)
    {
      c = toupper(cast(s32)rominfo.country[i]);

      if (c == 'U') country |= 4;
      else if (c == 'J') country |= 1;
      else if (c == 'E') country |= 8;
      else if (c == 'K') country |= 1;
      else if (c < 16) country |= c;
      else if ((c >= '0') && (c <= '9')) country |= c - '0';
      else if ((c >= 'A') && (c <= 'F')) country |= c - 'A' + 10;
    }
  }

  /* set default console region (USA > JAPAN > EUROPE) */
  if (country & 4) region_code = REGION_USA;
  else if (country & 1) region_code = REGION_JAPAN_NTSC;
  else if (country & 8) region_code = REGION_EUROPE;
  else if (country & 2) region_code = REGION_JAPAN_PAL;
  else region_code = REGION_USA;

  /* some games need specific region settings but have wrong header*/
  if (("T-45033" in rominfo.product && rominfo.checksum == 0x0F81) || /* Alisia Dragon (Europe) */
       "T-69046-50" in rominfo.product || /* Back to the Future III (Europe) */
       "T-120106-00" in rominfo.product || /* Brian Lara Cricket (Europe) */
       "T-70096 -00" in rominfo.product) /* Muhammad Ali Heavyweight Boxing (Europe) */
  {
    /* need PAL settings */
    region_code = REGION_EUROPE;
  }
  else if (rominfo.realchecksum == 0x532e && "1011-00" in rominfo.product)
  {
    /* On Dal Jang Goon (Korea) needs JAPAN region code */
    region_code = REGION_JAPAN_NTSC;
  }
}

/* 8-bit cartridge */
else
{
  region_code = sms_cart_region_detect();
}

/* save auto-detected region */
rom_region = region_code;

}
else
{
/* restore auto-detected region */
region_code = rom_region;
}

/* force console region if requested */
if (config.region_detect == 1) region_code = REGION_USA;
else if (config.region_detect == 2) region_code = REGION_EUROPE;
else if (config.region_detect == 3) region_code = REGION_JAPAN_NTSC;
else if (config.region_detect == 4) region_code = REGION_JAPAN_PAL;

/* autodetect PAL/NTSC timings */
vdp_pal = (region_code >> 6) & 0x01;

/* autodetect PAL/NTSC master clock */
system_clock = vdp_pal ? MCLOCK_PAL : MCLOCK_NTSC;

/* force PAL/NTSC timings if requested */
if (config.vdp_mode == 1) vdp_pal = 0;
else if (config.vdp_mode == 2) vdp_pal = 1;

/* force PAL/NTSC master clock if requested */
if (config.master_clock == 1) system_clock = MCLOCK_NTSC;
else if (config.master_clock == 2) system_clock = MCLOCK_PAL;
}

/****************************************************************************
...
[/code]

Thank you.
Steps To Reproduce Just run a US or JAP megadrive game, and see it emulated into a european 50Hz machine instead of a genesis/mdjap 60Hz
Additional Information
Github Commit
Flags Verified with Original
Regression Version
Affected Sets / Systems Genesis, Megadrive Eur and Jap
Attached Files
 
Relationships
There are no relationship linked to this issue.
Notes
2
User avatar
No.10979
Tafoid
Administrator
Sep 14, 2014, 11:45
MESS emulates all 3 machines faithfully:
Mega Drive (European) as megadriv
Mega Drive (Japanese) as megadrij
Genesis (US) as genesis

It is up to you, end user, to choose which driver (or machine) you wish to use for whatever cartridge is fed to it. This is just like a real console. For example, an image which will run on either is Sonic The Hedgehog. This game will play as 50hz on the 50hz machine (mess megadriv sonic) and 60hz on the 60hz machine (mess genesis sonic).

In your example of Streets of Rage 2 (US) (sor2u), yes, it won't work (as quite a few US only titles do not) in an European console (mess megadriv sor2u). MESS is accurate to show you this message. If you try with the Japanese Mega Drive (mess megadrij sor2u), you get the same message. The game is region locked to US/North America and only runs correctly using the North American Genesis machine (mess genesis sor2u).

In the end, it is completely up to the user to determine which machine (megadriv, megadrij, genesis) runs which game from which region. There is no magical one driver which covers all instances automatically. This will not change.
User avatar
No.10980
AWJ
Developer
Sep 14, 2014, 15:07
edited on: Sep 14, 2014, 15:08
MESS emulates the machine you tell it to, you can't throw a piece of software at it and ask it to choose the most appropriate machine to run. How would that even work with, say, the MSX family, where there are dozens of different models?

If you use the software lists (which is the recommended way to use MESS) it will warn you if you ask for a machine/software combination that has been flagged as incompatible.