diff --git a/th04/main/midboss/midboss.hpp b/th04/main/midboss/midboss.hpp new file mode 100644 index 00000000..89618c19 --- /dev/null +++ b/th04/main/midboss/midboss.hpp @@ -0,0 +1,31 @@ +typedef struct { + motion_t pos; + unsigned int frames_until; + int hp; + unsigned char sprite; + unsigned char phase; + int phase_frame; + // Treated as a bool in TH04 + unsigned char damage_this_frame; + unsigned char angle; +} midboss_stuff_t; + +extern midboss_stuff_t midboss; + +// Callbacks +extern farfunc_t_near midboss_update_func; +extern nearfunc_t_near midboss_render_func; + +#define MIDBOSS_DEC(stage) \ + void pascal far midboss##stage##_update(void); \ + void pascal near midboss##stage##_render(void); + +// "midbosses" unfortunately has 9 characters and therefore won't work as a +// 8.3 filename. However, since these have no names anyway, we can just +// declare all of them here. +MIDBOSS_DEC(1); +MIDBOSS_DEC(2); +MIDBOSS_DEC(3); +MIDBOSS_DEC(4); +MIDBOSS_DEC(5); +MIDBOSS_DEC(x); diff --git a/th04/shared.hpp b/th04/shared.hpp index 6f0cd350..17603ae7 100644 --- a/th04/shared.hpp +++ b/th04/shared.hpp @@ -32,31 +32,6 @@ extern nearfunc_t_near stage_invalidate; extern nearfunc_t_near stage_render; /// ------ -/// Midbosses -/// --------- -typedef struct { - motion_t pos; - unsigned int frames_until; - int hp; - unsigned char sprite; - unsigned char phase; - int phase_frame; - // Treated as a bool in TH04 - unsigned char damage_this_frame; - unsigned char angle; -} midboss_stuff_t; - -extern midboss_stuff_t midboss; - -// Callbacks -extern farfunc_t_near midboss_update_func; -extern nearfunc_t_near midboss_render_func; - -#define MIDBOSS_DEC(stage) \ - void pascal far midboss##stage##_update(void); \ - void pascal near midboss##stage##_render(void); -/// --------- - /// Score /// ----- extern unsigned long score_delta; diff --git a/th05/main/stage/setup.cpp b/th05/main/stage/setup.cpp index 23aabd49..1dfeaead 100644 --- a/th05/main/stage/setup.cpp +++ b/th05/main/stage/setup.cpp @@ -3,6 +3,8 @@ * TH05 stage initialization */ +#include "th04/main/midboss/midboss.hpp" + void pascal near stage1_setup(void) { midboss_update_func = midboss1_update; diff --git a/th05/th05.hpp b/th05/th05.hpp index 2979c5e2..8ff9f671 100644 --- a/th05/th05.hpp +++ b/th05/th05.hpp @@ -19,16 +19,6 @@ void pascal near stage2_update(void); void pascal near stage2_invalidate(void); /// ------ -/// Midbosses -/// --------- -MIDBOSS_DEC(1); -MIDBOSS_DEC(2); -MIDBOSS_DEC(3); -MIDBOSS_DEC(4); -MIDBOSS_DEC(5); -MIDBOSS_DEC(x); -/// --------- - /// Bosses /// ------ #include "th05/main/boss/boss.hpp"