diasurgical / devilution

Diablo devolved - magic behind the 1996 computer game
Other
8.78k stars 920 forks source link

fault.cpp #1422

Open AJenbo opened 5 years ago

AJenbo commented 5 years ago
AJenbo commented 4 years ago

It's a mess an no one cares

ChaosMarc commented 4 years ago

@AJenbo Why did you close this issue? Are all functions of this file binary exact?

qndel commented 4 years ago

no, we just don't care

AJenbo commented 4 years ago

@ChaosMarc we know the functions in this file well enough to say that they have nothing to do with game pay. They are simply and older form of Diablo's crash handeling and very Windows specific. Diablo 1.09 has better crash handling. Between the two versions crash handling was rewritten so having both versions becomes a bit messy. As my focus is on cross platform the Windows specific code also doesn't have much interest, and we have even better tools at this time. No one else on the current team appears interested in spending the time working on this file and so we removed it from the todo list. If anyone else wants to do it for copleatness sake they are of cause welcome to do so.

ChaosMarc commented 4 years ago

@AJenbo thank you very much for the explanation. I can definitely understand the reasoning. It's frustrating to work on code for which there is a better version at Handy already just for completions sake. So if I understood correctly you will use the 1.09 error handling for hellfire as well, right? This is probably an improvement but is it fully compatible? But won't this affected other files' bin exactness? But hey, as I am an ocd level completionist, maybe I will look into it myself :D

AJenbo commented 4 years ago

Normally one function won't affect the bin exactness of another as long as the signature is the same. There is however a chance that the different size could affect alignment, but that is also true for differing number of enums, headers and other things that aren't suppose to affect the output but still causes some strange behavior in VC 5/6. If that happens i guess we can just add some more enums with would help code quality any way :D

You are most welcome to work on it, any help is a appreciated and I would be happy to help you get started.

The error handling from 1.09 will work perfectly fine in hellfire, it all gets loaded in to the windows api at boot up and doesn't have any special knowledge about the rest of the system or vise versa.

The only call to the code in fault.cpp is in WinMain which we have already gotten bin exact, meaning that we have figured out the correct signature: https://github.com/diasurgical/devilution/blob/cb3381916ea39d0b4b4b8e3e44377a5936347122/Source/diablo.cpp#L323