BiosTools: improve region codes

Region code numbering now matches regions inside CDVD_internal.h
Added region assignment for non-standard romver
Renamed HK region to Asia as 'H' covers not only Hong Kong, but also Korea and Taiwan
This commit is contained in:
AKuHAK 2022-11-22 17:39:44 +02:00 committed by refractionpcsx2
parent f66797c5cf
commit 90a4025bcc
4 changed files with 61 additions and 27 deletions

View File

@ -85,29 +85,39 @@ void BIOSSettingsWidget::listRefreshed(const QVector<BIOSInfo>& items)
switch (bi.region)
{
case 2: // Japan
case 0: // Japan
item->setIcon(0, QIcon(QStringLiteral("%1/icons/flags/NTSC-J.png").arg(res_path)));
break;
case 3: // USA
case 1: // USA
item->setIcon(0, QIcon(QStringLiteral("%1/icons/flags/NTSC-U.png").arg(res_path)));
break;
case 4: // Europe
case 2: // Europe
item->setIcon(0, QIcon(QStringLiteral("%1/icons/flags/PAL-E.png").arg(res_path)));
break;
case 7: // China
item->setIcon(0, QIcon(QStringLiteral("%1/icons//flags/NTSC-C.png").arg(res_path)));
case 3: // Oceania
item->setIcon(0, QIcon(QStringLiteral("%1/icons/flags/PAL-A.png").arg(res_path)));
break;
case 5: // HK
case 4: // Asia
item->setIcon(0, QIcon(QStringLiteral("%1/icons/flags/NTSC-HK.png").arg(res_path)));
break;
case 6: // Free
case 0: // T10K
case 1: // Test
case 5: // Russia
item->setIcon(0, QIcon(QStringLiteral("%1/icons/flags/PAL-R.png").arg(res_path)));
break;
case 6: // China
item->setIcon(0, QIcon(QStringLiteral("%1/icons/flags/NTSC-C.png").arg(res_path)));
break;
case 7: // Mexico, flag is missing
case 8: // T10K
case 9: // Test
case 10: // Free
default:
item->setIcon(0, QIcon(QStringLiteral("%1/icons/flags/NTSC-J.png").arg(res_path)));
break;

View File

@ -277,14 +277,17 @@ static NVMLayout nvmlayouts[NVM_FORMAT_MAX] =
{0x146, 0x270, 0x2B0, 0x200, 0x1C8, 0x1E0, 0x1B0, 0x180, 0x198}, // eeproms from bios v1.70 and up
};
static u8 biosLangDefaults[8][16] =
{
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // T10K (Japanese, generally gets overridden)
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // Test (Japanese, as above)
{0x20, 0x20, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30}, // Japan (Japanese)
{0x30, 0x21, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41}, // USA (English)
{0x30, 0x21, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41}, // Europe (English)
{0x30, 0x21, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41}, // HongKong (English)
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // Free (Japanese, no examples to use)
{0x30, 0x2B, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B}, // China (Simplified Chinese)
static u8 biosLangDefaults[11][16] =
{
{0x20, 0x20, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30}, // Japan (Japanese)
{0x30, 0x21, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41}, // USA (English)
{0x30, 0x21, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41}, // Europe (English)
{0x30, 0x21, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41}, // Oceania (English)
{0x30, 0x21, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41}, // Asia (English)
{0x30, 0x21, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41}, // Russia (English)
{0x30, 0x2B, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4B}, // China (Simplified Chinese)
{0x30, 0x21, 0x80, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41}, // Mexico (English)
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // T10K (Japanese, generally gets overridden)
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // Test (Japanese, as above)
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // Free (Japanese, no examples to use)
};

View File

@ -435,6 +435,11 @@ std::string SysGetBiosDiscID()
// FIXME: we should return a serial based on
// the BIOS being run (either a checksum of the BIOS roms, and/or a string based on BIOS
// region and revision).
// Good candidate can be first part of EXTINFO data in the BIOS rom:
// Example for romver 0160EC20010704
// 20010704-160707,ROMconf,PS20160EC20010704.bin,kuma@rom-server/~/f10k/g/app/rom
// 20010704-160707 can be used as unique ID for Bios
// rom0:EXTINFO first 15 bytes
return {};
}

View File

@ -88,21 +88,37 @@ static bool LoadBiosVersion(std::FILE* fp, u32& version, std::string& descriptio
break;
}
// TODO: some regions can be detected only from rom1
/*
switch (rom1:DVDID[4])
{
// clang-format off
case 'O': zone = "Oceania";region = 3; break;
case 'R': zone = "Russia"; region = 5; break;
case 'M': zone = "Mexico"; region = 7; break;
// clang-format on
}
*/
switch (romver[4])
{
// clang-format off
case 'T': zone = "T10K"; region = 0; break;
case 'X': zone = "Test"; region = 1; break;
case 'J': zone = "Japan"; region = 2; break;
case 'A': zone = "USA"; region = 3; break;
case 'E': zone = "Europe"; region = 4; break;
case 'H': zone = "HK"; region = 5; break;
case 'P': zone = "Free"; region = 6; break;
case 'C': zone = "China"; region = 7; break;
case 'J': zone = "Japan"; region = 0; break;
case 'A': zone = "USA"; region = 1; break;
case 'E': zone = "Europe"; region = 2; break;
// case 'E': zone = "Oceania";region = 3; break; // Not implemented
case 'H': zone = "Asia"; region = 4; break;
// case 'E': zone = "Russia"; region = 3; break; // Not implemented
case 'C': zone = "China"; region = 6; break;
// case 'A': zone = "Mexico"; region = 7; break; // Not implemented
case 'T': zone = "T10K"; region = 8; break;
case 'X': zone = "Test"; region = 9; break;
case 'P': zone = "Free"; region = 10; break;
// clang-format on
default:
zone.clear();
zone += romver[4];
region = 0;
break;
}