diff --git a/game/pf.h b/game/pf.h new file mode 100644 index 00000000..84aa0dd5 --- /dev/null +++ b/game/pf.h @@ -0,0 +1,5 @@ +// Shared packfile declarations +// ---------------------------- + +// Maximum name of a file name inside a packfile. (8.3 + terminating \0) +#define PF_FN_LEN 13 diff --git a/master.hpp b/master.hpp index a024237f..267b4ebb 100644 --- a/master.hpp +++ b/master.hpp @@ -408,9 +408,6 @@ int MASTER_RET file_delete(const char MASTER_PTR *filename); // Packfiles // --------- -// Maximum file name length -#define PF_FN_LEN 13 - extern unsigned char pfkey; // 復号化キー extern unsigned bbufsiz; // バッファサイズ diff --git a/th01/formats/grc.hpp b/th01/formats/grc.hpp index affc0abd..a407c5a0 100644 --- a/th01/formats/grc.hpp +++ b/th01/formats/grc.hpp @@ -1,7 +1,9 @@ /// Uncompressed monochrome 8w×h sprite format /// ------------------------------------------ + #include "th01/formats/sprfmt_h.hpp" #include "th01/sprites/main_grc.h" +#include "game/pf.h" #define GRC_MAGIC "GRCG" diff --git a/th01/formats/pf.hpp b/th01/formats/pf.hpp index b84a1cc5..0f6842e4 100644 --- a/th01/formats/pf.hpp +++ b/th01/formats/pf.hpp @@ -1,3 +1,5 @@ +#include "game/pf.h" + // Encraption key extern uint8_t arc_key; diff --git a/th01/main/boss/entity_a.hpp b/th01/main/boss/entity_a.hpp index 83e06238..67920da6 100644 --- a/th01/main/boss/entity_a.hpp +++ b/th01/main/boss/entity_a.hpp @@ -1,6 +1,8 @@ /// Entities /// -------- +#include "game/pf.h" + // Slot count for unique .BOS files associated with CBossEntity instances. // *Not* CBossEntity instances themselves! #define BOS_ENTITY_SLOT_COUNT 4 diff --git a/th01/main/player/anim.hpp b/th01/main/player/anim.hpp index 5fd8537e..aa7c826a 100644 --- a/th01/main/player/anim.hpp +++ b/th01/main/player/anim.hpp @@ -1,3 +1,5 @@ +#include "game/pf.h" + static const int PLAYER_ANIM_IMAGES_PER_SLOT = 32; struct PlayerAnimImages { diff --git a/th02/snd/snd.h b/th02/snd/snd.h index cb47a391..019cedf9 100644 --- a/th02/snd/snd.h +++ b/th02/snd/snd.h @@ -1,3 +1,4 @@ +#include "game/pf.h" #include "defconv.h" #ifdef __cplusplus @@ -97,7 +98,7 @@ void snd_delay_until_volume(uint8_t volume); SND_LOAD_SE = (PMD_GET_SE_ADDRESS << 8), } snd_load_func_t; - #if (GAME <= 3) && defined(MASTER_HPP) + #if (GAME <= 3) // Loads a song in .M format ([func] == SND_LOAD_SONG) or a sound // effect bank in EFC format ([func] == SND_LOAD_SE) into the // respective work buffer of the sound driver. If MIDI is used, 'md' diff --git a/th04/snd/snd.h b/th04/snd/snd.h index 7a60d4cc..b540781f 100644 --- a/th04/snd/snd.h +++ b/th04/snd/snd.h @@ -51,7 +51,7 @@ extern "C" { // sets [snd_se_mode] and [snd_bgm_mode] accordingly. Returns [snd_bgm_mode]. int pascal snd_determine_modes(int req_bgm_mode, int req_se_mode); -#if defined(PMD) && defined(MASTER_HPP) +#if defined(PMD) // Loads a song ([func] == SND_LOAD_SONG) or a sound effect bank ([func] == // SND_LOAD_SE) into the respective work buffer of the sound driver. [fn] must // be null-terminated (despite the fixed length) and not have any extension.