mirror of https://github.com/nmlgc/ReC98.git
[Reverse-engineering] [th04/th05] Bullet template structure
Turns out that angles are more clearly expressed in hex after all. And if we use negative values for everything greater than 80h, we still remove those from the PI calculation. *Really* not sure about using that delta union in the TH04 one though. Might be saner to just hide the complexity of the technically two separate types after all… Let's see. Part of P0075, funded by Myles and -Tom-.
This commit is contained in:
parent
3292af086b
commit
f21269f373
|
@ -114,3 +114,31 @@ int pascal near bullet_patnum_for_angle(unsigned char angle);
|
|||
extern bullet_t bullets[BULLET_COUNT];
|
||||
#define pellets (&bullets[0])
|
||||
#define bullets16 (&bullets[PELLET_COUNT])
|
||||
|
||||
struct bullet_template_t {
|
||||
uint8_t spawn_type;
|
||||
unsigned char patnum; // TH05: 0 = pellet
|
||||
SPPoint origin;
|
||||
#if GAME == 5
|
||||
bullet_pattern_t pattern;
|
||||
bullet_special_motion_t special_motion;
|
||||
unsigned char spread;
|
||||
unsigned char spread_angle_delta;
|
||||
unsigned char stack;
|
||||
SubpixelLength8 stack_speed_delta;
|
||||
unsigned char angle;
|
||||
SubpixelLength8 speed;
|
||||
#else
|
||||
SPPoint velocity;
|
||||
bullet_pattern_t pattern;
|
||||
unsigned char angle;
|
||||
SubpixelLength8 speed;
|
||||
unsigned char count;
|
||||
bullet_template_delta_t delta;
|
||||
uint8_t unused_1;
|
||||
bullet_special_motion_t special_motion;
|
||||
uint8_t unused_2;
|
||||
#endif
|
||||
};
|
||||
|
||||
extern bullet_template_t bullet_template;
|
||||
|
|
|
@ -1,5 +1,12 @@
|
|||
#pragma option -b-
|
||||
|
||||
typedef union {
|
||||
unsigned char spread_angle;
|
||||
// In subpixels, obviously, but pre-C++11 doesn't let us use any of the
|
||||
// Subpixel classes with their custom assignment operators in a union...
|
||||
unsigned char stack_speed;
|
||||
} bullet_template_delta_t;
|
||||
|
||||
// All _AIMED patterns define the 0° [angle] as the current player position,
|
||||
// relative to the bullet origin.
|
||||
typedef enum {
|
||||
|
|
|
@ -1,5 +1,34 @@
|
|||
if GAME eq 4
|
||||
bullet_template_delta_t union
|
||||
spread_angle db ?
|
||||
stack_speed db ?
|
||||
bullet_template_delta_t ends
|
||||
endif
|
||||
|
||||
bullet_template_t struc
|
||||
spawn_type db ?
|
||||
patnum db ?
|
||||
BT_origin Point <?>
|
||||
if GAME eq 5
|
||||
pattern db ?
|
||||
BT_special_motion db ?
|
||||
spread db ?
|
||||
spread_angle_delta db ?
|
||||
BT_stack db ?
|
||||
stack_speed_delta db ?
|
||||
BT_angle db ?
|
||||
speed db ?
|
||||
else
|
||||
BT_velocity Point <?>
|
||||
pattern db ?
|
||||
BT_angle db ?
|
||||
speed db ?
|
||||
count db ?
|
||||
BT_delta bullet_template_delta_t <?>
|
||||
db ?
|
||||
BT_special_motion db ?
|
||||
db ?
|
||||
endif
|
||||
bullet_template_t ends
|
||||
|
||||
public _bullet_template
|
||||
|
|
3026
th04_main.asm
3026
th04_main.asm
File diff suppressed because it is too large
Load Diff
2036
th05_main.asm
2036
th05_main.asm
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue