Commit Graph

12 Commits

Author SHA1 Message Date
nmlgc b61e612fdf [Maintenance] #include each header's dependencies within the header itself
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.
2024-07-09 08:46:42 +02:00
nmlgc 15f89da4ee [Maintenance] master.hpp: Split off all PC-98 graphics-related declarations
Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-07-09 08:41:33 +02:00
nmlgc 0ffa756cae [Contributing] Decide on `seg` and `off` for x86-segment-related identifiers
I could have equally argued the opposite way, and in favor of `sgm` and
`ofs`, but I've also been using `seg` and `off` more prevalently
throughout the years.

Part of P0245, funded by [Anonymous], Blue Bolt, Ember2528, and Yanga.
2023-06-30 19:59:11 +02:00
nmlgc 49a6834c4a [Maintenance] Move OUT for 8-bit port numbers to x86real.h
We'd like to use this optimization in the platform layer as well.
Turning it into an inline function via __emit__() also allows us to
turn a bunch of other macros into proper inline functions.

Part of P0232, funded by [Anonymous].
2023-02-28 08:08:17 +01:00
nmlgc f16144a131 [Naming] Rename peek() and poke() macros to look more intrinsic
And correctly move them to a separate part of x86real.h, as they are
not part of Turbo C++ 4.0J's DOS.H.

Part of P0232, funded by [Anonymous].
2023-02-28 08:08:16 +01:00
nmlgc 85c20d325e [Maintenance] Declare correct calling conventions for library code used in TH01
Making these declarations independent of the compiler's default calling
convention used for the game's own code.

Part of P0229, funded by Ember2528.
2023-02-28 08:07:52 +01:00
nmlgc cc9b323501 [Maintenance] Keep Turbo C++'s <conio.h> from redefining I/O port intrinsics
Especially since it uses the inferior fundamental integer types because
this was the 90's.

Part of P0214, funded by Ember2528.
2022-08-14 22:58:18 +02:00
nmlgc 440637ed8e [Decompilation] [th01] Kikuri: Masked line copies from VRAM page 1 to 0
Could have also been EGC-accelerated, but who cares, it's only used for
the blocking entrance animation.

Completes P0198, funded by Lmocinemod and Ember2528.
2022-06-17 15:30:30 +02:00
nmlgc a2358bef47 [Maintenance] Remove `extern "C"` from `x86real.h` and `decomp.hpp`
One of those per delivery now, eh?

Part of P0189, funded by Arandui and Lmocinemod.
2022-04-16 23:53:46 +02:00
nmlgc af2c0e14a4 [Maintenance] Adopt the peek() and poke() inline functions from <dos.h>
Which still allows us to replace a bunch of manual MK_FP() macros with
calls to these functions.

Part of P0157, funded by Yanga.
2021-09-12 17:50:41 +02:00
nmlgc 53920309a1 [Decompilation] [th05] snd_kaja_interrupt()
Boom! Decompilable after all. And look what that made us finally point
out: In all 4 games that use this function, its return value is
undefined if BGM is inactive. (That is, if the user disabled it, or if
no FM sound board is installed.)

Part of P0148, funded by [Anonymous].
2021-07-21 00:35:03 +02:00
nmlgc 1c5ed4b06e [Maintenance] Copy <dos.h>'s 16-bit x86 Real Mode declarations to a new file
DOS is not the same thing as the underlying CPU, after all. A separate
file not only indicates to future port authors which parts of the code
are x86-specific, but it also speeds up build times…

… in theory, because removing 677 lines from 49 files each doesn't seem
to speed up the build as much as I had hoped? But apparently my whole
system mysteriously got faster in the meantime, and I was getting 22-23
seconds for the entire repo even before this commit. Good enough.

Part of P0134, funded by [Anonymous].
2021-02-20 23:49:45 +01:00