[Maintenance] [th05] Lasers: Prepare for two segments in one translation unit

Part of P0228, funded by [Anonymous] and nrook.
This commit is contained in:
nmlgc 2023-01-10 10:14:42 +01:00
parent bb42f673e9
commit c8997cd500
6 changed files with 16 additions and 4 deletions

View File

@ -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\demo.cpp th05\ems.cpp bin\th05\cfg_lres.obj th05\main010.cpp th05\f_dialog.cpp th05\dialog.cpp th05\playfld.cpp bin\th04\mb_inv.obj bin\th04\boss_bd.obj th05\boss_bg.cpp th05\laser_rh.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\midboss5.cpp th05\hud_ovrl.cpp bin\th04\player_p.obj bin\th04\vector2n.obj bin\th05\spark_a.obj th05\bullet_p.cpp bin\th04\grcg_3.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\midboss.cpp bin\th04\hud_hp.obj 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\boss_1.cpp th05\boss_4.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\demo.cpp th05\ems.cpp bin\th05\cfg_lres.obj th05\main010.cpp th05\f_dialog.cpp th05\dialog.cpp th05\playfld.cpp bin\th04\mb_inv.obj bin\th04\boss_bd.obj th05\boss_bg.cpp th05\laser_rh.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\midboss5.cpp th05\hud_ovrl.cpp bin\th04\player_p.obj bin\th04\vector2n.obj bin\th05\spark_a.obj th05\bullet_p.cpp bin\th04\grcg_3.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\midboss.cpp bin\th04\hud_hp.obj th05\mb_dft.cpp th05\laser.cpp th05\cheeto_u.cpp bin\th04\it_spl_u.obj th05\bullet_u.cpp th05\midboss1.cpp th05\boss_1.cpp th05\boss_4.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 @&&|
$**
|

1
th05/laser.cpp Normal file
View File

@ -0,0 +1 @@
#include "th05/main/bullet/laser.cpp"

View File

@ -1 +0,0 @@
#include "th05/main/bullet/laser_sc.cpp"

View File

@ -12,6 +12,9 @@ extern "C" {
}
#include "th05/main/bullet/laser.hpp"
// Segment 3 (as allocated in the header)
// ---------
void near lasers_shootout_add(void)
{
Laser near *laser;
@ -98,3 +101,4 @@ void pascal near laser_stop(int slot)
lasers[slot].flag = LF_FREE;
}
}
// ---------

View File

@ -73,6 +73,8 @@ extern Laser laser_template;
/// -------
/// "Manual" lasers ignore any age fields from the laser template.
#pragma codeseg LASER_SC_TEXT
// Spawns a new shoot-out laser based on the [laser_template].
void near lasers_shootout_add(void);
@ -90,6 +92,8 @@ void pascal near laser_manual_grow(int slot);
// Transitions the laser at [slot] to a stopping phase appropriate for its
// current one.
void pascal near laser_stop(int slot);
#pragma codeseg
/// -------
// Returns `true` if the laser is entirely off-screen.
@ -98,5 +102,9 @@ bool16 pascal near laser_render_ray(const laser_coords_t near& coords);
// Processes any collision between the given [laser] and the player.
void pascal near laser_hittest(Laser near& laser);
#pragma codeseg main__TEXT main_01
void near lasers_update(void);
void near lasers_render(void);
#pragma codeseg

View File

@ -4368,7 +4368,9 @@ loc_FBF7:
leave
retn
sub_FAA3 endp
main__TEXT ends
PLAYFLD_TEXT segment byte public 'CODE' use16
include th05/main/bullet/lasers_update_render.asm
include th05/main/bullet/cheetos_render.asm
include th04/main/item/splashes_render.asm
@ -4584,9 +4586,7 @@ loc_10282:
pop bp
retn
sub_10214 endp
main__TEXT ends
PLAYFLD_TEXT segment byte public 'CODE' use16
@playfield_shake_update_and_rende$qv procdesc pascal near
PLAYFLD_TEXT ends