Commit Graph

33 Commits

Author SHA1 Message Date
nmlgc d47f33f32b [Debloating] [th01] Resident structure: Resolve inconsistent types in copies
Part of P0229, funded by Ember2528.
2023-03-04 19:40:57 +01:00
nmlgc a6ce7ca17d [Debloating] [th01] Resident structure: Don't copy out the extra starting lives
Part of P0229, funded by Ember2528.
2023-03-04 19:40:57 +01:00
nmlgc 29c1496b42 [Debloating] [th01] Resident structure: Don't copy out the BGM mode
Not worth it for the two places that use this variable.

Part of P0229, funded by Ember2528.
2023-03-04 19:40:56 +01:00
nmlgc 6737b24436 [Debloating] [th01] Resident structure: Remove redundant total continue count
Keeping the structure layout for now though, since hacking resident
structures from DOS is a thing.

Part of P0229, funded by Ember2528.
2023-03-04 19:40:56 +01:00
nmlgc c7b76cc30b [Debloating] [th01] Use consistent code generation flags for all three binaries
Since we don't use DOS-native debuggers, there's really no reason not
to compile everything with `-k-`.

Part of P0229, funded by Ember2528.
2023-03-04 19:40:56 +01:00
nmlgc 8ef23356e6 [Debloating] [th01] Statically initialize VRAM plane pointers
Backporting this TH05 innovation to TH01. Dynamic far pointer
construction from the SEG_PLANE_* constants might be faster, but
definitely not smaller.
Also raises the question of how we organize the files during the long
time in which TH02-TH04 are not position-independent and thus still
need vram_planes_set() for building into identical binaries. Moving the
function definition up to TH02 is *kinda* unauthentic, but this branch
ultimately doesn't care.

Part of P0229, funded by Ember2528.
2023-03-04 19:40:56 +01:00
nmlgc 0690425551 [Debloating] [th01] Remove unused low-level code
Code that serves no purpose in the original game, but would cause quite
the annoyance to other port developers who might not immediately
realize that this code is unused. Keeping some of the functions that
come in handy during debugging, though.

Part of P0229, funded by Ember2528.
2023-03-04 19:40:55 +01:00
nmlgc 357573eaf7 [Naming] [th01] Use a consistent `rem_` prefix for current lives and bombs
Same rationale here – this naming scheme clarifies how these variables
are just redundant copies out of the resident structure.

Part of P0229, funded by Ember2528.
2023-02-28 08:07:52 +01:00
nmlgc e0e9741f92 [Naming] [th01] Use a consistent `credit_` prefix for starting lives
The `credit_` prefix may seem redundant within the REIIDEN.CFG
structure, but consistency seems more important here. Makes it much
easier to follow how these fields are copied around.

Part of P0229, funded by Ember2528.
2023-02-28 08:07:52 +01:00
nmlgc 24c07c72df [Maintenance] [th01] Replace generic C types with more specific ones
In all places visited during the next 6 pushes: The resident structure
and copies of its values, the packfile implementation, boss entities,
rendering font ROM glyphs to VRAM, and overall inconsistent code
between the three binaries.

Part of P0229, funded by Ember2528.
2023-02-28 08:07:52 +01:00
nmlgc c714c53310 [Decompilation] [th01] Main menu, part 1 (reviewed)
5.

Part of P0216, funded by JonathKane.
2022-08-16 01:45:46 +02:00
32th-System cc77dc0f19 [Decompilation] [th01] Main menu, part 1
With just the amount of changes to get everything compiling again.
Thank you! --Nmlgc
2022-08-16 01:45:23 +02:00
nmlgc 201722d25a [Maintenance] [th01] Finally add a BGM mode type
And name the FM state in a way that already prepares modded PMD
support. That's the number 1 TH01 mod idea, after all.

Part of P0216, funded by JonathKane.
2022-08-16 01:42:29 +02:00
nmlgc c4302b4ab7 [Maintenance] [th01] #include common.h from the resident structure header
Part of P0216, funded by JonathKane.
2022-08-16 01:41:14 +02:00
nmlgc 6a3c1e0f8d [Maintenance] [th01] REIIDEN.EXE: Fix the last remaining type mismatches
Part of P0215, funded by Ember2528 and Yanga.
2022-08-14 23:27:32 +02:00
nmlgc c26f885502 [Naming] [th01] Fix stage ID vs. stage number confusion
Part of P0214, funded by Ember2528.
2022-08-14 23:16:40 +02:00
nmlgc cf95cc8717 [Maintenance] [th01] Remove `extern "C"` from all remaining areas of code
Nothing says "we're getting things done" quite as much as this.

Part of P0214, funded by Ember2528.
2022-08-14 23:03:15 +02:00
nmlgc 6b3fc6c4d1 [Decompilation] [th01] Game init and exit functions: Move all data to C land
Part of P0213, funded by Ember2528 and GhostRiderCog.
2022-08-11 23:21:23 +02:00
nmlgc 738964a451 [Decompilation] [th01] Random resident structure stuff: Move all data to C land
Part of P0213, funded by Ember2528 and GhostRiderCog.
2022-08-11 23:21:23 +02:00
nmlgc 60a7e44b53 [Maintenance] Introduce proper Shift-JIS and JIS X 0208 types
Much more semantic than that twobyte_t abomination.

Part of P0212, funded by GhostRiderCog, Lmocinemod, and LeyDud.
2022-08-11 15:53:13 +02:00
nmlgc e97a869e90 [Maintenance] [th01] Compile all remaining C code as C++
And all that it needed was a few ellipses.

Part of P0212, funded by GhostRiderCog, Lmocinemod, and LeyDud.
2022-08-11 15:50:19 +02:00
nmlgc 3a97e3f846 [Maintenance] [th01] Move integer→string conversions to the `math/` directory
The nondescript nature of `core/` has been annoying me for a while, and
these function kind of are number-related after all.

Part of P0204, funded by [Anonymous] and Yanga.
2022-07-10 13:37:56 +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 4c500599a9 [Decompilation] [th01] Stage objects: Card/Orb collision handling
An X/Y point structure, in my TH01? And another actually logical
hitbox? (Rest of the code's still bad, though.)

Part of P0159, funded by Yanga.
2021-09-28 18:05:25 +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 0d137ee526 [Maintenance] Move the vram_planes_set() declaration to its own header file
Might seem inconsistent, given that the function initializes pointers
that are declared in planar.h… but it's always called from other game
initialization functions that don't require pc98.h or planar.h.

Part of P0133, funded by [Anonymous].
2021-01-30 19:11:55 +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 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 9c36df72e5 [Maintenance] [th01] Get rid of th01.h
Part of P0126, funded by [Anonymous] and Blue Bolt.
2020-11-15 21:27:41 +01:00
nmlgc 6c22af7e83 [Build] [th01] Only compile shared single-file translation units a single time
Which gets rid of 13 redundant translation units. Definitely a good
start, before I figure out how to best handle the more complicated
cases.

(Maintenance mode commit)
2020-11-04 14:47:52 +01:00
nmlgc eb89330f64 [Build] [th01] Move the -Z and -3 options onto the command line
Deactivating them is the exception, not the norm.

Part of P0122, funded by Yanga.
2020-10-06 13:27:33 +02:00
nmlgc afd74fb8aa [Decompilation] [th01] 16-bit integer to string conversion
"Hey, let's have separate functions for uint16_t and int16_t… and then
just *not* support negative numbers in the latter" :zunpet:

Part of P0104, funded by Ember2528.
2020-07-27 17:22:16 +02:00
nmlgc 0252da2a71 [Decompilation] [th01] Game init and exit functions
Yes, that's the code that forgot reactivating the text cursor before
returning to the DOS prompt!

Completes P0080, funded by Ember2528 and Splashman.
2020-03-03 13:12:00 +01:00