jpd002 / Play-

Play! - PlayStation2 Emulator
http://purei.org
Other
2.03k stars 249 forks source link

HLE vs LLE mcServe differences #1333

Open bigianb opened 5 months ago

bigianb commented 5 months ago

The following small home-brew file executes memory card calls and logs the output. There are differences between PCSX2 and Play! which I think will cause issues with games.

https://github.com/bigianb/ps2-functests/tree/main

Summary seems to be that mcChrDir seems to return the working directory after the cd (different than docs). cd to a non existing directory should return -4 whilst Play! returns 0

PCSX2 output:

Memcard test
Initialising memcard
mcInit returned 0
Init succeded
mcGetInfo returned 0
    mcGetInfo sync returned -1
    Type: 2 Free: 5353 Format: 1
mcGetInfo returned 0
    mcGetInfo sync returned 0
    Type: 2 Free: 5353 Format: 1
mcChdir '/' returned 0
    mcChdir sync returned 0
    mcChdir old dir returned '/'
mcGetDir /* returned 0 and 4 entriesdir FUNCTEST exists, so deleting it
    mcDelete returned 0
    mcDelete sync returned 0
mcMkDir 'FUNCTEST' returned 0
    mcMkDir sync returned 0
mcChdir 'FUNCTEST' returned 0
    mcChdir sync returned 0
    mcChdir dir returned '/FUNCTEST'
mcChdir '/notthere' returned 0
    mcChdir sync returned -4
    mcChdir dir returned '/FUNCTEST'
mcChdir '/nothere' returned 0
    mcChdir sync returned -4
    mcChdir dir returned '/FUNCTEST'
That's all folks

Play! output

Hello
Memcard test
Initialising memcard
mcInit returned 0
Init succeded
mcGetInfo returned 0
    mcGetInfo sync returned -1
    Type: 2 Free: 8192 Format: 1
mcGetInfo returned 0
    mcGetInfo sync returned 0
    Type: 2 Free: 8192 Format: 1
mcChdir '/' returned 0
    mcChdir sync returned 0
    mcChdir old dir returned ''
 **** ERROR: Expected old dir '/' to be returned from mcChdir ****
mcGetDir /* returned 0 and 9 entriesdir FUNCTEST exists, so deleting it
    mcDelete returned 0
    mcDelete sync returned 0
mcMkDir 'FUNCTEST' returned 0
    mcMkDir sync returned 0
mcChdir 'FUNCTEST' returned 0
    mcChdir sync returned 0
    mcChdir dir returned ''
 **** ERROR: Expected dir '/FUNCTEST' to be returned from mcChdir ****
mcChdir '/notthere' returned 0
    mcChdir sync returned 0
    mcChdir dir returned ''
 **** ERROR: Expected -4 to be returned from mcChdir ****
 **** ERROR: Expected dir '/FUNCTEST' to be returned from mcChdir ****
mcChdir '/nothere' returned 0
    mcChdir sync returned 0
    mcChdir dir returned ''
 **** ERROR: Expected -4 to be returned from mcChdir ****
 **** ERROR: Expected dir '/FUNCTEST' to be returned from mcChdir ****
That's all folks
jpd002 commented 5 months ago

Oh, very nice! We'll have to fix the problematic cases in the emu.

Interesting cases we could add: Using ChDir('\..') while being in the root dir. And also ChDir('\..\somedir'). There's a bunch of games that seem to use that (LOTR: The Return of the King for example, EA games, Kim Possible).

bigianb commented 5 months ago

exactly - it's something I've wanted to do for a while - it takes the guesswork out of things and can form an automated test at some stage. I'll keep adding the edge cases but thought what is shown currently is a good start because it specifically does things that RTA does.