Improve ROM markets Enumeration (#39)

<!--- Provide a general summary of your changes in the Title above -->

## Description
<!--- Describe your changes in detail -->
Based on research and trial and error, this makes the information more
appropriate.

## Motivation and Context
<!--- What does this sample do? What problem does it solve? -->
<!--- If it fixes/closes/resolves an open issue, please link to the
issue here -->

## How Has This Been Tested?
<!-- (if applicable) -->
<!--- Please describe in detail how you tested your sample/changes. -->
<!--- Include details of your testing environment, and the tests you ran
to -->
<!--- see how your change affects other areas of the code, etc. -->

## Screenshots
<!-- (if appropriate): -->

## Types of changes
<!--- What types of changes does your code introduce? Put an `x` in all
the boxes that apply: -->
- [x] Improvement (non-breaking change that adds a new feature)
- [ ] Bug fix (fixes an issue)
- [ ] Breaking change (breaking change)
- [ ] Config and build (change in the configuration and build system,
has no impact on code or features)

## Checklist:
<!--- Go over all the following points, and put an `x` in all the boxes
that apply. -->
<!--- If you're unsure about any of these, don't hesitate to ask. We're
here to help! -->
- [ ] My code follows the code style of this project.
- [ ] My change requires a change to the documentation.
- [ ] I have updated the documentation accordingly.
- [ ] I have added tests to cover my changes.
- [ ] All new and existing tests passed.

<!--- It would be nice if you could sign off your contribution by
replacing the name with your GitHub user name and GitHub email contact.
-->
Signed-off-by: GITHUB_USER <GITHUB_USER_EMAIL>
This commit is contained in:
Robin Jones 2023-08-17 21:15:13 +01:00 committed by GitHub
parent ed1fef88be
commit 887d83ae5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 77 additions and 80 deletions

View File

@ -224,7 +224,7 @@ uint8_t rom_db_match_expansion_pak(rom_header_t rom_header) {
// Space Station Silicon Valley has known issues on NTSC. // Space Station Silicon Valley has known issues on NTSC.
// We only check for the known working market here. // We only check for the known working market here.
if ( (rom_header.metadata.unique_identifier == *(uint16_t *) "SV") && (rom_header.metadata.destination_market != MARKET_PAL_GENERIC)) { if ( (rom_header.metadata.unique_identifier == *(uint16_t *) "SV") && (rom_header.metadata.destination_market != MARKET_EUROPEAN_BASIC)) {
return DB_MEMORY_EXPANSION_FAULTY; return DB_MEMORY_EXPANSION_FAULTY;
} }

View File

@ -114,54 +114,48 @@ typedef enum {
N64_ALECK64 = 'Z' N64_ALECK64 = 'Z'
} rom_media_type_t; } rom_media_type_t;
/** @brief ROM market type enumeration. */ /** @brief ROM market region & language type enumeration. */
typedef enum { typedef enum {
/** @brief The ROM is designed for all regions. */ /** @brief The ROM is designed for Japanese and "English" languages. */
MARKET_ALL = 'A', MARKET_JAPANESE_MULTI = 'A', // 1080 Snowboarding JPN is the only ROM that uses this? possibily a mistake, or the fact it also includes American English!.
/** @brief The ROM is designed for Brazil (probably PAL-M). */ /** @brief The ROM is designed for Brazil (Portuguese) language. */
MARKET_BRAZIL = 'B', MARKET_BRAZILIAN = 'B',
/** @brief The ROM is designed for China (probably PAL-D). */ /** @brief The ROM is designed for Chinese language. */
MARKET_CHINA = 'C', MARKET_CHINESE = 'C',
/** @brief The ROM is designed for Germany (probably PAL). */ /** @brief The ROM is designed for German language. */
MARKET_GERMANY = 'D', MARKET_GERMAN = 'D',
/** @brief The ROM is designed for USA. (probably NTSC-M) */ /** @brief The ROM is designed for North American "English" language. */
MARKET_USA = 'E', MARKET_NORTH_AMERICA = 'E',
/** @brief The ROM is designed for France (probably PAL). */ /** @brief The ROM is designed for French language. */
MARKET_FRANCE = 'F', MARKET_FRENCH = 'F',
/** @brief The ROM is designed for a NTSC Gateway 64. */ /** @brief The ROM is designed for a NTSC Gateway 64. */
MARKET_GATEWAY64_NTSC = 'G', MARKET_GATEWAY64_NTSC = 'G',
/** @brief The ROM is designed for Netherlands (probably PAL). */ /** @brief The ROM is designed for Dutch language. */
MARKET_NETHERLANDS = 'H', MARKET_DUTCH = 'H',
/** @brief The ROM is designed for Italy (probably PAL). */ /** @brief The ROM is designed for Italian language. */
MARKET_ITALY = 'I', MARKET_ITALIAN = 'I',
/** @brief The ROM is designed for Japan. (probably NTSC-J) */ /** @brief The ROM is designed for Japanese language. */
MARKET_JAPAN = 'J', MARKET_JAPANESE = 'J',
/** @brief The ROM is designed for Korea. */ /** @brief The ROM is designed for Korean language. */
MARKET_KOREA = 'K', MARKET_KOREAN = 'K',
/** @brief The ROM is designed for a PAL Gateway 64. */ /** @brief The ROM is designed for a PAL Gateway 64. */
MARKET_GATEWAY64_PAL = 'L', MARKET_GATEWAY64_PAL = 'L',
// MARKET_UNKNOWN_M = 'M', /** @brief The ROM is designed for Canada region (English and French) language. */
/** @brief The ROM is designed for Canada. */ MARKET_CANADIAN = 'N',
MARKET_CANADA = 'N', /** @brief The ROM is designed for European market and languages (must at minimum include English). */
// MARKET_UNKNOWN_O = 'O', MARKET_EUROPEAN_BASIC = 'P', // Sometimes used for Australian region ROMs as well.
/** @brief The ROM is designed for all PAL regions. */ /** @brief The ROM is designed for Spanish language */
MARKET_PAL_GENERIC = 'P', MARKET_SPANISH = 'S',
// MARKET_UNKNOWN_Q = 'Q', /** @brief The ROM is designed for Australia (English) language. */
// MARKET_UNKNOWN_R = 'R', MARKET_AUSTRALIAN = 'U',
/** @brief The ROM is designed for Spain (probably PAL). */ /** @brief The ROM is designed for Scandinavian (Swedish, Norwegian, Finnish, etc.) languages. */
MARKET_SPAIN = 'S', MARKET_SCANDINAVIAN = 'W',
// MARKET_UNKNOWN_T = 'T', /** @brief The ROM is designed for an undefined region and TBD language(s). */
/** @brief The ROM is designed for Australia (probably PAL). */ MARKET_OTHER_X = 'X', // many EU ROM's, Top Gear Rally (Asia) and HSV Racing (AUS) ROM uses this.
MARKET_AUSTRAILA = 'U', /** @brief The ROM is designed for a European region and language(s). */
// MARKET_UNKNOWN_V = 'V', MARKET_OTHER_Y = 'Y', // many EU ROM's uses this.
/** @brief The ROM is designed for Scandinavia. */ /** @brief The ROM is designed for an undefined region and TBD language(s). */
MARKET_SCANDINAVAIA = 'W', MARKET_OTHER_Z = 'Z' // no known ROM's use this.
/** @brief The ROM is designed for a PAL market (just unsure which and why). */
MARKET_PAL_X = 'X',
/** @brief The ROM is designed for a PAL market (just unsure which and why). */
MARKET_PAL_Y = 'Y',
/** @brief The ROM is designed for a PAL market (just unsure which and why). */
MARKET_PAL_Z = 'Z'
} rom_destination_market_t; } rom_destination_market_t;

View File

@ -42,45 +42,48 @@ static char *format_rom_media_type (rom_media_type_t media_type) {
static char *format_rom_destination_market (rom_destination_market_t market_type) { static char *format_rom_destination_market (rom_destination_market_t market_type) {
// TODO: These are all assumptions and should be corrected if required. // TODO: These are all assumptions and should be corrected if required.
// From http://n64devkit.square7.ch/info/submission/pal/01-01.html
switch (market_type) { switch (market_type) {
case MARKET_ALL: case MARKET_JAPANESE_MULTI:
return "All"; return "Japanese & English"; // 1080 Snowboarding JPN
case MARKET_BRAZIL: case MARKET_BRAZILIAN:
return "Brazil (MPAL)"; return "Brazilian (Portuguese)";
case MARKET_CHINA: case MARKET_CHINESE:
return "China"; return "Chinese";
case MARKET_GERMANY: case MARKET_GERMAN:
return "Germany (PAL)"; return "German";
case MARKET_USA: case MARKET_NORTH_AMERICA:
return "USA (NTSC)"; return "American English";
case MARKET_FRANCE: case MARKET_FRENCH:
return "France (PAL)"; return "French";
case MARKET_NETHERLANDS: case MARKET_DUTCH:
return "Netherlands (PAL)"; return "Dutch";
case MARKET_ITALY: case MARKET_ITALIAN:
return "Italy (PAL)"; return "Italian";
case MARKET_JAPAN: case MARKET_JAPANESE:
return "Japan (NTSC)"; return "Japanese";
case MARKET_KOREA: case MARKET_KOREAN:
return "Korea"; return "Korean";
case MARKET_CANADA: case MARKET_CANADIAN:
return "Canada"; return "Canadaian (English & French)";
case MARKET_SPAIN: case MARKET_SPANISH:
return "Spain (PAL)"; return "Spanish";
case MARKET_AUSTRAILA: case MARKET_AUSTRALIAN:
return "Austraila (PAL)"; return "Australian (English)";
case MARKET_SCANDINAVAIA: case MARKET_SCANDINAVIAN:
return "Scandinavaia"; return "Scandinavian";
case MARKET_GATEWAY64_NTSC: case MARKET_GATEWAY64_NTSC:
return "Gateway (NTSC)"; return "LodgeNet/Gateway (NTSC)";
case MARKET_GATEWAY64_PAL: case MARKET_GATEWAY64_PAL:
return "Gateway (PAL)"; return "LodgeNet/Gateway (PAL)";
case MARKET_PAL_GENERIC: case MARKET_EUROPEAN_BASIC:
return "Generic (PAL)"; return "PAL (includes English)"; // Mostly EU but is used on some Australian ROMs
case MARKET_PAL_X: // FIXME: some AUS ROM's use this so not only EUR case MARKET_OTHER_X: // FIXME: AUS HSV Racing ROM's and Asia Top Gear Rally use this so not only EUR
case MARKET_PAL_Y: return "Regional (non specific)";
case MARKET_PAL_Z: case MARKET_OTHER_Y:
return "Unknown (PAL)"; return "European (non specific)";
case MARKET_OTHER_Z:
return "Regional (unknown)";
default: default:
return "Unknown"; return "Unknown";
} }