OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / load.c
index 0080d54..eb589ff 100644 (file)
@@ -1,19 +1,14 @@
-/* File: load.c */
-
-/*
- * Copyright (c) 1997 Ben Harrison, and others
+/*!
+ * @file load.c
+ * @brief セーブファイル読み込み処理 / Purpose: support for loading savefiles -BEN-
+ * @date 2014/07/07
+ * @author
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
  *
  * This software may be copied and distributed for educational, research,
  * and not for profit purposes provided that this copyright and statement
  * are included in all such copies.  Other copyrights may also apply.
- */
-
-/* Purpose: support for loading savefiles -BEN- */
-
-#include "angband.h"
-
-
-/*
+ * @details
  * This file loads savefiles from Angband 2.7.X and 2.8.X
  *
  * Ancient savefiles (pre-2.7.0) are loaded by another file.
  * the existing "number of turns to protect for", and where each hit
  * by a monster will reduce the shield by that amount.
  *
- * XXX XXX XXX
+ * 
  */
 
+#include "angband.h"
+#include "generate.h"
+#include "trap.h"
 
 
 /*
@@ -82,9 +80,13 @@ static u32b  x_check = 0L;
  */
 static byte kanji_code = 0;
 
-/*
- * This function determines if the version of the savefile
- * currently being read is older than version "major.minor.patch.extra".
+/*!
+ * @brief 変愚蛮怒のバージョン比較処理 / This function determines if the version of the savefile currently being read is older than version "major.minor.patch.extra".
+ * @param major メジャーバージョン値
+ * @param minor マイナーバージョン値
+ * @param patch パッチバージョン値
+ * @param extra エクストラパージョン値
+ * @return 現在のバージョンより値が古いならtrue
  */
 static bool h_older_than(byte major, byte minor, byte patch, byte extra)
 {
@@ -109,8 +111,12 @@ static bool h_older_than(byte major, byte minor, byte patch, byte extra)
 }
 
 
-/*
- * The above function, adapted for Zangband
+/*!
+ * @brief Zangbandのバージョン比較処理 / The above function, adapted for Zangband
+ * @param x メジャーバージョン値
+ * @param y マイナーバージョン値
+ * @param z パッチバージョン値
+ * @return 現在のバージョンより値が古いならtrue
  */
 static bool z_older_than(byte x, byte y, byte z)
 {
@@ -131,14 +137,16 @@ static bool z_older_than(byte x, byte y, byte z)
 }
 
 
-/*
- * Hack -- Show information on the screen, one line at a time.
- *
+/*!
+ * @brief ゲームスクリーンにメッセージを表示する / Hack -- Show information on the screen, one line at a time.
+ * @param msg 表示文字列
+ * @return なし
+ * @details
  * Avoid the top two lines, to avoid interference with "msg_print()".
  */
 static void note(cptr msg)
 {
-       static int y = 2;
+       static TERM_LEN y = 2;
 
        /* Draw the message */
        prt(msg, y, 0);
@@ -151,11 +159,13 @@ static void note(cptr msg)
 }
 
 
-/*
+/*!
+ * @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;
@@ -173,22 +183,42 @@ static byte sf_get(void)
        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();
@@ -197,14 +227,22 @@ static void rd_u32b(u32b *ip)
        (*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)
 {
@@ -249,10 +287,10 @@ static void rd_string(char *str, int max)
 
        case 0:
        {
-               /* ÉÔÌÀ¤Î´Á»ú¥³¡¼¥É¤«¤é¥·¥¹¥Æ¥à¤Î´Á»ú¥³¡¼¥É¤ËÊÑ´¹ */
+               /* 不明の漢字コードからシステムの漢字コードに変換 */
                byte code = codeconv(str);
 
-               /* ´Á»ú¥³¡¼¥É¤¬È½ÌÀ¤·¤¿¤é¡¢¤½¤ì¤òµ­Ï¿ */
+               /* 漢字コードが判明したら、それを記録 */
                if (code) kanji_code = code;
 
                break;
@@ -265,8 +303,10 @@ 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)
 {
@@ -278,9 +318,11 @@ 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.
  *
@@ -298,18 +340,23 @@ static void strip_bytes(int n)
 static void rd_item_old(object_type *o_ptr)
 {
        char buf[128];
+       byte_hack tmp8u;
+       s16b tmp16s;
 
 
        /* Kind */
        rd_s16b(&o_ptr->k_idx);
 
-       /* Location */
-       rd_byte(&o_ptr->iy);
-       rd_byte(&o_ptr->ix);
+       rd_byte(&tmp8u);
+       o_ptr->iy = (POSITION)tmp8u;
+       rd_byte(&tmp8u);
+       o_ptr->ix = (POSITION)tmp8u;
 
        /* Type/Subtype */
-       rd_byte(&o_ptr->tval);
-       rd_byte(&o_ptr->sval);
+       rd_byte(&tmp8u);
+       o_ptr->tval = tmp8u;
+       rd_byte(&tmp8u);
+       o_ptr->sval = tmp8u;
 
        if (z_older_than(10, 4, 4))
        {
@@ -322,21 +369,32 @@ static void rd_item_old(object_type *o_ptr)
        rd_s16b(&o_ptr->pval);
 
        rd_byte(&o_ptr->discount);
-       rd_byte(&o_ptr->number);
-       rd_s16b(&o_ptr->weight);
+       rd_byte(&tmp8u);
+       o_ptr->number = (ITEM_NUMBER)tmp8u;
+
+       rd_s16b(&tmp16s);
+       o_ptr->weight = tmp16s;
+
+       rd_byte(&tmp8u);
+       o_ptr->name1 = tmp8u;
+
+       rd_byte(&tmp8u);
+       o_ptr->name2 = tmp8u;
 
-       rd_byte(&o_ptr->name1);
-       rd_byte(&o_ptr->name2);
        rd_s16b(&o_ptr->timeout);
 
        rd_s16b(&o_ptr->to_h);
-       rd_s16b(&o_ptr->to_d);
+       
+       rd_s16b(&tmp16s);
+       o_ptr->to_d = tmp16s;
        rd_s16b(&o_ptr->to_a);
 
        rd_s16b(&o_ptr->ac);
 
-       rd_byte(&o_ptr->dd);
-       rd_byte(&o_ptr->ds);
+       rd_byte(&tmp8u);
+       o_ptr->dd = tmp8u;
+       rd_byte(&tmp8u);
+       o_ptr->ds = tmp8u;
 
        rd_byte(&o_ptr->ident);
 
@@ -428,13 +486,13 @@ static void rd_item_old(object_type *o_ptr)
                        switch (o_ptr->xtra2 % 8)
                        {
                        case 0: add_flag(o_ptr->art_flags, TR_LEVITATION);     break;
-                       case 1: add_flag(o_ptr->art_flags, TR_LITE);        break;
+                       case 1: add_flag(o_ptr->art_flags, TR_LITE_1);        break;
                        case 2: add_flag(o_ptr->art_flags, TR_SEE_INVIS);   break;
                        case 3: add_flag(o_ptr->art_flags, TR_WARNING);     break;
                        case 4: add_flag(o_ptr->art_flags, TR_SLOW_DIGEST); break;
                        case 5: add_flag(o_ptr->art_flags, TR_REGEN);       break;
                        case 6: add_flag(o_ptr->art_flags, TR_FREE_ACT);    break;
-                       case 7: add_flag(o_ptr->art_flags, TR_HOLD_LIFE);   break;
+                       case 7: add_flag(o_ptr->art_flags, TR_HOLD_EXP);   break;
                        }
                        o_ptr->xtra2 = 0;
                }
@@ -543,14 +601,18 @@ static void rd_item_old(object_type *o_ptr)
 }
 
 
-/*
- * Read an object (New method)
+/*!
+ * @brief アイテムオブジェクトを読み込む(現版) / Read an object (New method)
+ * @param o_ptr アイテムオブジェクト保存先ポインタ
+ * @return なし
  */
 static void rd_item(object_type *o_ptr)
 {
        object_kind *k_ptr;
-       u32b flags;
+       BIT_FLAGS flags;
        char buf[128];
+       byte_hack tmp8u;
+       s16b tmp16s;
 
        if (h_older_than(1, 5, 0, 0))
        {
@@ -565,9 +627,10 @@ static void rd_item(object_type *o_ptr)
        /* Kind */
        rd_s16b(&o_ptr->k_idx);
 
-       /* Location */
-       rd_byte(&o_ptr->iy);
-       rd_byte(&o_ptr->ix);
+       rd_byte(&tmp8u);
+       o_ptr->iy = (POSITION)tmp8u;
+       rd_byte(&tmp8u);
+       o_ptr->ix = (POSITION)tmp8u;
 
        /* Type/Subtype */
        k_ptr = &k_info[o_ptr->k_idx];
@@ -580,21 +643,37 @@ static void rd_item(object_type *o_ptr)
 
        if (flags & SAVE_ITEM_DISCOUNT) rd_byte(&o_ptr->discount);
        else o_ptr->discount = 0;
-       if (flags & SAVE_ITEM_NUMBER) rd_byte(&o_ptr->number);
+       if (flags & SAVE_ITEM_NUMBER) {
+               rd_byte(&tmp8u);
+               o_ptr->number = tmp8u;
+       }       
        else o_ptr->number = 1;
 
-       rd_s16b(&o_ptr->weight);
+       rd_s16b(&tmp16s);
+       o_ptr->weight = tmp16s;
 
-       if (flags & SAVE_ITEM_NAME1) rd_byte(&o_ptr->name1);
+       if (flags & SAVE_ITEM_NAME1)
+       {
+               rd_byte(&tmp8u);
+               o_ptr->name1 = tmp8u;
+       }
        else o_ptr->name1 = 0;
-       if (flags & SAVE_ITEM_NAME2) rd_byte(&o_ptr->name2);
+       if (flags & SAVE_ITEM_NAME2)
+       {
+               rd_byte(&tmp8u);
+               o_ptr->name2 = tmp8u;
+       }
        else o_ptr->name2 = 0;
        if (flags & SAVE_ITEM_TIMEOUT) rd_s16b(&o_ptr->timeout);
        else o_ptr->timeout = 0;
 
        if (flags & SAVE_ITEM_TO_H) rd_s16b(&o_ptr->to_h);
        else o_ptr->to_h = 0;
-       if (flags & SAVE_ITEM_TO_D) rd_s16b(&o_ptr->to_d);
+       if (flags & SAVE_ITEM_TO_D)
+       {
+               rd_s16b(&tmp16s);
+               o_ptr->to_d = tmp16s;
+       }
        else o_ptr->to_d = 0;
        if (flags & SAVE_ITEM_TO_A) rd_s16b(&o_ptr->to_a);
        else o_ptr->to_a = 0;
@@ -602,9 +681,17 @@ static void rd_item(object_type *o_ptr)
        if (flags & SAVE_ITEM_AC) rd_s16b(&o_ptr->ac);
        else o_ptr->ac = 0;
 
-       if (flags & SAVE_ITEM_DD) rd_byte(&o_ptr->dd);
+       if (flags & SAVE_ITEM_DD)
+       {
+                rd_byte(&tmp8u);
+                o_ptr->dd = tmp8u;
+       }
        else o_ptr->dd = 0;
-       if (flags & SAVE_ITEM_DS) rd_byte(&o_ptr->ds);
+       if (flags & SAVE_ITEM_DS)
+       {
+               rd_byte(&tmp8u);
+               o_ptr->ds = tmp8u;
+       }
        else o_ptr->ds = 0;
 
        if (flags & SAVE_ITEM_IDENT) rd_byte(&o_ptr->ident);
@@ -622,6 +709,8 @@ static void rd_item(object_type *o_ptr)
        else o_ptr->art_flags[2] = 0;
        if (flags & SAVE_ITEM_ART_FLAGS3) rd_u32b(&o_ptr->art_flags[3]);
        else o_ptr->art_flags[3] = 0;
+       if (flags & SAVE_ITEM_ART_FLAGS4) rd_u32b(&o_ptr->art_flags[4]);
+       else o_ptr->art_flags[4] = 0;
 
        if (flags & SAVE_ITEM_CURSE_FLAGS) rd_u32b(&o_ptr->curse_flags);
        else o_ptr->curse_flags = 0;
@@ -660,15 +749,77 @@ static void rd_item(object_type *o_ptr)
                o_ptr->art_name = quark_add(buf);
        }
        else o_ptr->art_name = 0;
+       
+       if(h_older_than(2,1,2,4))
+       {
+               BIT_FLAGS flgs[TR_FLAG_SIZE];
+               object_flags(o_ptr, flgs);
+               
+               if ((o_ptr->name2 == EGO_DARK) || (o_ptr->name2 == EGO_ANCIENT_CURSE) || (o_ptr->name1 == ART_NIGHT))
+               {
+                       add_flag(o_ptr->art_flags, TR_LITE_M1);
+                       remove_flag(o_ptr->art_flags, TR_LITE_1);
+                       remove_flag(o_ptr->art_flags, TR_LITE_2);
+                       remove_flag(o_ptr->art_flags, TR_LITE_3);
+               }
+               else if (o_ptr->name2 == EGO_LITE_DARKNESS)
+               {
+                       if (o_ptr->tval == TV_LITE)
+                       {
+                               if (o_ptr->sval == SV_LITE_TORCH)
+                               {
+                                       add_flag(o_ptr->art_flags, TR_LITE_M1);
+                               }
+                               else if (o_ptr->sval == SV_LITE_LANTERN)
+                               {
+                                       add_flag(o_ptr->art_flags, TR_LITE_M2);
+                               }
+                               else if (o_ptr->sval == SV_LITE_FEANOR)
+                               {
+                                       add_flag(o_ptr->art_flags, TR_LITE_M3);
+                               }
+                       }
+                       else
+                       {
+                               /* Paranoia */
+                               add_flag(o_ptr->art_flags, TR_LITE_M1);
+                       }
+               }
+               else if (o_ptr->tval == TV_LITE)
+               {
+                       if (object_is_fixed_artifact(o_ptr))
+                       {
+                               add_flag(o_ptr->art_flags, TR_LITE_3);
+                       }
+                       else if (o_ptr->sval == SV_LITE_TORCH)
+                       {
+                               add_flag(o_ptr->art_flags, TR_LITE_1);
+                               add_flag(o_ptr->art_flags, TR_LITE_FUEL);
+                       }
+                       else if (o_ptr->sval == SV_LITE_LANTERN)
+                       {
+                               add_flag(o_ptr->art_flags, TR_LITE_2);
+                               add_flag(o_ptr->art_flags, TR_LITE_FUEL);       
+                       }
+                       else if (o_ptr->sval == SV_LITE_FEANOR)
+                       {
+                               add_flag(o_ptr->art_flags, TR_LITE_2);
+                       }
+               }
+       }
 }
 
 
-/*
- * 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)
 {
        byte tmp8u;
+       s16b tmp16s;
+       u32b tmp32u;
        char buf[128];
 
        /* Read the monster race */
@@ -691,18 +842,34 @@ static void rd_monster_old(monster_type *m_ptr)
                rd_byte(&m_ptr->sub_align);
 
        /* Read the other information */
-       rd_byte(&m_ptr->fy);
-       rd_byte(&m_ptr->fx);
-       rd_s16b(&m_ptr->hp);
-       rd_s16b(&m_ptr->maxhp);
+       rd_byte(&tmp8u);
+       m_ptr->fy = (POSITION)tmp8u;
+       rd_byte(&tmp8u);
+       m_ptr->fx = (POSITION)tmp8u;
+
+       rd_s16b(&tmp16s);
+       m_ptr->hp = tmp16s;
+       rd_s16b(&tmp16s);
+       m_ptr->maxhp = tmp16s;
+
        if (z_older_than(11, 0, 5))
        {
                m_ptr->max_maxhp = m_ptr->maxhp;
        }
        else
        {
-               rd_s16b(&m_ptr->max_maxhp);
+               rd_s16b(&tmp16s);
+               m_ptr->max_maxhp = (HIT_POINT)tmp16s;
+       }
+       if(h_older_than(2, 1, 2, 1))
+       {
+               m_ptr->dealt_damage = 0;
+       }
+       else
+       {
+               rd_s32b(&m_ptr->dealt_damage); 
        }
+       
        rd_s16b(&m_ptr->mtimed[MTIMED_CSLEEP]);
        rd_byte(&m_ptr->mspeed);
        if (z_older_than(10, 4, 2))
@@ -740,14 +907,15 @@ static void rd_monster_old(monster_type *m_ptr)
        }
        else if (z_older_than(10,0,11))
        {
-               s16b tmp16s;
                rd_s16b(&tmp16s);
                reset_target(m_ptr);
        }
        else
        {
-               rd_s16b(&m_ptr->target_y);
-               rd_s16b(&m_ptr->target_x);
+               rd_s16b(&tmp16s);
+               m_ptr->target_y = (POSITION)tmp16s;
+               rd_s16b(&tmp16s);
+               m_ptr->target_x = (POSITION)tmp16s;
        }
 
        rd_byte(&tmp8u);
@@ -758,10 +926,12 @@ static void rd_monster_old(monster_type *m_ptr)
        else
                m_ptr->smart = 0;
 
-       if (z_older_than(10, 4, 5))
+       if (z_older_than(10, 4, 5)) {
                m_ptr->exp = 0;
-       else
-               rd_u32b(&m_ptr->exp);
+       } else {
+               rd_u32b(&tmp32u);
+               m_ptr->exp = tmp32u;
+       }
 
        if (z_older_than(10, 2, 2))
        {
@@ -796,14 +966,18 @@ 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)
 {
-       u32b flags;
+       BIT_FLAGS flags;
        char buf[128];
        byte tmp8u;
+       s16b tmp16s;
+       u32b tmp32u;
 
        if (h_older_than(1, 5, 0, 0))
        {
@@ -820,11 +994,26 @@ static void rd_monster(monster_type *m_ptr)
        rd_s16b(&m_ptr->r_idx);
 
        /* Read the other information */
-       rd_byte(&m_ptr->fy);
-       rd_byte(&m_ptr->fx);
-       rd_s16b(&m_ptr->hp);
-       rd_s16b(&m_ptr->maxhp);
-       rd_s16b(&m_ptr->max_maxhp);
+       rd_byte(&tmp8u);
+       m_ptr->fy = (POSITION)tmp8u;
+       rd_byte(&tmp8u);
+       m_ptr->fx = (POSITION)tmp8u;
+
+       rd_s16b(&tmp16s);
+       m_ptr->hp = (HIT_POINT)tmp16s;
+       rd_s16b(&tmp16s);
+       m_ptr->maxhp = (HIT_POINT)tmp16s;
+       rd_s16b(&tmp16s);
+       m_ptr->max_maxhp = (HIT_POINT)tmp16s;
+
+       if(h_older_than(2, 1, 2, 1))
+       {
+               m_ptr->dealt_damage = 0;
+       }
+       else
+       {
+               rd_s32b(&m_ptr->dealt_damage); 
+       }
 
        /* Monster race index of its appearance */
        if (flags & SAVE_MON_AP_R_IDX) rd_s16b(&m_ptr->ap_r_idx);
@@ -871,9 +1060,17 @@ static void rd_monster(monster_type *m_ptr)
        }
        else m_ptr->mtimed[MTIMED_MONFEAR] = 0;
 
-       if (flags & SAVE_MON_TARGET_Y) rd_s16b(&m_ptr->target_y);
+       if (flags & SAVE_MON_TARGET_Y)
+       {
+               rd_s16b(&tmp16s);
+               m_ptr->target_y = (POSITION)tmp16s;
+       }
        else m_ptr->target_y = 0;
-       if (flags & SAVE_MON_TARGET_X) rd_s16b(&m_ptr->target_x);
+       if (flags & SAVE_MON_TARGET_X)
+       {
+               rd_s16b(&tmp16s);
+               m_ptr->target_x = (POSITION)tmp16s;
+       }
        else m_ptr->target_x = 0;
 
        if (flags & SAVE_MON_INVULNER)
@@ -886,7 +1083,11 @@ static void rd_monster(monster_type *m_ptr)
        if (flags & SAVE_MON_SMART) rd_u32b(&m_ptr->smart);
        else m_ptr->smart = 0;
 
-       if (flags & SAVE_MON_EXP) rd_u32b(&m_ptr->exp);
+       if (flags & SAVE_MON_EXP)
+       {
+               rd_u32b(&tmp32u);
+               m_ptr->exp = (EXP)tmp32u;
+       }
        else m_ptr->exp = 0;
 
        m_ptr->mflag = 0; /* Not saved */
@@ -949,28 +1150,37 @@ 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)
+static void rd_lore(MONRACE_IDX r_idx)
 {
        byte tmp8u;
+       s16b tmp16s;
 
        monster_race *r_ptr = &r_info[r_idx];
 
        /* Count sights/deaths/kills */
-       rd_s16b(&r_ptr->r_sights);
-       rd_s16b(&r_ptr->r_deaths);
-       rd_s16b(&r_ptr->r_pkills);
+       rd_s16b(&tmp16s);
+       r_ptr->r_sights = (MONSTER_NUMBER)tmp16s;
+       rd_s16b(&tmp16s);
+       r_ptr->r_deaths = (MONSTER_NUMBER)tmp16s;
+       rd_s16b(&tmp16s);
+       r_ptr->r_pkills = (MONSTER_NUMBER)tmp16s;
        if (h_older_than(1, 7, 0, 5))
        {
                r_ptr->r_akills = r_ptr->r_pkills;
        }
        else
        {
-               rd_s16b(&r_ptr->r_akills);
+               rd_s16b(&tmp16s);
+               r_ptr->r_akills = (MONSTER_NUMBER)tmp16s; 
        }
-       rd_s16b(&r_ptr->r_tkills);
+       rd_s16b(&tmp16s);
+       r_ptr->r_tkills = (MONSTER_NUMBER)tmp16s;
 
        /* Count wakes and ignores */
        rd_byte(&r_ptr->r_wake);
@@ -981,8 +1191,10 @@ static void rd_lore(int r_idx)
        rd_byte(&r_ptr->r_xtra2);
 
        /* Count drops */
-       rd_byte(&r_ptr->r_drop_gold);
-       rd_byte(&r_ptr->r_drop_item);
+       rd_byte(&tmp8u);
+       r_ptr->r_drop_gold = (ITEM_NUMBER)tmp8u;
+       rd_byte(&tmp8u);
+       r_ptr->r_drop_item = (ITEM_NUMBER)tmp8u;
 
        /* Count spells */
        rd_byte(&tmp8u);
@@ -1043,7 +1255,8 @@ static void rd_lore(int r_idx)
        }
 
        /* Read the "Racial" monster limit per level */
-       rd_byte(&r_ptr->max_num);
+       rd_byte(&tmp8u);
+       r_ptr->max_num = (MONSTER_NUMBER)tmp8u;
 
        /* Location in saved floor */
        rd_s16b(&r_ptr->floor_id);
@@ -1056,17 +1269,17 @@ 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()".
@@ -1131,9 +1344,11 @@ static void home_carry(store_type *st_ptr, object_type *o_ptr)
        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)
 {
@@ -1217,9 +1432,9 @@ 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)
 {
@@ -1242,9 +1457,10 @@ 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
@@ -1262,16 +1478,12 @@ static void rd_options(void)
 
        u16b c;
 
-       u32b flag[8];
-       u32b mask[8];
-
-
-       /*** Oops ***/
+       BIT_FLAGS flag[8];
+       BIT_FLAGS mask[8];
 
        /* Ignore old options */
        strip_bytes(16);
 
-
        /*** Special info */
 
        /* Read "delay_factor" */
@@ -1307,6 +1519,9 @@ static void rd_options(void)
        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;
+       cheat_sight = (c & 0x0040) ? TRUE : FALSE;
 
        rd_byte((byte *)&autosave_l);
        rd_byte((byte *)&autosave_t);
@@ -1418,12 +1633,11 @@ static void rd_options(void)
 
 
 
-
-
-/*
- * Hack -- strip the "ghost" info
- *
- * XXX XXX XXX This is such a nasty hack it hurts.
+/*!
+ * @brief ダミー情報スキップ / Hack -- strip the "ghost" info
+ * @return なし
+ * @details
+ * This is such a nasty hack it hurts.
  */
 static void rd_ghost(void)
 {
@@ -1437,12 +1651,14 @@ static void rd_ghost(void)
 }
 
 
-/*
- * Save quick start data
+/*!
+ * @brief クイックスタート情報を読み込む / Load quick start data
+ * @return なし
  */
 static void load_quick_start(void)
 {
        byte tmp8u;
+       s16b tmp16s;
        int i;
 
        if (z_older_than(11, 0, 13))
@@ -1455,8 +1671,10 @@ static void load_quick_start(void)
        rd_byte(&previous_char.prace);
        rd_byte(&previous_char.pclass);
        rd_byte(&previous_char.pseikaku);
-       rd_byte(&previous_char.realm1);
-       rd_byte(&previous_char.realm2);
+       rd_byte(&tmp8u);
+       previous_char.realm1 = (REALM_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       previous_char.realm2 = (REALM_IDX)tmp8u;
 
        rd_s16b(&previous_char.age);
        rd_s16b(&previous_char.ht);
@@ -1467,7 +1685,11 @@ static void load_quick_start(void)
        for (i = 0; i < 6; i++) rd_s16b(&previous_char.stat_max[i]);
        for (i = 0; i < 6; i++) rd_s16b(&previous_char.stat_max_max[i]);
 
-       for (i = 0; i < PY_MAX_LEVEL; i++) rd_s16b(&previous_char.player_hp[i]);
+       for (i = 0; i < PY_MAX_LEVEL; i++)
+       {
+               rd_s16b(&tmp16s);
+               previous_char.player_hp[i] = (HIT_POINT)tmp16s;
+       }
 
        rd_s16b(&previous_char.chaos_patron);
 
@@ -1482,8 +1704,9 @@ 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)
 {
@@ -1491,9 +1714,10 @@ static void rd_extra(void)
 
        byte tmp8u;
        s16b tmp16s;
+       s32b tmp32s;
        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));
 
@@ -1518,9 +1742,11 @@ static void rd_extra(void)
        rd_byte(&p_ptr->pclass);
        rd_byte(&p_ptr->pseikaku);
        rd_byte(&p_ptr->psex);
-       rd_byte(&p_ptr->realm1);
-       rd_byte(&p_ptr->realm2);
-       rd_byte(&tmp8u); /* oops */
+       rd_byte(&tmp8u);
+       p_ptr->realm1 = (REALM_IDX)tmp8u;
+       rd_byte(&tmp8u);
+       p_ptr->realm2 = (REALM_IDX)tmp8u;
+       rd_byte(&tmp8u);
 
        if (z_older_than(10, 4, 4))
        {
@@ -1531,7 +1757,8 @@ static void rd_extra(void)
        }
 
        /* Special Race/Class info */
-       rd_byte(&p_ptr->hitdie);
+       rd_byte(&tmp8u);
+       p_ptr->hitdie = tmp8u;
        rd_u16b(&p_ptr->expfact);
 
        /* Age/Height/Weight */
@@ -1544,8 +1771,7 @@ static void rd_extra(void)
        for (i = 0; i < 6; i++) rd_s16b(&p_ptr->stat_max_max[i]);
        for (i = 0; i < 6; i++) rd_s16b(&p_ptr->stat_cur[i]);
 
-       strip_bytes(24); /* oops */
-
+       strip_bytes(24);
        rd_s32b(&p_ptr->au);
 
        rd_s32b(&p_ptr->max_exp);
@@ -1574,7 +1800,7 @@ static void rd_extra(void)
                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;
@@ -1612,14 +1838,16 @@ static void rd_extra(void)
        else
        {
                rd_byte(&p_ptr->start_race);
-               rd_s32b(&p_ptr->old_race1);
-               rd_s32b(&p_ptr->old_race2);
+               rd_s32b(&tmp32s);
+               p_ptr->old_race1 = (BIT_FLAGS)tmp32s;
+               rd_s32b(&tmp32s);
+               p_ptr->old_race2 = (BIT_FLAGS)tmp32s;
                rd_s16b(&p_ptr->old_realm);
        }
 
        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;
@@ -1645,8 +1873,10 @@ static void rd_extra(void)
        {
                for (i = 0; i < MAX_MANE; i++)
                {
-                       rd_s16b(&p_ptr->mane_spell[i]);
-                       rd_s16b(&p_ptr->mane_dam[i]);
+                       rd_s16b(&tmp16s);
+                       p_ptr->mane_spell[i] = (SPELL_IDX)tmp16s;
+                       rd_s16b(&tmp16s);
+                       p_ptr->mane_dam[i] = (SPELL_IDX)tmp16s;
                }
                rd_s16b(&p_ptr->mane_num);
        }
@@ -1708,8 +1938,11 @@ static void rd_extra(void)
        rd_byte(&p_ptr->exit_bldg);
        rd_byte(&tmp8u);
 
-       rd_s16b(&p_ptr->oldpx);
-       rd_s16b(&p_ptr->oldpy);
+       rd_s16b(&tmp16s);
+       p_ptr->oldpx = (POSITION)tmp16s;
+       rd_s16b(&tmp16s);
+       p_ptr->oldpy = (POSITION)tmp16s;
+
        if (z_older_than(10, 3, 13) && !dun_level && !p_ptr->inside_arena) {p_ptr->oldpy = 33;p_ptr->oldpx = 131;}
 
        /* Was p_ptr->rewards[MAX_BACT] */
@@ -1759,7 +1992,8 @@ static void rd_extra(void)
        rd_s16b(&p_ptr->max_plv);
        if (z_older_than(10, 3, 8))
        {
-               rd_s16b(&max_dlv[DUNGEON_ANGBAND]);
+               rd_s16b(&tmp16s);
+               max_dlv[DUNGEON_ANGBAND] = tmp16s;
        }
        else
        {
@@ -1769,12 +2003,13 @@ static void rd_extra(void)
 
                for(i = 0; i < max; i++)
                {
-                       rd_s16b(&max_dlv[i]);
+                       rd_s16b(&tmp16s);
+                       max_dlv[i] = tmp16s;
                        if (max_dlv[i] > d_info[i].maxdepth) max_dlv[i] = d_info[i].maxdepth;
                }
        }
 
-       /* Repair maximum player level XXX XXX XXX */
+       /* Repair maximum player level */
        if (p_ptr->max_plv < p_ptr->lev) p_ptr->max_plv = p_ptr->lev;
 
        /* More info */
@@ -1897,7 +2132,8 @@ static void rd_extra(void)
                else
                {
                        rd_s16b(&p_ptr->tim_res_time);
-                       rd_byte(&p_ptr->mimic_form);
+                       rd_byte(&tmp8u);
+                       p_ptr->mimic_form = (IDX)tmp8u;
                        rd_s16b(&p_ptr->tim_mimic);
                        rd_s16b(&p_ptr->tim_sh_fire);
                }
@@ -1967,8 +2203,9 @@ static void rd_extra(void)
        rd_byte(&tmp8u);
        p_ptr->autopick_autoregister = tmp8u ? TRUE : FALSE;
 
-       rd_byte(&tmp8u); /* oops */
-       rd_byte(&p_ptr->action);
+       rd_byte(&tmp8u);
+       rd_byte(&tmp8u);
+       p_ptr->action = (ACTION_IDX)tmp8u;
        if (!z_older_than(10, 4, 3))
        {
                rd_byte(&tmp8u);
@@ -2114,13 +2351,13 @@ static void rd_extra(void)
        }
        else if (z_older_than(10, 3, 10))
        {
-               s32b tmp32s;
                rd_s32b(&tmp32s);
                p_ptr->visit = 1L;
        }
        else
        {
-               rd_s32b(&p_ptr->visit);
+               rd_s32b(&tmp32s);
+               p_ptr->visit = (BIT_FLAGS)tmp32s;
        }
        if (!z_older_than(11, 0, 5))
        {
@@ -2129,11 +2366,10 @@ static void rd_extra(void)
 }
 
 
-
-
-/*
- * 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
@@ -2198,13 +2434,7 @@ static errr rd_inventory(void)
                /* Warning -- backpack is full */
                else if (inven_cnt == INVEN_PACK)
                {
-                       /* Oops */
-#ifdef JP
-note("»ý¤Áʪ¤ÎÃæ¤Î¥¢¥¤¥Æ¥à¤¬Â¿¤¹¤®¤ë¡ª");
-#else
-                       note("Too many items in the inventory!");
-#endif
-
+                       note(_("持ち物の中のアイテムが多すぎる!", "Too many items in the inventory!"));
 
                        /* Fail */
                        return (54);
@@ -2235,29 +2465,52 @@ note("
 }
 
 
-
-/*
- * Read the saved messages
+/*!
+ * @brief メッセージログを読み込む / Read the saved messages
+ * @return なし
  */
 static void rd_messages(void)
 {
        int i;
        char buf[128];
+       int message_max;
 
-       s16b num;
 
-       /* Total */
-       rd_s16b(&num);
+       if (h_older_than(2, 2, 0, 75))
+       {
+               u16b num;
+               /* Total */
+               rd_u16b(&num);
+               message_max = (int)num;
 
-       /* Read the messages */
-       for (i = 0; i < num; i++)
+               /* Read the messages */
+               for (i = 0; i < message_max; 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);
+               message_max = (int)num;
 
-               /* Save the message */
-               message_add(buf);
+               /* Read the messages */
+               for (i = 0; i < message_max; i++)
+               {
+                       /* Read the message */
+                       rd_string(buf, sizeof(buf));
+
+                       /* Save the message */
+                       message_add(buf);
+               }
        }
+
 }
 
 
@@ -2281,9 +2534,10 @@ static void rd_messages(void)
 #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.
  */
@@ -2301,28 +2555,37 @@ static errr rd_dungeon_old(void)
        /*** Basic info ***/
 
        /* Header info */
-       rd_s16b(&dun_level);
+       rd_s16b(&tmp16s);
+       dun_level = (DEPTH)tmp16s;
        if (z_older_than(10, 3, 8)) dungeon_type = DUNGEON_ANGBAND;
-       else rd_byte(&dungeon_type);
+       else
+       { 
+               rd_byte(&tmp8u);
+               dungeon_type = (IDX)tmp8u;
+       }
 
        /* Set the base level for old versions */
        base_level = dun_level;
 
-       rd_s16b(&base_level);
+       rd_s16b(&tmp16s);
+       base_level = (DEPTH)tmp16s;
 
-       rd_s16b(&num_repro);
        rd_s16b(&tmp16s);
-       py = (int)tmp16s;
+       num_repro = (MONSTER_NUMBER)tmp16s;
+       rd_s16b(&tmp16s);
+       p_ptr->y = (POSITION)tmp16s;
        rd_s16b(&tmp16s);
-       px = (int)tmp16s;
-       if (z_older_than(10, 3, 13) && !dun_level && !p_ptr->inside_arena) {py = 33;px = 131;}
-       rd_s16b(&cur_hgt);
-       rd_s16b(&cur_wid);
+       p_ptr->x = (POSITION)tmp16s;
+       if (z_older_than(10, 3, 13) && !dun_level && !p_ptr->inside_arena) {p_ptr->y = 33;p_ptr->x = 131;}
+       rd_s16b(&tmp16s);
+       cur_hgt = (POSITION)tmp16s;
+       rd_s16b(&tmp16s);
+       cur_wid = (POSITION)tmp16s;
        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 */
@@ -2573,19 +2836,14 @@ static errr rd_dungeon_old(void)
        /* Verify maximum */
        if (limit > max_o_idx)
        {
-#ifdef JP
-note(format("¥¢¥¤¥Æ¥à¤ÎÇÛÎó¤¬Â礭¤¹¤®¤ë(%d)¡ª", limit));
-#else
-               note(format("Too many (%d) object entries!", limit));
-#endif
-
+               note(format(_("アイテムの配列が大きすぎる(%d)!", "Too many (%d) object entries!"), limit));
                return (151);
        }
 
        /* Read the dungeon items */
        for (i = 1; i < limit; i++)
        {
-               int o_idx;
+               OBJECT_IDX o_idx;
 
                object_type *o_ptr;
 
@@ -2593,15 +2851,9 @@ note(format("
                /* Get a new record */
                o_idx = o_pop();
 
-               /* Oops */
                if (i != o_idx)
                {
-#ifdef JP
-note(format("¥¢¥¤¥Æ¥àÇÛÃÖ¥¨¥é¡¼ (%d <> %d)", i, o_idx));
-#else
-                       note(format("Object allocation error (%d <> %d)", i, o_idx));
-#endif
-
+                       note(format(_("アイテム配置エラー (%d <> %d)", "Object allocation error (%d <> %d)"), i, o_idx));
                        return (152);
                }
 
@@ -2613,7 +2865,7 @@ note(format("
                rd_item(o_ptr);
 
 
-               /* XXX XXX XXX XXX XXX */
+               /* XXX XXX */
 
                /* Monster */
                if (o_ptr->held_m_idx)
@@ -2653,33 +2905,22 @@ note(format("
        /* Hack -- verify */
        if (limit > max_m_idx)
        {
-#ifdef JP
-note(format("¥â¥ó¥¹¥¿¡¼¤ÎÇÛÎó¤¬Â礭¤¹¤®¤ë(%d)¡ª", limit));
-#else
-               note(format("Too many (%d) monster entries!", limit));
-#endif
-
+               note(format(_("モンスターの配列が大きすぎる(%d)!", "Too many (%d) monster entries!"), limit));
                return (161);
        }
 
        /* Read the monsters */
        for (i = 1; i < limit; i++)
        {
-               int m_idx;
+               MONSTER_IDX m_idx;
                monster_type *m_ptr;
 
                /* Get a new record */
                m_idx = m_pop();
 
-               /* Oops */
                if (i != m_idx)
                {
-#ifdef JP
-note(format("¥â¥ó¥¹¥¿¡¼ÇÛÃÖ¥¨¥é¡¼ (%d <> %d)", i, m_idx));
-#else
-                       note(format("Monster allocation error (%d <> %d)", i, m_idx));
-#endif
-
+                       note(format(_("モンスター配置エラー (%d <> %d)", "Monster allocation error (%d <> %d)"), i, m_idx));
                        return (162);
                }
 
@@ -2714,17 +2955,24 @@ note(format("
 }
 
 
-
-/*
- * Read the saved floor
- *
+/*!
+ * @brief 保存されたフロアを読み込む / Read the saved floor
+ * @return info読み込みエラーコード
+ * @details
+ * この関数は、セーブデータの互換性を保つために多くのデータ改変処理を備えている。
+ * 現在確認している処理は以下の通り、
+ * <ul>
+ * <li>1.7.0.2で8bitだったcave_typeのfeat,mimicのID値を16bitに拡張する処理。</li>
+ * <li>1.7.0.8までに廃止、IDなどを差し替えたクエスト番号を置換する処理。</li>
+ * </ul>
  * The monsters/objects must be loaded in the same order
  * that they were stored, since the actual indexes matter.
  */
 static errr rd_saved_floor(saved_floor_type *sf_ptr)
 {
-       int ymax, xmax;
-       int i, y, x;
+       POSITION ymax, xmax;
+       POSITION y, x;
+       int i;
        byte count;
        byte tmp8u;
        s16b tmp16s;
@@ -2733,7 +2981,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        u32b tmp32u;
        u16b limit;
 
-       cave_template_type *template;
+       cave_template_type *templates;
 
 
        /*** Wipe all cave ***/
@@ -2748,7 +2996,8 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        {
                /*** Not a saved floor ***/
 
-               rd_s16b(&dun_level);
+               rd_s16b(&tmp16s);
+               dun_level = (DEPTH)tmp16s;
                base_level = dun_level;
        }
        else
@@ -2778,17 +3027,21 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
                if (tmp16s != sf_ptr->lower_floor_id) return 171;
        }
 
-       rd_s16b(&base_level);
-       rd_s16b(&num_repro);
+       rd_s16b(&tmp16s);
+       base_level = (DEPTH)tmp16s;
+       rd_s16b(&tmp16s);
+       num_repro = (MONSTER_NUMBER)tmp16s;
 
        rd_u16b(&tmp16u);
-       py = (int)tmp16u;
+       p_ptr->y = (POSITION)tmp16u;
 
        rd_u16b(&tmp16u);
-       px = (int)tmp16u;
+       p_ptr->x = (POSITION)tmp16u;
 
-       rd_s16b(&cur_hgt);
-       rd_s16b(&cur_wid);
+       rd_s16b(&tmp16s);
+       cur_hgt = (POSITION)tmp16s;
+       rd_s16b(&tmp16s);
+       cur_wid = (POSITION)tmp16s;
 
        rd_byte(&p_ptr->feeling);
 
@@ -2800,15 +3053,16 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        rd_u16b(&limit);
 
        /* Allocate the "template" array */
-       C_MAKE(template, limit, cave_template_type);
+       C_MAKE(templates, limit, cave_template_type);
 
        /* Read the templates */
        for (i = 0; i < limit; i++)
        {
-               cave_template_type *ct_ptr = &template[i];
+               cave_template_type *ct_ptr = &templates[i];
 
                /* Read it */
-               rd_u16b(&ct_ptr->info);
+               rd_u16b(&tmp16u);
+               ct_ptr->info = (BIT_FLAGS)tmp16u;
                if (h_older_than(1, 7, 0, 2))
                {
                        rd_byte(&tmp8u);
@@ -2853,10 +3107,10 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
                        cave_type *c_ptr = &cave[y][x];
 
                        /* Extract cave data */
-                       c_ptr->info = template[id].info;
-                       c_ptr->feat = template[id].feat;
-                       c_ptr->mimic = template[id].mimic;
-                       c_ptr->special = template[id].special;
+                       c_ptr->info = templates[id].info;
+                       c_ptr->feat = templates[id].feat;
+                       c_ptr->mimic = templates[id].mimic;
+                       c_ptr->special = templates[id].special;
 
                        /* Advance/Wrap */
                        if (++x >= xmax)
@@ -2891,7 +3145,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
                                }
                        }
                        else if ((c_ptr->feat == OLD_FEAT_QUEST_EXIT) &&
-                                (p_ptr->inside_quest == OLD_QUEST_WATER_CAVE))
+                               (p_ptr->inside_quest == OLD_QUEST_WATER_CAVE))
                        {
                                c_ptr->feat = feat_up_stair;
                                c_ptr->special = 0;
@@ -2900,7 +3154,7 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        }
 
        /* Free the "template" array */
-       C_FREE(template, limit, cave_template_type);
+       C_KILL(templates, limit, cave_template_type);
 
 
        /*** Objects ***/
@@ -2915,14 +3169,13 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        /* Read the dungeon items */
        for (i = 1; i < limit; i++)
        {
-               int o_idx;
+               OBJECT_IDX o_idx;
                object_type *o_ptr;
 
 
                /* Get a new record */
                o_idx = o_pop();
 
-               /* Oops */
                if (i != o_idx) return 152;
 
                /* Acquire place */
@@ -2974,13 +3227,12 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
        for (i = 1; i < limit; i++)
        {
                cave_type *c_ptr;
-               int m_idx;
+               MONSTER_IDX m_idx;
                monster_type *m_ptr;
 
                /* Get a new record */
                m_idx = m_pop();
 
-               /* Oops */
                if (i != m_idx) return 162;
 
 
@@ -3006,15 +3258,18 @@ static errr rd_saved_floor(saved_floor_type *sf_ptr)
 }
 
 
-/*
- * 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.
  */
 static errr rd_dungeon(void)
 {
        errr err = 0;
+       s16b tmp16s;
+       byte_hack tmp8u;
        byte num;
        int i;
 
@@ -3043,8 +3298,8 @@ static errr rd_dungeon(void)
        rd_s16b(&max_floor_id);
 
        /* Current dungeon type */
-       rd_byte(&dungeon_type);
-
+       rd_byte(&tmp8u);
+       dungeon_type = (DUNGEON_IDX)tmp8u;
 
        /* Number of the saved_floors array elements */
        rd_byte(&num);
@@ -3066,8 +3321,12 @@ static errr rd_dungeon(void)
                        saved_floor_type *sf_ptr = &saved_floors[i];
 
                        rd_s16b(&sf_ptr->floor_id);
-                       rd_byte(&sf_ptr->savefile_id);
-                       rd_s16b(&sf_ptr->dun_level);
+                       rd_byte(&tmp8u);
+                       sf_ptr->savefile_id = (s16b)tmp8u;
+
+                       rd_s16b(&tmp16s);
+                       sf_ptr->dun_level = (DEPTH)tmp16s;
+
                        rd_s32b(&sf_ptr->last_visit);
                        rd_u32b(&sf_ptr->visit_mark);
                        rd_s16b(&sf_ptr->upper_floor_id);
@@ -3079,7 +3338,6 @@ static errr rd_dungeon(void)
                for (i = 0; i < num; i++)
                {
                        saved_floor_type *sf_ptr = &saved_floors[i];
-                       byte tmp8u;
 
                        /* Unused element */
                        if (!sf_ptr->floor_id) continue;
@@ -3113,59 +3371,31 @@ static errr rd_dungeon(void)
        switch (err)
        {
        case 151:
-#ifdef JP
-               note("¥¢¥¤¥Æ¥à¤ÎÇÛÎó¤¬Â礭¤¹¤®¤ë¡ª");
-#else
-               note("Too many object entries!");
-#endif
+               note(_("アイテムの配列が大きすぎる!", "Too many object entries!"));
                break;
 
        case 152:
-#ifdef JP
-               note("¥¢¥¤¥Æ¥àÇÛÃÖ¥¨¥é¡¼");
-#else
-               note("Object allocation error");
-#endif
+               note(_("アイテム配置エラー", "Object allocation error"));
                break;
 
        case 161:
-#ifdef JP
-               note("¥â¥ó¥¹¥¿¡¼¤ÎÇÛÎó¤¬Â礭¤¹¤®¤ë¡ª");
-#else
-               note("Too many monster entries!");
-#endif
+               note(_("モンスターの配列が大きすぎる!", "Too many monster entries!"));
                break;
 
        case 162:
-#ifdef JP
-               note("¥â¥ó¥¹¥¿¡¼ÇÛÃÖ¥¨¥é¡¼");
-#else
-               note("Monster allocation error");
-#endif
+               note(_("モンスター配置エラー", "Monster allocation error"));
                break;
 
        case 171:
-#ifdef JP
-               note("Êݸ¤µ¤ì¤¿¥Õ¥í¥¢¤Î¥À¥ó¥¸¥ç¥ó¥Ç¡¼¥¿¤¬²õ¤ì¤Æ¤¤¤Þ¤¹¡ª");
-#else
-               note("Dungeon data of saved floors are broken!");
-#endif
+               note(_("保存されたフロアのダンジョンデータが壊れています!", "Dungeon data of saved floors are broken!"));
                break;
 
        case 182:
-#ifdef JP
-               note("¥Æ¥ó¥Ý¥é¥ê¡¦¥Õ¥¡¥¤¥ë¤òºîÀ®¤Ç¤­¤Þ¤»¤ó¡ª");
-#else
-               note("Failed to make temporal files!");
-#endif
+               note(_("テンポラリ・ファイルを作成できません!", "Failed to make temporal files!"));
                break;
 
        case 183:
-#ifdef JP
-               note("Error 183");
-#else
-               note("Error 183");
-#endif
+               note(_("Error 183", "Error 183"));
                break;
        }
 
@@ -3177,8 +3407,9 @@ static errr rd_dungeon(void)
 }
 
 
-/*
- * Actually read the savefile
+/*!
+ * @brief ロード処理全体のサブ関数 / Actually read the savefile
+ * @return エラーコード
  */
 static errr rd_savefile_new_aux(void)
 {
@@ -3190,6 +3421,7 @@ static errr rd_savefile_new_aux(void)
 
        byte tmp8u;
        u16b tmp16u;
+       s16b tmp16s;
        u32b tmp32u;
 
 #ifdef VERIFY_CHECKSUMS
@@ -3198,16 +3430,6 @@ static errr rd_savefile_new_aux(void)
 #endif
 
 
-       /* Mention the savefile version */
-       note(format(
-#ifdef JP
-                    "¥Ð¡¼¥¸¥ç¥ó %d.%d.%d ¤Î¥»¡¼¥Ö¡¦¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥ÉÃæ...",
-#else
-                    "Loading a %d.%d.%d savefile...",
-#endif
-                    (z_major > 9) ? z_major - 10 : z_major, z_minor, z_patch));
-
-
        /* Strip the version bytes */
        strip_bytes(4);
 
@@ -3226,6 +3448,12 @@ static errr rd_savefile_new_aux(void)
        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);
 
@@ -3253,31 +3481,15 @@ static errr rd_savefile_new_aux(void)
 
        /* Read RNG state */
        rd_randomizer();
-#ifdef JP
-if (arg_fiddle) note("Íð¿ô¾ðÊó¤ò¥í¡¼¥É¤·¤Þ¤·¤¿");
-#else
-       if (arg_fiddle) note("Loaded Randomizer Info");
-#endif
-
-
+       if (arg_fiddle) note(_("乱数情報をロードしました", "Loaded Randomizer Info"));
 
        /* Then the options */
        rd_options();
-#ifdef JP
-if (arg_fiddle) note("¥ª¥×¥·¥ç¥ó¤ò¥í¡¼¥É¤·¤Þ¤·¤¿");
-#else
-       if (arg_fiddle) note("Loaded Option Flags");
-#endif
+       if (arg_fiddle) note(_("オプションをロードしました", "Loaded Option Flags"));
 
        /* Then the "messages" */
        rd_messages();
-#ifdef JP
-if (arg_fiddle) note("¥á¥Ã¥»¡¼¥¸¤ò¥í¡¼¥É¤·¤Þ¤·¤¿");
-#else
-       if (arg_fiddle) note("Loaded Messages");
-#endif
-
-
+       if (arg_fiddle) note(_("メッセージをロードしました", "Loaded Messages"));
 
        for (i = 0; i < max_r_idx; i++)
        {
@@ -3299,12 +3511,7 @@ if (arg_fiddle) note("
        /* Incompatible save files */
        if (tmp16u > max_r_idx)
        {
-#ifdef JP
-note(format("¥â¥ó¥¹¥¿¡¼¤Î¼ï²¤¬Â¿¤¹¤®¤ë(%u)¡ª", tmp16u));
-#else
-               note(format("Too many (%u) monster races!", tmp16u));
-#endif
-
+               note(format(_("モンスターの種族が多すぎる(%u)!", "Too many (%u) monster races!"), tmp16u));
                return (21);
        }
 
@@ -3312,16 +3519,10 @@ note(format("
        for (i = 0; i < tmp16u; i++)
        {
                /* Read the lore */
-               rd_lore(i);
+               rd_lore((MONRACE_IDX)i);
        }
 
-#ifdef JP
-if (arg_fiddle) note("¥â¥ó¥¹¥¿¡¼¤Î»×¤¤½Ð¤ò¥í¡¼¥É¤·¤Þ¤·¤¿");
-#else
-       if (arg_fiddle) note("Loaded Monster Memory");
-#endif
-
-
+       if (arg_fiddle) note(_("モンスターの思い出をロードしました", "Loaded Monster Memory"));
 
        /* Object Memory */
        rd_u16b(&tmp16u);
@@ -3329,19 +3530,13 @@ if (arg_fiddle) note("
        /* Incompatible save files */
        if (tmp16u > max_k_idx)
        {
-#ifdef JP
-note(format("¥¢¥¤¥Æ¥à¤Î¼ïÎब¿¤¹¤®¤ë(%u)¡ª", tmp16u));
-#else
-               note(format("Too many (%u) object kinds!", tmp16u));
-#endif
-
+               note(format(_("アイテムの種類が多すぎる(%u)!", "Too many (%u) object kinds!"), tmp16u));
                return (22);
        }
 
        /* Read the object memory */
        for (i = 0; i < tmp16u; i++)
        {
-               byte tmp8u;
                object_kind *k_ptr = &k_info[i];
 
                rd_byte(&tmp8u);
@@ -3349,21 +3544,7 @@ note(format("
                k_ptr->aware = (tmp8u & 0x01) ? TRUE: FALSE;
                k_ptr->tried = (tmp8u & 0x02) ? TRUE: FALSE;
        }
-#ifdef JP
-if (arg_fiddle) note("¥¢¥¤¥Æ¥à¤Îµ­Ï¿¤ò¥í¡¼¥É¤·¤Þ¤·¤¿");
-#else
-       if (arg_fiddle) note("Loaded Object Memory");
-#endif
-
-
-       /* Init the wilderness seeds */
-       for (i = 0; i < max_wild_x; i++)
-       {
-               for (j = 0; j < max_wild_y; j++)
-               {
-                       wilderness[j][i].seed = randint0(0x10000000);
-               }
-       }
+       if (arg_fiddle) note(_("アイテムの記録をロードしました", "Loaded Object Memory"));
 
        /* 2.1.3 or newer version */
        {
@@ -3378,12 +3559,7 @@ if (arg_fiddle) note("
                /* Incompatible save files */
                if (max_towns_load > max_towns)
                {
-#ifdef JP
-note(format("Ä®¤¬Â¿¤¹¤®¤ë(%u)¡ª", max_towns_load));
-#else
-                       note(format("Too many (%u) towns!", max_towns_load));
-#endif
-
+                       note(format(_("町が多すぎる(%u)!", "Too many (%u) towns!"), max_towns_load));
                        return (23);
                }
 
@@ -3400,68 +3576,78 @@ note(format("Į
                }
 
                /* Incompatible save files */
-               if (max_quests_load > max_quests)
+               if (max_quests_load > max_q_idx)
                {
-#ifdef JP
-note(format("¥¯¥¨¥¹¥È¤¬Â¿¤¹¤®¤ë(%u)¡ª", max_quests_load));
-#else
-                       note(format("Too many (%u) quests!", max_quests_load));
-#endif
-
+                       note(format(_("クエストが多すぎる(%u)!", "Too many (%u) quests!"), max_quests_load));
                        return (23);
                }
 
                for (i = 0; i < max_quests_load; i++)
                {
-                       if (i < max_quests)
+                       if (i < max_q_idx)
                        {
-                               rd_s16b(&quest[i].status);
-                               rd_s16b(&quest[i].level);
+                               quest_type* const q_ptr = &quest[i];
+                               
+                               rd_s16b(&q_ptr->status);
+                               rd_s16b(&tmp16s);
+                               q_ptr->level = tmp16s;
 
                                if (z_older_than(11, 0, 6))
                                {
-                                       quest[i].complev = 0;
+                                       q_ptr->complev = 0;
+                               }
+                               else
+                               {
+                                       rd_byte(&tmp8u);
+                                       q_ptr->complev = tmp8u;
+                               }
+                               if(h_older_than(2, 1, 2, 2))
+                               {
+                                       q_ptr->comptime = 0;
                                }
                                else
                                {
-                                       rd_byte(&quest[i].complev);
+                                       rd_u32b(&q_ptr->comptime);
                                }
 
                                /* Load quest status if quest is running */
-                               if ((quest[i].status == QUEST_STATUS_TAKEN) ||
-                                   (!z_older_than(10, 3, 14) && (quest[i].status == QUEST_STATUS_COMPLETED)) ||
+                               if ((q_ptr->status == QUEST_STATUS_TAKEN) ||
+                                   (!z_older_than(10, 3, 14) && (q_ptr->status == QUEST_STATUS_COMPLETED)) ||
                                    (!z_older_than(11, 0, 7) && (i >= MIN_RANDOM_QUEST) && (i <= (MIN_RANDOM_QUEST + max_rquests_load))))
                                {
-                                       rd_s16b(&quest[i].cur_num);
-                                       rd_s16b(&quest[i].max_num);
-                                       rd_s16b(&quest[i].type);
+                                       rd_s16b(&tmp16s);
+                                       q_ptr->cur_num = (MONSTER_NUMBER)tmp16s;
+                                       rd_s16b(&tmp16s);
+                                       q_ptr->max_num = (MONSTER_NUMBER)tmp16s;
+                                       rd_s16b(&q_ptr->type);
 
                                        /* Load quest monster index */
-                                       rd_s16b(&quest[i].r_idx);
+                                       rd_s16b(&q_ptr->r_idx);
 
-                                       if ((quest[i].type == QUEST_TYPE_RANDOM) && (!quest[i].r_idx))
+                                       if ((q_ptr->type == QUEST_TYPE_RANDOM) && (!q_ptr->r_idx))
                                        {
                                                determine_random_questor(&quest[i]);
                                        }
 
                                        /* Load quest item index */
-                                       rd_s16b(&quest[i].k_idx);
+                                       rd_s16b(&q_ptr->k_idx);
 
-                                       if (quest[i].k_idx)
-                                               a_info[quest[i].k_idx].gen_flags |= TRG_QUESTITEM;
+                                       if (q_ptr->k_idx)
+                                               a_info[q_ptr->k_idx].gen_flags |= TRG_QUESTITEM;
 
-                                       rd_byte(&quest[i].flags);
+                                       rd_byte(&tmp8u);
+                                       q_ptr->flags = tmp8u;
 
                                        if (z_older_than(10, 3, 11))
                                        {
-                                               if (quest[i].flags & QUEST_FLAG_PRESET)
+                                               if (q_ptr->flags & QUEST_FLAG_PRESET)
                                                {
-                                                       quest[i].dungeon = 0;
+                                                       q_ptr->dungeon = 0;
                                                }
                                                else
                                                {
                                                        init_flags = INIT_ASSIGN;
-                                                       p_ptr->inside_quest = i;
+                                                       p_ptr->inside_quest = (QUEST_IDX)i;
 
                                                        process_dungeon_file("q_info.txt", 0, 0, 0, 0);
                                                        p_ptr->inside_quest = old_inside_quest;
@@ -3469,12 +3655,13 @@ note(format("
                                        }
                                        else
                                        {
-                                               rd_byte(&quest[i].dungeon);
+                                               rd_byte(&tmp8u);
+                                               q_ptr->dungeon = tmp8u;
                                        }
                                        /* Mark uniques */
-                                       if (quest[i].status == QUEST_STATUS_TAKEN || quest[i].status == QUEST_STATUS_UNTAKEN)
-                                               if (r_info[quest[i].r_idx].flags1 & RF1_UNIQUE)
-                                                       r_info[quest[i].r_idx].flags1 |= RF1_QUESTOR;
+                                       if (q_ptr->status == QUEST_STATUS_TAKEN || q_ptr->status == QUEST_STATUS_UNTAKEN)
+                                               if (r_info[q_ptr->r_idx].flags1 & RF1_UNIQUE)
+                                                       r_info[q_ptr->r_idx].flags1 |= RF1_QUESTOR;
                                }
                        }
                        /* Ignore the empty quests from old versions */
@@ -3496,7 +3683,7 @@ note(format("
                /* Quest 18 was removed */
                if (h_older_than(1, 7, 0, 6))
                {
-                       WIPE(&quest[OLD_QUEST_WATER_CAVE], quest_type);
+                       (void)WIPE(&quest[OLD_QUEST_WATER_CAVE], quest_type);
                        quest[OLD_QUEST_WATER_CAVE].status = QUEST_STATUS_UNTAKEN;
                }
 
@@ -3521,12 +3708,7 @@ note(format("
                /* Incompatible save files */
                if ((wild_x_size > max_wild_x) || (wild_y_size > max_wild_y))
                {
-#ifdef JP
-note(format("¹ÓÌÂ礭¤¹¤®¤ë(%u/%u)¡ª", wild_x_size, wild_y_size));
-#else
-                       note(format("Wilderness is too big (%u/%u)!", wild_x_size, wild_y_size));
-#endif
-
+                       note(format(_("荒野が大きすぎる(%u/%u)!", "Wilderness is too big (%u/%u)!"), wild_x_size, wild_y_size));
                        return (23);
                }
 
@@ -3540,11 +3722,7 @@ note(format("
                }
        }
 
-#ifdef JP
-if (arg_fiddle) note("¥¯¥¨¥¹¥È¾ðÊó¤ò¥í¡¼¥É¤·¤Þ¤·¤¿");
-#else
-       if (arg_fiddle) note("Loaded Quests");
-#endif
+       if (arg_fiddle) note(_("クエスト情報をロードしました", "Loaded Quests"));
 
        /* Load the Artifacts */
        rd_u16b(&tmp16u);
@@ -3552,12 +3730,7 @@ if (arg_fiddle) note("
        /* Incompatible save files */
        if (tmp16u > max_a_idx)
        {
-#ifdef JP
-note(format("ÅÁÀâ¤Î¥¢¥¤¥Æ¥à¤¬Â¿¤¹¤®¤ë(%u)¡ª", tmp16u));
-#else
-               note(format("Too many (%u) artifacts!", tmp16u));
-#endif
-
+               note(format(_("伝説のアイテムが多すぎる(%u)!", "Too many (%u) artifacts!"), tmp16u));
                return (24);
        }
 
@@ -3582,23 +3755,13 @@ note(format("
                        rd_s16b(&a_ptr->floor_id);
                }
        }
-#ifdef JP
-if (arg_fiddle) note("ÅÁÀâ¤Î¥¢¥¤¥Æ¥à¤ò¥í¡¼¥É¤·¤Þ¤·¤¿");
-#else
-       if (arg_fiddle) note("Loaded Artifacts");
-#endif
-
-
+       if (arg_fiddle) note(_("伝説のアイテムをロードしました", "Loaded Artifacts"));
 
        /* Read the extra stuff */
        rd_extra();
        if (p_ptr->energy_need < -999) world_player = TRUE;
 
-#ifdef JP
-if (arg_fiddle) note("ÆÃÊ̾ðÊó¤ò¥í¡¼¥É¤·¤Þ¤·¤¿");
-#else
-       if (arg_fiddle) note("Loaded extra information");
-#endif
+       if (arg_fiddle) note(_("特別情報をロードしました", "Loaded extra information"));
 
 
        /* Read the player_hp array */
@@ -3607,19 +3770,15 @@ if (arg_fiddle) note("
        /* Incompatible save files */
        if (tmp16u > PY_MAX_LEVEL)
        {
-#ifdef JP
-note(format("¥Ò¥Ã¥È¥Ý¥¤¥ó¥ÈÇÛÎó¤¬Â礭¤¹¤®¤ë(%u)¡ª", tmp16u));
-#else
-               note(format("Too many (%u) hitpoint entries!", tmp16u));
-#endif
-
+               note(format(_("ヒットポイント配列が大きすぎる(%u)!", "Too many (%u) hitpoint entries!"), tmp16u));
                return (25);
        }
 
        /* Read the player_hp array */
        for (i = 0; i < tmp16u; i++)
        {
-               rd_s16b(&p_ptr->player_hp[i]);
+               rd_s16b(&tmp16s);
+               p_ptr->player_hp[i] = (HIT_POINT)tmp16s;
        }
 
        /* Important -- Initialize the sex */
@@ -3688,19 +3847,15 @@ note(format("
 
        for (i = 0; i < 64; i++)
        {
-               rd_byte(&p_ptr->spell_order[i]);
+               rd_byte(&tmp8u);
+               p_ptr->spell_order[i] = (SPELL_IDX)tmp8u;
        }
 
 
        /* Read the inventory */
        if (rd_inventory())
        {
-#ifdef JP
-note("»ý¤Áʪ¾ðÊó¤òÆɤ߹þ¤à¤³¤È¤¬¤Ç¤­¤Þ¤»¤ó");
-#else
-               note("Unable to read inventory");
-#endif
-
+               note(_("持ち物情報を読み込むことができません", "Unable to read inventory"));
                return (21);
        }
 
@@ -3761,7 +3916,7 @@ note("
 
        if (!z_older_than(11, 0, 9))
        {
-               char buf[SCREEN_BUF_SIZE];
+               char buf[SCREEN_BUF_MAX_SIZE];
                rd_string(buf, sizeof(buf));
                if (buf[0]) screen_dump = string_make(buf);
        }
@@ -3779,20 +3934,11 @@ note("
        if (!p_ptr->is_dead)
        {
                /* Dead players have no dungeon */
-#ifdef JP
-note("¥À¥ó¥¸¥ç¥óÉü¸µÃæ...");
-#else
-               note("Restoring Dungeon...");
-#endif
+               note(_("ダンジョン復元中...", "Restoring Dungeon..."));
 
                if (rd_dungeon())
                {
-#ifdef JP
-note("¥À¥ó¥¸¥ç¥ó¥Ç¡¼¥¿Æɤ߹þ¤ß¼ºÇÔ");
-#else
-                       note("Error reading dungeon data");
-#endif
-
+                       note(_("ダンジョンデータ読み込み失敗", "Error reading dungeon data"));
                        return (34);
                }
 
@@ -3830,12 +3976,7 @@ note("
        /* Verify */
        if (o_v_check != n_v_check)
        {
-#ifdef JP
-note("¥Á¥§¥Ã¥¯¥µ¥à¤¬¤ª¤«¤·¤¤");
-#else
-               note("Invalid checksum");
-#endif
-
+               note(_("チェックサムがおかしい", "Invalid checksum"));
                return (11);
        }
 
@@ -3850,12 +3991,7 @@ note("
        /* Verify */
        if (o_x_check != n_x_check)
        {
-#ifdef JP
-note("¥¨¥ó¥³¡¼¥É¤µ¤ì¤¿¥Á¥§¥Ã¥¯¥µ¥à¤¬¤ª¤«¤·¤¤");
-#else
-               note("Invalid encoded checksum");
-#endif
-
+               note(_("エンコードされたチェックサムがおかしい", "Invalid encoded checksum"));
                return (11);
        }
 
@@ -3865,9 +4001,9 @@ note("
        return (0);
 }
 
-
-/*
- * Actually read the savefile
+/*!
+ * @brief ロード処理全体のメイン関数 / Actually read the savefile
+ * @return エラーコード
  */
 errr rd_savefile_new(void)
 {
@@ -3899,8 +4035,10 @@ 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)
 {
@@ -3960,10 +4098,13 @@ 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)
+bool load_floor(saved_floor_type *sf_ptr, BIT_FLAGS mode)
 {
        FILE *old_fff = NULL;
        byte old_xor_byte = 0;