[Separate translation units] [th02] game_exit()

Part of P0133, funded by [Anonymous].
This commit is contained in:
nmlgc 2021-01-29 18:14:41 +01:00
parent 84d4914a3b
commit e8588b1b0a
9 changed files with 44 additions and 42 deletions

View File

@ -78,17 +78,17 @@ bin\th02\zun_res.com: th02\zun_res1.c th02\zun_res2.c th02\zun_res3.c
$**
| masters.lib
bin\th02\op.exe: th02\op_01.cpp bin\exit_dos.obj bin\th02\zunerror.obj bin\th02\grppsafx.obj bin\th02\op.obj th02\op_02_1.cpp bin\th02\pi_load.obj bin\th02\grp_rect.obj bin\frmdely2.obj th02\op_02_2.cpp bin\th02\snd_mmdr.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_load.obj bin\th02\pi_put.obj bin\th02\snd_kaja.obj th02\op_02_3.cpp bin\th02\snd_se.obj bin\frmdely1.obj th02\op_03.cpp th02\op_04.cpp th02\op_05.cpp th02\op_06.cpp
bin\th02\op.exe: th02\op_01.cpp bin\exit_dos.obj bin\th02\zunerror.obj bin\th02\grppsafx.obj bin\th02\op.obj th02\op_02_1.cpp bin\th02\pi_load.obj bin\th02\grp_rect.obj bin\frmdely2.obj th02\op_02_2.cpp bin\th02\exit.obj bin\th02\snd_mmdr.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_load.obj bin\th02\pi_put.obj bin\th02\snd_kaja.obj th02\op_02_3.cpp bin\th02\snd_se.obj bin\frmdely1.obj th02\op_03.cpp th02\op_04.cpp th02\op_05.cpp th02\op_06.cpp
$(CC) $(CFLAGS) -ml -Z -DGAME=2 -nbin\th02\ -eOP.EXE @&&|
$**
|
bin\th02\main.exe: bin\th02\main.obj bin\th02\zunerror.obj th02\main02_1.cpp bin\th02\pi_load.obj bin\th02\vector.obj bin\frmdely1.obj th02\main02_2.cpp bin\th02\snd_mmdr.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_dlyv.obj bin\th02\snd_load.obj th02\mptn_i.cpp bin\th02\initmain.obj bin\th02\pi_put.obj bin\th02\snd_kaja.obj bin\th02\snd_dlym.obj bin\th02\snd_se.obj th02\main_03.cpp
bin\th02\main.exe: bin\th02\main.obj bin\th02\zunerror.obj th02\main02_1.cpp bin\th02\pi_load.obj bin\th02\vector.obj bin\frmdely1.obj th02\main02_2.cpp bin\th02\exit.obj bin\th02\snd_mmdr.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_dlyv.obj bin\th02\snd_load.obj th02\mptn_i.cpp bin\th02\initmain.obj bin\th02\pi_put.obj bin\th02\snd_kaja.obj bin\th02\snd_dlym.obj bin\th02\snd_se.obj th02\main_03.cpp
$(CC) $(CFLAGS) -ml -Z -DGAME=2 -nbin\th02\ -eMAIN.EXE @&&|
$**
|
bin\th02\maine.exe: bin\th02\maine.obj bin\th02\grppsafx.obj th02\maine021.cpp bin\th02\pi_load.obj bin\frmdely1.obj th02\maine022.cpp bin\th02\snd_mmdr.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_load.obj bin\th02\initmain.obj bin\th02\pi_put.obj bin\th02\snd_kaja.obj bin\th02\snd_dlym.obj th02\maine_03.c th02\maine_04.cpp th02\maine_05.cpp
bin\th02\maine.exe: bin\th02\maine.obj bin\th02\grppsafx.obj th02\maine021.cpp bin\th02\pi_load.obj bin\frmdely1.obj th02\maine022.cpp bin\th02\exit.obj bin\th02\snd_mmdr.obj bin\th02\snd_mode.obj bin\th02\snd_pmdr.obj bin\th02\snd_load.obj bin\th02\initmain.obj bin\th02\pi_put.obj bin\th02\snd_kaja.obj bin\th02\snd_dlym.obj th02\maine_03.c th02\maine_04.cpp th02\maine_05.cpp
$(CC) $(CFLAGS) -ml -3 -Z -DGAME=2 -nbin\th02\ -eMAINE.EXE @&&|
$**
|

31
th02/core/exit.c Normal file
View File

@ -0,0 +1,31 @@
#pragma codeseg SHARED
#include <dos.h>
#include "master.hpp"
#include "th02/core/initexit.h"
void game_exit(void)
{
pfend();
graph_clear_both();
#if (GAME >= 4)
mem_unassign();
vsync_end();
#else
vsync_end();
mem_unassign();
#endif
text_clear();
#if (GAME >= 3)
js_end();
#endif
egc_start();
#if (GAME >= 4)
bgm_finish();
#endif
}

View File

@ -5,3 +5,8 @@
void game_exit(void);
void game_exit_to_dos(void);
#define graph_clear_both() \
graph_accesspage(1); graph_clear(); \
graph_accesspage(0); graph_clear(); \
graph_accesspage(0); graph_showpage(0);

View File

@ -1,3 +1,4 @@
#include <dos.h>
#include "th01/hardware/vplanset.h"
int game_init_op(void)

View File

@ -1,25 +1 @@
void game_exit(void)
{
pfend();
graph_clear_both();
#if GAME >= 4
mem_unassign();
vsync_end();
#else
vsync_end();
mem_unassign();
#endif
text_clear();
#if GAME >= 3
js_end();
#endif
egc_start();
#if GAME >= 4
bgm_finish();
#endif
}
#include "th02/core/exit.c"

View File

@ -7,12 +7,10 @@
#pragma option -3
extern "C" {
#include <dos.h>
#include "th02/th02.h"
#include "platform.h"
#include "master.hpp"
#include "th02/hardware/frmdelay.h"
#include "th02/hardware/input.hpp"
#include "th02/hardware/input.c"
#include "th02/exit.c"
}

View File

@ -6,8 +6,7 @@
#pragma codeseg SHARED
extern "C" {
#include <dos.h>
#include "th02/th02.h"
#include "platform.h"
#include "master.hpp"
#include "th02/hardware/frmdelay.h"
#include "th02/hardware/input.hpp"
@ -17,5 +16,4 @@ extern "C" {
extern const char pf_fn[] = PF_FN;
#include "th02/hardware/input.c"
#include "th02/exit.c"
}

View File

@ -7,8 +7,7 @@
#pragma option -3
extern "C" {
#include <dos.h>
#include "th02/th02.h"
#include "platform.h"
#include "master.hpp"
#include "th02/mem.h"
#include "th02/core/initexit.h"
@ -22,5 +21,4 @@ const char pf_fn[] = PF_FN;
#include "th02/hardware/input.c"
#include "th02/core/initop.cpp"
#include "th02/exit.c"
}

View File

@ -10,11 +10,6 @@
// Hardware
// -------
#define graph_clear_both() \
graph_accesspage(1); graph_clear(); \
graph_accesspage(0); graph_clear(); \
graph_accesspage(0); graph_showpage(0);
#include "th01/hardware/grppsafx.h"
// -------