Basically, read Library Versions from XBE to detect HLE Patches. However, this title or XDK 4039 is not scanned because XBE lacks information about DSOUND Library.
This behaviour shows in "The Simpsons Road Rage", but there seem to exist two: a 4039 and a 4034 version :
Title ID : 0x45410013
Title : L"The Simpsons Road Rage"
Game Region : 0x00000004
Section Name : 0x00010880 ("DSOUND")
Flags : 0x00000001 (Writable) (Preload) (Executable)
Virtual Address : 0x0017CAE0
Virtual Size : 0x0001B77C
Raw Address : 0x00168000
Size of Raw : 0x0001B59C
Section Name Address : 0x00010880
Section Reference Count : 0x00000000
Head Shared Reference Count Addr : 0x00010854
Tail Shared Reference Count Addr : 0x00010856
Section Digest : 19D948B43FB782974B82256EB2FD6B41544A98C4
Library Name : XAPILIB
Version : 1.0.4039
Flags : QFEVersion : 0x0004, Retail, Approved
Library Name : D3D8
Version : 1.0.4039
Flags : QFEVersion : 0x0002, Retail, Approved
Library Name : XBOXKRNL
Version : 1.0.4039
Flags : QFEVersion : 0x0001, Retail, Approved
Library Name : LIBC
Version : 1.0.4039
Flags : QFEVersion : 0x0001, Retail, Approved
Library Name : LIBCPMT
Version : 1.0.4039
Flags : QFEVersion : 0x0001, Retail, Approved
Library Name : LIBCI
Version : 1.0.4039
Flags : QFEVersion : 0x0001, Retail, Approved
Library Name : XGRAPHC
Version : 1.0.4039
Flags : QFEVersion : 0x0001, Retail, Approved
XDK 4039 is used with the following titles :
EDIT : The 4034 Xbe dump shows different library versions :
Title ID : 0x45410013
Title : L"The Simpsons Road Rage"
Game Region : 0x00000001
Section Name : 0x00010880 ("DSOUND")
Flags : 0x00000001 (Writable) (Preload) (Executable)
Virtual Address : 0x0017B1E0
Virtual Size : 0x0001B448
Raw Address : 0x00166000
Size of Raw : 0x0001B314
Section Name Address : 0x00010880
Section Reference Count : 0x00000000
Head Shared Reference Count Addr : 0x00010854
Tail Shared Reference Count Addr : 0x00010856
Section Digest : 81D3DA0E97E2D23E01B3E4A2A3F5A85DF40AC028
Library Name : XAPILIB
Version : 1.0.4034
Flags : QFEVersion : 0x0001, Retail, Approved
Library Name : D3D8
Version : 1.0.4034
Flags : QFEVersion : 0x0001, Retail, Approved
Library Name : XBOXKRNL
Version : 1.0.4034
Flags : QFEVersion : 0x0001, Retail, Approved
Library Name : LIBC
Version : 1.0.4034
Flags : QFEVersion : 0x0001, Retail, Approved
Library Name : LIBCPMT
Version : 1.0.4034
Flags : QFEVersion : 0x0001, Retail, Approved
Library Name : LIBCI
Version : 1.0.4034
Flags : QFEVersion : 0x0001, Retail, Approved
Library Name : DSOUND
Version : 1.0.3936
Flags : QFEVersion : 0x0001, Retail, Approved
Library Name : XGRAPHC
Version : 1.0.4034
Flags : QFEVersion : 0x0001, Retail, Approved
XDK 4034 is used with the following titles :
Okay, I meant to respond to this earlier because this is a VERY good question. I ran into this problem with Cxbx IIRC before. You see, the DSOUND library IS there, however, Microsoft shipped this XDK version with a bug. They forgot to actually name the DSOUND library properly. So for games that use that XDK, you'll have to scan for DSOUND functions regardless of whether you find that library name or not. Since I don't have any 4039 games on hand right now, I can't put that to the test.
Shogun
Maybe this helps: The current Xbox DB contains three 4039 titles: Agent Under Fire, Tony Hawk's Pro Skater 3 and UFC Tapout. (Luckily, none use LTCG.)
However, according to the same DB, Simpsons Road Rage actually does contain a DSOUND library, namely version 3936. (The other 7 linked-in libraries are all numbered version 4034 - NOT 4039!) This probably means that there exist different builds of the same game...
Yeah, this is a PAL version. Libraries may be different from NTSC...
This issue was moved to Cxbx-Reloaded/game-compatibility#199
Oops, closed this again by mistake. I'll update the title and labels to prevent this in the future...
@jarupxx Are we still having DSound missing for 4039 titles issue in current master branch?
@RadWolfie We are still having the issue. 4039 Titles can not scan DSound.
I've been thinking - in the V2 OOVPA registration approach, if we're scanning an Xbe for which we have no version-exact OOVPA, maybe we should always check the lower version first, and if found, report that fact separately. If this lower version OOVPA generates hits on many other titles from the same (unsupported) xdk version too, it might mean that the lower OOVPA version still applies. But if on the other hand the older version OOVPA nearly never gives a hit, but the higher version does, then it might mean the newer OOVPA version was introduced earlier. Both situations should be investigated further, so we can come up with even better fitting OOVPA registrations
I was confused for a moment. I finally see the difference between library (containing build version) and "section" section. DSound library section is not detecting because it was left out base on xbe dump file. So... let's do this little bit different.
Read each section headers, then get a build version. If it's not finding a build version, then use last known build version from recently went through build version. Sound good?
Edit: Good news I do have 007: Agent Under Fire title on me.
Scratch that, both section headers and library sections has different name for same purpose. I had made a temporary hack method for this workaround. Would it be acceptable for now?
On 007: Agent Under Fire title, it is only able to find 5 OOVPAs... even in HLEDB v1. I can confirm all 5 OOVPAs are detected inside DSound section header. Which is really strange... I think there are multiple changes in 4039 build for DSound. Yet, I cannot verify if it is true.
Good job! Confirmed scanning on The Simpsons Road Rage PAL.
I'm look through OOVPAs, It seems to be similar in 4134, but offset and length were different a bit. How can we verify it?
Quote from @PatrickvL
Regarding HLE scanning: This Xbe dump does show a "DSOUND" (and a possibly related "DOLBY") section, but no sound-related library header. There's no choice but to use the library version from the other libraries. (In this case, 4039)
Do note, that only the oldest titles contained libraries with differences in their version numbers - at some point (perhaps at 4039), all titles started to use the same version for all their contained libraries.
Hence, version detection requires only the looking at the first library header.
@PatrickvL We cannot use the first library header as it is not reliable. We have to go through each library header to get the highest build version it has.
@jarupxx
How many OOVPAs did it find on The Simpsons Road Rage PAL version?
We might need to make a brand new database just for DSound 4039 database. To verify it, we need to find the creations and releases first. Then we can proceed with breakpoint, including conditional input, in exception handler to catch "ignored" exception. Finally, determine which function it belong to. Aka making OOVPA signature for it.
Or make some comparison between two nearest build version such as 4134 and 4034 with reverse engineering document of them we had done in the past. Then verify the address is giving you accurate information in parameters.
Copying my quote for as an example of first library header vs all library header versions. (Note: This is not relative to 4039 issue directly, it is used as a reference to PatrickvL's discussion.)
Blood Wake
XAPILIB --> 3911
DSOUND --> 3936
D3D8 --> 3948
D3DX8 --> 3911
XGRAPHC --> 3911
XBOXKRNL --> 3911>> LIBC --> 3911
Kabuki Warriors
XAPILIB --> 3911
D3D8 --> 3925
D3DX8 --> 3911
XGRAPHC --> 3911
DSOUND --> 3936
DMUSIC --> 3925
XBOXKRNL --> 3911
LIBC --> 3911
@jarupxx Only 8 OOVPAs were found on The Simpsons Road Rage PAL version. We need to create DSound 4039 database. Would you like me to do that work? I can start this work after the OOVPAs review was completed.
We can do this together. Since I have 007: Agent Under Fire and you have The Simpsons Road Rage PAL. We can verify if both side are accurate enough to make a finalize OOVPA signature. I'm letting you know I am doing things little bit differently, I'll pm you the details.
@PatrickvL We can already scan the XDK 4039 titles that missing DSOUND in Library Name. I can confirm good enough OOVPAs are detected.
Is it acceptable for you?
Absolutely fine, thanks!