diff --git a/Makefile.mak b/Makefile.mak index 01863b07..070e19fd 100644 --- a/Makefile.mak +++ b/Makefile.mak @@ -149,7 +149,7 @@ bin\th05\op.exe: th05\op010.cpp bin\th05\op.obj th05\op011.cpp th05\m_char.cpp b $** | -bin\th05\main.exe: bin\th05\main.obj bin\th04\slowdown.obj th05\ems.cpp bin\th05\cfg_lres.obj th05\main010.cpp th05\f_dialog.cpp th05\dialog.cpp th05\playfld.cpp th05\main011.cpp th05\p_common.cpp th05\p_reimu.cpp th05\p_marisa.cpp th05\p_mima.cpp th05\p_yuuka.cpp bin\th05\player.obj bin\th05\hud_bar.obj bin\th05\scoreupd.obj th05\hud_ovrl.cpp bin\th04\player_p.obj th05\player_a.cpp bin\th05\bullet_1.obj th05\bullet_c.cpp bin\th03\vector2.obj bin\th03\hfliplut.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_mode.obj bin\th05\bullet.obj th05\bullet_t.cpp bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th05\cdg_put.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\initmain.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\frmdelay.obj bin\th04\cdg_load.obj bin\th04\scrolly3.obj bin\th04\motion_3.obj th05\gather.cpp th05\main032.cpp th05\mb_dft.cpp th05\laser_sc.cpp th05\cheeto_u.cpp bin\th04\it_spl_u.obj th05\bullet_u.cpp th05\main034.cpp th05\boss_6.cpp th05\boss_x.cpp th05\boss.cpp th05\main014.cpp +bin\th05\main.exe: bin\th05\main.obj bin\th04\slowdown.obj th05\ems.cpp bin\th05\cfg_lres.obj th05\main010.cpp th05\f_dialog.cpp th05\dialog.cpp th05\playfld.cpp th05\main011.cpp th05\p_common.cpp th05\p_reimu.cpp th05\p_marisa.cpp th05\p_mima.cpp th05\p_yuuka.cpp bin\th05\player.obj bin\th05\hud_bar.obj bin\th05\scoreupd.obj th05\hud_ovrl.cpp bin\th04\player_p.obj th05\player_a.cpp bin\th05\bullet_1.obj th05\bullet_c.cpp bin\th03\vector2.obj bin\th03\hfliplut.obj bin\th04\snd_pmdr.obj bin\th04\snd_mmdr.obj bin\th04\snd_mode.obj bin\th05\bullet.obj th05\bullet_t.cpp bin\th04\cdg_p_na.obj bin\th04\snd_se_r.obj bin\th04\snd_se.obj bin\th05\cdg_put.obj bin\th04\exit.obj bin\th05\vector.obj bin\th05\snd_load.obj bin\th05\snd_kaja.obj bin\th05\initmain.obj bin\th05\input_s.obj bin\th05\inp_h_w.obj bin\th05\frmdelay.obj bin\th04\cdg_load.obj bin\th04\scrolly3.obj bin\th04\motion_3.obj th05\gather.cpp th05\main032.cpp th05\mb_dft.cpp th05\laser_sc.cpp th05\cheeto_u.cpp bin\th04\it_spl_u.obj th05\bullet_u.cpp th05\midboss1.cpp th05\main034.cpp th05\boss_6.cpp th05\boss_x.cpp th05\boss.cpp th05\main014.cpp $(CC) $(CFLAGS) $(LARGE_LFLAGS) -3 -Z -DGAME=5 -DBINARY='M' -nbin\th05\ -eMAIN.EXE @&&| $** | diff --git a/th05/main/midboss/m1.cpp b/th05/main/midboss/m1.cpp new file mode 100644 index 00000000..b9e7f6ef --- /dev/null +++ b/th05/main/midboss/m1.cpp @@ -0,0 +1,37 @@ +/// Stage 1 midboss +/// --------------- + +#include "platform.h" +#include "pc98.h" +#include "master.hpp" +#include "th01/math/subpixel.hpp" +#include "th04/math/motion.hpp" +extern "C" { +#include "th04/math/vector.hpp" +#include "th04/main/playfld.hpp" +} +#include "th04/main/midboss/midboss.hpp" + +// State +// ----- + +#define distance_from_center midboss.pos.velocity.x +// ----- + +void near midboss1_move(void) +{ + midboss.pos.prev.x = midboss.pos.cur.x; + midboss.pos.prev.y = midboss.pos.cur.y; + + midboss.pos.cur.x.v = vector1_at( + to_sp(playfield_fraction_x(1 / 2.0f)), + distance_from_center, + CosTable8[midboss.angle] + ); + midboss.pos.cur.y.v = vector1_at( + to_sp(playfield_fraction_y(6 / 23.0f)), + distance_from_center, + SinTable8[midboss.angle] + ); + midboss.angle -= 0x02; +} diff --git a/th05/midboss1.cpp b/th05/midboss1.cpp new file mode 100644 index 00000000..72ab5798 --- /dev/null +++ b/th05/midboss1.cpp @@ -0,0 +1 @@ +#include "th05/main/midboss/m1.cpp" diff --git a/th05_main.asm b/th05_main.asm index 42c9a4f2..845abc4d 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -39,7 +39,7 @@ include th05/main/enemy/enemy.inc main_01 group SLOWDOWN_TEXT, m_TEXT, EMS_TEXT, ma_TEXT, CFG_LRES_TEXT, mai_TEXT, main_TEXT, main__TEXT, PLAYFLD_TEXT, main_0_TEXT, HUD_OVRL_TEXT, DIALOG_TEXT, PLAYER_P_TEXT, main_01_TEXT g_SHARED group SHARED, SHARED_ -main_03 group SCROLLY3_TEXT, MOTION_3_TEXT, main_031_TEXT, BULLET_A_TEXT, main_032_TEXT, main_033_TEXT, MB_DFT_TEXT, LASER_SC_TEXT, CHEETO_U_TEXT, IT_SPL_U_TEXT, BULLET_U_TEXT, main_034_TEXT, main_035_TEXT, BOSS_6_TEXT, BOSS_X_TEXT, main_036_TEXT, BOSS_TEXT +main_03 group SCROLLY3_TEXT, MOTION_3_TEXT, main_031_TEXT, BULLET_A_TEXT, main_032_TEXT, main_033_TEXT, MB_DFT_TEXT, LASER_SC_TEXT, CHEETO_U_TEXT, IT_SPL_U_TEXT, BULLET_U_TEXT, MIDBOSS1_TEXT, main_034_TEXT, main_035_TEXT, BOSS_6_TEXT, BOSS_X_TEXT, main_036_TEXT, BOSS_TEXT ; =========================================================================== @@ -10402,45 +10402,12 @@ BULLET_U_TEXT segment byte public 'CODE' use16 extern @bullets_update$qv:proc BULLET_U_TEXT ends +MIDBOSS1_TEXT segment byte public 'CODE' use16 + @midboss1_move$qv procdesc near +MIDBOSS1_TEXT ends + main_034_TEXT segment byte public 'CODE' use16 -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_17FC6 proc near - push bp - mov bp, sp - mov ax, _midboss_pos.cur.x - mov _midboss_pos.prev.x, ax - mov ax, _midboss_pos.cur.y - mov _midboss_pos.prev.y, ax - push (192 shl 4) - push _midboss_pos.velocity.x - mov al, _midboss_angle - mov ah, 0 - add ax, ax - mov bx, ax - push _CosTable8[bx] - call vector1_at - mov _midboss_pos.cur.x, ax - push (96 shl 4) - push _midboss_pos.velocity.x - mov al, _midboss_angle - mov ah, 0 - add ax, ax - mov bx, ax - push _SinTable8[bx] - call vector1_at - mov _midboss_pos.cur.y, ax - mov al, _midboss_angle - add al, -2 - mov _midboss_angle, al - pop bp - retn -sub_17FC6 endp - - ; =============== S U B R O U T I N E ======================================= ; Attributes: bp-based frame @@ -10559,7 +10526,7 @@ loc_1812B: xor edx, edx div ebx mov _midboss_pos.velocity.x, ax - call sub_17FC6 + call @midboss1_move$qv cmp _midboss_phase_frame, 1500 jge short loc_1818B cmp _midboss_hp, 0