Commit Graph

35 Commits

Author SHA1 Message Date
nmlgc b3e61807a1 [Decompilation] [th04/th05] Playfield shaking
Part of P0185, funded by [Anonymous], -Tom-, and Blue Bolt.
2022-03-05 17:50:33 +01:00
nmlgc 78dcbf4b75 [Maintenance] master.hpp transition: EGC-accelerated VRAM shift functions
Part of P0185, funded by [Anonymous], -Tom-, and Blue Bolt.
2022-03-05 15:31:50 +01:00
nmlgc 488115513c [Maintenance] master.hpp transition: EMS functions
Part of P0168, funded by Blue Bolt and rosenrose.
2021-11-28 19:15:22 +01:00
nmlgc c940059037 [Decompilation] [th05] Shinki + EX-Alice: Background rendering
Palette hacks not included yet. Yup, that's how all phases can use
hardware color #0 as their background color.

Completes P0147, funded by -Tom- and Ember2528.
2021-06-21 15:48:42 +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 01c92da1ac [Decompilation] [th05] snd_load()
A decompilation of ZUN-written ASM that was almost worth it, for once!
Too bad that those aren't the <string.h> intrinsics that the
Wolfenstein 3D disassembly hinted at, though.

Part of P0135, funded by [Anonymous].
2021-03-19 19:22:57 +01:00
nmlgc ffcc46d32f [Decompilation] [th05] pi_put_8(), pi_put_quarter_8()
> assigning to the DI register immediately before a CALL
Yeah, no amount of comma operator trickery can get *that* out of this
compiler. Also, these TH05 .PI functions are the only place in PC-98
Touhou with a `IMUL DI, imm8` instruction, which is impossible to get
out of Turbo C++'s built-in assembler.
Well, at least the `if` branches decompile somewhat nicely.

Part of P0134, funded by [Anonymous].
2021-02-20 23:50:03 +01: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 7a44adf8d0 [Maintenance] Use the C++ resdata_*() wrappers in all ZUN.COM sub-binaries
Getting us completely macro-free there… even though it did require a
separate version of those functions if the ID is a pointer.

Part of P0134, funded by [Anonymous].
2021-02-20 15:46:48 +01:00
nmlgc ce25a6e579 [Separate translation units] [th02/th03/th05] game_init_main()
Oh look, new content! Gotta finish this push at some point, after all…

Part of P0133, funded by [Anonymous].
2021-01-30 19:50:32 +01:00
nmlgc c876216c1d [Maintenance] Remove master.lib's original master.h 🎉
My repo will never include all of master.lib anyway, as explained in
https://rec98.nmlgc.net/blog/2020-11-03.
That gets me a median build time of 27 seconds for the entirety of
ReC98 on my system, just as estimated in that same blog post. And we're
far from done with #include optimizations…

Part of P0133, funded by [Anonymous].
2021-01-30 19:37:41 +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 eeb4e7ebfa [Maintenance] [th01/th02/th03] Compile the ZUN Soft logo animation as C++
This might have almost been the case that justified making master.hpp
compatible with C translation units… but even this one would like to
use the template functions from th01/math/vector.hpp.

Part of P0133, funded by [Anonymous].
2021-01-30 19:22:12 +01:00
nmlgc d3a1335e35 [Maintenance] master.hpp transition: Resident palette functions
Final one! Now we only need to get all translation units to use this
header…

Part of P0133, funded by [Anonymous].
2021-01-30 18:51:29 +01:00
nmlgc e8ac905d25 [Maintenance] master.hpp transition: Machine identification
Part of P0133, funded by [Anonymous].
2021-01-30 18:47:35 +01:00
nmlgc 952a1e47f7 [Maintenance] master.hpp transition: Gaiji functions
Part of P0133, funded by [Anonymous].
2021-01-30 18:46:21 +01:00
nmlgc 27bf06751a [Maintenance] master.hpp transition: Keyboard functions
Part of P0133, funded by [Anonymous].
2021-01-30 18:34:14 +01:00
nmlgc c27e7a1b01 [Maintenance] master.hpp transition: Superimpose sprite functions
Part of P0133, funded by [Anonymous].
2021-01-30 18:33:18 +01:00
nmlgc 120dda99e4 [Maintenance] master.hpp transition: Packfile data and functions
Part of P0132, funded by [Anonymous].
2021-01-05 22:09:13 +01:00
nmlgc 55fb6f2e56 [Maintenance] master.hpp transition: Joystick data and functions
Part of P0132, funded by [Anonymous].
2021-01-05 22:08:57 +01:00
nmlgc dd7e200f3b [Separate translation units] [th02] .PI blitting
Part of P0132, funded by [Anonymous].
2021-01-05 19:34:59 +01:00
nmlgc 74a11d667d [Maintenance] master.hpp transition: Resident data
With a type-safe wrapper template that removes the need for ID length
and structure-size-in-paragraphs macros. *And* <dos.h>!

Part of P0126, funded by [Anonymous] and Blue Bolt.
2020-11-15 21:28:55 +01:00
nmlgc aea27d2221 [Maintenance] master.hpp transition: DOS functions
Part of P0126, funded by [Anonymous] and Blue Bolt.
2020-11-15 21:23:29 +01:00
nmlgc 199f73eba4 [Maintenance] master.hpp transition: Math declarations
Part of P0126, funded by [Anonymous] and Blue Bolt.
2020-11-15 21:22:15 +01:00
nmlgc d515d67c9f [Maintenance] master.hpp transition: Optionally buffered single-file I/O
Now the fact that those can be buffered is also documented outside of
MASTER.MAN.

Part of P0126, funded by [Anonymous] and Blue Bolt.
2020-11-15 21:21:04 +01:00
nmlgc 90f1c2ca93 [Maintenance] master.hpp transition: Text RAM declarations
Part of P0126, funded by [Anonymous] and Blue Bolt.
2020-11-15 21:19:42 +01:00
nmlgc 6a8de71720 [Maintenance] master.hpp transition: EGC declarations
Part of P0125, funded by [Anonymous].
2020-11-02 23:33:09 +01:00
nmlgc 3ee848f456 [Maintenance] [th05] Use master.hpp for the character selection menu
6149 LoC with the original master.h, vs. 2524 LoC *and* additional
semantic sugar with master.hpp. Nice!

(Yes, *semantic* sugar.)

Part of P0124, funded by [Anonymous] and Blue Bolt.
2020-11-02 22:21:51 +01:00
nmlgc b674adff18 [Maintenance] master.hpp transition: Heap functions
Part of P0124, funded by [Anonymous] and Blue Bolt.
2020-11-02 22:17:48 +01:00
nmlgc 65a12d13a8 [Maintenance] master.hpp transition: .PI declarations
Part of P0124, funded by [Anonymous] and Blue Bolt.
2020-11-02 22:09:17 +01:00
nmlgc c8fa62d0c2 [Maintenance] master.hpp transition: GRCG declarations
Part of P0124, funded by [Anonymous] and Blue Bolt.
2020-11-02 21:50:51 +01:00
nmlgc e78f73d779 [Maintenance] master.hpp transition: Graphics declarations
Part of P0124, funded by [Anonymous] and Blue Bolt.
2020-11-02 21:48:51 +01:00
nmlgc 02cd7f4acc [Maintenance] master.hpp transition: Palette declarations
Since we can't even change whitespace inside a preprocessor macro
without getting a `redefinition is not identical` warning, these have
to be wrapped in `#if !defined(__MASTER_H)` blocks for now.

Part of P0124, funded by [Anonymous] and Blue Bolt.
2020-11-02 21:45:56 +01:00
nmlgc 7306a4b185 [Maintenance] master.hpp transition: VSync declarations
Merely applying our coding style for now.

Part of P0124, funded by [Anonymous] and Blue Bolt.
2020-11-02 21:43:39 +01:00
nmlgc 8266bbd83e [Maintenance] Start a C++ master.lib header file
The regular master.h is big, uncomfortable in C++ mode, and bloated
with all those portability `#define`s that effectively only cover a
small portion of the PC-98-specific code anyway. So, let's gradually
transition to a new smaller header that is more integrated into the
ReC98 codebase, by simply no longer #including `master.h` in new code.

Which also explains its weird place in the root directory. Even though
`libs/master.lib/` contains plenty of game-specific modifications, it
didn't feel right to have anything in this directory refer to types
from `pc98.h`.

Part of P0124, funded by [Anonymous] and Blue Bolt.
2020-11-02 21:12:59 +01:00