ref: 3a3530252b40b29bb0933c227c6634c4170da9e9
parent: c0a6441bcba2de735322d7738cb2366b0820c424
author: Clownacy <Clownacy@users.noreply.github.com>
date: Thu Sep 17 17:05:55 EDT 2020
Document some leftover debug-related code
--- a/src/Draw.cpp
+++ b/src/Draw.cpp
@@ -730,18 +730,17 @@
// Dummied-out log function
// According to the Mac port, its name really is just "out".
-BOOL out(int unknown)
+BOOL out(int surface_identifier)
{
- char unknown2[0x100];
- int unknown3;
- int unknown4;
- int unknown5;
+ char str[0x100];
- (void)unknown;
- (void)unknown2;
- (void)unknown3;
- (void)unknown4;
- (void)unknown5;
+ // The actual name of these two variables are unknown
+ (void)surface_identifier;
+ (void)str;
+
+ // There may have been some kind of 'OutputDebugStringA' call here,
+ // like the one in 'EnumDevices_Callback' in 'Input.cpp'.
+ // Pixel may have kept them wrapped in '#ifdef DEBUG' blocks.
return TRUE;
}
--- a/src/GenericLoad.cpp
+++ b/src/GenericLoad.cpp
@@ -295,6 +295,8 @@
char str[0x40];
sprintf(str, "PixTone = %d byte", pt_size);
- // There must have been some kind of console print function here or something
+ // There must have once been a 'OutputDebugStringA' call here or something.
+ // See 'EnumDevices_Callback' in 'Input.cpp' for an example of this.
+
return TRUE;
}
--- a/src/Input.cpp
+++ b/src/Input.cpp
@@ -150,13 +150,20 @@
directinput_objects->device = _joystick;
- char string[0x100];
+ // This is interesting: there are at least two places in the game
+ // where it seems like there's meant to be a debug print just like
+ // this one: these are the 'out' function in 'Draw.cpp', and the
+ // 'LoadGenericData' function in 'GenericLoad.cpp'.
+ // Perhaps Pixel kept them wrapped in '#ifdef DEBUG' blocks, and
+ // simply forgot to do the same here.
+
+ char str[0x100];
#ifdef FIX_MAJOR_BUGS
- sprintf(string, "DeviceGUID = %08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X\n", lpddi->guidInstance.Data1, lpddi->guidInstance.Data2, lpddi->guidInstance.Data3, lpddi->guidInstance.Data4[0], lpddi->guidInstance.Data4[1], lpddi->guidInstance.Data4[2], lpddi->guidInstance.Data4[3], lpddi->guidInstance.Data4[4], lpddi->guidInstance.Data4[5], lpddi->guidInstance.Data4[6], lpddi->guidInstance.Data4[7]);
+ sprintf(str, "DeviceGUID = %08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X\n", lpddi->guidInstance.Data1, lpddi->guidInstance.Data2, lpddi->guidInstance.Data3, lpddi->guidInstance.Data4[0], lpddi->guidInstance.Data4[1], lpddi->guidInstance.Data4[2], lpddi->guidInstance.Data4[3], lpddi->guidInstance.Data4[4], lpddi->guidInstance.Data4[5], lpddi->guidInstance.Data4[6], lpddi->guidInstance.Data4[7]);
#else
- sprintf(string, "DeviceGUID = %x\n", lpddi->guidInstance); // Tries to print a struct as an int
+ sprintf(str, "DeviceGUID = %x\n", lpddi->guidInstance); // Tries to print a struct as an int
#endif
- OutputDebugStringA(string);
+ OutputDebugStringA(str);
return DIENUM_STOP;
}