Commit Graph

15 Commits

Author SHA1 Message Date
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 dc5882782d [Decompilation] [th02] Dialog: Extra Stage scripts
And that's all in-game dialog code decompiled! 🎉

Part of P0261, funded by [Anonymous] and Yanga.
2023-11-01 23:17:52 +01:00
nmlgc 70d87fe900 [Decompilation] [th02] Dialog: Stage 5 scripts
Part of P0261, funded by [Anonymous] and Yanga.
2023-11-01 23:17:52 +01:00
nmlgc bc5710285d [Decompilation] [th02] Dialog: Stage 4 scripts
The inconsistency between 1- and 2-byte face IDs is exactly why I chose
to polyfill std::array.

Part of P0261, funded by [Anonymous] and Yanga.
2023-11-01 23:17:52 +01:00
nmlgc ed9ee93f5f [Decompilation] [th02] Dialog: Stage 2 scripts
Just a trivial one for the intro part before Meira appears, but it's
going to get slightly more intricate in other stages. We also want to
keep these face IDs as `std_array`s even once we moved the face IDs from
ASM to C land, since the count() method avoids the need for redundantly
declaring `BoxCount` as a separate enum value.

It would further seem like a nice idea to carve the intended values for
`dialog_box_cur` into stone via run-time assert()s, but we would have
to disable them on `master` via `NDEBUG` anyway. Which immediately
stops them from realistically doing their job because modders – the
intended audience – certainly won't remove the `NDEBUG` macro before
they're gonna mod. And maybe those assert()s will even just be an
additional burden to them, because they *want* to change things up
beyond those numbers?

Completes P0260, funded by Yanga.
2023-11-01 23:17:52 +01:00
nmlgc a2f7002731 [Decompilation] [th02] Dialog: Generic parts of specific scripts
Which is *not* meant to run the entirety of a sequence, just the
generic part where nothing except text happens for a number of boxes.
That's certainly one way of doing things.

Part of P0260, funded by Yanga.
2023-11-01 23:17:51 +01:00
nmlgc c6812766b6 [Decompilation] [th02] Dialog: Displaying full boxes of text
Part of P0260, funded by Yanga.
2023-11-01 23:17:51 +01:00
nmlgc d38f2a675d [Decompilation] [th02] Dialog: Displaying individual lines
And we're finally polyfilling std::array to avoid writing these hack
structures over and over.
Unfortunately, we can't ever polyfill it *exactly* because Turbo C++
4.0J neither supports namespaces nor template classes nested inside
non-template classes to simulate namespaces. Might as well go for a
PascalCased class name in accordance with the existing coding style
then – no need to add an exception just to have a class name like
`std_array` or something.

Part of P0260, funded by Yanga.
2023-11-01 23:17:51 +01:00
nmlgc c4622992b5 [Decompilation] [th02] Dialog: Face rendering
Part of P0260, funded by Yanga.
2023-11-01 23:17:51 +01:00
nmlgc be31caeba8 [Decompilation] [th02] Dialog: Box slide-in animation
Part of P0260, funded by Yanga.
2023-11-01 23:17:51 +01:00
nmlgc c468e2a113 [Decompilation] [th02] Dialog: Box rendering
Part of P0260, funded by Yanga.
2023-11-01 23:17:51 +01:00
nmlgc f2b7f78012 [Decompilation] [th02] Dialog: Player character blitting
Starting strong with 4 bugs right out of the gate! 🎺

Part of P0260, funded by Yanga.
2023-11-01 23:17:51 +01:00
nmlgc dfaa3c67c4 [Decompilation] [th02] Dialog: EGC initialization
Second-to-last one!

Completes P0259, funded by Splashman and Yanga.
2023-11-01 23:17:51 +01:00
nmlgc 8f28286349 [Decompilation] [th02] Dialog: Text loading
Part of P0259, funded by Splashman and Yanga.
2023-11-01 23:17:51 +01:00