Commit Graph

2008 Commits

Author SHA1 Message Date
nmlgc bca1b7d38a [Maintenance] Add a `nullptr` polyfill to platform.h
Which allows us to remove <stddef.h> from translation units that just
needed it for `NULL`.

Part of P0203, funded by [Anonymous] and GhostRiderCog.
2022-07-10 13:02:51 +02:00
nmlgc 4568bf7383 [Decompilation] [th01] Particles / HUD HP / Missiles: Move data to C land
…including those.

Completes P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:09 +02:00
nmlgc 3f52d9a16f [Decompilation] [th01] YuugenMagan: Sprite loading and initial variables
Doing this one now allows us to completely get rid of a bunch of ASM
land declations…

Part of P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:08 +02:00
nmlgc 988cf64bf3 [Decompilation] [th01] Missiles: Spawn function + Sprite selection by angle
The latter being the dumbest, most decadent piece of FPU abuse in this
game. But it works 🤷

Part of P0202, funded by [Anonymous] and Yanga.
2022-06-25 18:21:08 +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 6f2881f056 [Maintenance] Remove `extern "C"` from more areas of code
The .PTN functions, vector functions, and egc_copy_rect_1_to_0_1()
(finally!) from TH01, as well as playfld.hpp from all games(finally!),
together with a bunch of other functions in their vicinity.

Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 23:28:19 +02:00
nmlgc 54fe83513b [Maintenance] Remove the intended type from the -Z -3 inhibition macro
Nobody cares about preserving perfect semantics across a macro whose
only job is to worsen code generation on one specific compiler. And
even aside from semantics, signedness would be the only difference that
types would make, and parameter passing couldn't care less about it.

Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 23:25:08 +02:00
nmlgc f4785a2577 [Maintenance] [th01] Boss entities: Declare dummy clamp parameters as defaults
Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 22:53:28 +02:00
nmlgc 124f68946a [Maintenance] [th01] Boss entities: Force `bos_image` through a getter method
Noooo, SinGyoku will in fact prove the existence of this getter method
via the given code generation detail. Might as well go fully consistent
then and exclusively use the methods, ending the previous party time.

Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 22:50:24 +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 5f5b1a5132 [Research] Revise the section about inlining
And move it under the C++ chapter, as both top-level `inline` and
(obviously) class methods are only supported in C++ mode.

Part of P0201, funded by Ember2528 and Yanga.
2022-06-24 22:49:52 +02:00
nmlgc 9342665312 [Readme] Update branch overview 2022-06-17 19:02:59 +02:00
nmlgc 67e46b5e33 [Research] [th01] Find out why the ドカーン ending image is even visible at all
No frame delay after its blitting call, immediately overwritten on the
next iteration… but if EGC "acceleration" leads to 8000 VRAM page
switches, you don't need additional delay for parts of the image to
remain visible after all.

Part of P0200, funded by Yanga.
2022-06-17 15:30:30 +02:00
nmlgc bfdb1e33f4 [Decompilation] [th01] Endings: Bad
Part of P0200, funded by Yanga.
2022-06-17 15:30:30 +02:00
nmlgc cfb0b5f21b [Decompilation] [th01] Endings: Good
100 functions remaining in all of TH01!

Part of P0200, funded by Yanga.
2022-06-17 15:30:30 +02:00
nmlgc f1dbf5f13f [Decompilation] [th01] Endings: Boss slideshow
Alignment hacks! Alignment hacks everywhere.
(The translation unit layout workarounds are temporary, at least.)

Part of P0200, funded by Yanga.
2022-06-17 15:30:30 +02:00
nmlgc 0724d972de [Decompilation] [th01] Kikuri: Move all data to C land
5th PC-98 Touhou boss completely decompiled, 26 to go!

Part of P0200, funded by Yanga.
2022-06-17 15:30:30 +02:00
nmlgc dfd52513de [Decompilation] [th01] Kikuri: Main function
Part of P0200, funded by Yanga.
2022-06-17 15:30:30 +02:00
nmlgc 5af2048057 [Decompilation] [th01] Kikuri: Pattern 10/10
The one where Kikuri fires 10 vertical lasers from the top along the
entire width of the playfield.

Completes P0199, funded by Lmocinemod.
2022-06-17 15:30:30 +02:00
nmlgc f047079139 [Decompilation] [th01] Kikuri: Pattern 9/10
The one where Kikuri' souls fire symmetric 3-line rain pellets at a
much longer interval than ZUN intended, thanks to him once again
confusing > and >=.

Part of P0199, funded by Lmocinemod.
2022-06-17 15:30:30 +02:00
nmlgc a8191f029a [Decompilation] [th01] Kikuri: Pattern 8/10
The one where Kikuri fires 6 lasers from her left eye, 30 frames apart,
and randomly aimed within a 120-pixel range around the player.

Part of P0199, funded by Lmocinemod.
2022-06-17 15:30:30 +02:00
nmlgc 46bc4fbe64 [Decompilation] [th01] Kikuri: Pattern 7/10
The one where Kikuri fires a 4-spiral along the edge of the disc… or
something to that effect. Not that much code, but still quite a chaotic
pattern, especially on higher difficulties.

Part of P0199, funded by Lmocinemod.
2022-06-17 15:30:30 +02:00
nmlgc 023d75f93b [Decompilation] [th01] Kikuri: Pattern 6/10
The one where Kikuri's souls fire single aimed pellets every 200
frames. Barely even noticeable as a distinct pattern due to the 4
other, much more complex patterns in phase 6 that run simultaneously.

Part of P0199, funded by Lmocinemod.
2022-06-17 15:30:30 +02:00
nmlgc 9dc05082a7 [Decompilation] [th01] Kikuri: Pattern 5/10
The one where Kikuri fires two red lasers from her eyes every 200
frames. They're aimed to the respective opposite direction around the
player, crossing each other on the way there.

Part of P0199, funded by Lmocinemod.
2022-06-17 15:30:30 +02:00
nmlgc b6d65cab76 [Decompilation] [th01] Kikuri: Pattern 4/10
The one where Kikuri's souls move on a diagonal line and drop tears.
Almost wouldn't have called this one a pattern, but the ripples can
kill the player, after all.

Part of P0199, funded by Lmocinemod.
2022-06-17 15:30:30 +02:00
nmlgc 662b53dd1f [Decompilation] [th01] Kikuri: Pattern 3/10
The one where Kikuri's souls fire spread pellet groups every 80 frames.
Pretty much Kikuri's counterpart to Elis' pattern_bat_slow_spreads(),
as it's also aimed on every difficulty except Lunatic.

Part of P0199, funded by Lmocinemod.
2022-06-17 15:30:30 +02:00
nmlgc 6a710cd7a0 [Decompilation] [th01] Kikuri: Soul activation
Part of P0199, funded by Lmocinemod.
2022-06-17 15:30:30 +02:00
nmlgc 2cae284a05 [Decompilation] [th01] Kikuri: Pattern 2/10
The one where Kikuri fires small spinning 8-pellet circles from her
ball of light, aimed to the player. The only pattern in the entire game
that uses the "spin pellet" type, forcing two additional parameters
onto every other single-pellet spawn call. (Luckily, C++ has default
arguments!)

Part of P0199, funded by Lmocinemod.
2022-06-17 15:30:30 +02:00
nmlgc 985c4af2ff [Decompilation] [th01] Kikuri: Pattern 1/10
The infamous first pattern of the fight, where Kikuri fires an
uninterrupted symmetric spiral of pellets for 800 frames.

(Coincidentally, TH01 has also reached the 80% RE mark with this one!)

Part of P0199, funded by Lmocinemod.
2022-06-17 15:30:30 +02:00
nmlgc 440637ed8e [Decompilation] [th01] Kikuri: Masked line copies from VRAM page 1 to 0
Could have also been EGC-accelerated, but who cares, it's only used for
the blocking entrance animation.

Completes P0198, funded by Lmocinemod and Ember2528.
2022-06-17 15:30:30 +02:00
nmlgc a1895cc7b3 [Decompilation] [th01] Kikuri: Tear and ripple effect rendering
The worst case of an `else if` chain so far. Perfectly regular if you
abstract away the per-sprite calculations, yet still hopelessly
hardcoded… and broken anyway, especially together with the collision
detection from the previous commit.

Part of P0198, funded by Lmocinemod and Ember2528.
2022-06-17 15:30:30 +02:00
nmlgc ca5aef394a [Decompilation] [th01] Kikuri: Player↔ripple collision detection
What's with all these useful helper functions all of a sudden?

Part of P0198, funded by Lmocinemod and Ember2528.
2022-06-16 22:52:23 +02:00
nmlgc 38dd331734 [Decompilation] [th01] Kikuri: Tear spawning
Part of P0198, funded by Lmocinemod and Ember2528.
2022-06-16 22:52:18 +02:00
nmlgc 53abecd7d4 [Decompilation] [th01] Kikuri: Soul movement and rendering calls
Part of P0198, funded by Lmocinemod and Ember2528.
2022-06-16 22:52:13 +02:00