Second part to fixing the 10th style SQ-INIT error. This has
cross-impact on the kind of security data the game expects.
Therefore, we need to expose the IO board type and make it
configurable like the security data for the different game
versions.
More details explained in a dev journal entry to following
in one of the next commits.
This is one part of fixing the 10th style SQ-INIT boot error.
For some reason, 10th style calls the "second dongle slot"
which, according to the code, is expected to return the same data
as the first (black) dongle slot. Original ezusb/C02/D01 IO boards
do not have a second dongle round plug slot nor ever came with
a splitter cable. I checked original manuals of the C02 conversion
kit, E11 and ECO software upgrade kits. No white dongle nor
additional hardware for any other dongle than a black dongle.
The paths changed for 18 and again for 19. Refactor and improve
the detection logic to consider this. This also should make
the code more maintainable.
The synchronization block was too coarse and kept the lock
acquired even when the hooked call continued traversing because
it skipped the chart patch trap code. This was apparently fine
on several games but caused very flaky deadlocking on iidx18
during the boot screens and even crashed iidx19 consistently
before showing the boot screen.
Applies to iidx18 and iidx19 when using the recently extended
redirect feature for settings paths, mixing / and \ crashes the
game in some operator sub-menus when trying to save settings.
- Use static assert to verify struct sizes
- Replace "magic numbers" with proper sizeof's
- Allocate largest size buffer for message response to address
compiler warnings which indicates potential out of bounds
reads/writes
Provide an option for non final lincle revisions and
if the "modern" monitor check is not delivering stable
results on the final lincle revision, e.g. using the
original "pendual lcd" monitor.
When the process requests to exit, the debugger thread attached
from inject swallowed that event simply without taking action
of actually terminating the process. Handle this accordingly
when the debugger loop is running and terminate the process
Affects all games based on version 18 and 19 which includes
the chinese versions
This code is based on the toastertools implementation.
Credits to the original authors.
* popnhook1 for pop'n 15 - 18 has been added
* popnio has been added
* inject.exe has new syntax for loading hook DLLs, `real.dll=hook.dll`. This will trigger an early IAT hook where it will load the EXE suspended without resolving imports, replace the reference to real.dll in the import table with hook.dll, and then resolve everything before launching. This allows for ezusb.dll to be hooked properly.
* launcher.exe also has a new early IAT hook feature now. Use `-I real.dll=hook.dll`. The idea is the same as described above for inject.exe.
* Updated ezusb constant namings based on what is visible in ezusb.dll's debug statements.
The launcher.exe implementation of early IAT hooking means that someone can implement popnhook2.dll for 19 and above. I have tried pop'n music Sunny Park using a modified version of popnhook1 and it seems to work to some degree: the I/O check and security check returns OK which means the ezusb hooking used in popnhook1 is also working for the later games using `launcher.exe -I ezusb.dll=ezusb2-popn-shim.dll ...`. The process is rather invasive (manually resolving all imports means more chances to fail) so it has been implemented in such a way that the launcher will work the same as it has before as long as `-I` isn't specified.
One questionable thing I am not confident about is the `texture_usage_fix` hack flag I added in the conf. As the comment says, pop'n music 16 will work in Windows XP without the flag being set, but the game will immediately crash on later OSes without the flag being set in my experience. No other games had this issue in my experience. Enabling it in other games doesn't seem to have any negative effects.