OK, *one* more for modern 32-bit Windows before the support tiers go
into effect, bringing this delivery to a nice 69 commits.
Completes P0285, funded by [Anonymous] and iruleatgames.
Technically not bloat if we imagine a development setting where ZUN
ran ZUN_RES.COM once and then repeatedly deleted HUUHI.DAT while
leaving ZUN_RES.COM resident.
Part of P0285, funded by [Anonymous] and iruleatgames.
OK, this is the big one. We still keep using `#include` guards only
where we absolutely need to, but with each header now being valid in
isolation, this can now actually help *minimize* the length of each
translation unit's `#include` list. Turns out that after removing all
the duplicates, we only *actually* need to guard 29 headers across all
5 games.
Part of P0285, funded by [Anonymous] and iruleatgames.
These declarations (and the associated `planar.h` dependency) are
needed by a lot fewer translation units than the rest of `ptn.hpp`.
Part of P0284, funded by [Anonymous] and Blue Bolt.
It has a hidden dependency on TH04's scroll functions, and TH02 seems
to use screen coordinates throughout.
Part of P0284, funded by [Anonymous] and Blue Bolt.
With the upcoming `#include` cleanup, it finally makes sense to split
off all graphics-related code into its own header. In turn, it makes
more sense to store all of these future master.lib headers in, well,
the master.lib directory, which provides a new 8 characters for their
file names. Turns out that the rationale I gave for the root directory
placement in 8266bbd didn't hold up 3½ years later…
(Also, the `pc98.h` declarations will eventually be split into
`game/coords.hpp` and something in `platform/x86real/pc98/`.)
Part of P0284, funded by [Anonymous] and Blue Bolt.
egc_setrop() delivers nothing of value, just obscures the single thing
it does, and disrupts the visual flow of the code.
egc_selectpat() isn't much better, is used a total of two times, says
almost nothing from its name alone, and MASTER.MAN's documentation adds
so little of value that you'd want to consult hardware documentation
anyway once you try to understand it.
Not to mention that both add a dependency on master.hpp for what are
actually PC-98 hardware constants.
Part of P0284, funded by [Anonymous] and Blue Bolt.
The upcoming `#include` cleanup is going to spell out all implicit
dependencies of every header file. This would
• `#include "master.hpp"` in every header that uses `PF_FN_LEN`, and
• `#include "pc98.h"` in `master.hpp`, adding lots of graphics
declarations to translation units that don't need them.
Moving `PF_FN_LEN` to its own file not only avoids needless inclusions
of `master.hpp` and all of its future dependencies later, but already
removes `master.hpp` from 6 translation units – not to mention that we
no longer need to preprocessor-guard some of the usages of `PF_FN_LEN`.
Part of P0284, funded by [Anonymous] and Blue Bolt.
`irand()` and `rand()` are only identical on Borland compilers. The
specific RNG implementation is an integral part of the original game
logic, so we actually never want to use the generic libc `rand()`. Any
future replays recorded on PC-98 builds should play back identically on
whatever system we port the games to, after all.
Part of P0284, funded by [Anonymous] and Blue Bolt.
The translation units were probably a better place back when most of
the codebase was still compiled in C mode, we only had a few C++ TUs,
almost everything needed to be declared as `extern "C"`, and moving
these declarations into the headers would have been really noisy with
all the `#ifdef __cplusplus` / `#endif` required. Nowadays though,
we've greatly reduced that surface area. And given that headers will
include even more headers as part of the upcoming `#include` cleanup,
it makes sense to make the jump now.
Part of P0284, funded by [Anonymous] and Blue Bolt.
Much more than usual, now that we've got a snappy build system! This
commit covers
• All .PI functions across all games
• TH02's High Score entry functions
• TH03's shots_update() and shots_render()
• All functions declared in `th04/op/op.hpp`
• TH04/TH05's bb_txt_put_8_raw(), bullet_template_clip(),
player_pos_update_and_clamp(), score_update_and_render(), and
slowdown_frame_delay()
• TH05's reimu_stars_update_and_render(), score_delta_commit(),
stage2_invalidate(), stage2_update(), and space_window_set()
Part of P0284, funded by [Anonymous] and Blue Bolt.
Borland's C preprocessor does not track enum values, so this check
always failed when running the code through just `CPP.EXE`.
Part of P0284, funded by [Anonymous] and Blue Bolt.
Everything related to the definition concept should be in one place.
The resident structure is merely where it's all stored, and the
`debloated` branch will get rid of that structure eventually.
Part of P0284, funded by [Anonymous] and Blue Bolt.
Not only would the `(GAME != 2)` need to include TH03 in the future,
but this `#undef` trickery will blow up once we start reorganizing the
`#include`s in the next few commits.
Sadly, a few source files use master.lib's grcg_off() function in one
game and the macro in the other, which makes it infeasible to assign a
distinct name for every function.
Part of P0284, funded by [Anonymous] and Blue Bolt.
MS-DOS Player translates long names to the 8.3 format via
GetShortPathNameA(), but it fundamentally can't do Unicode.
Part of P0284, funded by [Anonymous] and Blue Bolt.
Especially helpful on Linux where there's the Linux-native `PATH`, the
completely unrelated `PATH` inside Wine, and `WINEPATH` to prefill the
latter from the former.
Part of P0284, funded by [Anonymous] and Blue Bolt.
Creates at least somewhat of a better diff than if we had renamed the
batch file two commits ago.
Now that we invoke TLINK ourselves, the `tlink.exe` error can no longer
appear. Since it did take a few hours to RE this back in 624e0cb, I've
preserved the section at a more dedicated place, at
https://gist.github.com/nmlgc/6229345c74d1a7d3c6c1b3e988beb0e9
It will also be spelled out in the blog post of this delivery.
Completes P0004, funded by GhostPhanom.
I considered disabling it by default and only enabling it through an
optional `CONFIG_RESEARCH` variable, but that turned out to be too
annoying and inconsistent when `build_dumb.bat` generation came into
play.
Part of P0004, funded by GhostPhanom.