Commit Graph

25 Commits

Author SHA1 Message Date
nmlgc f5da2a50a5 [Maintenance] [th02/th04/th05] Stage tiles: Move metrics to a separate header
The vertical shmup counterpart to 841d8be. Cleans up the subsystem
hierarchy by ensuring that at least all tile /formats/ code does not
depend on /main/ code.

Part of P0258, funded by [Anonymous] and Blue Bolt.
2023-10-31 22:33:10 +01:00
nmlgc 491f7b83d2 [Build] Compile shared translation units in 386 mode by default
By now, it has become clear that this the norm rather than the
exception among these units. Thankfully!

Part of P0245, funded by [Anonymous], Blue Bolt, Ember2528, and Yanga.
2023-06-30 19:59:11 +02:00
nmlgc bca1b7d38a [Maintenance] Add a `nullptr` polyfill to platform.h
Which allows us to remove <stddef.h> from translation units that just
needed it for `NULL`.

Part of P0203, funded by [Anonymous] and GhostRiderCog.
2022-07-10 13:02:51 +02:00
nmlgc 6f2881f056 [Maintenance] Remove `extern "C"` from more areas of code
The .PTN functions, vector functions, and egc_copy_rect_1_to_0_1()
(finally!) from TH01, as well as playfld.hpp from all games(finally!),
together with a bunch of other functions in their vicinity.

Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 23:28:19 +02:00
nmlgc efff8d61bb [Maintenance] Change line endings in old C/C++ files to LF
Yup, even a DOS compiler from 1994 considered CRLF line endings as
stupid.

Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 01:06:32 +01:00
nmlgc ebbb5b8255 [Maintenance] Move tile-related files to their own subdirectory
The next commit will make clear that tile functionality is not a subset
of the non-boss stage code.

Part of P0147, funded by -Tom- and Ember2528.
2021-06-20 19:37:20 +02:00
nmlgc 8426f3e13f [Maintenance] Make the playfield fraction functions available to ≥TH02
Part of P0146, funded by -Tom- and Ember2528.
2021-06-09 23:10:01 +02:00
nmlgc b1cf7ee021 [Maintenance] [th02] .MPN: Update existing decompilations to current standards
Part of P0138, funded by [Anonymous] and Blue Bolt.
2021-04-22 19:25:01 +02:00
nmlgc f635948480 [Naming] .MPN: Rename mptn_* to mpn_*
We've been using the three-letter extension names for everything else
that isn't .DAT, so it's more consistent to do the same for .MPN,
however particularly nice and readable its FOURCC may be. 8.3 filenames
also really appreciate that they'll have to accommodate one fewer
letter.

Part of P0138, funded by [Anonymous] and Blue Bolt.
2021-04-22 19:16:18 +02:00
nmlgc e1d5bdafed [Maintenance] master.hpp: Type-safe hmem_allocbyte() and hmem_free() wrappers
Sure, we can't use them everywhere, but it's really nice to get rid of
that casting madness – and any explicit references to x86 memory
segmentation – wherever we can.

Part of P0138, funded by [Anonymous] and Blue Bolt.
2021-04-21 17:50:12 +02:00
nmlgc 78b958f111 [Separate translation units] [th02] key_delay()
Part of P0138, funded by [Anonymous] and Blue Bolt.
2021-04-21 17:50:04 +02:00
nmlgc 531b044cb9 [Separate translation units] [th01/th02/th03/th04] vram_planes_set()
Boom! Clever segment renaming allows us to link the same .OBJ into 12
binaries.
(Well, 10 for now, due to alignment issues in TH04's OP.EXE and
MAINE.EXE.)

Part of P0138, funded by [Anonymous] and Blue Bolt.
2021-04-21 17:40:11 +02:00
nmlgc 1244bd74e7 [Maintenance] Prefer the -zC and -zP options over `#pragma codeseg`
Might look uglier, but has the advantage of not generating an empty
segment with the default name… *and* the default padding, which will
really come in handy with the following breakthrough.

Part of P0137, funded by [Anonymous].
2021-04-03 20:12:09 +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
nmlgc 3428739f80 [Separate translation units] [th02] .MPTN: Inner load functions
Part of P0133, funded by [Anonymous].
2021-01-30 19:53:00 +01:00
nmlgc 0ce869c30a [Maintenance] Complete the master.hpp transition
Part of P0133, funded by [Anonymous].
2021-01-30 19:22:29 +01:00
nmlgc 3bf078b68c [Separate translation units] [th02/th03/th04] pi_load()
Part of P0132, funded by [Anonymous].
2021-01-05 20:01:44 +01:00
nmlgc a1653146da [Separate translation units] [th02] 2D vector functions
Part of P0132, funded by [Anonymous].
2021-01-05 19:51:41 +01:00
nmlgc 52fdb33d1d [Separate translation units] [th02] frame_delay()
Part of P0132, funded by [Anonymous].
2021-01-05 19:23:31 +01:00
nmlgc 4850d6d457 [Maintenance] Rename "seg2" to "SHARED"
There's the better name, in ALLCAPS for improved grepping. TH01 is also
going to need a pseudo-binary to bundle translation units that appear
in more than one .EXE, and since "segment 2" would be wrong for that
game, it makes more sense to have one consistent name for these
pseudo-binaries in all games.

(Maintenance mode commit)
2020-11-03 17:01:26 +01:00
nmlgc 1610d7b63d [Maintenance] Decide on a consistent place for file-wide `#pragma`s
(Maintenance mode commit)
2020-10-01 16:35:56 +02:00
nmlgc aee8a13958 [Separate translation units] [th02] game_exit_to_dos(), zun_error(), graph_putsa_fx()
Oh, wait. Due to ridiculously unlucky alignment, we can't actually
approach TH03's OP.EXE from the top of code segment 2… without
covering way too many functions at once, that is.
At least TH02 works out with "just" three functions at once. *If* we
add seg2 back to OP.EXE, where we previously needed to delete it… 😵

Part of P0114, funded by Lmocinemod.
2020-09-07 21:18:40 +02:00
nmlgc 6204fdd450 [Separate translation units] [th02/th03/th04] frame_delay_2()
Completes P0113, funded by Lmocinemod.
2020-09-07 21:18:38 +02:00
nmlgc f0511221b7 [Maintenance] [th02/th03/th04/th05] Establish a common name for code segment 2
About time I finally developed this piece of tech. Towards TH05, this
segment got more and more undecompilable ASM functions mixed inbetween
C ones. Which means that pretty much all of the current ASM land
`#include`s in that segment will have to become translation units. And
we *really* don't want an additional layer of numbered, per-binary
translation units that just `#include` maybe one or two functions.

Also yeah, no _TEXT suffix, to drive home the point that this is a
"library" segment, and not really "owned" by any one file.

Part of P0113, funded by Lmocinemod.
2020-09-07 21:18:38 +02:00
nmlgc e3a78bd19b [Maintenance] Fix vector creation function declarations and calls
Part of P0099, funded by Ember2528.
2020-07-12 15:22:50 +02:00