diff --git a/th02/common.h b/th02/common.h new file mode 100644 index 00000000..245a825f --- /dev/null +++ b/th02/common.h @@ -0,0 +1,6 @@ +/* ReC98 + * ----- + * Common, essential macros for TH02. No types here! + */ + +#define SHOTTYPE_COUNT 3 diff --git a/th02/maine_04.cpp b/th02/maine_04.cpp index 4e769d3b..fb2b6d04 100644 --- a/th02/maine_04.cpp +++ b/th02/maine_04.cpp @@ -5,9 +5,10 @@ extern "C" { #include -#include "th02/th02.h" +#include "ReC98.h" #include "master.hpp" #include "th01/math/clamp.hpp" +#include "th02/common.h" #include "th02/resident.hpp" #include "th02/hardware/frmdelay.h" #include "th02/hardware/input.hpp" diff --git a/th02/maine_05.cpp b/th02/maine_05.cpp index db07b4cf..ae0bb1a8 100644 --- a/th02/maine_05.cpp +++ b/th02/maine_05.cpp @@ -4,7 +4,7 @@ */ extern "C" { -#include "th02/th02.h" +#include "ReC98.h" #include "x86real.h" #include "master.hpp" #include "th01/math/polar.hpp" diff --git a/th02/op/cmt_load.c b/th02/op/cmt_load.c index 0fee9d68..6c2cb3ba 100644 --- a/th02/op/cmt_load.c +++ b/th02/op/cmt_load.c @@ -4,7 +4,7 @@ char music_cmt[MUSIC_CMT_LINE_COUNT][MUSIC_CMT_LINE_LEN]; void pascal near music_cmt_load(int track) { int i; - file_ropen(MUSIC_CMT_FILE); + file_ropen(MUSIC_CMT_FN); file_seek(track * MUSIC_CMT_LEN, SEEK_SET); file_read(music_cmt, MUSIC_CMT_LEN); file_close(); diff --git a/th02/op/music.inc b/th02/op/music.inc index ed0bc5b2..7db55ee1 100644 --- a/th02/op/music.inc +++ b/th02/op/music.inc @@ -1,3 +1,2 @@ -; Music Room constants. MUSIC_CMT_LINE_LEN equ 42 MUSIC_CMT_LINE_COUNT equ 20 diff --git a/th02/op_01.cpp b/th02/op_01.cpp index 778afa88..2bc79426 100644 --- a/th02/op_01.cpp +++ b/th02/op_01.cpp @@ -5,12 +5,15 @@ extern "C" { #include -#include "th02/th02.h" +#include "ReC98.h" #include "x86real.h" #include "th02/resident.hpp" #include "master.hpp" #include "libs/kaja/kaja.h" +#include "th01/rank.h" #include "th01/math/clamp.hpp" +#include "th01/hardware/grppsafx.h" +#include "th02/common.h" #include "th02/hardware/frmdelay.h" #include "th02/hardware/grp_rect.h" #include "th02/hardware/input.hpp" @@ -40,10 +43,9 @@ unsigned char demo_num; resident_t __seg *resident_sgm; putfunc_t near *putfunc; -// No, we don't want to put these two into th02.h. Apparently, declaring -// variables with extern before definining them for real within the same -// compilation unit causes Turbo C++ to emit *everything* in a different -// order... really, I couldn't make this up. +// Apparently, declaring variables with `extern` before definining them for +// real within the same compilation unit causes Turbo C++ to emit *everything* +// in a different order... really, I couldn't make this up. extern char extra_unlocked; extern unsigned int score_duration; diff --git a/th02/op_03.cpp b/th02/op_03.cpp index fad111b9..ddef9891 100644 --- a/th02/op_03.cpp +++ b/th02/op_03.cpp @@ -6,7 +6,7 @@ #pragma codestring "\x00" extern "C" { -#include "th02/th02.h" +#include "ReC98.h" #include "x86real.h" #include "master.hpp" #include "th02/hardware/frmdelay.h" diff --git a/th02/op_04.cpp b/th02/op_04.cpp index 11b05c7a..ff42cebd 100644 --- a/th02/op_04.cpp +++ b/th02/op_04.cpp @@ -7,8 +7,10 @@ extern "C" { #include #include #include -#include "th02/th02.h" +#include "ReC98.h" #include "master.hpp" +#include "th01/rank.h" +#include "th02/common.h" #include "th02/hardware/frmdelay.h" #include "th02/hardware/input.hpp" #include "th02/core/globals.hpp" diff --git a/th02/op_05.cpp b/th02/op_05.cpp index f2497a2d..e104e705 100644 --- a/th02/op_05.cpp +++ b/th02/op_05.cpp @@ -4,10 +4,12 @@ */ extern "C" { -#include "th02/th02.h" +#include "ReC98.h" #include "x86real.h" #include "master.hpp" #include "th01/math/clamp.hpp" +#include "th01/hardware/grppsafx.h" +#include "th02/common.h" #include "th02/resident.hpp" #include "th02/hardware/frmdelay.h" #include "th02/hardware/grp_rect.h" diff --git a/th02/op_06.cpp b/th02/op_06.cpp index 641e02fe..fb0dc9d5 100644 --- a/th02/op_06.cpp +++ b/th02/op_06.cpp @@ -4,16 +4,21 @@ */ extern "C" { -#include "th02/th02.h" +#include "ReC98.h" #include "x86real.h" #include "master.hpp" #include "libs/kaja/kaja.h" #include "th01/math/polar.hpp" +#include "th01/hardware/grppsafx.h" #include "th02/math/vector.hpp" #include "th02/hardware/frmdelay.h" #include "th02/hardware/input.hpp" #include "th02/formats/pi.h" #include "th02/snd/snd.h" +#include "th02/shiftjis/fns.hpp" + +static const int MUSIC_CMT_LINE_LEN = 42; +static const int MUSIC_CMT_LINE_COUNT = 20; #define TRACK_COUNT sizeof(MUSIC_FILES) / sizeof(MUSIC_FILES[0]) #define SEL_QUIT TRACK_COUNT + 1 diff --git a/th02/shiftjis/fns.hpp b/th02/shiftjis/fns.hpp index d0ef970f..139e71a6 100644 --- a/th02/shiftjis/fns.hpp +++ b/th02/shiftjis/fns.hpp @@ -1 +1,2 @@ #define PF_FN "“Œ•û••–‚.˜^" +#define MUSIC_CMT_FN "MUSIC.TXT" diff --git a/th02/th02.h b/th02/th02.h deleted file mode 100644 index 05ac6e33..00000000 --- a/th02/th02.h +++ /dev/null @@ -1,21 +0,0 @@ -/* ReC98 - * ----- - * Include file for TH02 - */ - -#include "ReC98.h" -#include "th01/rank.h" - -#undef grcg_off - -// Hardware -// ------- -#include "th01/hardware/grppsafx.h" -// ------- - -// Music Room -#define MUSIC_CMT_FILE "MUSIC.TXT" -#define MUSIC_CMT_LINE_LEN 42 -#define MUSIC_CMT_LINE_COUNT 20 - -#define SHOTTYPE_COUNT 3 diff --git a/th02/zun_res1.cpp b/th02/zun_res1.cpp index 85d62015..729d7d76 100644 --- a/th02/zun_res1.cpp +++ b/th02/zun_res1.cpp @@ -6,8 +6,9 @@ #include #include -#include "th02/th02.h" +#include "ReC98.h" #include "master.hpp" +#include "th01/rank.h" #include "th02/resident.hpp" #include "th02/snd/snd.h" #include "th02/formats/cfg.h" diff --git a/th02/zun_res2.c b/th02/zun_res2.c index a8b74bef..96a9780f 100644 --- a/th02/zun_res2.c +++ b/th02/zun_res2.c @@ -7,8 +7,9 @@ #include #include -#include "th02/th02.h" +#include "ReC98.h" #include "master.hpp" +#include "th01/rank.h" #include "th02/formats/scoredat.h" extern char rank; diff --git a/th02/zun_res3.c b/th02/zun_res3.c index aebafdfc..6a03a77a 100644 --- a/th02/zun_res3.c +++ b/th02/zun_res3.c @@ -4,7 +4,7 @@ */ #include -#include "th02/th02.h" +#include "ReC98.h" #include "master.hpp" #include "th02/formats/scoredat.h" #include "th02/gaiji/gaiji.h"