OSDN Git Service

v3.0.0 Alpha5 OSDN最終版
[hengband/hengband.git] / src / main-win.c
index 5f7541f..d50d04f 100644 (file)
@@ -3,7 +3,7 @@
  * @file main-win.c
  * @brief Windows版固有実装(メインエントリポイント含む)
  * @date 2018/03/16
- * @author Bakabakaband Team
+ * @author Hengband Team
  * @details
  *
  * <h3>概要</h3>
 #include "floor/floor-events.h"
 #include "game-option/runtime-arguments.h"
 #include "game-option/special-options.h"
-#include "io/chuukei.h"
 #include "io/files-util.h"
 #include "io/inet.h"
 #include "io/input-key-acceptor.h"
+#include "io/record-play-movie.h"
 #include "io/signal-handlers.h"
 #include "io/write-diary.h"
 #include "main/angband-initializer.h"
 #define GRAPHICS_NONE 0
 #define GRAPHICS_ORIGINAL 1
 #define GRAPHICS_ADAM_BOLT 2
-#define GRAPHICS_Bakabakaband 3
+#define GRAPHICS_HENGBAND 3
 
 /*
  * Menu constants -- see "ANGBAND.RC"
@@ -695,21 +695,26 @@ static void term_getsize(term_data *td)
     TERM_LEN wid = td->cols * td->tile_wid + td->size_ow1 + td->size_ow2;
     TERM_LEN hgt = td->rows * td->tile_hgt + td->size_oh1 + td->size_oh2;
 
-    RECT rc;
-    rc.left = 0;
-    rc.right = rc.left + wid;
-    rc.top = 0;
-    rc.bottom = rc.top + hgt;
-
-    AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle);
-    td->size_wid = rc.right - rc.left;
-    td->size_hgt = rc.bottom - rc.top;
-    if (!td->w)
-        return;
+    RECT rw, rc;
+    if (td->w) {
+        GetWindowRect(td->w, &rw);
+        GetClientRect(td->w, &rc);
 
-    GetWindowRect(td->w, &rc);
-    td->pos_x = rc.left;
-    td->pos_y = rc.top;
+        td->size_wid = (rw.right - rw.left) - (rc.right - rc.left) + wid;
+        td->size_hgt = (rw.bottom - rw.top) - (rc.bottom - rc.top) + hgt;
+
+        td->pos_x = rw.left;
+        td->pos_y = rw.top;
+    } else {
+        /* Tempolary calculation */
+        rc.left = 0;
+        rc.right = wid;
+        rc.top = 0;
+        rc.bottom = hgt;
+        AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle);
+        td->size_wid = rc.right - rc.left;
+        td->size_hgt = rc.bottom - rc.top;
+    }
 }
 
 /*
@@ -812,6 +817,7 @@ static void save_prefs(void)
     strcpy(buf, use_bg ? "1" : "0");
     WritePrivateProfileString("Angband", "BackGround", buf, ini_file);
     WritePrivateProfileString("Angband", "BackGroundBitmap", bg_bitmap_file[0] != '\0' ? bg_bitmap_file : "bg.bmp", ini_file);
+    WritePrivateProfileString("Angband", "SaveFile", savefile, ini_file);
 
     for (int i = 0; i < MAX_TERM_DATA; ++i) {
         save_prefs_aux(i);
@@ -887,6 +893,7 @@ static void load_prefs(void)
     arg_music = (GetPrivateProfileInt("Angband", "Music", 0, ini_file) != 0);
     use_bg = GetPrivateProfileInt("Angband", "BackGround", 0, ini_file);
     GetPrivateProfileString("Angband", "BackGroundBitmap", "bg.bmp", bg_bitmap_file, 1023, ini_file);
+    GetPrivateProfileString("Angband", "SaveFile", "", savefile, 1023, ini_file);
     for (int i = 0; i < MAX_TERM_DATA; ++i) {
         load_prefs_aux(i);
     }
@@ -940,15 +947,17 @@ static void load_sound_prefs(void)
     char wav_path[1024];
     char *zz[SAMPLE_SOUND_MAX];
 
-    path_build(ini_path, 1024, ANGBAND_DIR_XTRA_SOUND, "sound.cfg");
+    path_build(ini_path, 1024, ANGBAND_DIR_XTRA_SOUND, "sound_debug.cfg");
+    if (GetPrivateProfileString("Device", "type", "", mci_device_type, 256, ini_path) == 0) {
+        path_build(ini_path, 1024, ANGBAND_DIR_XTRA_SOUND, "sound.cfg");
+        GetPrivateProfileString("Device", "type", "", mci_device_type, 256, ini_path);
+    }
+
     for (int i = 0; i < SOUND_MAX; i++) {
         GetPrivateProfileString("Sound", angband_sound_name[i], "", tmp, 1024, ini_path);
         int num = tokenize_whitespace(tmp, SAMPLE_SOUND_MAX, zz);
         for (int j = 0; j < num; j++) {
-            /* Access the sound */
             path_build(wav_path, 1024, ANGBAND_DIR_XTRA_SOUND, zz[j]);
-
-            /* Save the sound filename, if it exists */
             if (check_file(wav_path))
                 sound_file[i][j] = string_make(zz[j]);
         }
@@ -963,8 +972,12 @@ static void load_music_prefs(void)
     char *zz[SAMPLE_MUSIC_MAX];
     char key[80];
 
-    path_build(ini_path, 1024, ANGBAND_DIR_XTRA_MUSIC, "music.cfg");
-    GetPrivateProfileString("Device", "type", "", mci_device_type, 256, ini_path);
+    path_build(ini_path, 1024, ANGBAND_DIR_XTRA_MUSIC, "music_debug.cfg");
+    if (GetPrivateProfileString("Device", "type", "", mci_device_type, 256, ini_path) == 0) {
+        path_build(ini_path, 1024, ANGBAND_DIR_XTRA_MUSIC, "music.cfg");
+        GetPrivateProfileString("Device", "type", "", mci_device_type, 256, ini_path);
+    }
+
     for (int i = 0; i < MUSIC_BASIC_MAX; i++) {
         GetPrivateProfileString("Basic", angband_music_basic_name[i], "", tmp, 1024, ini_path);
         int num = tokenize_whitespace(tmp, SAMPLE_MUSIC_MAX, zz);
@@ -1120,7 +1133,7 @@ static bool init_graphics(void)
         name = "16X16.BMP";
 
         ANGBAND_GRAF = "new";
-    } else if (arg_graphics == GRAPHICS_Bakabakaband) {
+    } else if (arg_graphics == GRAPHICS_HENGBAND) {
         wid = 32;
         hgt = 32;
         twid = 32;
@@ -1162,7 +1175,7 @@ static bool init_graphics(void)
         }
     }
 
-    if (arg_graphics == GRAPHICS_Bakabakaband) {
+    if (arg_graphics == GRAPHICS_HENGBAND) {
         path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, "mask32.bmp");
         if (!ReadDIB(data[0].w, buf, &infMask)) {
             plog_fmt("Cannot read bitmap file '%s'", buf);
@@ -1868,7 +1881,7 @@ static errr term_pict_win(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, c
     HDC hdcSrc = CreateCompatibleDC(hdc);
     HBITMAP hbmSrcOld = SelectObject(hdcSrc, infGraph.hBitmap);
 
-    if (arg_graphics == GRAPHICS_ADAM_BOLT || arg_graphics == GRAPHICS_Bakabakaband) {
+    if (arg_graphics == GRAPHICS_ADAM_BOLT || arg_graphics == GRAPHICS_HENGBAND) {
         hdcMask = CreateCompatibleDC(hdc);
         SelectObject(hdcMask, infMask.hBitmap);
     }
@@ -1881,7 +1894,7 @@ static errr term_pict_win(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, c
         TERM_LEN x1 = col * w1;
         TERM_LEN y1 = row * h1;
 
-        if (arg_graphics == GRAPHICS_ADAM_BOLT || arg_graphics == GRAPHICS_Bakabakaband) {
+        if (arg_graphics == GRAPHICS_ADAM_BOLT || arg_graphics == GRAPHICS_HENGBAND) {
             TERM_LEN x3 = (tcp[i] & 0x7F) * w1;
             TERM_LEN y3 = (tap[i] & 0x7F) * h1;
             tw2 = tw2 * w1 / tw1;
@@ -1915,7 +1928,7 @@ static errr term_pict_win(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, c
 
     SelectObject(hdcSrc, hbmSrcOld);
     DeleteDC(hdcSrc);
-    if (arg_graphics == GRAPHICS_ADAM_BOLT || arg_graphics == GRAPHICS_Bakabakaband) {
+    if (arg_graphics == GRAPHICS_ADAM_BOLT || arg_graphics == GRAPHICS_HENGBAND) {
         SelectObject(hdcMask, hbmSrcOld);
         DeleteDC(hdcMask);
     }
@@ -1967,7 +1980,7 @@ static void windows_map(player_type *player_ptr)
 static void term_data_link(term_data *td)
 {
     term_type *t = &td->t;
-    term_init(t, td->cols, td->rows, td->keys);
+    term_init(t, td->cols, td->rows, FILE_READ_BUFF_SIZE);
     t->soft_cursor = TRUE;
     t->higher_pict = TRUE;
     t->attr_blank = TERM_WHITE;
@@ -1997,7 +2010,7 @@ static void init_windows(void)
     td = &data[0];
     WIPE(td, term_data);
 #ifdef JP
-    td->s = "馬鹿馬鹿蛮怒";
+    td->s = "変愚蛮怒";
 #else
     td->s = angband_term_name[0];
 #endif
@@ -2034,17 +2047,21 @@ static void init_windows(void)
     }
 
     load_prefs();
+
+    /* Atrributes of main window */
     td = &data[0];
     td->dwStyle = (WS_OVERLAPPED | WS_THICKFRAME | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION | WS_VISIBLE);
     td->dwExStyle = 0;
     td->visible = TRUE;
 
+    /* Attributes of sub windows */
     for (int i = 1; i < MAX_TERM_DATA; i++) {
         td = &data[i];
         td->dwStyle = (WS_OVERLAPPED | WS_THICKFRAME | WS_SYSMENU);
         td->dwExStyle = (WS_EX_TOOLWINDOW);
     }
 
+    /* Font of each window */
     for (int i = 0; i < MAX_TERM_DATA; i++) {
         td = &data[i];
         strncpy(td->lf.lfFaceName, td->font_want, LF_FACESIZE);
@@ -2055,11 +2072,11 @@ static void init_windows(void)
             td->tile_wid = td->font_wid;
         if (!td->tile_hgt)
             td->tile_hgt = td->font_hgt;
-
         term_getsize(td);
         term_window_resize(td);
     }
 
+    /* Create sub windows */
     for (int i = MAX_TERM_DATA - 1; i >= 1; --i) {
         td = &data[i];
 
@@ -2067,14 +2084,18 @@ static void init_windows(void)
         td->w
             = CreateWindowEx(td->dwExStyle, AngList, td->s, td->dwStyle, td->pos_x, td->pos_y, td->size_wid, td->size_hgt, HWND_DESKTOP, NULL, hInstance, NULL);
         my_td = NULL;
+
         if (!td->w)
             quit(_("サブウィンドウに作成に失敗しました", "Failed to create sub-window"));
 
+        td->size_hack = TRUE;
+        term_getsize(td);
+        term_window_resize(td);
+
         if (td->visible) {
-            td->size_hack = TRUE;
             ShowWindow(td->w, SW_SHOW);
-            td->size_hack = FALSE;
         }
+        td->size_hack = FALSE;
 
         term_data_link(td);
         angband_term[i] = &td->t;
@@ -2084,20 +2105,28 @@ static void init_windows(void)
             SetActiveWindow(td->w);
         }
 
-        if (data[i].posfix) {
-            term_window_pos(&data[i], HWND_TOPMOST);
+        if (td->posfix) {
+            term_window_pos(td, HWND_TOPMOST);
         } else {
-            term_window_pos(&data[i], td->w);
+            term_window_pos(td, td->w);
         }
     }
 
+    /* Create main window */
     td = &data[0];
     my_td = td;
     td->w = CreateWindowEx(td->dwExStyle, AppName, td->s, td->dwStyle, td->pos_x, td->pos_y, td->size_wid, td->size_hgt, HWND_DESKTOP, NULL, hInstance, NULL);
     my_td = NULL;
+
     if (!td->w)
         quit(_("メインウィンドウの作成に失敗しました", "Failed to create Angband window"));
 
+    /* Resize */
+    td->size_hack = TRUE;
+    term_getsize(td);
+    term_window_resize(td);
+    td->size_hack = FALSE;
+
     term_data_link(td);
     angband_term[0] = &td->t;
     normsize.x = td->cols;
@@ -2215,7 +2244,7 @@ static void setup_menus(void)
     CheckMenuItem(hm, IDM_OPTIONS_NO_GRAPHICS, (arg_graphics == GRAPHICS_NONE ? MF_CHECKED : MF_UNCHECKED));
     CheckMenuItem(hm, IDM_OPTIONS_OLD_GRAPHICS, (arg_graphics == GRAPHICS_ORIGINAL ? MF_CHECKED : MF_UNCHECKED));
     CheckMenuItem(hm, IDM_OPTIONS_NEW_GRAPHICS, (arg_graphics == GRAPHICS_ADAM_BOLT ? MF_CHECKED : MF_UNCHECKED));
-    CheckMenuItem(hm, IDM_OPTIONS_NEW2_GRAPHICS, (arg_graphics == GRAPHICS_Bakabakaband ? MF_CHECKED : MF_UNCHECKED));
+    CheckMenuItem(hm, IDM_OPTIONS_NEW2_GRAPHICS, (arg_graphics == GRAPHICS_HENGBAND ? MF_CHECKED : MF_UNCHECKED));
     CheckMenuItem(hm, IDM_OPTIONS_BIGTILE, (arg_bigtile ? MF_CHECKED : MF_UNCHECKED));
     CheckMenuItem(hm, IDM_OPTIONS_MUSIC, (arg_music ? MF_CHECKED : MF_UNCHECKED));
     CheckMenuItem(hm, IDM_OPTIONS_SOUND, (arg_sound ? MF_CHECKED : MF_UNCHECKED));
@@ -2249,7 +2278,7 @@ static void check_for_save_file(player_type *player_ptr, LPSTR cmd_line)
     strcat(savefile, s);
     validate_file(savefile);
     game_in_progress = TRUE;
-    play_game(player_ptr, FALSE);
+    play_game(player_ptr, FALSE, FALSE);
 }
 
 /*
@@ -2268,7 +2297,8 @@ static void process_menus(player_type *player_ptr, WORD wCmd)
         } else {
             game_in_progress = TRUE;
             term_flush();
-            play_game(player_ptr, TRUE);
+            strcpy(savefile, "");
+            play_game(player_ptr, TRUE, FALSE);
             quit(NULL);
         }
 
@@ -2294,7 +2324,7 @@ static void process_menus(player_type *player_ptr, WORD wCmd)
                 validate_file(savefile);
                 game_in_progress = TRUE;
                 term_flush();
-                play_game(player_ptr, FALSE);
+                play_game(player_ptr, FALSE, FALSE);
                 quit(NULL);
             }
         }
@@ -2370,8 +2400,8 @@ static void process_menus(player_type *player_ptr, WORD wCmd)
             ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
 
             if (GetOpenFileName(&ofn)) {
-                prepare_browse_movie_aux(savefile);
-                play_game(player_ptr, FALSE);
+                prepare_browse_movie_without_path_build(savefile);
+                play_game(player_ptr, FALSE, TRUE);
                 quit(NULL);
                 return;
             }
@@ -2583,8 +2613,8 @@ static void process_menus(player_type *player_ptr, WORD wCmd)
             break;
         }
 
-        if (arg_graphics != GRAPHICS_Bakabakaband) {
-            arg_graphics = GRAPHICS_Bakabakaband;
+        if (arg_graphics != GRAPHICS_HENGBAND) {
+            arg_graphics = GRAPHICS_HENGBAND;
             term_xtra_win_react(player_ptr);
             term_key_push(KTRL('R'));
         }
@@ -3029,7 +3059,7 @@ LRESULT PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
         p_ptr->panic_save = 1;
         signals_ignore_tstp();
         (void)strcpy(p_ptr->died_from, _("(緊急セーブ)", "(panic save)"));
-        (void)save_player(p_ptr);
+        (void)save_player(p_ptr, SAVE_TYPE_CLOSE_GAME);
         quit(NULL);
         return 0;
     }
@@ -3238,10 +3268,8 @@ LRESULT PASCAL AngbandListProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
         return 0;
     }
     case WM_NCLBUTTONDOWN: {
-#ifdef HTCLOSE
         if (wParam == HTCLOSE)
             wParam = HTSYSMENU;
-#endif /* HTCLOSE */
 
         if (wParam == HTSYSMENU) {
             if (td->visible) {
@@ -3411,147 +3439,60 @@ static void hook_quit(concptr str)
  */
 static void init_stuff(void)
 {
-       int i;
-
-       char path[1024];
-
-
-       /* Get program name with full path */
-       GetModuleFileName(hInstance, path, 512);
-
-       /* Save the "program name" */
-       argv0 = path;
-
-       /* Get the name of the "*.ini" file */
-       strcpy(path + strlen(path) - 4, ".INI");
-
-       /* Save the the name of the ini-file */
-       ini_file = string_make(path);
-
-       /* Analyze the path */
-       i = strlen(path);
-
-       /* Get the path */
-       for (; i > 0; i--)
-       {
-               if (path[i] == '\\')
-               {
-                       /* End of path */
-                       break;
-               }
-       }
-
-       /* Add "lib" to the path */
-       strcpy(path + i + 1, "lib\\");
-
-       /* Validate the path */
-       validate_dir(path, TRUE);
-
-       /* Init the file paths */
-       init_file_paths(path, path);
-
-       /* Hack -- Validate the paths */
-       validate_dir(ANGBAND_DIR_APEX, FALSE);
-       validate_dir(ANGBAND_DIR_BONE, FALSE);
-
-       /* Allow missing 'edit' directory */
-       if (!check_dir(ANGBAND_DIR_EDIT))
-       {
-               /* Must have 'data'! */
-               validate_dir(ANGBAND_DIR_DATA, TRUE);
-       }
-       else
-       {
-               /* Don't need 'data' */
-               validate_dir(ANGBAND_DIR_DATA, FALSE);
-       }
-
-       validate_dir(ANGBAND_DIR_FILE, TRUE);
-       validate_dir(ANGBAND_DIR_HELP, FALSE);
-       validate_dir(ANGBAND_DIR_INFO, FALSE);
-       validate_dir(ANGBAND_DIR_PREF, TRUE);
-       validate_dir(ANGBAND_DIR_SAVE, FALSE);
-       validate_dir(ANGBAND_DIR_USER, TRUE);
-       validate_dir(ANGBAND_DIR_XTRA, TRUE);
-
-       /* Build the filename */
-       path_build(path, sizeof(path), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt"));
-
-       /* Hack -- Validate the "news.txt" file */
-       validate_file(path);
-
-
-#if 0 /* #ifndef JP */
-       /* Build the "font" path */
-       path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "font");
-
-       /* Allocate the path */
-       ANGBAND_DIR_XTRA_FONT = string_make(path);
-
-       /* Validate the "font" directory */
-       validate_dir(ANGBAND_DIR_XTRA_FONT, TRUE);
-
-       /* Build the filename */
-       path_build(path, sizeof(path), ANGBAND_DIR_XTRA_FONT, "8X13.FON");
-
-       /* Hack -- Validate the basic font */
-       validate_file(path);
-#endif
-
-
-#ifdef USE_GRAPHICS
-
-       /* Build the "graf" path */
-       path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "graf");
-
-       /* Allocate the path */
-       ANGBAND_DIR_XTRA_GRAF = string_make(path);
-
-       /* Validate the "graf" directory */
-       validate_dir(ANGBAND_DIR_XTRA_GRAF, TRUE);
-
-#endif /* USE_GRAPHICS */
-
-
-#ifdef USE_SOUND
-
-       /* Build the "sound" path */
-       path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "sound");
-
-       /* Allocate the path */
-       ANGBAND_DIR_XTRA_SOUND = string_make(path);
-
-       /* Validate the "sound" directory */
-       validate_dir(ANGBAND_DIR_XTRA_SOUND, FALSE);
-
-#endif /* USE_SOUND */
-
-#ifdef USE_MUSIC
-
-       /* Build the "music" path */
-       path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "music");
-
-       /* Allocate the path */
-       ANGBAND_DIR_XTRA_MUSIC = string_make(path);
-
-       /* Validate the "music" directory */
-       validate_dir(ANGBAND_DIR_XTRA_MUSIC, FALSE);
-
-#endif /* USE_MUSIC */
-
-       /* Build the "help" path */
-       path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "help");
+    char path[1024];
+    GetModuleFileName(hInstance, path, 512);
+    argv0 = path;
+    strcpy(path + strlen(path) - 4, ".INI");
+    ini_file = string_make(path);
+    int i = strlen(path);
 
-       /* Allocate the path */
-       ANGBAND_DIR_XTRA_HELP = string_make(path);
+    for (; i > 0; i--) {
+        if (path[i] == '\\') {
+            break;
+        }
+    }
 
-       /* Validate the "help" directory */
-       /* validate_dir(ANGBAND_DIR_XTRA_HELP); */
+    strcpy(path + i + 1, "lib\\");
+    validate_dir(path, TRUE);
+    init_file_paths(path, path);
+    validate_dir(ANGBAND_DIR_APEX, FALSE);
+    validate_dir(ANGBAND_DIR_BONE, FALSE);
+    if (!check_dir(ANGBAND_DIR_EDIT)) {
+        validate_dir(ANGBAND_DIR_DATA, TRUE);
+    } else {
+        validate_dir(ANGBAND_DIR_DATA, FALSE);
+    }
+
+    validate_dir(ANGBAND_DIR_FILE, TRUE);
+    validate_dir(ANGBAND_DIR_HELP, FALSE);
+    validate_dir(ANGBAND_DIR_INFO, FALSE);
+    validate_dir(ANGBAND_DIR_PREF, TRUE);
+    validate_dir(ANGBAND_DIR_SAVE, FALSE);
+    validate_dir(ANGBAND_DIR_DEBUG_SAVE, FALSE);
+    validate_dir(ANGBAND_DIR_USER, TRUE);
+    validate_dir(ANGBAND_DIR_XTRA, TRUE);
+    path_build(path, sizeof(path), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt"));
+
+    validate_file(path);
+    path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "graf");
+    ANGBAND_DIR_XTRA_GRAF = string_make(path);
+    validate_dir(ANGBAND_DIR_XTRA_GRAF, TRUE);
+
+    path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "sound");
+    ANGBAND_DIR_XTRA_SOUND = string_make(path);
+    validate_dir(ANGBAND_DIR_XTRA_SOUND, FALSE);
+
+    path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "music");
+    ANGBAND_DIR_XTRA_MUSIC = string_make(path);
+    validate_dir(ANGBAND_DIR_XTRA_MUSIC, FALSE);
+
+    path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "help");
+    ANGBAND_DIR_XTRA_HELP = string_make(path);
 }
 
 /*!
  * todo よく見るとhMutexはちゃんと使われていない……?
- * @brief (Windows固有)馬鹿馬鹿蛮怒が起動済かどうかのチェック
+ * @brief (Windows固有)変愚蛮怒が起動済かどうかのチェック
  */
 static bool is_already_running(void)
 {
@@ -3578,7 +3519,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC
     hInstance = hInst;
     if (is_already_running()) {
         MessageBox(
-            NULL, _("馬鹿馬鹿蛮怒はすでに起動しています。", "Bakabakaband is already running."), _("エラー!", "Error"), MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
+            NULL, _("変愚蛮怒はすでに起動しています。", "Hengband is already running."), _("エラー!", "Error"), MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
         return FALSE;
     }
 
@@ -3671,53 +3612,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR lpCmdLine, int nC
     term_activate(term_screen);
     init_angband(p_ptr, process_autopick_file_command);
     initialized = TRUE;
-#ifdef CHUUKEI
-    if (lpCmdLine[0] == '-') {
-        switch (lpCmdLine[1]) {
-        case 'p':
-        case 'P': {
-            if (!lpCmdLine[2])
-                break;
-            chuukei_server = TRUE;
-            if (connect_chuukei_server(&lpCmdLine[2]) < 0) {
-                msg_print("connect fail");
-                return 0;
-            }
-            msg_print("connect");
-            msg_print(NULL);
-            break;
-        }
-
-        case 'c':
-        case 'C': {
-            if (!lpCmdLine[2])
-                break;
-            chuukei_client = TRUE;
-            connect_chuukei_server(&lpCmdLine[2]);
-            play_game(player_ptr, FALSE);
-            quit(NULL);
-            return 0;
-        }
-        case 'X':
-        case 'x': {
-            if (!lpCmdLine[2])
-                break;
-            prepare_browse_movie(&lpCmdLine[2]);
-            play_game(player_ptr, FALSE);
-            quit(NULL);
-            return 0;
-        }
-        }
-    }
-#endif
-
-#ifdef CHUUKEI
-    if (!chuukei_server)
-        check_for_save_file(lpCmdLine);
-#else
     check_for_save_file(p_ptr, lpCmdLine);
-#endif
-
     prt(_("[ファイル] メニューの [新規] または [開く] を選択してください。", "[Choose 'New' or 'Open' from the 'File' menu]"), 23, _(8, 17));
     term_fresh();
     while (GetMessage(&msg, NULL, 0, 0)) {