/*!
* @brief ゲームスクリーンにメッセージを表示する / Hack -- Show information on the screen, one line at a time.
- * @param cptr 表示文字列
+ * @param msg 表示文字列
* @return なし
* @details
* Avoid the top two lines, to avoid interference with "msg_print()".
}
-/*
+/*!
+ * @brief ロードファイルポインタから1バイトを読み込む
+ * @return 読み込んだバイト値
+ * @details
* The following functions are used to load the basic building blocks
* of savefiles. They also maintain the "checksum" info for 2.7.0+
*/
-
static byte sf_get(void)
{
byte c, v;
return (v);
}
+/*!
+ * @brief ロードファイルポインタから1バイトを読み込んでポインタに渡す
+ * @param ip 読み込みポインタ
+ * @return なし
+ */
static void rd_byte(byte *ip)
{
*ip = sf_get();
}
+/*!
+ * @brief ロードファイルポインタから符号なし16bit値を読み込んでポインタに渡す
+ * @param ip 読み込みポインタ
+ * @return なし
+ */
static void rd_u16b(u16b *ip)
{
(*ip) = sf_get();
(*ip) |= ((u16b)(sf_get()) << 8);
}
+/*!
+ * @brief ロードファイルポインタから符号つき16bit値を読み込んでポインタに渡す
+ * @param ip 読み込みポインタ
+ * @return なし
+ */
static void rd_s16b(s16b *ip)
{
rd_u16b((u16b*)ip);
}
+/*!
+ * @brief ロードファイルポインタから符号なし32bit値を読み込んでポインタに渡す
+ * @param ip 読み込みポインタ
+ * @return なし
+ */
static void rd_u32b(u32b *ip)
{
(*ip) = sf_get();
(*ip) |= ((u32b)(sf_get()) << 24);
}
+/*!
+ * @brief ロードファイルポインタから符号つき32bit値を読み込んでポインタに渡す
+ * @param ip 読み込みポインタ
+ * @return なし
+ */
static void rd_s32b(s32b *ip)
{
rd_u32b((u32b*)ip);
}
-/*
- * Hack -- read a string
+/*!
+ * @brief ロードファイルポインタから文字列を読み込んでポインタに渡す / Hack -- read a string
+ * @param str 読み込みポインタ
+ * @param max 最大読み取りバイト数
+ * @return なし
*/
static void rd_string(char *str, int max)
{
}
-/*
- * Hack -- strip some bytes
+/*!
+ * @brief ロードファイルポインタを指定バイト分飛ばして進める / Hack -- strip some bytes
+ * @param n スキップバイト数
+ * @return なし
*/
static void strip_bytes(int n)
{
#define OLD_MAX_MANE 22
-/*
- * Read an object (Old method)
- *
+/*!
+ * @brief アイテムオブジェクト1件を読み込む(変愚ver1.5.0以前) / Read an object (Old method)
+ * @param o_ptr アイテムオブジェクト読み取り先ポインタ
+ * @return なし
+ * @details
* This function attempts to "repair" old savefiles, and to extract
* the most up to date values for various object fields.
*
}
-/*
- * Read an object (New method)
+/*!
+ * @brief アイテムオブジェクトを読み込む(現版) / Read an object (New method)
+ * @param o_ptr アイテムオブジェクト保存先ポインタ
+ * @return なし
*/
static void rd_item(object_type *o_ptr)
{
}
-/*
- * Read a monster (Old method)
+/*!
+ * @brief モンスターを読み込む(変愚ver1.5.0以前) / Read a monster (Old method)
+ * @param m_ptr モンスター保存先ポインタ
+ * @return なし
*/
static void rd_monster_old(monster_type *m_ptr)
{
}
-/*
- * Read a monster (New method)
+/*!
+ * @brief モンスターを読み込む(現版) / Read a monster (New method)
+ * @param m_ptr モンスター保存先ポインタ
+ * @return なし
*/
static void rd_monster(monster_type *m_ptr)
{
#define RF4_BR_GRAV 0x00800000 /* Breathe Gravity */
#define RF4_BR_SHAR 0x01000000 /* Breathe Shards */
#define RF4_BR_WALL 0x04000000 /* Breathe Force */
-/*
- * Read the monster lore
+
+/*!
+ * @brief モンスターの思い出を読み込む / Read the monster lore
+ * @param r_idx 読み込み先モンスターID
+ * @return なし
*/
static void rd_lore(int r_idx)
{
r_ptr->r_flags2 &= r_ptr->flags2;
r_ptr->r_flags3 &= r_ptr->flags3;
r_ptr->r_flags4 &= r_ptr->flags4;
- r_ptr->r_flags5 &= r_ptr->flags5;
- r_ptr->r_flags6 &= r_ptr->flags6;
+ r_ptr->r_flags5 &= r_ptr->a_ability_flags1;
+ r_ptr->r_flags6 &= r_ptr->a_ability_flags2;
r_ptr->r_flagsr &= r_ptr->flagsr;
}
-
-
-
-/*
- * Add the item "o_ptr" to the inventory of the "Home"
- *
+/*!
+ * @brief 店置きのアイテムオブジェクトを読み込む / Add the item "o_ptr" to the inventory of the "Home"
+ * @param st_ptr 店舗の参照ポインタ
+ * @param o_ptr アイテムオブジェクト参照ポインタ
+ * @return なし
+ * @details
* In all cases, return the slot (or -1) where the object was placed
*
* Note that this is a hacked up version of "inven_carry()".
return;
}
-
-/*
- * Read a store
+/*!
+ * @brief 店舗情報を読み込む / Read a store
+ * @param town_number 街ID
+ * @param store_number 店舗ID
+ * @return エラーID
*/
static errr rd_store(int town_number, int store_number)
{
}
-
-/*
- * Read RNG state (added in 2.8.0)
+/*!
+ * @brief 乱数状態を読み込む / Read RNG state (added in 2.8.0)
+ * @return なし
*/
static void rd_randomizer(void)
{
-/*
- * Read options (ignore most pre-2.8.0 options)
- *
+/*!
+ * @brief ゲームオプションを読み込む / Read options (ignore most pre-2.8.0 options)
+ * @return なし
+ * @details
* Note that the normal options are now stored as a set of 256 bit flags,
* plus a set of 256 bit masks to indicate which bit flags were defined
* at the time the savefile was created. This will allow new options
cheat_know = (c & 0x1000) ? TRUE : FALSE;
cheat_live = (c & 0x2000) ? TRUE : FALSE;
cheat_save = (c & 0x4000) ? TRUE : FALSE;
+ cheat_diary_output = (c & 0x8000) ? TRUE : FALSE;
+ cheat_turn = (c & 0x0080) ? TRUE : FALSE;
rd_byte((byte *)&autosave_l);
rd_byte((byte *)&autosave_t);
-
-
-/*
- * Hack -- strip the "ghost" info
- *
+/*!
+ * @brief ダミー情報スキップ / Hack -- strip the "ghost" info
+ * @return なし
+ * @details
* XXX XXX XXX This is such a nasty hack it hurts.
*/
static void rd_ghost(void)
}
-/*
- * Save quick start data
+/*!
+ * @brief クイックスタート情報を読み込む / Load quick start data
+ * @return なし
*/
static void load_quick_start(void)
{
previous_char.quick_ok = (bool)tmp8u;
}
-/*
- * Read the "extra" information
+/*!
+ * @brief その他の情報を読み込む / Read the "extra" information
+ * @return なし
*/
static void rd_extra(void)
{
s16b tmp16s;
u16b tmp16u;
- rd_string(player_name, sizeof(player_name));
+ rd_string(p_ptr->name, sizeof(p_ptr->name));
rd_string(p_ptr->died_from, sizeof(p_ptr->died_from));
for (i = 0; i < 5; i++) for (j = 0; j < 60; j++) rd_s16b(&p_ptr->weapon_exp[i][j]);
else
for (i = 0; i < 5; i++) for (j = 0; j < 64; j++) rd_s16b(&p_ptr->weapon_exp[i][j]);
- for (i = 0; i < 10; i++) rd_s16b(&p_ptr->skill_exp[i]);
+ for (i = 0; i < GINOU_MAX; i++) rd_s16b(&p_ptr->skill_exp[i]);
if (z_older_than(10, 4, 1))
{
if (p_ptr->pclass != CLASS_BEASTMASTER) p_ptr->skill_exp[GINOU_RIDING] /= 2;
if (z_older_than(10, 0, 1))
{
- for (i = 0; i < OLD_MAX_MANE; i++)
+ for (i = 0; i < MAX_MANE; i++)
{
p_ptr->mane_spell[i] = -1;
p_ptr->mane_dam[i] = 0;
}
-
-
-/*
- * Read the player inventory
- *
+/*!
+ * @brief プレイヤーの所持品情報を読み込む / Read the player inventory
+ * @return なし
+ * @details
* Note that the inventory changed in Angband 2.7.4. Two extra
* pack slots were added and the equipment was rearranged. Note
* that these two features combine when parsing old save-files, in
}
-
-/*
- * Read the saved messages
+/*!
+ * @brief メッセージログを読み込む / Read the saved messages
+ * @return なし
*/
static void rd_messages(void)
{
int i;
char buf[128];
- s16b num;
- /* Total */
- rd_s16b(&num);
+ if (h_older_than(2, 2, 0, 75))
+ {
+ u16b num;
+ /* Total */
+ rd_u16b(&num);
- /* Read the messages */
- for (i = 0; i < num; i++)
+ /* Read the messages */
+ for (i = 0; i < num; i++)
+ {
+ /* Read the message */
+ rd_string(buf, sizeof(buf));
+
+ /* Save the message */
+ message_add(buf);
+ }
+ }
+ else
{
- /* Read the message */
- rd_string(buf, sizeof(buf));
+ u32b num;
+ /* Total */
+ rd_u32b(&num);
+
+ /* Read the messages */
+ for (i = 0; i < num; i++)
+ {
+ /* Read the message */
+ rd_string(buf, sizeof(buf));
- /* Save the message */
- message_add(buf);
+ /* Save the message */
+ message_add(buf);
+ }
}
+
}
#define QUEST_OLD_CASTLE 27
#define QUEST_ROYAL_CRYPT 28
-/*
- * Read the dungeon (old method)
- *
+/*!
+ * @brief メッセージログを読み込む / Read the dungeon (old method)
+ * @return なし
+ * @details
* The monsters/objects must be loaded in the same order
* that they were stored, since the actual indexes matter.
*/
rd_s16b(&num_repro);
rd_s16b(&tmp16s);
- py = (int)tmp16s;
+ p_ptr->y = (int)tmp16s;
rd_s16b(&tmp16s);
- px = (int)tmp16s;
- if (z_older_than(10, 3, 13) && !dun_level && !p_ptr->inside_arena) {py = 33;px = 131;}
+ p_ptr->x = (int)tmp16s;
+ if (z_older_than(10, 3, 13) && !dun_level && !p_ptr->inside_arena) {p_ptr->y = 33;p_ptr->x = 131;}
rd_s16b(&cur_hgt);
rd_s16b(&cur_wid);
rd_s16b(&tmp16s); /* max_panel_rows */
rd_s16b(&tmp16s); /* max_panel_cols */
#if 0
- if (!py || !px) {py = 10;px = 10;}/* ダンジョン生成に失敗してセグメンテったときの復旧用 */
+ if (!p_ptr->y || !p_ptr->x) {p_ptr->y = 10;p_ptr->x = 10;}/* ダンジョン生成に失敗してセグメンテったときの復旧用 */
#endif
/* Maximal size */
/* Read the dungeon items */
for (i = 1; i < limit; i++)
{
- int o_idx;
+ IDX o_idx;
object_type *o_ptr;
}
-
-/*
- * Read the saved floor
- *
+/*!
+ * @brief 保存されたフロアを読み込む / Read the saved floor
+ * @return なし
+ * @details
* The monsters/objects must be loaded in the same order
* that they were stored, since the actual indexes matter.
*/
rd_s16b(&num_repro);
rd_u16b(&tmp16u);
- py = (int)tmp16u;
+ p_ptr->y = (int)tmp16u;
rd_u16b(&tmp16u);
- px = (int)tmp16u;
+ p_ptr->x = (int)tmp16u;
rd_s16b(&cur_hgt);
rd_s16b(&cur_wid);
}
-/*
- * Read the dungeon (new method)
- *
+/*!
+ * @brief 保存されたフロアを読み込む(現版) / Read the dungeon (new method)
+ * @return なし
+ * @details
* The monsters/objects must be loaded in the same order
* that they were stored, since the actual indexes matter.
*/
}
-/*
- * Actually read the savefile
+/*!
+ * @brief ロード処理全体のサブ関数 / Actually read the savefile
+ * @return エラーコード
*/
static errr rd_savefile_new_aux(void)
{
#endif
- /* Mention the savefile version */
- note(format(
- _("バージョン %d.%d.%d のセーブ・ファイルをロード中...", "Loading a %d.%d.%d savefile..."),
- (z_major > 9) ? z_major - 10 : z_major, z_minor, z_patch));
-
-
/* Strip the version bytes */
strip_bytes(4);
rd_byte(&h_ver_minor);
rd_byte(&h_ver_major);
+ /* Mention the savefile version */
+ note(format(
+ _("バージョン %d.%d.%d.%d のセーブ・ファイルをロード中...", "Loading a %d.%d.%d.%d savefile..."),
+ (h_ver_major > 9) ? h_ver_major - 10 : h_ver_major, h_ver_minor, h_ver_patch, h_ver_extra));
+
+
/* Operating system info */
rd_u32b(&sf_system);
/* Read the object memory */
for (i = 0; i < tmp16u; i++)
{
- byte tmp8u;
object_kind *k_ptr = &k_info[i];
rd_byte(&tmp8u);
return (0);
}
-
-/*
- * Actually read the savefile
+/*!
+ * @brief ロード処理全体のメイン関数 / Actually read the savefile
+ * @return エラーコード
*/
errr rd_savefile_new(void)
{
}
-/*
- * Actually load and verify a floor save data
+/*!
+ * @brief 保存フロア読み込みのサブ関数 / Actually load and verify a floor save data
+ * @param sf_ptr 保存フロア読み込み先
+ * @return 成功したらtrue
*/
static bool load_floor_aux(saved_floor_type *sf_ptr)
{
}
-/*
- * Attempt to load the temporally saved-floor data
+/*!
+ * @brief 一時保存フロア情報を読み込む / Attempt to load the temporally saved-floor data
+ * @param sf_ptr 保存フロア読み込み先
+ * @param mode オプション
+ * @return 成功したらtrue
*/
bool load_floor(saved_floor_type *sf_ptr, u32b mode)
{