Commit Graph

20 Commits

Author SHA1 Message Date
nmlgc d876eeb7bd [Decompilation] [th04] Bullets: Clipping and pre-spawn hit test
First place to confirm the hitbox of both the 8×8 pellets and the 16×16
sprite bullets!

Well, "hitbox". It's really more of a kill delta of 8×8 pixels between
the center points of a bullet and the player. You can distribute these
pixels to any combination of bullet and player "hitboxes" that make up
8×8. 4×4 around both the player and bullets? 1×1 for bullets, and 8×8
for the player? All equally valid… or perhaps none of them, once you
keep in mind that other entity types might have different kill deltas,
which turns the concept of a "hitbox" into just a confusing abstraction.

Part of P0150, funded by Blue Bolt.
2021-07-31 20:19:26 +02:00
nmlgc 4cbeadde96 [Decompilation] [th04] Bullets: Sprite selection by angle
Part of P0150, funded by Blue Bolt.
2021-07-31 16:15:36 +02:00
nmlgc f99aa1ae29 [Decompilation] [th04] Bullets: Bypassing rank-based speed tuning
Still way premature to say things like "the base speed of a bullet
aroup is not affected by difficulty, only by rank". (Which also would
be a way less meaningful statement than you might think it is.)

Part of P0150, funded by Blue Bolt.
2021-07-31 09:33:51 +02:00
nmlgc 4d7c8bb21f [Decompilation] [th04] Bullets: Pointless per-difficulty spawn wrappers
Not even "debugging reasons" could explain the presence of these
functions adequately…

Part of P0150, funded by Blue Bolt.
2021-07-31 09:33:51 +02:00
nmlgc 05e4c4a80c [Naming] [th04/th05] Bullets: Mid-level regular/special spawn wrappers
Too bad that it would have made no sense to call them "goofy bullets".
"Regular" is also a better name than "normal" (which is a difficulty!).

Completes P0149, funded by Blue Bolt, Ember2528, and -Tom-.
2021-07-31 09:33:51 +02:00
nmlgc 48c67d5e14 [Decompilation] [th04/th05] Common transformations from playfield space to VRAM
… quite some readability improvements in this regard.

Part of P0149, funded by Blue Bolt, Ember2528, and -Tom-.
2021-07-31 09:33:50 +02:00
nmlgc db05bffca3 [Maintenance] Turn motion_t into a template
motion_t is also used for certain animations in MAINE.EXE, so not all
instances refer to entities in playfield space. Explicitly specifying
the latter now allows us to gain…

Part of P0149, funded by Blue Bolt, Ember2528, and -Tom-.
2021-07-31 09:33:50 +02:00
nmlgc af5d9c421a [Reverse-engineering] [th04/th05] Bullets: Turn zap_trigger into a union
Probably a smart choice on part of ZUN, actually.

Part of P0149, funded by Blue Bolt, Ember2528, and -Tom-.
2021-07-31 09:33:48 +02:00
nmlgc 75c4f2d3cc [Reverse-engineering] [th04/th05] Bullets: Distinguish clear and zap mechanics
And actually document them correctly.

Clear: Custom duration, awards constant points per bullet during the
       entire duration, plays a decay animation
  Zap: Fixed duration, awards a semi-exponential bonus for all bullets
       alive on the first frame, plays a, um, "zapping" animation… in
       TH04, because it's bugged in TH05 :zunpet:

Part of P0149, funded by Blue Bolt, Ember2528, and -Tom-.
2021-07-31 09:33:35 +02:00
nmlgc 8a5a9accd6 [Maintenance] Rename pellet/bullet "patterns" to "groups"
We're going to need some name for the longer, boss-specific danmaku
animations. Turns out that these are exactly called "patterns" in
Sparen's glossary:

	https://sparen.github.io/ph3tutorials/ddsg0.html#sub4

So what we called a "pattern" is actually called a "group". Whoops!

Part of P0142, funded by Yanga.
2021-05-27 20:21:09 +02:00
nmlgc 1535aa7dd2 [Reverse-engineering] [th04/th05] X/Y turning for bouncing bullets
Part of P0118, funded by -Tom- and Ember2528.
2020-09-17 22:27:19 +02:00
nmlgc 6cd11b0a44 [Reverse-engineering] [th05] Bullets: Pellet delay cloud render list
Making sure that we don't ever have to iterate over the 8×8 pellet part
of the bullet array during rendering… sure, but why not give the same
optimization treatment to the 16×16 bullets?

Part of P0112, funded by [Anonymous] and Blue Bolt.
2020-08-28 15:31:02 +02:00
nmlgc ba29539fc7 [Maintenance] Declare a distinct type for VRAM offsets
… and this one, while I'm at it. I've been using pretty much every
possible type for VRAM offset variables, depending on my mood that day,
since signedness apparently never matters for those.
Except that it does. And so, just like with most of our high-level
types, we also have to account for ZUN's little signedness
inconsistencies here. Oh well, at least it's now only one of two types,
and there's no need to choose between `int` or `unsigned int` or
`short` or `unsigned short` or `int16_t` or `uint16_t` or `size_t` or…

Part of P0111, funded by [Anonymous] and Blue Bolt.
2020-08-28 14:53:33 +02:00
nmlgc 368f151759 [Maintenance] Declare distinct types for screen, VRAM, and TRAM coordinates
Whew, time to look at every `int` variable we ever declared! The best
moment to do this would have been a year ago, but well, better late
than never. No need to communicate that in comments anymore.

These shouldn't be used for widths, heights, or sprite-space
coordinates. Maybe we'll cover that another time, this commit is
already large enough.

Part of P0111, funded by [Anonymous] and Blue Bolt.
2020-08-28 14:53:30 +02:00
nmlgc 401d3793b5 [Maintenance] [th04/th05] Mirror bullet.hpp structures and enums in ASM land
Because pretty much all of TH05's bullet spawn code is micro-optimized
and undecompilable ASM, we'll unfortunately have to keep those ASM
versions around forever 😕

Well, the TH05 ones at least.

Part of P0109, funded by [Anonymous] and Blue Bolt.
2020-08-16 21:40:33 +02:00
nmlgc 829946a29e [Decompilation] [th04] Difficulty- and rank-based bullet pattern tuning
Because it's at least *possible* to decompile TH04's version of these
functions.

Part of P0109, funded by [Anonymous] and Blue Bolt.
2020-08-16 21:40:32 +02:00
nmlgc 97dce75446 [Maintenance] Proofread all comments in C land 2020-06-21 22:14:08 +02:00
nmlgc 86c7ce540c [Maintenance] [th04/th05] Rename `pellets_alive` to `pellets_render_count`
More consistent with the next structure…

Part of P0088, funded by -Tom-.
2020-05-03 23:17:37 +02:00
nmlgc cf68f49803 [Reverse-engineering] [th04/th05] Boss phase end functions
…which I'd like to cover all at once.

Part of P0086, funded by [Anonymous] and Blue Bolt.
2020-04-15 21:34:19 +02:00
nmlgc d1f3dcd620 [Maintenance] Move all features exclusive to MAIN.EXE to a main/ subdirectory
Adding op/, main/, and end/ directories does nicely cover a great
majority of the "not really further classifiable slices" implied in
d56bd45.

Part of P0086, funded by [Anonymous] and Blue Bolt.
2020-04-15 20:58:01 +02:00