OSDN Git Service

[Refactor] #37353 TRAP_* 定義を trap.h へ移動、関連要素も整理。 / Move TRAP_* definition to trap...
[hengband/hengband.git] / src / init2.c
index 201b070..eed984d 100644 (file)
@@ -35,6 +35,8 @@
 #include "angband.h"
 
 #include "init.h"
+#include "trap.h"
+#include "rooms.h"
 
 #ifndef MACINTOSH
 #ifdef CHECK_MODIFICATION_TIME
@@ -43,8 +45,7 @@
 #endif /* CHECK_MODIFICATION_TIME */
 #endif
 
-
-
+static void put_title(void);
 
 /*!
  * @brief 各データファイルを読み取るためのパスを取得する
@@ -113,28 +114,6 @@ void init_file_paths(char *path)
        /* Prepare to append to the Base Path */
        tail = path + strlen(path);
 
-
-#ifdef VM
-
-       /*** Use "flat" paths with VM/ESA ***/
-
-       /* Use "blank" path names */
-       ANGBAND_DIR_APEX = string_make("");
-       ANGBAND_DIR_BONE = string_make("");
-       ANGBAND_DIR_DATA = string_make("");
-       ANGBAND_DIR_EDIT = string_make("");
-       ANGBAND_DIR_SCRIPT = string_make("");
-       ANGBAND_DIR_FILE = string_make("");
-       ANGBAND_DIR_HELP = string_make("");
-       ANGBAND_DIR_INFO = string_make("");
-       ANGBAND_DIR_SAVE = string_make("");
-       ANGBAND_DIR_USER = string_make("");
-       ANGBAND_DIR_XTRA = string_make("");
-
-
-#else /* VM */
-
-
        /*** Build the sub-directory names ***/
 
        /* Build a path name */
@@ -197,15 +176,13 @@ void init_file_paths(char *path)
        strcpy(tail, "xtra");
        ANGBAND_DIR_XTRA = string_make(path);
 
-#endif /* VM */
-
 
 #ifdef NeXT
 
        /* Allow "fat binary" usage with NeXT */
        if (TRUE)
        {
-               cptr next = NULL;
+               concptr next = NULL;
 
 # if defined(m68k)
                next = "m68k";
@@ -254,7 +231,7 @@ int error_line; /*!< データ読み込み/初期化時に汎用的にエラー
 /*!
  * エラーメッセージの名称定義 / Standard error message text
  */
-cptr err_str[PARSE_ERROR_MAX] =
+concptr err_str[PARSE_ERROR_MAX] =
 {
        NULL,
 #ifdef JP
@@ -309,7 +286,7 @@ header m_head; /*!< プレイヤー職業魔法情報のヘッダ構造体 */
  * @param template_file ファイル名
  * @return テキストの方が新しいか、rawファイルがなく更新の必要がある場合-1、更新の必要がない場合0。
  */
-static errr check_modification_date(int fd, cptr template_file)
+static errr check_modification_date(int fd, concptr template_file)
 {
        char buf[1024];
 
@@ -429,7 +406,7 @@ static errr init_info_raw(int fd, header *head)
  * @param len データの長さ
  * @return エラーコード
  */
-static void init_header(header *head, int num, int len)
+static void init_header(header *head, IDX num, int len)
 {
        /* Save the "version" */
        head->v_major = FAKE_VER_MAJOR;
@@ -438,7 +415,7 @@ static void init_header(header *head, int num, int len)
        head->v_extra = 0;
 
        /* Save the "record" information */
-       head->info_num = num;
+       head->info_num = (IDX)num;
        head->info_len = len;
 
        /* Save the size of "*_head" and "*_info" */
@@ -461,12 +438,12 @@ static void init_header(header *head, int num, int len)
  * Note that we let each entry have a unique "name" and "text" string,
  * even if the string happens to be empty (everyone has a unique '\0').
  */
-static errr init_info(cptr filename, header *head,
+static errr init_info(concptr filename, header *head,
                      void **info, char **name, char **text, char **tag)
 {
        int fd;
 
-       int mode = 0644;
+       BIT_FLAGS mode = 0644;
 
        errr err = 1;
 
@@ -481,11 +458,7 @@ static errr init_info(cptr filename, header *head,
        /*** Load the binary image file ***/
 
        /* Build the filename */
-#ifdef JP
-       path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format("%s_j.raw", filename));
-#else
-       path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format("%s.raw", filename));
-#endif
+       path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format(_("%s_j.raw", "%s.raw"), filename));
 
 
        /* Attempt to open the "raw" file */
@@ -537,12 +510,7 @@ static errr init_info(cptr filename, header *head,
                fp = my_fopen(buf, "r");
 
                /* Parse it */
-#ifdef JP
-               if (!fp) quit(format("'%s.txt'ファイルをオープンできません。", filename));
-#else
-               if (!fp) quit(format("Cannot open '%s.txt' file.", filename));
-#endif
-
+               if (!fp) quit(format(_("'%s.txt'ファイルをオープンできません。", "Cannot open '%s.txt' file."), filename));
 
                /* Parse the file */
                err = init_info_txt(fp, buf, head, head->parse_info_txt);
@@ -553,13 +521,12 @@ static errr init_info(cptr filename, header *head,
                /* Errors */
                if (err)
                {
-                       cptr oops;
+                       concptr oops;
 
 #ifdef JP
                        /* Error string */
                        oops = (((err > 0) && (err < PARSE_ERROR_MAX)) ? err_str[err] : "未知の");
 
-                       /* Oops */
                        msg_format("'%s.txt'ファイルの %d 行目にエラー。", filename, error_line);
                        msg_format("レコード %d は '%s' エラーがあります。", error_idx, oops);
                        msg_format("構文 '%s'。", buf);
@@ -571,7 +538,6 @@ static errr init_info(cptr filename, header *head,
                        /* Error string */
                        oops = (((err > 0) && (err < PARSE_ERROR_MAX)) ? err_str[err] : "unknown");
 
-                       /* Oops */
                        msg_format("Error %d at line %d of '%s.txt'.", err, error_line, filename);
                        msg_format("Record %d contains a '%s' error.", error_idx, oops);
                        msg_format("Parsing '%s'.", buf);
@@ -598,11 +564,7 @@ static errr init_info(cptr filename, header *head,
                FILE_TYPE(FILE_TYPE_DATA);
 
                /* Build the filename */
-#ifdef JP
-               path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format("%s_j.raw", filename));
-#else
-               path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format("%s.raw", filename));
-#endif
+               path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format(_("%s_j.raw", "%s.raw"), filename));
 
 
                /* Grab permissions */
@@ -621,7 +583,7 @@ static errr init_info(cptr filename, header *head,
                if (fd >= 0)
                {
                        /* Dump it */
-                       fd_write(fd, (cptr)(head), head->head_size);
+                       fd_write(fd, (concptr)(head), head->head_size);
 
                        /* Dump the "*_info" array */
                        fd_write(fd, head->info_ptr, head->info_size);
@@ -656,23 +618,13 @@ static errr init_info(cptr filename, header *head,
                /*** Load the binary image file ***/
 
                /* Build the filename */
-#ifdef JP
-               path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format("%s_j.raw", filename));
-#else
-               path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format("%s.raw", filename));
-#endif
-
+               path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format(_("%s_j.raw", "%s.raw"), filename));
 
                /* Attempt to open the "raw" file */
                fd = fd_open(buf, O_RDONLY);
 
                /* Process existing "raw" file */
-#ifdef JP
-               if (fd < 0) quit(format("'%s_j.raw'ファイルをロードできません。", filename));
-#else
-               if (fd < 0) quit(format("Cannot load '%s.raw' file.", filename));
-#endif
-
+               if (fd < 0) quit(format(_("'%s_j.raw'ファイルをロードできません。", "Cannot load '%s.raw' file."), filename));
 
                /* Attempt to parse the "raw" file */
                err = init_info_raw(fd, head);
@@ -681,11 +633,7 @@ static errr init_info(cptr filename, header *head,
                (void)fd_close(fd);
 
                /* Error */
-#ifdef JP
-               if (err) quit(format("'%s_j.raw'ファイルを解析できません。", filename));
-#else
-               if (err) quit(format("Cannot parse '%s.raw' file.", filename));
-#endif
+               if (err) quit(format(_("'%s_j.raw'ファイルを解析できません。", "Cannot parse '%s.raw' file."), filename));
 
 #ifdef ALLOW_TEMPLATES
        }
@@ -1547,7 +1495,7 @@ static errr init_towns(void)
                        /* Scan the choices */
                        for (k = 0; k < STORE_CHOICES; k++)
                        {
-                               int k_idx;
+                               KIND_OBJECT_IDX k_idx;
 
                                /* Extract the tval/sval codes */
                                int tv = store_table[j][k][0];
@@ -1631,10 +1579,10 @@ static errr init_quests(void)
        /*** Prepare the quests ***/
 
        /* Allocate the quests */
-       C_MAKE(quest, max_quests, quest_type);
+       C_MAKE(quest, max_q_idx, quest_type);
 
        /* Set all quest to "untaken" */
-       for (i = 0; i < max_quests; i++)
+       for (i = 0; i < max_q_idx; i++)
        {
                quest[i].status = QUEST_STATUS_UNTAKEN;
        }
@@ -1650,9 +1598,9 @@ static bool feat_tag_is_not_found = FALSE;
  * Initialize quest array
  * @return 地形ID
  */
-s16b f_tag_to_index_in_init(cptr str)
+s16b f_tag_to_index_in_init(concptr str)
 {
-       s16b feat = f_tag_to_index(str);
+       FEAT_IDX feat = f_tag_to_index(str);
 
        if (feat < 0) feat_tag_is_not_found = TRUE;
 
@@ -1667,7 +1615,7 @@ s16b f_tag_to_index_in_init(cptr str)
  */
 static errr init_feat_variables(void)
 {
-       int i;
+       FEAT_IDX i;
 
        /* Nothing */
        feat_none = f_tag_to_index_in_init("NONE");
@@ -1790,6 +1738,14 @@ static errr init_feat_variables(void)
        feat_shallow_water = f_tag_to_index_in_init("SHALLOW_WATER");
        feat_deep_lava = f_tag_to_index_in_init("DEEP_LAVA");
        feat_shallow_lava = f_tag_to_index_in_init("SHALLOW_LAVA");
+       feat_heavy_cold_zone = f_tag_to_index_in_init("HEAVY_COLD_ZONE");
+       feat_cold_zone = f_tag_to_index_in_init("COLD_ZONE");
+       feat_heavy_electrical_zone = f_tag_to_index_in_init("HEAVY_ELECTRICAL_ZONE");
+       feat_electrical_zone = f_tag_to_index_in_init("ELECTRICAL_ZONE");
+       feat_deep_acid_puddle = f_tag_to_index_in_init("DEEP_ACID_PUDDLE");
+       feat_shallow_acid_puddle = f_tag_to_index_in_init("SHALLOW_ACID_PUDDLE");
+       feat_deep_poisonous_puddle = f_tag_to_index_in_init("DEEP_POISONOUS_PUDDLE");
+       feat_shallow_poisonous_puddle = f_tag_to_index_in_init("SHALLOW_POISONOUS_PUDDLE");
        feat_dirt = f_tag_to_index_in_init("DIRT");
        feat_grass = f_tag_to_index_in_init("GRASS");
        feat_flower = f_tag_to_index_in_init("FLOWER");
@@ -1833,7 +1789,7 @@ static errr init_other(void)
        }
 
        /* Allocate and Wipe the max dungeon level */
-       C_MAKE(max_dlv, max_d_idx, s16b);
+       C_MAKE(max_dlv, max_d_idx, DEPTH);
 
        /* Allocate and wipe each line of the cave */
        for (i = 0; i < MAX_HGT; i++)
@@ -1846,8 +1802,8 @@ static errr init_other(void)
        /*** Prepare the various "bizarre" arrays ***/
 
        /* Macro variables */
-       C_MAKE(macro__pat, MACRO_MAX, cptr);
-       C_MAKE(macro__act, MACRO_MAX, cptr);
+       C_MAKE(macro__pat, MACRO_MAX, concptr);
+       C_MAKE(macro__act, MACRO_MAX, concptr);
        C_MAKE(macro__cmd, MACRO_MAX, bool);
 
        /* Macro action buffer */
@@ -1857,7 +1813,7 @@ static errr init_other(void)
        quark_init();
 
        /* Message variables */
-       C_MAKE(message__ptr, MESSAGE_MAX, u16b);
+       C_MAKE(message__ptr, MESSAGE_MAX, u32b);
        C_MAKE(message__buf, MESSAGE_BUF, char);
 
        /* Hack -- No messages yet */
@@ -1920,7 +1876,7 @@ static errr init_other(void)
         *  Window 1 : Display messages
         *  Window 2 : Display inven/equip
         */
-       window_flag[1] = 1L << 6;
+       window_flag[1] = 1L << A_MAX;
        window_flag[2] = 1L << 0;
 
 
@@ -1994,13 +1950,7 @@ static errr init_object_alloc(void)
        }
 
        /* Paranoia */
-#ifdef JP
-if (!num[0]) quit("町のアイテムがない!");
-#else
-       if (!num[0]) quit("No town objects!");
-#endif
-
-
+       if (!num[0]) quit(_("町のアイテムがない!", "No town objects!"));
 
        /*** Initialize object allocation info ***/
 
@@ -2036,11 +1986,11 @@ if (!num[0]) quit("町のアイテムがない!");
                                z = y + aux[x];
 
                                /* Load the entry */
-                               table[z].index = i;
-                               table[z].level = x;
-                               table[z].prob1 = p;
-                               table[z].prob2 = p;
-                               table[z].prob3 = p;
+                               table[z].index = (KIND_OBJECT_IDX)i;
+                               table[z].level = (DEPTH)x;
+                               table[z].prob1 = (PROB)p;
+                               table[z].prob2 = (PROB)p;
+                               table[z].prob3 = (PROB)p;
 
                                /* Another entry complete for this locale */
                                aux[x]++;
@@ -2105,11 +2055,11 @@ static errr init_alloc(void)
                        p = (100 / r_ptr->rarity);
 
                        /* Load the entry */
-                       alloc_race_table[i].index = elements[i].index;
-                       alloc_race_table[i].level = x;
-                       alloc_race_table[i].prob1 = p;
-                       alloc_race_table[i].prob2 = p;
-                       alloc_race_table[i].prob3 = p;
+                       alloc_race_table[i].index = (KIND_OBJECT_IDX)elements[i].index;
+                       alloc_race_table[i].level = (DEPTH)x;
+                       alloc_race_table[i].prob1 = (PROB)p;
+                       alloc_race_table[i].prob2 = (PROB)p;
+                       alloc_race_table[i].prob3 = (PROB)p;
                }
        }
 
@@ -2159,13 +2109,7 @@ static errr init_alloc(void)
        }
 
        /* Paranoia */
-#ifdef JP
-       if (!num[0]) quit("町のモンスターがない!");
-#else
-       if (!num[0]) quit("No town monsters!");
-#endif
-
-
+       if (!num[0]) quit(_("町のモンスターがない!", "No town monsters!"));
 
        /*** Initialize monster allocation info ***/
 
@@ -2226,7 +2170,7 @@ static errr init_alloc(void)
  * Hack -- take notes on line 23
  * @return なし
  */
-static void note(cptr str)
+static void note(concptr str)
 {
        Term_erase(0, 23, 255);
        Term_putstr(20, 23, -1, TERM_WHITE, str);
@@ -2241,12 +2185,12 @@ static void note(cptr str)
  * @return なし
  * @note
  * <pre>
- * XXX XXX XXX This function is "messy" because various things
+ * This function is "messy" because various things
  * may or may not be initialized, but the "plog()" and "quit()"
  * functions are "supposed" to work under any conditions.
  * </pre>
  */
-static void init_angband_aux(cptr why)
+static void init_angband_aux(concptr why)
 {
        /* Why */
        plog(why);
@@ -2286,7 +2230,7 @@ static void init_angband_aux(cptr why)
  * @return なし
  * @note
  * <pre>
- * XXX XXX XXX This function is "messy" because various things
+ * This function is "messy" because various things
  * may or may not be initialized, but the "plog()" and "quit()"
  * functions are "supposed" to work under any conditions.
  * Verify some files, display the "news.txt" file, create
@@ -2330,7 +2274,7 @@ void init_angband(void)
 {
        int fd = -1;
 
-       int mode = 0664;
+       BIT_FLAGS mode = 0664;
 
        FILE *fp;
 
@@ -2340,12 +2284,7 @@ void init_angband(void)
        /*** Verify the "news" file ***/
 
        /* Build the filename */
-#ifdef JP
-       path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "news_j.txt");
-#else
-       path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "news.txt");
-#endif
-
+       path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt"));
 
        /* Attempt to open the file */
        fd = fd_open(buf, O_RDONLY);
@@ -2355,13 +2294,7 @@ void init_angband(void)
        {
                char why[1024];
 
-               /* Message */
-#ifdef JP
-       sprintf(why, "'%s'ファイルにアクセスできません!", buf);
-#else
-               sprintf(why, "Cannot access the '%s' file!", buf);
-#endif
-
+               sprintf(why, _("'%s'ファイルにアクセスできません!", "Cannot access the '%s' file!"), buf);
 
                /* Crash and burn */
                init_angband_aux(why);
@@ -2372,17 +2305,10 @@ void init_angband(void)
 
 
        /*** Display the "news" file ***/
-
-       /* Clear screen */
        Term_clear();
 
        /* Build the filename */
-#ifdef JP
-       path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "news_j.txt");
-#else
-       path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, "news.txt");
-#endif
-
+       path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt"));
 
        /* Open the News file */
        fp = my_fopen(buf, "r");
@@ -2435,13 +2361,7 @@ void init_angband(void)
                {
                        char why[1024];
 
-                       /* Message */
-#ifdef JP
-                       sprintf(why, "'%s'ファイルを作成できません!", buf);
-#else
-                       sprintf(why, "Cannot create the '%s' file!", buf);
-#endif
-
+                       sprintf(why, _("'%s'ファイルを作成できません!", "Cannot create the '%s' file!"), buf);
 
                        /* Crash and burn */
                        init_angband_aux(why);
@@ -2451,22 +2371,13 @@ void init_angband(void)
        /* Close it */
        (void)fd_close(fd);
 
+       put_title();
 
        /*** Initialize some arrays ***/
 
        /* Initialize misc. values */
-#ifdef JP
-note("[変数を初期化しています...(その他)");
-#else
-       note("[Initializing values... (misc)]");
-#endif
-
-#ifdef JP
-if (init_misc()) quit("その他の変数を初期化できません");
-#else
-       if (init_misc()) quit("Cannot initialize misc. values");
-#endif
-
+       note(_("[変数を初期化しています...(その他)", "[Initializing values... (misc)]"));
+       if (init_misc()) quit(_("その他の変数を初期化できません", "Cannot initialize misc. values"));
 
        /* Initialize feature info */
 #ifdef JP
@@ -2481,53 +2392,28 @@ if (init_misc()) quit("その他の変数を初期化できません");
 
 
        /* Initialize object info */
-#ifdef JP
-       note("[データの初期化中... (アイテム)]");
-       if (init_k_info()) quit("アイテム初期化不能");
-#else
-       note("[Initializing arrays... (objects)]");
-       if (init_k_info()) quit("Cannot initialize objects");
-#endif
+       note(_("[データの初期化中... (アイテム)]", "[Initializing arrays... (objects)]"));
+       if (init_k_info()) quit(_("アイテム初期化不能", "Cannot initialize objects"));
 
 
        /* Initialize artifact info */
-#ifdef JP
-       note("[データの初期化中... (伝説のアイテム)]");
-       if (init_a_info()) quit("伝説のアイテム初期化不能");
-#else
-       note("[Initializing arrays... (artifacts)]");
-       if (init_a_info()) quit("Cannot initialize artifacts");
-#endif
+       note(_("[データの初期化中... (伝説のアイテム)]", "[Initializing arrays... (artifacts)]"));
+       if (init_a_info()) quit(_("伝説のアイテム初期化不能", "Cannot initialize artifacts"));
 
 
        /* Initialize ego-item info */
-#ifdef JP
-       note("[データの初期化中... (名のあるアイテム)]");
-       if (init_e_info()) quit("名のあるアイテム初期化不能");
-#else
-       note("[Initializing arrays... (ego-items)]");
-       if (init_e_info()) quit("Cannot initialize ego-items");
-#endif
+       note(_("[データの初期化中... (名のあるアイテム)]", "[Initializing arrays... (ego-items)]"));
+       if (init_e_info()) quit(_("名のあるアイテム初期化不能", "Cannot initialize ego-items"));
 
 
        /* Initialize monster info */
-#ifdef JP
-       note("[データの初期化中... (モンスター)]");
-       if (init_r_info()) quit("モンスター初期化不能");
-#else
-       note("[Initializing arrays... (monsters)]");
-       if (init_r_info()) quit("Cannot initialize monsters");
-#endif
+       note(_("[データの初期化中... (モンスター)]", "[Initializing arrays... (monsters)]"));
+       if (init_r_info()) quit(_("モンスター初期化不能", "Cannot initialize monsters"));
 
 
        /* Initialize dungeon info */
-#ifdef JP
-       note("[データの初期化中... (ダンジョン)]");
-       if (init_d_info()) quit("ダンジョン初期化不能");
-#else
-       note("[Initializing arrays... (dungeon)]");
-       if (init_d_info()) quit("Cannot initialize dungeon");
-#endif
+       note(_("[データの初期化中... (ダンジョン)]", "[Initializing arrays... (dungeon)]"));
+       if (init_d_info()) quit(_("ダンジョン初期化不能", "Cannot initialize dungeon"));
        {
                int i;
                for (i = 1; i < max_d_idx; i++)
@@ -2536,118 +2422,51 @@ if (init_misc()) quit("その他の変数を初期化できません");
        }
 
        /* Initialize magic info */
-#ifdef JP
-       note("[データの初期化中... (魔法)]");
-       if (init_m_info()) quit("魔法初期化不能");
-#else
-       note("[Initializing arrays... (magic)]");
-       if (init_m_info()) quit("Cannot initialize magic");
-#endif
+       note(_("[データの初期化中... (魔法)]", "[Initializing arrays... (magic)]"));
+       if (init_m_info()) quit(_("魔法初期化不能", "Cannot initialize magic"));
 
        /* Initialize weapon_exp info */
-#ifdef JP
-       note("[データの初期化中... (熟練度)]");
-       if (init_s_info()) quit("熟練度初期化不能");
-#else
-       note("[Initializing arrays... (skill)]");
-       if (init_s_info()) quit("Cannot initialize skill");
-#endif
+       note(_("[データの初期化中... (熟練度)]", "[Initializing arrays... (skill)]"));
+       if (init_s_info()) quit(_("熟練度初期化不能", "Cannot initialize skill"));
 
        /* Initialize wilderness array */
-#ifdef JP
-note("[配列を初期化しています... (荒野)]");
-#else
-       note("[Initializing arrays... (wilderness)]");
-#endif
+       note(_("[配列を初期化しています... (荒野)]", "[Initializing arrays... (wilderness)]"));
 
-#ifdef JP
-if (init_wilderness()) quit("荒野を初期化できません");
-#else
-       if (init_wilderness()) quit("Cannot initialize wilderness");
-#endif
+       if (init_wilderness()) quit(_("荒野を初期化できません", "Cannot initialize wilderness"));
 
 
        /* Initialize town array */
-#ifdef JP
-note("[配列を初期化しています... (街)]");
-#else
-       note("[Initializing arrays... (towns)]");
-#endif
-
-#ifdef JP
-if (init_towns()) quit("街を初期化できません");
-#else
-       if (init_towns()) quit("Cannot initialize towns");
-#endif
+       note(_("[配列を初期化しています... (街)]", "[Initializing arrays... (towns)]"));
+       if (init_towns()) quit(_("街を初期化できません", "Cannot initialize towns"));
 
 
        /* Initialize building array */
-#ifdef JP
-note("[配列を初期化しています... (建物)]");
-#else
-       note("[Initializing arrays... (buildings)]");
-#endif
-
-#ifdef JP
-if (init_buildings()) quit("建物を初期化できません");
-#else
-       if (init_buildings()) quit("Cannot initialize buildings");
-#endif
+       note(_("[配列を初期化しています... (建物)]", "[Initializing arrays... (buildings)]"));
+       if (init_buildings()) quit(_("建物を初期化できません", "Cannot initialize buildings"));
 
 
        /* Initialize quest array */
-#ifdef JP
-note("[配列を初期化しています... (クエスト)]");
-#else
-       note("[Initializing arrays... (quests)]");
-#endif
-
-#ifdef JP
-if (init_quests()) quit("クエストを初期化できません");
-#else
-       if (init_quests()) quit("Cannot initialize quests");
-#endif
-
+       note(_("[配列を初期化しています... (クエスト)]", "[Initializing arrays... (quests)]"));
+       if (init_quests()) quit(_("クエストを初期化できません", "Cannot initialize quests"));
 
        /* Initialize vault info */
-#ifdef JP
-       if (init_v_info()) quit("vault 初期化不能");
-#else
-       if (init_v_info()) quit("Cannot initialize vaults");
-#endif
-
+       if (init_v_info()) quit(_("vault 初期化不能", "Cannot initialize vaults"));
 
        /* Initialize some other arrays */
-#ifdef JP
-       note("[データの初期化中... (その他)]");
-       if (init_other()) quit("その他のデータ初期化不能");
-#else
-       note("[Initializing arrays... (other)]");
-       if (init_other()) quit("Cannot initialize other stuff");
-#endif
+       note(_("[データの初期化中... (その他)]", "[Initializing arrays... (other)]"));
+       if (init_other()) quit(_("その他のデータ初期化不能", "Cannot initialize other stuff"));
 
 
        /* Initialize some other arrays */
-#ifdef JP
-       /* translation */
-       note("[データの初期化中... (アロケーション)]");
-       if (init_alloc()) quit("アロケーション・スタッフ初期化不能");
-#else
-       note("[Initializing arrays... (alloc)]");
-       if (init_alloc()) quit("Cannot initialize alloc stuff");
-#endif
+       note(_("[データの初期化中... (アロケーション)]", "[Initializing arrays... (alloc)]"));
+       if (init_alloc()) quit(_("アロケーション・スタッフ初期化不能", "Cannot initialize alloc stuff"));
 
 
 
        /*** Load default user pref files ***/
 
        /* Initialize feature info */
-#ifdef JP
-note("[ユーザー設定ファイルを初期化しています...]");
-#else
-       note("[Initializing user pref files...]");
-#endif
-
+       note(_("[ユーザー設定ファイルを初期化しています...]", "[Initializing user pref files...]"));
 
        /* Access the "basic" pref file */
        strcpy(buf, "pref.prf");
@@ -2661,20 +2480,33 @@ note("[ユーザー設定ファイルを初期化しています...]");
        /* Process that file */
        process_pref_file(buf);
 
-       /* Done */
-#ifdef JP
-       note("[初期化終了]");
+       note(_("[初期化終了]", "[Initialization complete]"));
+}
+
+/*!
+ * @brief タイトル記述
+ * @return なし
+ */
+static void put_title(void)
+{
+       char title[120];
+       int col;
+#if H_VER_EXTRA > 0
+       sprintf(title, _("変愚蛮怒 %d.%d.%d.%d(%s)", "Hengband %d.%d.%d.%d(%s)"), H_VER_MAJOR, H_VER_MINOR, H_VER_PATCH, H_VER_EXTRA,
 #else
-       note("[Initialization complete]");
+       sprintf(title, _("変愚蛮怒 %d.%d.%d(%s)", "Hengband %d.%d.%d(%s)"), H_VER_MAJOR, H_VER_MINOR, H_VER_PATCH,
 #endif
-
+       IS_STABLE_VERSION ? _("安定版", "Stable") : _("開発版", "Developing"));
+       col = (80 - strlen(title)) / 2;
+       col = col < 0 ? 0 : col;
+       prt(title, VER_INFO_ROW, col);
 }
 
 /*!
  * @brief サムチェック情報を出力 / Get check sum in string form
  * @return サムチェック情報の文字列
  */
-cptr get_check_sum(void)
+concptr get_check_sum(void)
 {
        return format("%02x%02x%02x%02x%02x%02x%02x%02x%02x", 
                      f_head.v_extra,