pcsx2 icon indicating copy to clipboard operation
pcsx2 copied to clipboard

[Feature Request]: generate different *.mec based on bios version

Open AKuHAK opened this issue 3 years ago • 0 comments

Description

Currently, if the user has incomplete bios dump without *.mec file, PCSX2 will generate the *.mec file with static value: https://github.com/PCSX2/pcsx2/blob/9094ee0dc61affefacfdad642ddf6d1becb0602c/pcsx2/CDVD/CDVD.cpp#L146 For acting closer to real hardware PCSX2 can make safe guess and provide some generic *.mec based on bios data. Below description of each byte and about how to generate them on bios data basis:

  1. version[0] According to https://github.com/PCSX2/pcsx2/blob/9094ee0dc61affefacfdad642ddf6d1becb0602c/pcsx2/CDVD/CDVD.cpp#L2554 and https://github.com/PCSX2/pcsx2/blob/9094ee0dc61affefacfdad642ddf6d1becb0602c/pcsx2/CDVD/CDVD.cpp#L2556 first byte contains mg_zones: https://github.com/PCSX2/pcsx2/blob/9094ee0dc61affefacfdad642ddf6d1becb0602c/pcsx2/CDVD/CDVD_internal.h#L176 This is basically Mechacon region. Bios also has region that can be extracted from ROMVER 5th byte and later on assigned to BiosZoneStrings https://github.com/PCSX2/pcsx2/blob/9094ee0dc61affefacfdad642ddf6d1becb0602c/pcsx2/ps2/BiosTools.cpp#L81-L109 https://github.com/PCSX2/pcsx2/blob/9094ee0dc61affefacfdad642ddf6d1becb0602c/pcsx2/ps2/BiosTools.h#L31-L42 Below the table of assignment: BiosZoneStrings[2] - "Japan" ---> mg_zones[0] - "Japan" BiosZoneStrings[3] - "USA" ---> mg_zones[1] - "USA" or mg_zones[7] - "Mexico" BiosZoneStrings[4] - "Europe" ---> mg_zones[2] - "Europe" or mg_zones[3] - "Oceania" or mg_zones[5] - "Russia" BiosZoneStrings[5] - "HK" ---> mg_zones[4] - "Asia" BiosZoneStrings[7] - "China" ---> mg_zones[6] - "China" Special cases like, "T10K", "Test", etc. will fall into default mg_zones[0] - "Japan" Unfortunately, rom0:ROMVER will not provide complete region, causeUSA and Mexico share the same ROMVER, while Europe, Oceania and Russia also share the same ROMVER. Those extra regions can be ignored and can be assigned only the most popular region. If someone needs to get more detailed region data, this data can be extracted from *.rom1 file by calling rom1:DVDID. Possible values can be taken here: https://github.com/PCSX2/pcsx2/blob/9094ee0dc61affefacfdad642ddf6d1becb0602c/pcsx2/CDVD/CDVD.cpp#L2566 DVDVER will be in format 3.04M where 5th byte represents the region: so A - USA M- Mexico E - Europe O - Oceania R - Russia if rom1 is missing as well, then it is also possible to get region information from NVRAM Model Number (SCPH-39003). This is the less accurate method, cause NVRAM on real ps2 is writable and possibly can contain non-accurate data. SCPH-50011 - Mexico (the only known model for that region) All other models with ROMVER:A - USA PAL consoles can be differed by the last two digits of Model Number: SCPH-xxxx03, SCPH-xxxx04 - Europe SCPH-xxxx02 - Oceania SCPH-xxxx08 - Russia If rom1 is missing and NVRAM does not contain a valid Model Number then fall into default USA or Europe region
  2. version[1] and version[2] Major and minor versions of Mechacon. Some static values. Looks like there is no direct connection between the exact mechacon version and bios, rom1, or NVRAM. However, some safe guesses can be done from the BiosVersion and BiosRegion values: https://github.com/PCSX2/pcsx2/blob/9094ee0dc61affefacfdad642ddf6d1becb0602c/pcsx2/ps2/BiosTools.h#L50-L51 BiosVersion 1.00/1.01 - Mehcacon 1.2 BiosVersion 1.10/1.20 - Mehcacon 2.4 BiosVersion 1.50 - Mehcacon 2.12 BiosVersion 1.60 - Mehcacon 3.2 BiosVersion 1.70/1.90 - Mehcacon 5.4 BiosVersion 1.80, BiosRegion "China" - Mehcacon 5.4 BiosVersion 1.80, BiosRegion "Japan" - Mehcacon 5.10 BiosVersion 2.10 - Mehcacon 5.14 BiosVersion 2.00 - Mehcacon 6.4 BiosVersion 2.20, Model number SCPH-75xxx - Mehcacon 6.6 BiosVersion 2.20, Model number SCPH-77xxx - Mehcacon 6.10 BiosVersion 2.20, Model number SCPH-79xxx/SCPH-90xxx - Mehcacon 6.12 BiosVersion 2.30 - Mehcacon 6.12
  3. version[3] looks like it has zero on all models except for special PSX DESR systems that were released only for the Japan region. For those models, it has a value of 01. BiosVersion 1.80, BiosRegion "Japan" - 1 BiosVersion 2.10 - 1 Other consoles - 0

All data was taken form massive submissions into PS2Ident. Someone can check this information by running command PS2IDBMS.exe PS2Ident.db or by taking this information from test consoles.

Reason

Improve accuracy and act closer to the real hardware,

Examples

Real hardware

AKuHAK avatar Aug 28 '22 10:08 AKuHAK