Assembler: fix bug writing FIXUP_DATADATA items
sourceline 34 of "1213_ep1.exe"'s globalscript does a StrCopy()
to a .data - allocated array (the variable used with the .data + 60
fixup is basically a pointer there).
this caused a crash in the first room (room 1) directly after the intro
cutscene, after the BOSS finishes talking.
examining this bug (using the -f flag of agsdisas to print the fixup
section) i found that FIXUP_DATADATA items, unlike all others,
need to be right at the start of the fixup section (sorted too, but
in front of the others).
the sort function now takes care of this peculiarity.
to debug this, i added code to the engine to print sourceline
(look for SCMD_LINENUM in cc_instance.cpp) statements to stderr,
and the following patch to Engine/ac/string.h, to detect where
the error is coming from.
looking at sourceline 34 in the .s file then revealed the access to
a datadata fixup.
+#define STRIFY(X) STRIFY_REAL(X)
+#define STRIFY_REAL(X) # X
// Check that a supplied buffer from a text script function was not null
-#define VALIDATE_STRING(strin) if ((unsigned long)strin <= 4096) quit("!String argument was null: make sure you pass a string, not an int, as a buffer")
+#define VALIDATE_STRING(strin) if ((unsigned long)strin <= 4096) quit(__FILE__ ":" STRIFY(__LINE__) " !String argument was null: make sure you pass a string, not an int, as a buffer")