PS2 [Research/Idea]Improve compatibility using Deckard

Discussion in 'General PS2 Discussion' started by kozarovv, Dec 17, 2019.

  1. 7,658
    5,892
    872
    kozarovv

    kozarovv Developer

    Joined:
    Nov 8, 2014
    Messages:
    7,658
    Likes Received:
    5,892
    Trophy Points:
    872
    Home Page:
    Hello. :) Due to some research that i did for emulators used in PS3/PS4, i was forced to do some Deckard work. That took me some time, but i got some promising results on emulators. That should be replicable on real hardware that use Deckard emu.

    So let's go to the point. Deckard have implemented some external commands that allow some settings to get better compatibility in PS2 titles. To do that it reads rom:XPARAM file, and check there for configurations basing on Title ID. When matching ID is found, changes to emulation are applied.

    I documented commands from Deckard with some examples from XPARAM here: https://playstationdev.wiki/ps2devwiki/index.php?title=IOP/Deckard#Per_game_configuration

    Here are few examples that are missing on 750XX, but available on newer models:
    Format here is command name | command | value | title ID (game name)

    PARAM_MIPS_DCACHE_ON | 0x10 | 0 | SLPM_652.68 (Initial D Special Stage)
    PARAM_MIPS_DCACHE_ON | 0x10 | 0 | SLPM_653.08 (Tokyo Metropolitan Expressway Battle 01)
    PARAM_MIPS_DCACHE_ON | 0x10 | 0 | SLPM_653.08 (Bakusou Decotra Legend -Otoko Hanamichi Dream)

    Initial D Special Stage is most known example of game that have issues on SCPH-7500X, but was fixed later.
    Here is interesting list: https://translate.google.pl/translate?sl=auto&tl=en&u=https://www.jp.playstation.com/info/notice/nt_20051020_scph75000.html

    Idea:

    Is to try fix those games on SCPH-750XX by hooking XPARAM by FMCB, and edit some title to check that gonna fix it. I tested that only on PS3/PS4 on PS2 emulator, but it worked, so here should be just matter of test. And here we are coming to moment when i hope i interested some PS2 dev to try that, because i'm not able to do that. I bring that thread here as a info that we are able to improve compatibility, but i can't go any futher.

    Last few infos:

    0xA0C864 was interesting function for us in Deckard
    Configs in XPARAM are located at data segment, format is "pointer to GAME ID, Command, Value" word, word, word.

    That's all folks, i hope that will bring some new stuff in future. :)

    Edit: XPARAM from real PS2 seems to be even less complicated than one from emulators.

    Init is doing some checks, like that we are in ps2 mode. When all passed it goes to simple check for game id, if match then read config for it.

    Code:
    0x74                 lw      $a0, CONFIG_ID($s0) # disc id from list
    0x7C                 move    $a1, $s7            # disc id
    0x80                 jal     sub_304             # cmp
    0x84                 li      $a2, 11             # 11char
    0x88                 bnez    $v0, loc_188
    0x8C                 nop
    0x90                 addiu   $s3, 1
    0x94                 lw      $v0, CONFIG.command($s0)
    0xA0                 lw      $v1, CONFIG.value($s0)
    
     
    Last edited: Dec 17, 2019
    ted209, uyjulian, DeViL303 and 5 others like this.
  2. 7,658
    5,892
    872
    kozarovv

    kozarovv Developer

    Joined:
    Nov 8, 2014
    Messages:
    7,658
    Likes Received:
    5,892
    Trophy Points:
    872
    Home Page:
    Overall research/reversing that will be nice, but i realized there is easier way to test that. But require very specific user :D

    So.. Requirements:

    • Game: SLPM_652.68 (Initial D Special Stage)
    • Ability to repack Game image (assuming there is no security added for that)
    • PS2 model SCPH-750XX
    • Some basic knowledge

    What to do? Since config base on Game ID, we can try to change it to one that already have command that we require.

    • Unpack ISO image content
    • Rename SLPM_652.68 file to SLPM_622.54
    • Edit SYSTEM.CNF to point to SLPM_622.54 instead of old ID.
    • Rebuild ISO
    • Best will be burn it to DVD, but maybe game is compatible with OPL
    • Test that game work.

    This apply PARAM_MIPS_DCACHE_ON with 0 value, like on newer PS2 models. Simple test that should confirm that configs can be edited/reused, etc.
     
    Last edited: Dec 17, 2019
    ted209, jolek and TnA like this.
  3. 787
    1,420
    222
    sp193

    sp193 Developer

    Joined:
    Oct 13, 2014
    Messages:
    787
    Likes Received:
    1,420
    Trophy Points:
    222
    Location:
    Singapore
    Home Page:
    I unpacked PS2LOGO (extract the data in .data, which seems to be a compressed file), to get the uncompressed cex.bin file that loads at 0x00100000.

    PARAM seems to be loaded by PS2LOGO, before LoadExecPS2() is invoked. In ways, it could be viewed as a necessary prerequisite to maintain game compatibility on the SCPH-75000 and later. It should be possible to pass your customized parameters to the emulator with rom0:XPARAM.

    The module seems to accept either 2 or 3+ parameters. If 2 parameters are specified, the 2nd parameter is the game ID, used to locate the game compatibility setting to use from among the list built into XPARAM itself.
    The 3+ parameter option is used if the game's SYSTEM.CNF has a "PARAM2" option, as parsed by PS2LOGO.

    A quick Google search shows that at least Ibara had one. I'm not sure what the parameters mean, but the colon is a separator and any non-alphanumeric characters before it are replaced with a NULL (which separates each parameter to SifLoadModule). The values after the colon must be in hexadecimal and only upper-case letters are recognized.
    Starting from argv[2], the parameters are processed in pairs, for 8 bytes of data transferred to the emulator in each pass.

    It could be at the 0X10_0 translates to [0x10, 0] (which seems to be a common (?) setting in XPARAM.

    SYSTEM.CNF from Ibara:
    Code:
    BOOT2 = cdrom0:\SLPM_663.01;1
    VER = 1.02
    VMODE = NTSC
    PARAM2 = 0X10_0:FD171E1E2CC00E864339E4358A89AD85
    
     
    uyjulian, ted209, jolek and 2 others like this.
  4. 7,658
    5,892
    872
    kozarovv

    kozarovv Developer

    Joined:
    Nov 8, 2014
    Messages:
    7,658
    Likes Received:
    5,892
    Trophy Points:
    872
    Home Page:
    Function that read all that seems to check MD5 at some point. So probably hex after : is MD5 sum of something.
    0x102040 (read PARAM2) --> 0x1026A8 --> 0x10D2B0 --> 0x10D630 (MD5)
    Offsets for 75004 cex.bin.

    That's first time i see PARAM2, and if it really is that simple. Then that should be easy to create custom configs, although i'm not sure about that MD5 check. Seems to not being mandatory.
    Really nice find, i try to do some tests soon. :)
     
    uyjulian, TnA, ted209 and 1 other person like this.

Share This Page