Commit Graph

11 Commits

Author SHA1 Message Date
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 718590908f [Maintenance] [th04/th05] Remove `extern "C"` from more areas of code
Mostly centered around the HUD, popup, overlay, boss, and player shot
functions we're about to reference in the upcoming decompilations.

Part of P0186, funded by [Anonymous] and Blue Bolt.
2022-03-26 20:44:54 +01:00
nmlgc 9432e0d2bf [Maintenance] Macros: Update to current coding standards
Less fancy token pasting, replacing them with inline functions where
possible, entirely removing unnecessary ones, and fixing smaller
issues here and there.

Part of P0186, funded by [Anonymous] and Blue Bolt.
2022-03-25 14:05:36 +01:00
nmlgc ea54e59f93 [Maintenance] Macros: Avoid references to implicit local variables
If the macro itself is local to a function, these can work in certain
scenarios, but never for global ones.

Part of P0186, funded by [Anonymous] and Blue Bolt.
2022-03-25 14:03:53 +01: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 164591f9fe [Maintenance] Consistently express angle literals in signed hex format
Originally just a workaround to remove angles from the PI counter, but
having the sign indicate the Y direction also makes them a lot nicer to
read in C land.

(Maintenance mode commit)
2020-10-02 14:48:54 +02:00
nmlgc a207d6a494 [Decompilation] Add screen-space assignment overloads for Subpixels
Also great news for those people who want to remove any and all C++ in
their mods, because this forces us to spell out subpixel literals as
actual floats, every time. And with that, you're back to being able to
simply search-replace for all the instances you'll have to change.

Part of P0099, funded by Ember2528.
2020-07-12 16:00:59 +02:00
nmlgc 624b66f3ca [Maintenance] [th04/th05] Add a segment split before the title popup functions
A bit tricky with those ASM translation units near-calling functions in
the very first segment, and #pragma codeseg requiring an additional
group parameter to correctly calculate array offsets (including those
used for `switch` statements). But doable.

Part of P0089, funded by [Anonymous] and Blue Bolt.
2020-05-03 23:28:25 +02:00
nmlgc 02f0a0afcc [Build] Don't word-align everything by default
Again, 11 necessary workarounds, vs. forcing byte aligment in at least
18 places, and that number would have significantly grown in the
future.

Part of P0085, funded by -Tom-.
2020-04-03 17:35:57 +02:00
nmlgc 765eae82e8 [Maintenance] [th05] Minimize #includes for the shot type translation units
Since a few annoying alignment bytes suggested more translation units
than previously expected, using many small headers has proved to be
better than one big shared TH04/TH05 header file. Or should we *really*
pepper the code with lots of `#pragma codestring`? 😛

And in case we have multiple translation units which all #include the
same set of headers, we'll just go with situational shared headers,
using a common prefix.

Part of P0062, funded by Touhou Patch Center.
2019-12-22 15:32:44 +01:00
nmlgc e7e1cbcaaf [Decompilation] [th05] Marisa's shot control functions
Yeah… such fun pretending that the original code wasn't copy-pasted.
And yes, Reimu will have to wait until the next one.

Completes P0037, funded by zorg.
2019-10-14 23:54:37 +02:00