Commit Graph

32 Commits

Author SHA1 Message Date
nmlgc 1ea836f4b7 [Decompilation] [th01] Elis: Pattern 7/13
The one where Elis' bat form fires a slow spread group every 16 frames.
Interestingly, it's easiest on Lunatic, where the pellets are always
fired downwards and you just have to not stand below Elis. On every
other difficulty, the pellets are aimed to the player.

And what's this, an appropriately used local variable?!

Part of P0195, funded by Yanga.
2022-05-31 23:15:14 +02:00
nmlgc 5d93a5038b [Decompilation] [th01] Elis: Random bat movement
Which would look even nicer if the bat wasn't exclusively rendered on
the byte-aligned 8×1-pixel grid.

Completes P0194, funded by Ember2528.
2022-05-31 23:15:07 +02:00
nmlgc dfb0c43b86 [Decompilation] [th01] Elis: Bat→girl transformation
Part of P0194, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 520e488701 [Decompilation] [th01] Elis: Girl→bat transformation
That's 75% of TH01 RE'd!

Part of P0194, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 3272375991 [Decompilation] [th01] Elis: Phase 3 pattern selection
If you were wondering where Phase 2 was: That one just consists of a
wavy teleport back to Elis' base position.

Part of P0194, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 31aa78a2d1 [Decompilation] [th01] Elis: Pattern 6/13
The one where Elis fires pellets from 5 random blue rifts around her
sprite, first with random angles firing downwards, then with random
angles in all directions.

A~nd we've reached Konngara levels of copy-pasta again. 🍝

Part of P0194, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 603931baf1 [Decompilation] [th01] Elis: Pattern 5/13
The one where Elis spawns 10 spheres that fire dense clusters of random
pellets.

Part of P0194, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc b2006b5042 [Decompilation] [th01] Elis: Pattern 4/13
The one where Elis fires a curved 5-stack of static rings.

Part of P0194, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 23dbb7fd61 [Decompilation] [th01] Elis: Star of David rendering
Nice that this is a dedicated function. ZUN could have easily
copy-pasted it into every pattern, just as we've seen with Konngara… 🎺

Part of P0194, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 8088f2fd35 [Decompilation] [th01] Elis: Phase 1 pattern selection
Part of P0194, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 0a4a6adda5 [Decompilation] [th01] Elis: Sprite-relative polar line blitting and unblitting
Oh hey, ZUN wrote a function to help with the very meaningful task of
expressing the Star of David's point coordinates in polar form!

Part of P0194, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 183d7a2b57 [Decompilation] [th01] Elis: Pattern 3/13
The one where Elis, on Lunatic, runs past the pellet cap of 100 by
spawning 160 slow aimed pellets along a circle in a single frame, and
that's not the only janky quirk in there.

Completes P0193, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 85a76f74a8 [Decompilation] [th01] Elis: Pattern 2/13
The one where Elis fires missiles from random locations around her
sprite, aimed at random angles towards the bottom of the playfield.

Part of P0193, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc af7dd08626 [Decompilation] [th01] Elis: Pattern 1/13
The one where Elis fires 11 (yes, 11) evenly spaced lasers from her
left eye (?) across the whole playfield, from either the left or right
edge to the other one. First pattern you see in the fight.

Part of P0193, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 19f754f770 [Reverse-engineering] [th01] Elis: Common bullet spawn area
Part of P0193, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc d34e5b90fa [Maintenance] [th01] Elis: Define constants for the individual entities
Part of P0193, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 6beb197ec2 [Decompilation] [th01] Elis: Move compiler-generated data to C land
Featuring the most disgusting alignment workaround yet.

Part of P0193, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 772c1730fd [Naming] [th01] Elis: Generic pattern state variable
Yup, assigning this one to Elis, even though its proximity to the rest
of the generic boss variables might suggest that it was intended as a
generic boss state variable. Nope, that idea has already demonstrated
its uglyness in the previous TH04 and TH05 pushes…

Part of P0193, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 2c09fa4fe3 [Decompilation] [th01] Add a generic entity position template
It's slowly starting to make sense, as it eliminates the need for both
separate `*_COUNT` macros in places where the count isn't used for
anything else, as well as custom class declarations.

Part of P0193, funded by Ember2528.
2022-05-31 22:55:33 +02:00
nmlgc 4f63210c8a [Maintenance] [th01] Move boss entity loading calls next to their freeing calls
With loading and freeing code physically close together, it almost
looks like C++ classes.

Part of P0174, funded by Ember2528.
2022-01-31 05:15:08 +01:00
nmlgc e4343b2c95 [Maintenance] [th01] Better distinguish boss "entities" from "other sprites"
Part of P0174, funded by Ember2528.
2022-01-31 05:15:04 +01:00
nmlgc e6979070ce [Decompilation] [th01] Elis: Girl sprite unblitting and background snapping
Completes P0166, funded by Ember2528.
2021-11-07 23:15:24 +01:00
nmlgc aeb7fb48aa [Decompilation] [th01] Elis: Sprite loading
In which all the declarations expand the C++ code to take up more lines
than the previous compressed ASM representation.

Part of P0166, funded by Ember2528.
2021-11-07 23:14:13 +01:00
nmlgc e0ecc6bdc0 [Decompilation] [th01] Elis: Initial variables
Part of P0166, funded by Ember2528.
2021-11-07 23:11:52 +01:00
nmlgc e9af8c91db [Decompilation] [th01] Elis: Sprite freeing
Part of P0166, funded by Ember2528.
2021-11-07 23:08:44 +01:00
nmlgc 6217e51efb [Decompilation] [th01] Elis: Wavy teleport animation
The one with the yellow random stars on top of Elis.

And you know what, I'm just going to accept these incorrect 4 bytes
temporarily. The easy workaround for the three calls in the first
conditional branch inverts the order of that branch and the next one
in the generated ASM, and working around *that* will cause a
disproportionately greater mess. The code generation here is
semantically equivalent to the original ASM, doesn't add or remove a
single byte, and the issue is going to fix itself 5 commits from now.

Part of P0166, funded by Ember2528.
2021-11-07 23:07:22 +01:00
nmlgc 5e8ed65c04 [Naming] [th01] Elis: Girl sprite unblitting and background snapping
In which ZUN wanted to use a parameter to distinguish between taking
the position from Stationary-Or-Wavy-Elis and Attacking-Elis, but then
sets the latter's position to the former's before doing anything with
that parameter.

Part of P0166, funded by Ember2528.
2021-11-07 23:05:58 +01:00
nmlgc 7bf183621c [Reverse-engineering] [th01] Bosses: .PTN slot IDs
Common sense: Entity backgrounds always go into slot X, missile sprites
into slot Y, and wave sprites into slot Z
ZUN: "Nah, let's set aside two slots, and bosses can just freely use
them as they want 🎺"

Part of P0165, funded by Ember2528.
2021-11-07 22:50:28 +01: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 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