Cxbx-Reloaded Progress Report (March 2021)
Added 2021-05-06 15:25:13 +0000 UTCProgress Report (March 2021)
And here we go with a quick recap of everything that improved this month: yet another global performance improvement, more rendering improvements (some that made at least two games become fully playable), another input device supported (arcade joystick) and some other nice quality of life improvements to make CxBx-Reloaded better/easier to use.
General Improvements
Add D3D9 half-pixel offset [PR #2149]
Fixes UI rendering issues especially text (eg. any game menus or in-game text where some characters are closer that they should or “cut”).
Before:

After:

Add support for the arcade joystick device to the input GUI [PR #2150]
This adds the arcade joystick to our list of supported devices (not only listed when you’re changing the settings for input, but also actually seen by the game as the actual arcade joystick).

Hide Sensitive Fields from EEPROM GUI [PR #2141]
This change was made due to common mistakes occurring from the community, revealing their own information and some users had to blur their sensitive info (which can take time). Since we already know auto-generated are working fine for ages. This pull request introduces hide sensitive info from the internet and from our discord's help support channel. Regardless if they are auto-generated, dumped from actual hardware, or manual input of their own preference. Following fields are set as sensitive fields and automatically hidden by default:
● HDD Key
● Serial Number
● MAC address
● Online Key
● Parental Control Password (always hidden)
Fix XeUnloadSection erroneously zeroing memory [PR #2154]
In cases where XeUnloadSection does not decommit memory (due to the section being too small), we'd zero that section. Turns out this should not be done and some games (or to be specific, middleware) relies on those sections not being zeroed. While investigating this issue it was also noticed Xbe section headers and library versions are read in an odd way. The code was modified to read them in a single call, which should hopefully be faster. Technically this loses some logging information, but the loss is so minimal it’s not considered an issue.
Fixes Apex/Racing Evoluzione crashing before reaching menus. Since this crash resided in BINK code, it's possible this fixes more games with BINK version(s) relying on this edge case.
Fix partition formatting [PR #2155]
1. Fixes a long standing bug introduced by #944 where partition formatting occasionally failed, resulting either in errors printed to the log or in a game crash. In my case, I often had to re-run the game multiple times to get partitions to format properly.
2. Modernizes CxbxGetPartitionNumberFromHandle and CxbxGetPartitionDataPathFromHandle to use Unicode and support long paths properly. This saves on internal Unicode -> ANSI -> Unicode conversions which could potentially also be lossy.
Use the backbuffer format requested by the title [PR #2151]
Seems the previous behaviour ensured the backbuffer format matched the display mode in windowed mode - this might be a holdover from D3D8.
The hostbackbuffer is now unspecified.
The xboxbackbuffer is now whatever format the title requested.
Fixes NBA Live 2K5 alpha blending issue.
Before:

After:

Added option to allow keyboard/mouse input when the rendering window is unfocused [PR #2152]
Closes #2142. As the title says, this adds a new option in the input gui that allows keyboard/mouse input to be registered by the game even when the cursor is outside of the rendering window.
Fix crash in fullscreen mode [PR #2165]
Set a backbuffer format, since UNKNOWN is only accepted in windowed mode.
Fixes issue introduced in #2151.
Vertex buffer cache improvements [PR #2164]
This PR improves the vertex buffer cache again to improve its performance. Based on Group S Challenge as a test case, it was identified our current cache generated a lot of "false positive" matches, continuously evicting buffers and recreating new ones up to 1000 times per frame. Turns out, those cases were caused by vertex buffers with identical vertex data but different vertex declarations.
The vertex buffer cache was modified to key cached resources by a (dataHash, vertexElementsHash) pair of elements, which allows such "buffer views" to coexist in the cache without continuously invalidating each other. On top of that, I modified vertexElementsHash not to hash some of the vertex stream attributes not relevant for the final form of the vertex buffer - most notably, it wrongly hashed a stream number, effectively evicting buffers from the cache if they are being bound to different stream numbers!
This has potential to improve performance in every game, based on my testing Group S Challenge gets a 3x performance improvement in-race, jumping from <20FPS to 55-60FPS - essentially full speed.
Upscale rendertargets and depth surfaces consistently [PR #2168]
Rather than just upscaling the backbuffer.
Allows high resolution rendering in some games that rendered to textures.
Fixes Amped shadows when upscaling, due to SetRenderTarget failure (probably mixing scaled and unscaled RT & Depth).
Games that wouldn't upscale properly before:
● Panzer Dragoon Orta
● Crash Tag Team Racing
● Crash Nitro Kart (menu only)
● Knight of the Temple 2
● Dead or Alive 3 (reflections)
● Virtua Cop 3
● Shadow of Memories
Added option to clear the cache partitions from the GUI [PR #2170]
Now it’s easier (and mostly fail proof) to clear the correct partitions when needed.
Use Win10 CPU Sets API where supported [PR #2172]
Using CPU Sets (introduced in Windows 10) instead of thread affinity allows to ensure that the entire physical core is reserved ONLY for the game code, so even the worker threads and third party libraries inside the process cannot run code on it.
For Windows 7 and 8.1, the existing thread affinity approach is retained
Notable Game Improvements
Long month and a lot of testing needed to be made… that wasn’t fully made, so the results below are just some of what I could observe from my limited time:
187 Ride or Die [PLAYABLE]
https://www.youtube.com/watch?v=C0r8DAiInKA
Finally the game graphics aren’t covered by a back screen anymore. Previously if you wanted to see anything in-game (other than the HUD), you had to turn on wireframe rendering mode. Now there’s just some minor visual issues (including some reflection issues with the surface of cars in some levels) and some audio looping incorrectly (character voices in-game). Other than that, no game breaking issues.
Burnout [PLAYABLE]
https://www.youtube.com/watch?v=EIlGW0Lbjvs
This wasn’t even a case of game breaking issues previously, it’s more to the side “we have a higher standard for saying a game is playable” of things. Two latest issues fixed that made this game jump into our playable list were performance and rendering (cars wouldn’t render the correct colors outside of tunnels if you had some specific GPUs).
Red Faction 2 [IN-GAME]
Really close to playable status now: performance improved enough that it should run at playable speeds even with slow hardware and most visual issues were fixed… but sadly one regression prevents it from getting the wanted green label: night vision. If at some point you enable this feature in-game, the game can get stuck into a black screen (and this can’t be disabled or fixed once you’ve done it, can happen even if you’ve used night vision once, but you can also get lucky enough to use it a few times before the black screen of death). Once this is fixed, it’s probably safe to assume the game is playable as the major issue that plagued it for the longest time (not being able to create a game profile to save and resume your progress) was also fixed this month.
Deus Ex Invisible War [MENUS]
For the first time we also have this Deus Ex game reaching the menus (previously only hanging on the loading screen, doing nothing else than crashing or hanging forever before being able to show anything else on screen).
Final Words
Sadly I couldn’t put as many hours as I’ve wanted into testing games to check for actual compatibility improvements (most of my tests this month were related to checking against regressions to be sure some of the games we had working at some point didn’t regressed), but I’m still happy with the results we got.
As always, don’t forget to check the updated compatibility information in our site ;) https://cxbx-reloaded.co.uk/compatibility