Commit Graph

28 Commits

Author SHA1 Message Date
nmlgc cac520e466 [Maintenance] [th01] Bosses: Rewrite Orb hitboxes in a visually correct way
You know that things are complicated when you have to resort to Unicode
box drawing character art to explain how two hitboxes relate to each
other. I *hope* this makes enough sense, and that I won't be rewriting
this in terms of ORB_W and ORB_H after all in the future. For now
though, it's immediately obvious when the hitbox reaches outside the
entity. In the case of YuugenMagan, it even simplifies the coordinates
so much that we don't need separate constants.

Part of P0205, funded by [Anonymous] and Yanga.
2022-07-17 19:29:04 +02:00
nmlgc 853952b610 [Maintenance] [th01] Boss entities: The hitbox method relates to the *orb*
I keep getting confused when reading the code.

Part of P0205, funded by [Anonymous] and Yanga.
2022-07-17 19:27:47 +02:00
nmlgc c6e51f7545 [Maintenance] [th01] Clean up pellet headers
Part of P0205, funded by [Anonymous] and Yanga.
2022-07-17 19:26:54 +02:00
nmlgc 001033d15a [Maintenance] [th01] Remove `extern "C"` from more areas of code
The .GRC and .GRP functions, to be specific.

Part of P0203, funded by [Anonymous] and GhostRiderCog.
2022-07-10 13:09:12 +02:00
nmlgc 68ace9c126 [Decompilation] [th01] SinGyoku: Move all data to C land
6th PC-98 Touhou boss completely decompiled, 25 to go!

Part of P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc 50f58a6045 [Decompilation] [th01] SinGyoku: Main function
80 functions remaining in TH01, and less than 10,000 ASM instructions
remaining in REIIDEN.EXE!

Part of P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc 40d9348c86 [Decompilation] [th01] SinGyoku: Transformations for patterns 5 and 6
Then again, this more flexible architecture points towards SinGyoku's
male form potentially having had way more varied patterns earlier in
development… or planned, but never realized.

Part of P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc a3364e8f60 [Decompilation] [th01] SinGyoku: Pattern 6/6
The one where SinGyoku's male form fires 3 sets of 10 aimed sling
pellets from random locations within its sprite.

Part of P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc 1020bbba56 [Decompilation] [th01] SinGyoku: Pattern 5/6
The one where SinGyoku's male form fires 3×10 pellets at random
downwards angles.

Part of P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc 5447272a2b [Decompilation] [th01] SinGyoku: Transformations for patterns 3 and 4
Why are these separate functions? ☹

Part of P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc 6508d215bc [Decompilation] [th01] SinGyoku: Pattern 4/6
The one where SinGyoku's female form fires 30 crossing pellets from her
left and right hands.

Part of P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc e0e8808530 [Decompilation] [th01] SinGyoku: Pattern 3/6
The one where SinGyoku's female form fires 20 chasing pellets from her
left and right hands.

Part of P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc 20a8e665de [Decompilation] [th01] SinGyoku: Sphere→person→sphere transformation
Complete with callback function parameters that are completely ignored
by SinGyoku's female-form patterns. That's all the entity
synchronization code in this fight though?! Nice.

Part of P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc ff49e9e32b [Decompilation] [th01] SinGyoku: Pattern 2/6
The one where SinGyoku slams their sphere form into Reimu and then
returns to not quite its base Y coordinate.
One big collidable object == technically a pattern, right?

(90 functions remaining in TH01!)

Completes P0201, funded by Ember2528 and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc 8edf287eb6 [Decompilation] [th01] SinGyoku: Pattern 1/6
The one where SinGyoku's sphere form sprays a half-circle of pellets
at static downwards angles, randomly selecting either a direction from
right to left or from left to right. First pattern you see in the
fight, and the only pellet pattern in phase 1.

Part of P0201, funded by Ember2528 and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc 6c3dc34f9b [Decompilation] [th01] SinGyoku: Rotating sphere movement and rendering
With 3 ZUN bugs, this one small function is technically buggier than
the entirety of Kikuri… or at least *as* buggy, with only two of them
being visible in the original game.

Oh well, that's 80% of REIIDEN.EXE RE'd!

Part of P0201, funded by Ember2528 and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc 108714eb1d [Decompilation] [th01] SinGyoku: Accelerating sphere rotation
Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 23:28:19 +02:00
nmlgc 3c7371c2de [Decompilation] [th01] SinGyoku: Sprite loading and initial variables
Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 23:28:19 +02:00
nmlgc 49248f458c [Decompilation] [th01] SinGyoku: Sprite freeing
Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 23:28:19 +02:00
nmlgc 4779a95c95 [Decompilation] [th01] SinGyoku: Sphere rotation and rendering
Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 23:28:19 +02:00
nmlgc b48c03f5cc [Naming] [th01] SinGyoku: Generic pattern state variable
Four semantic meanings… still enough for a single commit.

Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 23:28:19 +02:00
nmlgc 7cbe533784 [Maintenance] [th01] Add select_for_rank() subpixel and laser speed wrappers
Another one from the visual noise reduction department.

Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 22:49:52 +02:00
nmlgc a99eb4ed44 [Decompilation] [th01] select_for_rank: Don't redeclare the rank variable
Otherwise, it gets quite annoying to use that variable in the rest of
the translation unit.

Part of P0153, funded by Ember2528.
2021-08-22 15:07:17 +02:00
nmlgc dc9e3ee475 [Decompilation] [th01] Bosses: Collision handling
Functions with 12 parameters are hard to describe, y'know. Looking
forward to decompiling these giant expressions for the actual
boss↔orb collision parameter passed to this function…

Oh well, at least we're now totally ready for some boss code next
year. 😌

Completes P0131, funded by Yanga.
2020-12-18 01:38:52 +01:00
nmlgc f80001d34b [Reverse-engineering] [th01] Bosses: Current HP
And once again, SinGyoku is the only boss to get its own variable.
Maybe this means that it was the first boss to be implemented after
all?

Part of P0131, funded by Yanga.
2020-12-18 01:38:49 +01:00
nmlgc d5fd70c458 [Decompilation] [th01] HUD: HP rendering
And we're right back to things not being nice. Because yeah, why
shouldn't these three distinct rendering functions be part of a single
function, selected by magic numbers?
Or why shouldn't the 16×16 wrapper around a 32×32 set of graphics
functions be used to handle backgrounds for 16×8 sprites, resulting in
needlessly complex parameter calculations that lead to sloppy code?

Part of P0131, funded by Yanga.
2020-12-18 01:38:48 +01:00
nmlgc 64f872e5c5 [Decompilation] [th01] Difficulty-based value selection
And with that, TH01 is pushed over the 50% completion mark! 🎉

This time, it's only YuugenMagan who gets no own copy. Giant RE% gains
from all these calls, but let's hope I don't regret already decompiling
this one for all bosses. It's not quite at the beginning of SinGyoku's,
Mima's, and Elis' code segment, after all…

Part of P0130, funded by Yanga.
2020-12-18 00:59:41 +01:00
nmlgc 2c180c3825 [Reverse-engineering] [th01] Bosses: Current phase frame
One shared variable for all bosses except SinGyoku. Maybe the
biggest single set of PI false positives left in TH01?

Part of P0130, funded by Yanga.
2020-12-18 00:55:23 +01:00