Especially annoying if that happens in the middle of a Shift-JIS multi-byte
sequence, like in those two instances in TH02's OP.EXE. Also, making up for
the lack of string analysis during the dumping process of TH05's MAIN.EXE.
Which challenges a lot about what we thought to know about Amusement Makers'
modifications to master.lib, due to the fact that TH02 contains the modified
version of this function, but the original of draw_trapezoid...
And I haven't even begun to research how this removal of conditional branches
could have a positive effect on the game, especially since it's only called
before exiting anyway.
Yeah, the code is identical to the near version, with the only difference
being the PROC directive declaring the function as either near or far. Now, I
could either turn the function body into some kind of macro stored in a
separate file and then instantiate it from both near and far functions... or I
could just copy the original structure. Who cares, anyway.
OK, *that's* the last piece of C++ crud shared across all main executables.
According to the object in the library file though, it seems to include one
more dword named
__DestructorCountPtr
in the BSS segment. Neither games nor the runtime itself seem to use it, and
as a consequence, it doesn't even seem to be included in the games' BSS
segments, given that they all end with the symbols of xx.cpp...
Neither is this one. Also, interesting how IDA didn't identify the function in
one third of the cases.
[Binary change] Order of 2 relocations in TH03's MAINL.EXE, TH04's MAIN.EXE
and MAINE.EXE, and TH05's MAINE.EXE.
Yup. From TH03 on, ZUN uses a different version of master.lib, containing more
features than the last official version 0.23 from May 1995. Given the relative
insignificance of the features in question, I presume that Amusement Makers
must have kept their own, improved fork of master.lib, rather than ZUN having
hacked master.lib on his own.
Anyway, that doesn't matter. In the end, we still have to reverse-engineer each
and every one of these changes, and some of the more complicated functions
won't even be reduced before the actual reverse-engineering step of this
project.
[Binary change] Order of 3 relocations in TH05's OP.EXE.
OK, looks like we got all of the C++ crap out of the way... e~xcept for
another function in TH01's REIIDEN.EXE, of course.
[Binary change] Order of 2 relocations in TH01's FUUIN.EXE.
God, this C++ stuff really is a crappy mess. Even had to manually adjust the
alignments at the end of the the TEXTC segment - and no, the ALIGN directive
remains an inadequate tool random bytes, even more so because TASM's
implementation just pads the space with random bytes. But hey, nice to finally
see some reduction outside of seg000.
[Binary change]
* Order of 3 relocations in all of TH04 and TH05's OP.EXE
* Order of 6 relocations in TH03's OP.EXE and MAIN.EXE, and TH05's MAIN.EXE
and MAINE.EXE
* Order of 9 relocations in all of TH01, TH02's OP.EXE and MAINE.EXE, and
TH03's MAINL.EXE
* Order of 11 relocations in TH02's MAINE.EXE
[Binary change]
* Order of 2 relocations in all executables of TH02, TH03, TH04 and TH05
* Order of 4 relocations in TH01's FUUIN.EXE
* Inserts a new relocation into TH01's REIIDEN.EXE
Yup. 50 functions in a single module, totalling 12,633 bytes, used in all 15
game executables, and no references to any of that in the remaining game code.
[Binary change]
* Order of 3 relocations in all of THO3, TH04 and TH05, TH02's MAIN.EXE and
MAINE.EXE, and TH01's OP.EXE and FUUIN.EXE
* Order of 2 relocations in TH02's OP.EXE and TH01's REIIDEN.EXE
* Inserts a new relocation into TH03's MAIN.EXE
Well. Even after downloading pretty much every (identical) copy of Turbo /
Borland C++ 3, 4, 5 and everything inbetween, I could *not* find the original
source to most of the C++ parts in the runtime. Using the IDA disassemblies
to build their slices is simply the only option.
... Really, though, who cares.
Same for registerbgifont() being a wrapper around registerfarbgifont(). But
at least there, IDA should have noticed something weird. The original delete[]
operator refers to the delete function, so registerbgifont() would have had to
be a wrapper around registerbgidriver(), which of course doesn't make sense,
and IDA claims to *know* these functions...
Lol, "registerbgidriver". Just because the original function is nothing but a
wrapper around free(), and registerbgidriver() is also just a wrapper around
registerfarbgidriver().
Well, great. Why did the trapezoid variables have to be included in this
object file? 10 of the executables don't use them, and there's no way to
locate that one needle in the haystack of uninitialized data now.