Conversation
As of recently, decomp.me's matching system has updated a bit to be more reliable. This lowered leskal's work into a high-70s compared to the 80.99% he seemingly had. My code is a fork of leskal's and thus has some improvements, including the better accuracy to the target asm.
|
I would like to leave a quick note that the game seems to refer g_wipe to actually be g_pwipe, as hinted by the assembly. Unless you guys were already on top of that, I would just point that out. |
|
I've also got vprintf working! 100% matched too! https://decomp.me/scratch/HjnSN Since I don't know how I will be integrating the function into the project, I figured you guys could help me. This is my first game decomp project and, while I do reverse engineer games, I haven't contributed yet... so yeah. |
I checked out the scratch you linked. |
|
Strange, as that seems to be one of the only solutions. Additionally, the language is set to C++. ¯\_(ツ)_/¯ I don't know what could be wrong... |
Here is a cleaned up version that calls the class methods: https://decomp.me/scratch/7xN0t. |
|
I have checked and my code seems to be correct to that of the target assembly. I DO make a |
|
Yes, your code compiles to the same assembly, but I see no reason why you would write it that way? The whole code base is C++ so you don't need to "wrap C++ as C". |
|
I mean...how in this way...my code is more correct in that it's accurate. I don't need pretty'd up stuff for a simple function (as matching > readability, and at that anything else is nice). Optimizing for human readability isn't good if we already have working code in that sense. I know, there is a "stylistic change" that can happen. HOWEVER, I noticed that quite a bit of the codebase does have the binary-intent readability mine had. vprintf is a very small function in this sense and, while it does handle an enormous amount of text in-game, is only ever used to print out text. Additionally, most decomp projects do need the closest you can get to with a binary-identical output. Your code is also theoretically pretty fragile and prone to failing if we ever change code structure and/or optimization flags. Mine is fragile in the sense that if people decide to toy around and try to break it. Also, we cannot rely solely on RAII for critical timing or functions that are sensitive to the stack/register layout. It's also really compiler-dependent. The compiler was smart enough to know your code...but other compilers might handle it a lot differently. I've also added some comments just in case mine is used. |
|
|
If all we cared about was matching, we'd just throw in some inline assembly and call it done. The objective is to reconstruct what the original developers could have actually wrote so the code is understandable. This is more archeological reconstruction than clean room reimplementation. The best matches are the ones that look like production game code from 2002, not compiler output golf. |
As of recently, decomp.me's matching system has updated a bit to be more reliable. This lowered leskal's work into a high-70s compared to the 80.99% he seemingly had. My code is a fork of leskal's and thus has some improvements, including the better accuracy to the target asm. While it's not 100% matched, it is a few steps closer to matching.