Hello everyone,
Firstly, I apologize for the delay in releasing this patreon update. I've been occupied with other tasks and wasn't able to find the time to write this report. Let's go through what I've been up to:
Soon, I'll finish "fxm removal". It's one of the object managers in RPCS3 designed to replace global variables. Its main disadvantage was use of global mutex and also forced use of refcounted pointers. Another disadvantage was its complex yet misleading API. The purpose of such object managers was to reset its global state automatically after emulation restart in a manner which is hard to misuse for the programmer. The replacement, which I designed recently (it resides under g_fxo name) is much simpler and provides an object that "just exists" without any synchronization overhead.
https://github.com/RPCS3/rpcs3/pull/6394 - Switched AppVeyor to use VS 2019. VS 2017 advertised support for inline variables but had a bug preventing its use. Since my work on previous PRs made use of the same, it was necessary to make RPCS3 use VS 2019 on Windows ahead of the intended schedule.
https://github.com/RPCS3/rpcs3/pull/6444 - Fixed VFS filename escaping technique to allow control characters in filenames such as newlines. This is a curious thing which I had previously overlooked before for some odd reason. Windows doesn't allow them, but other operating systems typically do. We already had a technique to escape some visible characters such as ":" which are not allowed in filenames on Windows.
https://github.com/RPCS3/rpcs3/pull/6450 - Fixed an issue with system time wrapping around about every 30 minutes on Windows. This is an old bug and was caused by 64-bit multiplication overflow. I had to use 128-bit intermediate multiplication result to do it correctly.
https://github.com/RPCS3/rpcs3/pull/6471 - Changed the behavior of unimplemented HLE functions to no longer throw exceptions and instead show up as a TODO in the log and return CELL_OK. This was a trivial change, but RPCS3's codebase is currently plagued with exceptions. I occasionally did some work to decrease their negative influence in some places, but there is an extreme amount of work still left to do. It's very unfortunate that I didn't realize this until later on, that the emulation has very little place for heavyweight C++ features, such as exceptions. I hope some day I will be able to disable them all together. It's hard to work with JIT recompilers where exceptions can be thrown and there was really no good excuse to throw them in the first place. Just lack of experience and the inability to find better ways for solving problems.
Relating to exceptions, I tolerated some native filesystem errors at RPCS3 startup instead of hard crashing. As a side effect, I allowed for completely disabling of TTY output by creating a directory called "TTY.log" in place of file.
Dropped using of undocumented Windows syscalls for keyed events. There isn't much information about them around, but reversing shown that WinAPI implementation had begun abandoning use of these syscalls around Windows 8. Concentrating all hand-written code that was using this feature in one place made this transition easier. I decided to use native semaphores which are available since Windows XP.
https://github.com/RPCS3/rpcs3/pull/6631 - Fixed an error in internal path creation function where RPCS3 tries to create parent folders when they already exist. An attempt to do so could produce some unexpected errors on Windows, but now it should be good. This was also an old problem.
https://github.com/RPCS3/rpcs3/pull/6637 - Finished old work of making savedata saving atomic. Also fixed few possible regressions which were introduced by this feature. The purpose of "atomic savedata" is to increase reliability of creating user saves in the case of unfortunate events: emulator crash, BSOD or a power loss. Currently, it simply makes sure that the old savedata remains in place, otherwise both old and new data could be damaged. Missing "maintenance" function is designed to make sure that the old savedata also doesn't disappear despite being intact.
In the same PR I fixed one of the Windows-specific workarounds made to allow access to deleted files. On the original PS3 filesystem, on Linux and many other POSIX-compatible operating systems. Deleting opened files is allowed and files will remain "invisible" on disk until the last user closes them. On Windows, this feature is typically emulated by moving the file somewhere and marking it for deletion. I changed the location of placing files being deleted in order to not interfere with removing empty directories.
I have some unpublished work locally such as atomic shared pointer implementation which may allow to experiment with lock-free algorithms more easily.
I also plan to fix GDB server soon and finally close the oldest pull request. In fact, its presence and its design choices made me to start this "quest" in doing some side work such as fxm removal. I'm not forgetting about all my scatter plans, such as recompiler improvements.
Thanks for all the support!