[Reverse-engineering] [th05] Custom entity structure
On the surface, TH05 uses one single 26-byte structure for
• the Stage 2 starfield,
• Alice's puppets,
• curve bullet heads,
• Mai's snowballs and Yuki's fireballs,
• Yumeko's knives,
• and Shinki's 32×32 bullets.
But looking closer, it turns out that the fields of all these have very
different semantics, and in some cases, even different types. uth05win
treated all of those as distinct structures, and we're going to do the
same, merely overlaying the pointers onto the same generic array.
Part of P0078, funded by iruleatgames and -Tom-.
2020-02-25 21:02:44 +00:00
|
|
|
CUSTOM_COUNT = 64
|
|
|
|
|
|
|
|
custom_t struc
|
|
|
|
db 26 dup (?)
|
|
|
|
custom_t ends
|
|
|
|
|
2020-02-26 21:24:36 +00:00
|
|
|
; Stage 2 star particles
|
|
|
|
; ----------------------
|
|
|
|
S2PARTICLE_COUNT = 64
|
|
|
|
S2PARTICLE_W = 16
|
|
|
|
S2PARTICLE_H = 16
|
|
|
|
|
|
|
|
s2particle_t struc
|
|
|
|
flag db ?
|
|
|
|
S2P_angle db ?
|
|
|
|
pos motion_t <?>
|
|
|
|
zoom dw ?
|
|
|
|
dw 5 dup (?)
|
|
|
|
s2particle_t ends
|
|
|
|
|
|
|
|
s2particles equ <_custom_entities>
|
|
|
|
; ----------------------
|
|
|
|
|
2020-02-26 19:48:02 +00:00
|
|
|
; Alice's puppets
|
|
|
|
; ---------------
|
|
|
|
PUPPET_COUNT = 2
|
|
|
|
PUPPET_W = 32
|
|
|
|
PUPPET_H = 32
|
|
|
|
PUPPET_HP = 500
|
|
|
|
|
|
|
|
puppet_t struc
|
|
|
|
flag db ?
|
|
|
|
PUPPET_angle db ?
|
|
|
|
pos motion_t <?>
|
|
|
|
phase_frame dw ?
|
|
|
|
|
|
|
|
radius_motion label word
|
|
|
|
radius_gather label word
|
|
|
|
dw ?
|
|
|
|
|
|
|
|
PUPPET_patnum dw ?
|
|
|
|
PUPPET_hp_cur dw ? ; _cur to avoid a collision with PUPPET_HP
|
|
|
|
PUPPET_damage_this_frame dw ?
|
|
|
|
dw ?
|
|
|
|
puppet_t ends
|
|
|
|
|
|
|
|
puppets equ <_custom_entities>
|
|
|
|
puppet0 equ <puppets[0 * size puppet_t]>
|
|
|
|
puppet1 equ <puppets[1 * size puppet_t]>
|
|
|
|
; ---------------
|
|
|
|
|
[Reverse-engineering] [th05] Custom entity structure
On the surface, TH05 uses one single 26-byte structure for
• the Stage 2 starfield,
• Alice's puppets,
• curve bullet heads,
• Mai's snowballs and Yuki's fireballs,
• Yumeko's knives,
• and Shinki's 32×32 bullets.
But looking closer, it turns out that the fields of all these have very
different semantics, and in some cases, even different types. uth05win
treated all of those as distinct structures, and we're going to do the
same, merely overlaying the pointers onto the same generic array.
Part of P0078, funded by iruleatgames and -Tom-.
2020-02-25 21:02:44 +00:00
|
|
|
public _custom_entities
|