diff --git a/th04/main/boss/impl.hpp b/th04/main/boss/impl.hpp index dec8171e..fac15f5c 100644 --- a/th04/main/boss/impl.hpp +++ b/th04/main/boss/impl.hpp @@ -44,3 +44,24 @@ tiles_render_after_custom(boss.phase_frame); \ } \ } + +// Like boss_bg_render_entrance_bb_opaque_and_backdrop(), but rendering 3) as +// a transition between stage tiles (where the entrance .BB bit is 0) and the +// backdrop image (where the entrance .BB bit is 1). +#define boss_bg_render_entrance_bb_transition_and_backdrop( \ + on_hp_fill, backdrop_left, backdrop_top, backdrop_col \ +) { \ + if(boss.phase == PHASE_BOSS_HP_FILL) { \ + on_hp_fill; \ + } else if(boss.phase == PHASE_BOSS_ENTRANCE_BB) { \ + boss_backdrop_render(backdrop_left, backdrop_top, backdrop_col); \ + tiles_bb_invalidate(bb_boss_seg, (boss.phase_frame / 2)); \ + tiles_redraw_invalidated(); \ + } else if(boss.phase < PHASE_BOSS_EXPLODE_BIG) { \ + boss_backdrop_render(backdrop_left, backdrop_top, backdrop_col); \ + } else if(boss.phase == PHASE_BOSS_EXPLODE_BIG) { \ + tiles_render_all(); \ + } else /* if(boss.phase == PHASE_NONE) */ { \ + tiles_render_after_custom(boss.phase_frame); \ + } \ +} diff --git a/th05/main/boss/bosses.hpp b/th05/main/boss/bosses.hpp index 63f73c1e..0b641d40 100644 --- a/th05/main/boss/bosses.hpp +++ b/th05/main/boss/bosses.hpp @@ -6,6 +6,12 @@ // Image coordinates // ----------------- +static const pixel_t SARA_BACKDROP_W = 320; +static const screen_x_t SARA_BACKDROP_LEFT = ( + PLAYFIELD_LEFT + (PLAYFIELD_W / 2) - (SARA_BACKDROP_W / 2) +); +static const screen_y_t SARA_BACKDROP_TOP = PLAYFIELD_TOP; + static const screen_x_t LOUISE_BACKDROP_LEFT = PLAYFIELD_LEFT; static const screen_y_t LOUISE_BACKDROP_TOP = PLAYFIELD_TOP; diff --git a/th05/main/boss/render.cpp b/th05/main/boss/render.cpp index fdee22ee..4b21c7c5 100644 --- a/th05/main/boss/render.cpp +++ b/th05/main/boss/render.cpp @@ -66,6 +66,16 @@ extern boss_particle_t boss_particles[BOSS_PARTICLE_COUNT]; extern lineset_t linesets[LINESET_COUNT]; /// ---------- +void pascal near sara_bg_render(void) +{ + boss_bg_render_entrance_bb_transition_and_backdrop( + tiles_render_after_custom(boss.phase_frame), + SARA_BACKDROP_LEFT, + SARA_BACKDROP_TOP, + 0 + ); +} + void pascal near louise_bg_render(void) { boss_bg_render_entrance_bb_opaque_and_backdrop( diff --git a/th05_main.asm b/th05_main.asm index b1889a2c..0c29ca54 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -2810,64 +2810,7 @@ loc_D060: sub_D032 endp include th04/main/boss/backdrop.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -public @SARA_BG_RENDER$QV -@sara_bg_render$qv proc near - push bp - mov bp, sp - cmp _boss_phase, PHASE_BOSS_HP_FILL - jnz short loc_D09F - cmp _boss_phase_frame, 2 - jg short loc_D0EF - jmp short loc_D0EA -; --------------------------------------------------------------------------- - -loc_D09F: - cmp _boss_phase, PHASE_BOSS_ENTRANCE_BB - jnz short loc_D0C8 - call @boss_backdrop_render$qiic pascal, (64 shl 16) or 16, 0 - mov ax, _bb_boss_seg - mov _tiles_bb_seg, ax - mov ax, _boss_phase_frame - cwd - sub ax, dx - sar ax, 1 - call @tiles_bb_invalidate_raw$qi pascal, ax - call tiles_redraw_invalidated - pop bp - retn -; --------------------------------------------------------------------------- - -loc_D0C8: - cmp _boss_phase, PHASE_BOSS_EXPLODE_BIG - jnb short loc_D0DC - call @boss_backdrop_render$qiic pascal, (64 shl 16) or 16, 0 - pop bp - retn -; --------------------------------------------------------------------------- - -loc_D0DC: - cmp _boss_phase, PHASE_BOSS_EXPLODE_BIG - jz short loc_D0EA - cmp _boss_phase_frame, 2 - jg short loc_D0EF - -loc_D0EA: - call tiles_render_all - pop bp - retn -; --------------------------------------------------------------------------- - -loc_D0EF: - call tiles_render - pop bp - retn -@sara_bg_render$qv endp - + @SARA_BG_RENDER$QV procdesc pascal near @LOUISE_BG_RENDER$QV procdesc pascal near @ALICE_BG_RENDER$QV procdesc pascal near @MAI_YUKI_BG_RENDER$QV procdesc pascal near