Commit Graph

29 Commits

Author SHA1 Message Date
nmlgc 5356d0e5b6 [Decompilation] [th02] High Score menu: Main function
Part of P0285, funded by [Anonymous] and iruleatgames.
2024-07-09 08:47:03 +02:00
nmlgc c6687a9308 [Decompilation] [th02] High Score menu: HUUHI.DAT saving
Part of P0285, funded by [Anonymous] and iruleatgames.
2024-07-09 08:47:03 +02:00
nmlgc 9a4970c6d8 [Decompilation] [th02] High Score menu: Rendering
Part of P0285, funded by [Anonymous] and iruleatgames.
2024-07-09 08:47:02 +02:00
nmlgc 69a796744f [Translation unit catch-up] [th02] HUUHI.DAT: Loading
Part of P0285, funded by [Anonymous] and iruleatgames.
2024-07-09 08:47:02 +02:00
nmlgc fdaf261931 [Translation unit catch-up] [th02] HUUHI.DAT: Default data
Technically not bloat if we imagine a development setting where ZUN
ran ZUN_RES.COM once and then repeatedly deleted HUUHI.DAT while
leaving ZUN_RES.COM resident.

Part of P0285, funded by [Anonymous] and iruleatgames.
2024-07-09 08:47:02 +02:00
nmlgc 1e41fa0617 [Maintenance] Remove redundant `#include`s
Part of P0285, funded by [Anonymous] and iruleatgames.
2024-07-09 08:46:51 +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 3fad323d14 [Maintenance] master.hpp: Move into the master.lib directory
With the upcoming `#include` cleanup, it finally makes sense to split
off all graphics-related code into its own header. In turn, it makes
more sense to store all of these future master.lib headers in, well,
the master.lib directory, which provides a new 8 characters for their
file names. Turns out that the rationale I gave for the root directory
placement in 8266bbd didn't hold up 3½ years later…
(Also, the `pc98.h` declarations will eventually be split into
`game/coords.hpp` and something in `platform/x86real/pc98/`.)

Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-07-09 08:41:24 +02:00
nmlgc c85c0e2483 [Maintenance] Remove `extern "C"` from more areas of code
Much more than usual, now that we've got a snappy build system! This
commit covers
• All .PI functions across all games
• TH02's High Score entry functions
• TH03's shots_update() and shots_render()
• All functions declared in `th04/op/op.hpp`
• TH04/TH05's bb_txt_put_8_raw(), bullet_template_clip(),
  player_pos_update_and_clamp(), score_update_and_render(), and
  slowdown_frame_delay()
• TH05's reimu_stars_update_and_render(), score_delta_commit(),
  stage2_invalidate(), stage2_update(), and space_window_set()

Part of P0284, funded by [Anonymous] and Blue Bolt.
2024-07-09 08:40:43 +02:00
nmlgc f0fbaf667c [Decompilation] [th02] Endings: Script code for Bad and Good endings
On the list of functions yet to be decompiled, these were at number 7
and 1, respectively, which corresponds to number 7 and 22 on the total
list of functions in PC-98 Touhou.

Completes P0278, funded by Yanga.
2024-04-12 00:29:10 +02:00
nmlgc 5359bff77b [Naming] [th02] Add a `_reset` infix to `input_sense()`
Matching TH04 and TH05 functions, which differentiate between raw
sensing and resetting+sensing. In that light, the previous name for
TH02's function was rather misleading for leaving out that crucial
detail…

Part of P0278, funded by Yanga.
2024-04-12 00:29:09 +02:00
nmlgc 459cdd6fe0 [Maintenance] [th02] Score: Consolidate rendering functions
Part of P0278, funded by Yanga.
2024-04-12 00:29:09 +02:00
nmlgc 61cd04c103 [Maintenance] [th02] Score: Define a single type for score values
No unsigned score values in this game. Yet…

Part of P0278, funded by Yanga.
2024-04-12 00:29:09 +02:00
nmlgc 6d702988af [Maintenance] Remove `extern "C"` from more areas of code
Covering every input function across all games.

Part of P0278, funded by Yanga.
2024-04-11 23:17:45 +02:00
nmlgc 062aa7ae1d [Maintenance] Purge the C-style `typedef struct` syntax
I might change this convention again in the future, particularly once
someone wants to fund C89 conformance, but let's stay consistent for
now.

Part of P0264, funded by [Anonymous] and Blue Bolt.
2024-02-02 23:59:34 +01:00
nmlgc 26926080bc [Maintenance] Remove `extern "C"` from more areas of code
This commit covers
• TH02/TH03/TH04/TH05's frame_delay() and frame_delay_2() (finally!)
• TH02/TH03/TH04/TH05's game_init_main()
• TH02's graph_copy_rect_1_to_0_16()
• TH03/TH04/TH05's cfg_load_resident_ptr()
• TH05's piano_setup_and_put_initial() and piano_render()

Part of P0264, funded by [Anonymous] and Blue Bolt.
2024-02-02 23:59:34 +01:00
nmlgc 214c404ef5 [Maintenance] Introduce a type for PC-98 text RAM attributes
No need for signed variants this time!

Part of P0262, funded by [Anonymous] and Blue Bolt.
2023-11-30 18:47:20 +01:00
nmlgc 2efd1fb29d [Maintenance] Get rid of ReC98.h
… and this mistake.

Part of P0186, funded by [Anonymous] and Blue Bolt.
2022-03-26 20:44:54 +01:00
nmlgc 7211d4deeb [Maintenance] [th02] Get rid of th02.h
… remove the last of the game-specific header files, …

Part of P0186, funded by [Anonymous] and Blue Bolt.
2022-03-26 20:44:54 +01:00
nmlgc f4a73bba3f [Maintenance] Move the ring increment/decrement macros to clamp.hpp
That means we can finally…

Part of P0186, funded by [Anonymous] and Blue Bolt.
2022-03-26 20:44:54 +01:00
nmlgc 1c468eef21 [Maintenance] [th02] Put OP/MAINE globals into a single translation unit
Part of P0186, funded by [Anonymous] and Blue Bolt.
2022-03-26 20:44:42 +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 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 5fac2006ff [Maintenance] Consistently use "score" instead of "points"
Or at least in addition.

Part of P0172, funded by [Anonymous] and Blue Bolt.
2021-12-27 00:50:39 +01:00
nmlgc e07624a7be [Maintenance] [th01] Start a new header for clamping macros
Part of P0158, funded by Yanga.
2021-09-28 18:05:24 +02:00
nmlgc 0ce869c30a [Maintenance] Complete the master.hpp transition
Part of P0133, funded by [Anonymous].
2021-01-30 19:22:29 +01:00
nmlgc 9d23f26445 [Maintenance] [th02] Move HUUHI.DAT declarations to their own file
The `struct date` members in `scoredat_t` add a dependency on <dos.h>
to the entire header file. Makes sense to move it out as early as
possible.

Part of P0133, funded by [Anonymous].
2021-01-30 19:20:08 +01:00
nmlgc 72c32c8c9c [Maintenance] [th02] Compile more C translation units as C++
Everything that uses input and master.lib graphics functions.

Part of P0133, funded by [Anonymous].
2021-01-30 19:19:50 +01:00