OSDN Git Service

アイテムの外見(flavor)の処理方法を変更。flavor.c内に直にデータを書くのでは無く
[hengband/hengband.git] / src / cmd4.c
index c4b4c75..9046c15 100644 (file)
@@ -1343,7 +1343,7 @@ void do_cmd_messages(int num_now)
                                cptr str = msg;
 
                                /* Display matches */
-                               while ((str = strstr(str, shower)) != NULL)
+                               while ((str = my_strstr(str, shower)) != NULL)
                                {
                                        int len = strlen(shower);
 
@@ -1402,7 +1402,7 @@ void do_cmd_messages(int num_now)
 
 
                        /* Get a "shower" string, or continue */
-                       if (!askfor_aux(shower, 80)) continue;
+                       if (!askfor(shower, 80)) continue;
 
                        /* Okay */
                        continue;
@@ -1422,7 +1422,7 @@ void do_cmd_messages(int num_now)
 
 
                        /* Get a "finder" string, or continue */
-                       if (!askfor_aux(finder, 80)) continue;
+                       if (!askfor(finder, 80)) continue;
 
                        /* Show it */
                        strcpy(shower, finder);
@@ -1433,7 +1433,7 @@ void do_cmd_messages(int num_now)
                                cptr msg = message_str(z);
 
                                /* Search for it */
-                               if (strstr(msg, finder))
+                               if (my_strstr(msg, finder))
                                {
                                        /* New location */
                                        i = z;
@@ -2291,28 +2291,28 @@ void do_cmd_options(void)
 
                /* Give some choices */
 #ifdef JP
-               prt("(1)     ¥­¡¼ÆþÎÏ          ¥ª¥×¥·¥ç¥ó", 2, 5);
-               prt("(2)     ²èÌ̽ÐÎÏ          ¥ª¥×¥·¥ç¥ó", 3, 5);
-               prt("(3)   ¥²¡¼¥à¥×¥ì¥¤        ¥ª¥×¥·¥ç¥ó", 4, 5);
-               prt("(4)   ¹ÔÆ°Ãæ»ß´Ø·¸        ¥ª¥×¥·¥ç¥ó", 5, 5);
-               prt("(5)      ¸úΨ²½           ¥ª¥×¥·¥ç¥ó", 6, 5);
-               prt("(6) ´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ  ¥ª¥×¥·¥ç¥ó", 7, 5);
-               prt("(R)    ¥×¥ì¥¤µ­Ï¿         ¥ª¥×¥·¥ç¥ó", 8, 5);
+               prt("(1)      ¥­¡¼ÆþÎÏ        ¥ª¥×¥·¥ç¥ó", 2, 5);
+               prt("(2)     ¥Þ¥Ã¥×²èÌÌ       ¥ª¥×¥·¥ç¥ó", 3, 5);
+               prt("(3)    ¥Æ¥­¥¹¥Èɽ¼¨      ¥ª¥×¥·¥ç¥ó", 4, 5);
+               prt("(4)    ¥²¡¼¥à¥×¥ì¥¤      ¥ª¥×¥·¥ç¥ó", 5, 5);
+               prt("(5)    ¹ÔÆ°Ãæ»ß´Ø·¸      ¥ª¥×¥·¥ç¥ó", 6, 5);
+               prt("(6)    ´Ê°×¼«Æ°Ç˲õ      ¥ª¥×¥·¥ç¥ó", 7, 5);
+               prt("(R)     ¥×¥ì¥¤µ­Ï¿       ¥ª¥×¥·¥ç¥ó", 8, 5);
 
                /* Special choices */
-               prt("(P) ¼«Æ°½¦¤¤¥¨¥Ç¥£¥¿", 10, 5);
-               prt("(D)  ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 11, 5);
+               prt("(P)  ¼«Æ°½¦¤¤¥¨¥Ç¥£¥¿", 10, 5);
+               prt("(D)   ´ðËÜ¥¦¥§¥¤¥ÈÎÌ", 11, 5);
                prt("(H) Äã¥Ò¥Ã¥È¥Ý¥¤¥ó¥È·Ù¹ð", 12, 5);
-               prt("(M)   ÄãËâÎÏ¿§ïçÃÍ", 13, 5);
-               prt("(A)    ¼«Æ°¥»¡¼¥Ö         ¥ª¥×¥·¥ç¥ó", 14, 5);
+               prt("(M)    ÄãËâÎÏ¿§ïçÃÍ", 13, 5);
+               prt("(A)     ¼«Æ°¥»¡¼¥Ö       ¥ª¥×¥·¥ç¥ó", 14, 5);
                /* Window flags */
-               prt("(W) ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
+               prt("(W)  ¥¦¥¤¥ó¥É¥¦¥Õ¥é¥°", 15, 5);
 #else
                prt("(1) Input Options", 2, 5);
-               prt("(2) Output Options", 3, 5);
-               prt("(3) Game-Play Options", 4, 5);
-               prt("(4) Disturbance Options", 5, 5);
-               prt("(5) Efficiency Options", 6, 5);
+               prt("(2) Map Screen Options", 3, 5);
+               prt("(3) Text Display Options", 4, 5);
+               prt("(4) Game-Play Options", 5, 5);
+               prt("(5) Disturbance Options", 6, 5);
                prt("(6) Easy Auto-Destroyer Options", 7, 5);
                prt("(R) Play-record Options", 8, 5);
                /* Special choices */
@@ -2329,7 +2329,7 @@ void do_cmd_options(void)
                {
                        /* Birth */
 #ifdef JP
-                       prt("(B)       ½é´ü            ¥ª¥×¥·¥ç¥ó (»²¾È¤Î¤ß)", 16, 5);
+                       prt("(B)        ½é´ü          ¥ª¥×¥·¥ç¥ó (»²¾È¤Î¤ß)", 16, 5);
 #else
                        prt("(B) Birth Options (Browse Only)", 16, 5);
 #endif
@@ -2338,7 +2338,7 @@ void do_cmd_options(void)
                {
                        /* Birth */
 #ifdef JP
-                       prt("(B)       ½é´ü            ¥ª¥×¥·¥ç¥ó", 16, 5);
+                       prt("(B)        ½é´ü          ¥ª¥×¥·¥ç¥ó", 16, 5);
 #else
                        prt("(B) Birth Options", 16, 5);
 #endif
@@ -2349,7 +2349,7 @@ void do_cmd_options(void)
                {
                        /* Cheating */
 #ifdef JP
-                       prt("(C)       º¾µ½            ¥ª¥×¥·¥ç¥ó", 17, 5);
+                       prt("(C)        º¾µ½          ¥ª¥×¥·¥ç¥ó", 17, 5);
 #else
                        prt("(C) Cheating Options", 17, 5);
 #endif
@@ -2373,7 +2373,6 @@ void do_cmd_options(void)
                /* Analyze */
                switch (k)
                {
-                       /* General Options */
                        case '1':
                        {
                                /* Process the general options */
@@ -2386,64 +2385,59 @@ void do_cmd_options(void)
                                break;
                        }
 
-                       /* General Options */
                        case '2':
                        {
                                /* Process the general options */
 #ifdef JP
-                               do_cmd_options_aux(OPT_PAGE_OUTPUT, "²èÌ̽ÐÎÏ¥ª¥×¥·¥ç¥ó");
+                               do_cmd_options_aux(OPT_PAGE_MAPSCREEN, "¥Þ¥Ã¥×²èÌÌ¥ª¥×¥·¥ç¥ó");
 #else
-                               do_cmd_options_aux(OPT_PAGE_OUTPUT, "Output Options");
+                               do_cmd_options_aux(OPT_PAGE_MAPSCREEN, "Map Screen Options");
 #endif
 
                                break;
                        }
 
-                       /* Inventory Options */
                        case '3':
                        {
                                /* Spawn */
 #ifdef JP
-                               do_cmd_options_aux(OPT_PAGE_GAMEPLAY, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
+                               do_cmd_options_aux(OPT_PAGE_TEXT, "¥Æ¥­¥¹¥Èɽ¼¨¥ª¥×¥·¥ç¥ó");
 #else
-                               do_cmd_options_aux(OPT_PAGE_GAMEPLAY, "Game-Play Options");
+                               do_cmd_options_aux(OPT_PAGE_TEXT, "Text Display Options");
 #endif
 
                                break;
                        }
 
-                       /* Disturbance Options */
                        case '4':
                        {
                                /* Spawn */
 #ifdef JP
-                               do_cmd_options_aux(OPT_PAGE_DISTURBANCE, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
+                               do_cmd_options_aux(OPT_PAGE_GAMEPLAY, "¥²¡¼¥à¥×¥ì¥¤¡¦¥ª¥×¥·¥ç¥ó");
 #else
-                               do_cmd_options_aux(OPT_PAGE_DISTURBANCE, "Disturbance Options");
+                               do_cmd_options_aux(OPT_PAGE_GAMEPLAY, "Game-Play Options");
 #endif
 
                                break;
                        }
 
-                       /* Efficiency Options */
                        case '5':
                        {
                                /* Spawn */
 #ifdef JP
-                               do_cmd_options_aux(OPT_PAGE_EFFICIENCY, "¸úΨ²½¥ª¥×¥·¥ç¥ó");
+                               do_cmd_options_aux(OPT_PAGE_DISTURBANCE, "¹ÔÆ°Ãæ»ß´Ø·¸¤Î¥ª¥×¥·¥ç¥ó");
 #else
-                               do_cmd_options_aux(OPT_PAGE_EFFICIENCY, "Efficiency Options");
+                               do_cmd_options_aux(OPT_PAGE_DISTURBANCE, "Disturbance Options");
 #endif
 
                                break;
                        }
 
-                       /* Object auto-destruction Options */
                        case '6':
                        {
                                /* Spawn */
 #ifdef JP
-                               do_cmd_options_aux(OPT_PAGE_AUTODESTROY, "´Ê°×¥¢¥¤¥Æ¥à¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
+                               do_cmd_options_aux(OPT_PAGE_AUTODESTROY, "´Ê°×¼«Æ°Ç˲õ¥ª¥×¥·¥ç¥ó");
 #else
                                do_cmd_options_aux(OPT_PAGE_AUTODESTROY, "Easy Auto-Destroyer Options");
 #endif
@@ -2728,64 +2722,16 @@ void do_cmd_pref(void)
        (void)process_pref_file_command(buf);
 }
 
-void do_cmd_pickpref(void)
+void do_cmd_reload_autopick(void)
 {
-       char buf[80];
-       errr err;
-
-#ifdef JP
-       if(!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
-#else
-       if(!get_check("Reload auto-pick preference file? ")) return;
-#endif
-
-       /* Free old entries */
-       init_autopicker();
-
-       /* ¥­¥ã¥éËè¤ÎÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß */
-#ifdef JP
-       sprintf(buf, "picktype-%s.prf", player_name);
-#else
-       sprintf(buf, "pickpref-%s.prf", player_name);
-#endif
-       err = process_pickpref_file(buf);
-
-       if(err == 0)
-       {
-#ifdef JP
-               msg_format("%s¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", buf);
-#else
-               msg_format("loaded '%s'.", buf);
-#endif
-       }
-
-       /* ¶¦Ä̤ÎÀßÄê¥Õ¥¡¥¤¥ëÆɤ߹þ¤ß */
-
-       /* Process 'pick????.prf' if 'pick????-<name>.prf' doesn't exist */
-       if (0 > err)
-       {
-#ifdef JP
-               err = process_pickpref_file("picktype.prf");
-#else
-               err = process_pickpref_file("pickpref.prf");
-#endif
-
-               if(err == 0)
-               {
 #ifdef JP
-                       msg_print("picktype.prf¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£");
+       if (!get_check("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ò¥í¡¼¥É¤·¤Þ¤¹¤«? ")) return;
 #else
-                       msg_print("loaded 'pickpref.prf'.");
+       if (!get_check("Reload auto-pick preference file? ")) return;
 #endif
-               }
-       }
 
-
-#ifdef JP
-       if(err) msg_print("¼«Æ°½¦¤¤ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£");
-#else
-       if(err) msg_print("Failed to reload autopick preference.");
-#endif
+       /* Load the file with messages */
+       autopick_load_pref(TRUE);
 }
 
 #ifdef ALLOW_MACROS
@@ -3146,7 +3092,7 @@ void do_cmd_macros(void)
                        sprintf(tmp, "%s.prf", player_name);
 
                        /* Ask for a file */
-                       if (!askfor_aux(tmp, 80)) continue;
+                       if (!askfor(tmp, 80)) continue;
 
                        /* Process the given filename */
                        err = process_pref_file(tmp);
@@ -3202,7 +3148,7 @@ void do_cmd_macros(void)
                        sprintf(tmp, "%s.prf", player_name);
 
                        /* Ask for a file */
-                       if (!askfor_aux(tmp, 80)) continue;
+                       if (!askfor(tmp, 80)) continue;
 
                        /* Dump the macros */
                        (void)macro_dump(tmp);
@@ -3302,6 +3248,13 @@ void do_cmd_macros(void)
                        /* Clear */
                        clear_from(20);
 
+                       /* Help message */
+#ifdef JP
+                       c_prt(TERM_L_RED, "¥«¡¼¥½¥ë¥­¡¼¤Îº¸±¦¤Ç¥«¡¼¥½¥ë°ÌÃÖ¤ò°ÜÆ°¡£Backspace¤«Delete¤Ç°ìʸ»úºï½ü¡£", 22, 0);
+#else
+                       c_prt(TERM_L_RED, "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char.", 22, 0);
+#endif
+
                        /* Prompt */
 #ifdef JP
                        prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
@@ -3314,7 +3267,7 @@ void do_cmd_macros(void)
                        ascii_to_text(tmp, macro__buf);
 
                        /* Get an encoded action */
-                       if (askfor_aux(tmp, 80))
+                       if (askfor(tmp, 80))
                        {
                                /* Convert to ascii */
                                text_to_ascii(macro__buf, tmp);
@@ -3389,7 +3342,7 @@ void do_cmd_macros(void)
                        sprintf(tmp, "%s.prf", player_name);
 
                        /* Ask for a file */
-                       if (!askfor_aux(tmp, 80)) continue;
+                       if (!askfor(tmp, 80)) continue;
 
                        /* Dump the macros */
                        (void)keymap_dump(tmp);
@@ -3489,6 +3442,13 @@ void do_cmd_macros(void)
                        /* Clear */
                        clear_from(20);
 
+                       /* Help message */
+#ifdef JP
+                       c_prt(TERM_L_RED, "¥«¡¼¥½¥ë¥­¡¼¤Îº¸±¦¤Ç¥«¡¼¥½¥ë°ÌÃÖ¤ò°ÜÆ°¡£Backspace¤«Delete¤Ç°ìʸ»úºï½ü¡£", 22, 0);
+#else
+                       c_prt(TERM_L_RED, "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char.", 22, 0);
+#endif
+
                        /* Prompt */
 #ifdef JP
                        prt("¹ÔÆ°: ", 20, 0);
@@ -3501,7 +3461,7 @@ void do_cmd_macros(void)
                        ascii_to_text(tmp, macro__buf);
 
                        /* Get an encoded action */
-                       if (askfor_aux(tmp, 80))
+                       if (askfor(tmp, 80))
                        {
                                /* Convert to ascii */
                                text_to_ascii(macro__buf, tmp);
@@ -3569,15 +3529,28 @@ void do_cmd_macros(void)
                        prt("Command: Enter a new action", 16, 0);
 #endif
 
+                       /* Clear */
+                       clear_from(20);
+
+                       /* Help message */
+#ifdef JP
+                       c_prt(TERM_L_RED, "¥«¡¼¥½¥ë¥­¡¼¤Îº¸±¦¤Ç¥«¡¼¥½¥ë°ÌÃÖ¤ò°ÜÆ°¡£Backspace¤«Delete¤Ç°ìʸ»úºï½ü¡£", 22, 0);
+#else
+                       c_prt(TERM_L_RED, "Press Left/Right arrow keys to move cursor. Backspace/Delete to delete a char.", 22, 0);
+#endif
 
-                       /* Go to the correct location */
-                       Term_gotoxy(0, 22);
+                       /* Prompt */
+#ifdef JP
+                       prt("¥Þ¥¯¥í¹ÔÆ°: ", 20, 0);
+#else
+                       prt("Action: ", 20, 0);
+#endif
 
                        /* Hack -- limit the value */
                        tmp[80] = '\0';
 
                        /* Get an encoded action */
-                       if (!askfor_aux(buf, 80)) continue;
+                       if (!askfor(buf, 80)) continue;
 
                        /* Extract an action */
                        text_to_ascii(macro__buf, buf);
@@ -3601,7 +3574,21 @@ void do_cmd_macros(void)
 }
 
 
-static void cmd_visuals_aux(int i, int *num, int max)
+static cptr lighting_level_str[F_LIT_MAX] =
+{
+#ifdef JP
+       "ɸ½à¿§",
+       "ÌÀ¿§",
+       "°Å¿§",
+#else
+       "standard",
+       "brightly lit",
+       "darkened",
+#endif
+};
+
+
+static bool cmd_visuals_aux(int i, int *num, int max)
 {
        if (iscntrl(i))
        {
@@ -3611,32 +3598,87 @@ static void cmd_visuals_aux(int i, int *num, int max)
                sprintf(str, "%d", *num);
 
                if (!get_string(format("Input new number(0-%d): ", max-1), str, 4))
-                       return;
+                       return FALSE;
 
                tmp = strtol(str, NULL, 0);
                if (tmp >= 0 && tmp < max)
                        *num = tmp;
-               return;
        }
        else if (isupper(i))
                *num = (*num + max - 1) % max;
        else
                *num = (*num + 1) % max;
 
-       return;
+       return TRUE;
+}
+
+static void print_visuals_menu(cptr choice_msg)
+{
+#ifdef JP
+       prt("²èÌÌɽ¼¨¤ÎÀßÄê", 1, 0);
+#else
+       prt("Interact with Visuals", 1, 0);
+#endif
+
+       /* Give some choices */
+#ifdef JP
+       prt("(0) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 3, 5);
+#else
+       prt("(0) Load a user pref file", 3, 5);
+#endif
+
+#ifdef ALLOW_VISUALS
+#ifdef JP
+       prt("(1) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹", 4, 5);
+       prt("(2) ¥¢¥¤¥Æ¥à¤Î   ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹", 5, 5);
+       prt("(3) ÃÏ·Á¤Î       ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹", 6, 5);
+       prt("(4) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¿ôÃÍÁàºî)", 7, 5);
+       prt("(5) ¥¢¥¤¥Æ¥à¤Î   ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¿ôÃÍÁàºî)", 8, 5);
+       prt("(6) ÃÏ·Á¤Î       ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¿ôÃÍÁàºî)", 9, 5);
+       prt("(7) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¥·¥ó¥Ü¥ë¥¨¥Ç¥£¥¿)", 10, 5);
+       prt("(8) ¥¢¥¤¥Æ¥à¤Î   ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¥·¥ó¥Ü¥ë¥¨¥Ç¥£¥¿)", 11, 5);
+       prt("(9) ÃÏ·Á¤Î       ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë (¥·¥ó¥Ü¥ë¥¨¥Ç¥£¥¿)", 12, 5);
+#else
+       prt("(1) Dump monster attr/chars", 4, 5);
+       prt("(2) Dump object attr/chars", 5, 5);
+       prt("(3) Dump feature attr/chars", 6, 5);
+       prt("(4) Change monster attr/chars (numeric operation)", 7, 5);
+       prt("(5) Change object attr/chars (numeric operation)", 8, 5);
+       prt("(6) Change feature attr/chars (numeric operation)", 9, 5);
+       prt("(7) Change monster attr/chars (visual mode)", 10, 5);
+       prt("(8) Change object attr/chars (visual mode)", 11, 5);
+       prt("(9) Change feature attr/chars (visual mode)", 12, 5);
+#endif
+
+#endif /* ALLOW_VISUALS */
+
+#ifdef JP
+       prt("(R) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
+#else
+       prt("(R) Reset visuals", 13, 5);
+#endif
+
+       /* Prompt */
+#ifdef JP
+       prt(format("¥³¥Þ¥ó¥É: %s", choice_msg ? choice_msg : ""), 15, 0);
+#else
+       prt(format("Command: %s", choice_msg ? choice_msg : ""), 15, 0);
+#endif
 }
 
+static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx);
+static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, int direct_k_idx);
+static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level);
+
 /*
  * Interact with "visuals"
  */
 void do_cmd_visuals(void)
 {
        int i;
-
        char tmp[160];
-
        char buf[1024];
-
+       bool need_redraw = FALSE;
        const char *empty_symbol = "<< ? >>";
 
        if (use_bigtile) empty_symbol = "<< ?? >>";
@@ -3644,11 +3686,9 @@ void do_cmd_visuals(void)
        /* File type is "TEXT" */
        FILE_TYPE(FILE_TYPE_TEXT);
 
-
        /* Save the screen */
        screen_save();
 
-
        /* Interact until done */
        while (1)
        {
@@ -3656,56 +3696,7 @@ void do_cmd_visuals(void)
                Term_clear();
 
                /* Ask for a choice */
-#ifdef JP
-               prt("²èÌÌɽ¼¨¤ÎÀßÄê", 2, 0);
-#else
-               prt("Interact with Visuals", 2, 0);
-#endif
-
-
-               /* Give some choices */
-#ifdef JP
-               prt("(1) ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 4, 5);
-#else
-               prt("(1) Load a user pref file", 4, 5);
-#endif
-
-#ifdef ALLOW_VISUALS
-#ifdef JP
-               prt("(2) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹", 5, 5);
-               prt("(3) ¥¢¥¤¥Æ¥à¤Î   ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹", 6, 5);
-               prt("(4) ÃÏ·Á¤Î       ¿§/ʸ»ú ¤ò¥Õ¥¡¥¤¥ë¤Ë½ñ¤­½Ð¤¹", 7, 5);
-               prt("(5) (̤»ÈÍÑ)", 8, 5);
-               prt("(6) ¥â¥ó¥¹¥¿¡¼¤Î ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 9, 5);
-               prt("(7) ¥¢¥¤¥Æ¥à¤Î   ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 10, 5);
-               prt("(8) ÃÏ·Á¤Î       ¿§/ʸ»ú ¤òÊѹ¹¤¹¤ë", 11, 5);
-               prt("(9) (̤»ÈÍÑ)", 12, 5);
-#else
-               prt("(2) Dump monster attr/chars", 5, 5);
-               prt("(3) Dump object attr/chars", 6, 5);
-               prt("(4) Dump feature attr/chars", 7, 5);
-               prt("(5) (unused)", 8, 5);
-               prt("(6) Change monster attr/chars", 9, 5);
-               prt("(7) Change object attr/chars", 10, 5);
-               prt("(8) Change feature attr/chars", 11, 5);
-               prt("(9) (unused)", 12, 5);
-#endif
-
-#endif
-#ifdef JP
-               prt("(0) ²èÌÌɽ¼¨ÊýË¡¤Î½é´ü²½", 13, 5);
-#else
-               prt("(0) Reset visuals", 13, 5);
-#endif
-
-
-               /* Prompt */
-#ifdef JP
-               prt("¥³¥Þ¥ó¥É:", 18, 0);
-#else
-               prt("Command: ", 15, 0);
-#endif
-
+               print_visuals_menu(NULL);
 
                /* Prompt */
                i = inkey();
@@ -3713,9 +3704,10 @@ void do_cmd_visuals(void)
                /* Done */
                if (i == ESCAPE) break;
 
-               /* Load a 'pref' file */
-               else if (i == '1')
+               switch (i)
                {
+               /* Load a 'pref' file */
+               case '0':
                        /* Prompt */
 #ifdef JP
                        prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 15, 0);
@@ -3723,29 +3715,29 @@ void do_cmd_visuals(void)
                        prt("Command: Load a user pref file", 15, 0);
 #endif
 
-
                        /* Prompt */
 #ifdef JP
-                       prt("¥Õ¥¡¥¤¥ë: ", 18, 0);
+                       prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
 #else
                        prt("File: ", 17, 0);
 #endif
 
-
                        /* Default filename */
                        sprintf(tmp, "%s.prf", player_name);
 
                        /* Query */
-                       if (!askfor_aux(tmp, 70)) continue;
+                       if (!askfor(tmp, 70)) continue;
 
                        /* Process the given filename */
                        (void)process_pref_file(tmp);
-               }
+
+                       need_redraw = TRUE;
+                       break;
 
 #ifdef ALLOW_VISUALS
 
                /* Dump monster attr/chars */
-               else if (i == '2')
+               case '1':
                {
                        static cptr mark = "Monster attr/chars";
 
@@ -3756,7 +3748,6 @@ void do_cmd_visuals(void)
                        prt("Command: Dump monster attr/chars", 15, 0);
 #endif
 
-
                        /* Prompt */
 #ifdef JP
                        prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
@@ -3764,12 +3755,11 @@ void do_cmd_visuals(void)
                        prt("File: ", 17, 0);
 #endif
 
-
                        /* Default filename */
                        sprintf(tmp, "%s.prf", player_name);
-                       
+
                        /* Get a filename */
-                       if (!askfor_aux(tmp, 70)) continue;
+                       if (!askfor(tmp, 70)) continue;
 
                        /* Build the filename */
                        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
@@ -3810,10 +3800,11 @@ void do_cmd_visuals(void)
                        msg_print("Dumped monster attr/chars.");
 #endif
 
+                       break;
                }
 
                /* Dump object attr/chars */
-               else if (i == '3')
+               case '2':
                {
                        static cptr mark = "Object attr/chars";
 
@@ -3824,7 +3815,6 @@ void do_cmd_visuals(void)
                        prt("Command: Dump object attr/chars", 15, 0);
 #endif
 
-
                        /* Prompt */
 #ifdef JP
                        prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
@@ -3832,12 +3822,11 @@ void do_cmd_visuals(void)
                        prt("File: ", 17, 0);
 #endif
 
-
                        /* Default filename */
                        sprintf(tmp, "%s.prf", player_name);
 
                        /* Get a filename */
-                       if (!askfor_aux(tmp, 70)) continue;
+                       if (!askfor(tmp, 70)) continue;
 
                        /* Build the filename */
                        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
@@ -3861,11 +3850,21 @@ void do_cmd_visuals(void)
                                /* Skip non-entries */
                                if (!k_ptr->name) continue;
 
-                               /* Skip entries with flavor */
-                               if (k_ptr->flavor) continue;
+                               if (!k_ptr->flavor)
+                               {
+                                       /* Tidy name */
+                                       strip_name(o_name, i);
+                               }
+                               else
+                               {
+                                       object_type forge;
+
+                                       /* Prepare dummy object */
+                                       object_prep(&forge, i);
 
-                               /* Tidy name */
-                               strip_name(o_name, i);
+                                       /* Get un-shuffled flavor name */
+                                       object_desc(o_name, &forge, OD_FORCE_FLAVOR);
+                               }
 
                                /* Dump a comment */
                                auto_dump_printf("# %s\n", o_name);
@@ -3885,10 +3884,11 @@ void do_cmd_visuals(void)
                        msg_print("Dumped object attr/chars.");
 #endif
 
+                       break;
                }
 
                /* Dump feature attr/chars */
-               else if (i == '4')
+               case '3':
                {
                        static cptr mark = "Feature attr/chars";
 
@@ -3899,7 +3899,6 @@ void do_cmd_visuals(void)
                        prt("Command: Dump feature attr/chars", 15, 0);
 #endif
 
-
                        /* Prompt */
 #ifdef JP
                        prt("¥Õ¥¡¥¤¥ë: ", 17, 0);
@@ -3907,12 +3906,11 @@ void do_cmd_visuals(void)
                        prt("File: ", 17, 0);
 #endif
 
-
                        /* Default filename */
                        sprintf(tmp, "%s.prf", player_name);
 
                        /* Get a filename */
-                       if (!askfor_aux(tmp, 70)) continue;
+                       if (!askfor(tmp, 70)) continue;
 
                        /* Build the filename */
                        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
@@ -3942,8 +3940,10 @@ void do_cmd_visuals(void)
                                auto_dump_printf("# %s\n", (f_name + f_ptr->name));
 
                                /* Dump the feature attr/char info */
-                               auto_dump_printf("F:%d:0x%02X/0x%02X\n\n", i,
-                                       (byte)(f_ptr->x_attr), (byte)(f_ptr->x_char));
+                               auto_dump_printf("F:%d:0x%02X/0x%02X:0x%02X/0x%02X:0x%02X/0x%02X\n\n", i,
+                                       (byte)(f_ptr->x_attr[F_LIT_STANDARD]), (byte)(f_ptr->x_char[F_LIT_STANDARD]),
+                                       (byte)(f_ptr->x_attr[F_LIT_LITE]), (byte)(f_ptr->x_char[F_LIT_LITE]),
+                                       (byte)(f_ptr->x_attr[F_LIT_DARK]), (byte)(f_ptr->x_char[F_LIT_DARK]));
                        }
 
                        /* Close */
@@ -3956,33 +3956,36 @@ void do_cmd_visuals(void)
                        msg_print("Dumped feature attr/chars.");
 #endif
 
+                       break;
                }
 
-               /* Modify monster attr/chars */
-               else if (i == '6')
+               /* Modify monster attr/chars (numeric operation) */
+               case '4':
                {
+#ifdef JP
+                       static cptr choice_msg = "¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹";
+#else
+                       static cptr choice_msg = "Change monster attr/chars";
+#endif
                        static int r = 0;
 
-                       /* Prompt */
 #ifdef JP
-                       prt("¥³¥Þ¥ó¥É: ¥â¥ó¥¹¥¿¡¼¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
+                       prt(format("¥³¥Þ¥ó¥É: %s", choice_msg), 15, 0);
 #else
-                       prt("Command: Change monster attr/chars", 15, 0);
+                       prt(format("Command: %s", choice_msg), 15, 0);
 #endif
 
-
                        /* Hack -- query until done */
                        while (1)
                        {
                                monster_race *r_ptr = &r_info[r];
-                               byte a, a2;
-                               char c, c2;
+                               char c;
                                int t;
 
-                               byte da = (r_ptr->d_attr);
-                               byte dc = (r_ptr->d_char);
-                               byte ca = (r_ptr->x_attr);
-                               byte cc = (r_ptr->x_char);
+                               byte da = r_ptr->d_attr;
+                               byte dc = r_ptr->d_char;
+                               byte ca = r_ptr->x_attr;
+                               byte cc = r_ptr->x_char;
 
                                /* Label the object */
 #ifdef JP
@@ -3995,7 +3998,6 @@ void do_cmd_visuals(void)
                                                   r, (r_name + r_ptr->name)));
 #endif
 
-
                                /* Label the Default values */
 #ifdef JP
                                Term_putstr(10, 19, -1, TERM_WHITE,
@@ -4006,13 +4008,7 @@ void do_cmd_visuals(void)
 #endif
 
                                Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
-
-                               a = da;
-                               c = dc;
-                               if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
-
-                               Term_putch(43, 19, a, c);
-                               if (use_bigtile) Term_putch(43 + 1, 19, a2, c2);
+                               Term_queue_bigchar(43, 19, da, dc, 0, 0);
 
                                /* Label the Current values */
 #ifdef JP
@@ -4024,22 +4020,15 @@ void do_cmd_visuals(void)
 #endif
 
                                Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
-
-                               a = ca;
-                               c = cc;
-                               if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
-
-                               Term_putch(43, 20, a, c);
-                               if (use_bigtile) Term_putch(43 + 1, 20, a2, c2);
-
+                               Term_queue_bigchar(43, 20, ca, cc, 0, 0);
 
                                /* Prompt */
 #ifdef JP
                                Term_putstr(0, 22, -1, TERM_WHITE,
-                                           "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
+                                           "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
 #else
                                Term_putstr(0, 22, -1, TERM_WHITE,
-                                           "Command (n/N/^N/a/A/^A/c/C/^C): ");
+                                           "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
 #endif
 
                                /* Get a command */
@@ -4055,47 +4044,71 @@ void do_cmd_visuals(void)
                                switch (c)
                                {
                                case 'n':
-                                       cmd_visuals_aux(i, &r, max_r_idx);
+                                       {
+                                               int prev_r = r;
+                                               do
+                                               {
+                                                       if (!cmd_visuals_aux(i, &r, max_r_idx))
+                                                       {
+                                                               r = prev_r;
+                                                               break;
+                                                       }
+                                               }
+                                               while (!r_info[r].name);
+                                       }
                                        break;
                                case 'a':
                                        t = (int)r_ptr->x_attr;
-                                       cmd_visuals_aux(i, &t, 256);
+                                       (void)cmd_visuals_aux(i, &t, 256);
                                        r_ptr->x_attr = (byte)t;
+                                       need_redraw = TRUE;
                                        break;
                                case 'c':
                                        t = (int)r_ptr->x_char;
-                                       cmd_visuals_aux(i, &t, 256);
+                                       (void)cmd_visuals_aux(i, &t, 256);
                                        r_ptr->x_char = (byte)t;
+                                       need_redraw = TRUE;
+                                       break;
+                               case 'v':
+                                       do_cmd_knowledge_monsters(&need_redraw, TRUE, r);
+
+                                       /* Clear screen */
+                                       Term_clear();
+                                       print_visuals_menu(choice_msg);
                                        break;
                                }
                        }
+
+                       break;
                }
 
-               /* Modify object attr/chars */
-               else if (i == '7')
+               /* Modify object attr/chars (numeric operation) */
+               case '5':
                {
+#ifdef JP
+                       static cptr choice_msg = "¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹";
+#else
+                       static cptr choice_msg = "Change object attr/chars";
+#endif
                        static int k = 0;
 
-                       /* Prompt */
 #ifdef JP
-                       prt("¥³¥Þ¥ó¥É: ¥¢¥¤¥Æ¥à¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
+                       prt(format("¥³¥Þ¥ó¥É: %s", choice_msg), 15, 0);
 #else
-                       prt("Command: Change object attr/chars", 15, 0);
+                       prt(format("Command: %s", choice_msg), 15, 0);
 #endif
 
-
                        /* Hack -- query until done */
                        while (1)
                        {
                                object_kind *k_ptr = &k_info[k];
-                               byte a, a2;
-                               char c, c2;
+                               char c;
                                int t;
 
-                               byte da = (byte)k_ptr->d_attr;
-                               byte dc = (byte)k_ptr->d_char;
-                               byte ca = (byte)k_ptr->x_attr;
-                               byte cc = (byte)k_ptr->x_char;
+                               byte da = k_ptr->d_attr;
+                               byte dc = k_ptr->d_char;
+                               byte ca = k_ptr->x_attr;
+                               byte cc = k_ptr->x_char;
 
                                /* Label the object */
 #ifdef JP
@@ -4108,7 +4121,6 @@ void do_cmd_visuals(void)
                                                   k, (k_name + k_ptr->name)));
 #endif
 
-
                                /* Label the Default values */
 #ifdef JP
                                Term_putstr(10, 19, -1, TERM_WHITE,
@@ -4119,13 +4131,7 @@ void do_cmd_visuals(void)
 #endif
 
                                Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
-                               a = da;
-                               c = dc;
-                               if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
-
-                               Term_putch(43, 19, a, c);
-                               if (use_bigtile) Term_putch(43 + 1, 19, a2, c2);
-
+                               Term_queue_bigchar(43, 19, da, dc, 0, 0);
 
                                /* Label the Current values */
 #ifdef JP
@@ -4137,21 +4143,15 @@ void do_cmd_visuals(void)
 #endif
 
                                Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
-                               a = ca;
-                               c = cc;
-                               if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
-
-                               Term_putch(43, 20, a, c);
-                               if (use_bigtile) Term_putch(43 + 1, 20, a2, c2);
-
+                               Term_queue_bigchar(43, 20, ca, cc, 0, 0);
 
                                /* Prompt */
 #ifdef JP
                                Term_putstr(0, 22, -1, TERM_WHITE,
-                                           "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
+                                           "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
 #else
                                Term_putstr(0, 22, -1, TERM_WHITE,
-                                           "Command (n/N/^N/a/A/^A/c/C/^C): ");
+                                           "Command (n/N/^N/a/A/^A/c/C/^C/v/V/^V): ");
 #endif
 
                                /* Get a command */
@@ -4167,60 +4167,85 @@ void do_cmd_visuals(void)
                                switch (c)
                                {
                                case 'n':
-                                       cmd_visuals_aux(i, &k, max_k_idx);
+                                       {
+                                               int prev_k = k;
+                                               do
+                                               {
+                                                       if (!cmd_visuals_aux(i, &k, max_k_idx))
+                                                       {
+                                                               k = prev_k;
+                                                               break;
+                                                       }
+                                               }
+                                               while (!k_info[k].name || k_info[k].flavor);
+                                       }
                                        break;
                                case 'a':
-                                       t = (int)k_info[k].x_attr;
-                                       cmd_visuals_aux(i, &t, 256);
-                                       k_info[k].x_attr = (byte)t;
+                                       t = (int)k_ptr->x_attr;
+                                       (void)cmd_visuals_aux(i, &t, 256);
+                                       k_ptr->x_attr = (byte)t;
+                                       need_redraw = TRUE;
                                        break;
                                case 'c':
-                                       t = (int)k_info[k].x_char;
-                                       cmd_visuals_aux(i, &t, 256);
-                                       k_info[k].x_char = (byte)t;
+                                       t = (int)k_ptr->x_char;
+                                       (void)cmd_visuals_aux(i, &t, 256);
+                                       k_ptr->x_char = (byte)t;
+                                       need_redraw = TRUE;
+                                       break;
+                               case 'v':
+                                       do_cmd_knowledge_objects(&need_redraw, TRUE, k);
+
+                                       /* Clear screen */
+                                       Term_clear();
+                                       print_visuals_menu(choice_msg);
                                        break;
                                }
                        }
+
+                       break;
                }
 
-               /* Modify feature attr/chars */
-               else if (i == '8')
+               /* Modify feature attr/chars (numeric operation) */
+               case '6':
                {
+#ifdef JP
+                       static cptr choice_msg = "ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹";
+#else
+                       static cptr choice_msg = "Change feature attr/chars";
+#endif
                        static int f = 0;
+                       static int lighting_level = F_LIT_STANDARD;
 
-                       /* Prompt */
 #ifdef JP
-                       prt("¥³¥Þ¥ó¥É: ÃÏ·Á¤Î[¿§/ʸ»ú]¤òÊѹ¹¤·¤Þ¤¹", 15, 0);
+                       prt(format("¥³¥Þ¥ó¥É: %s", choice_msg), 15, 0);
 #else
-                       prt("Command: Change feature attr/chars", 15, 0);
+                       prt(format("Command: %s", choice_msg), 15, 0);
 #endif
 
-
                        /* Hack -- query until done */
                        while (1)
                        {
                                feature_type *f_ptr = &f_info[f];
-                               byte a, a2;
-                               char c, c2;
+                               char c;
                                int t;
 
-                               byte da = (byte)f_ptr->d_attr;
-                               byte dc = (byte)f_ptr->d_char;
-                               byte ca = (byte)f_ptr->x_attr;
-                               byte cc = (byte)f_ptr->x_char;
+                               byte da = f_ptr->d_attr[lighting_level];
+                               byte dc = f_ptr->d_char[lighting_level];
+                               byte ca = f_ptr->x_attr[lighting_level];
+                               byte cc = f_ptr->x_char[lighting_level];
 
                                /* Label the object */
+                               prt("", 17, 5);
 #ifdef JP
                                Term_putstr(5, 17, -1, TERM_WHITE,
-                                           format("ÃÏ·Á = %d, Ì¾Á° = %-40.40s",
-                                                  f, (f_name + f_ptr->name)));
+                                           format("ÃÏ·Á = %d, Ì¾Á° = %s, ÌÀÅÙ = %s",
+                                                  f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
 #else
                                Term_putstr(5, 17, -1, TERM_WHITE,
-                                           format("Terrain = %d, Name = %-40.40s",
-                                                  f, (f_name + f_ptr->name)));
+                                           format("Terrain = %d, Name = %s, Lighting = %s",
+                                                  f, (f_name + f_ptr->name), lighting_level_str[lighting_level]));
 #endif
 
-
                                /* Label the Default values */
 #ifdef JP
                                Term_putstr(10, 19, -1, TERM_WHITE,
@@ -4231,13 +4256,8 @@ void do_cmd_visuals(void)
 #endif
 
                                Term_putstr(40, 19, -1, TERM_WHITE, empty_symbol);
-                               a = da;
-                               c = dc;
-                               if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
-
-                               Term_putch(43, 19, a, c);
-                               if (use_bigtile) Term_putch(43 + 1, 19, a2, c2);
 
+                               Term_queue_bigchar(43, 19, da, dc, 0, 0);
 
                                /* Label the Current values */
 #ifdef JP
@@ -4249,21 +4269,15 @@ void do_cmd_visuals(void)
 #endif
 
                                Term_putstr(40, 20, -1, TERM_WHITE, empty_symbol);
-                               a = ca;
-                               c = cc;
-                               if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
-
-                               Term_putch(43, 20, a, c);
-                               if (use_bigtile) Term_putch(43 + 1, 20, a2, c2);
-
+                               Term_queue_bigchar(43, 20, ca, cc, 0, 0);
 
                                /* Prompt */
 #ifdef JP
                                Term_putstr(0, 22, -1, TERM_WHITE,
-                                           "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C): ");
+                                           "¥³¥Þ¥ó¥É (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
 #else
                                Term_putstr(0, 22, -1, TERM_WHITE,
-                                           "Command (n/N/^N/a/A/^A/c/C/^C): ");
+                                           "Command (n/N/^N/a/A/^A/c/C/^C/l/L/^L/d/D/^D/v/V/^V): ");
 #endif
 
                                /* Get a command */
@@ -4279,27 +4293,74 @@ void do_cmd_visuals(void)
                                switch (c)
                                {
                                case 'n':
-                                       cmd_visuals_aux(i, &f, max_f_idx);
+                                       {
+                                               int prev_f = f;
+                                               do
+                                               {
+                                                       if (!cmd_visuals_aux(i, &f, max_f_idx))
+                                                       {
+                                                               f = prev_f;
+                                                               break;
+                                                       }
+                                               }
+                                               while (!f_info[f].name || (f_info[f].mimic != f));
+                                       }
                                        break;
                                case 'a':
-                                       t = (int)f_info[f].x_attr;
-                                       cmd_visuals_aux(i, &t, 256);
-                                       f_info[f].x_attr = (byte)t;
+                                       t = (int)f_ptr->x_attr[lighting_level];
+                                       (void)cmd_visuals_aux(i, &t, 256);
+                                       f_ptr->x_attr[lighting_level] = (byte)t;
+                                       need_redraw = TRUE;
                                        break;
                                case 'c':
-                                       t = (int)f_info[f].x_char;
-                                       cmd_visuals_aux(i, &t, 256);
-                                       f_info[f].x_char = (byte)t;
+                                       t = (int)f_ptr->x_char[lighting_level];
+                                       (void)cmd_visuals_aux(i, &t, 256);
+                                       f_ptr->x_char[lighting_level] = (byte)t;
+                                       need_redraw = TRUE;
+                                       break;
+                               case 'l':
+                                       (void)cmd_visuals_aux(i, &lighting_level, F_LIT_MAX);
+                                       break;
+                               case 'd':
+                                       apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
+                                       need_redraw = TRUE;
+                                       break;
+                               case 'v':
+                                       do_cmd_knowledge_features(&need_redraw, TRUE, f, &lighting_level);
+
+                                       /* Clear screen */
+                                       Term_clear();
+                                       print_visuals_menu(choice_msg);
                                        break;
                                }
                        }
+
+                       break;
                }
 
-#endif
+               /* Modify monster attr/chars (visual mode) */
+               case '7':
+                       do_cmd_knowledge_monsters(&need_redraw, TRUE, -1);
+                       break;
 
-               /* Reset visuals */
-               else if (i == '0')
+               /* Modify object attr/chars (visual mode) */
+               case '8':
+                       do_cmd_knowledge_objects(&need_redraw, TRUE, -1);
+                       break;
+
+               /* Modify feature attr/chars (visual mode) */
+               case '9':
                {
+                       int lighting_level = F_LIT_STANDARD;
+                       do_cmd_knowledge_features(&need_redraw, TRUE, -1, &lighting_level);
+                       break;
+               }
+
+#endif /* ALLOW_VISUALS */
+
+               /* Reset visuals */
+               case 'R':
+               case 'r':
                        /* Reset */
                        reset_visuals();
 
@@ -4310,21 +4371,23 @@ void do_cmd_visuals(void)
                        msg_print("Visual attr/char tables reset.");
 #endif
 
-               }
+                       need_redraw = TRUE;
+                       break;
 
                /* Unknown option */
-               else
-               {
+               default:
                        bell();
+                       break;
                }
 
                /* Flush messages */
                msg_print(NULL);
        }
 
-
        /* Restore the screen */
        screen_load();
+
+       if (need_redraw) do_cmd_redraw();
 }
 
 
@@ -4417,7 +4480,7 @@ void do_cmd_colors(void)
                        sprintf(tmp, "%s.prf", player_name);
 
                        /* Query */
-                       if (!askfor_aux(tmp, 70)) continue;
+                       if (!askfor(tmp, 70)) continue;
 
                        /* Process the given filename */
                        (void)process_pref_file(tmp);
@@ -4456,7 +4519,7 @@ void do_cmd_colors(void)
                        sprintf(tmp, "%s.prf", player_name);
 
                        /* Get a filename */
-                       if (!askfor_aux(tmp, 70)) continue;
+                       if (!askfor(tmp, 70)) continue;
 
                        /* Build the filename */
                        path_build(buf, sizeof(buf), ANGBAND_DIR_USER, tmp);
@@ -4856,9 +4919,6 @@ static cptr do_cmd_feeling_text_lucky[11] =
  */
 void do_cmd_feeling(void)
 {
-       /* Verify the feeling */
-       if (feeling > 10) feeling = 10;
-
        /* No useful feeling in quests */
        if (p_ptr->inside_quest && !random_quest_number(dun_level))
        {
@@ -4913,20 +4973,13 @@ void do_cmd_feeling(void)
        }
 
        /* Display the feeling */
-       if (turn - old_turn >= (150 - dun_level)*TURNS_PER_TICK || cheat_xtra)
-       {
-               if (p_ptr->muta3 & MUT3_GOOD_LUCK) msg_print(do_cmd_feeling_text_lucky[feeling]);
-               else {
-                                       if((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)){
-                                               msg_print(do_cmd_feeling_text_combat[feeling]);
-                                       }else
-                                               msg_print(do_cmd_feeling_text[feeling]);
-                               }
-       }
+       if (p_ptr->muta3 & MUT3_GOOD_LUCK)
+               msg_print(do_cmd_feeling_text_lucky[p_ptr->feeling]);
+       else if (p_ptr->pseikaku == SEIKAKU_COMBAT ||
+                inventory[INVEN_BOW].name1 == ART_CRIMSON)
+               msg_print(do_cmd_feeling_text_combat[p_ptr->feeling]);
        else
-       {
-               msg_print(do_cmd_feeling_text[0]);
-       }
+               msg_print(do_cmd_feeling_text[p_ptr->feeling]);
 }
 
 
@@ -4994,6 +5047,7 @@ static cptr monster_group_text[] =
        "ÊÉ/¿¢Êª/µ¤ÂÎ",
        "¤ª¤Ð¤±¥­¥Î¥³",
        "µåÂÎ",
+       "¥×¥ì¥¤¥ä¡¼",
 #else
        "Uniques",
        "Ridable monsters",
@@ -5052,6 +5106,7 @@ static cptr monster_group_text[] =
        "Wall/Plant/Gas",
        "Mushroom patch",
        "Ball",
+       "Player",
 #endif
        NULL
 };
@@ -5061,7 +5116,7 @@ static cptr monster_group_text[] =
  * Symbols of monsters in each group. Note the "Uniques" group
  * is handled differently.
  */
-static cptr monster_group_char[] = 
+static cptr monster_group_char[] =
 {
        (char *) -1L,
        (char *) -2L,
@@ -5116,10 +5171,11 @@ static cptr monster_group_char[] =
        "X",
        "Y",
        "Z",
-       "$!?=&`.|/\\~[]()>",
-       "#",
+       "!$&()+./=>?[\\]`{|~",
+       "#%",
        ",",
        "*",
+       "@",
        NULL
 };
 
@@ -5153,7 +5209,7 @@ static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
  * of monsters in the group.
  *
  * mode & 0x01 : check for non-empty group
- * mode & 0x02 : cheat?
+ * mode & 0x02 : visual operation only
  */
 static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
 {
@@ -5179,7 +5235,7 @@ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
                if (!r_ptr->name) continue ;
 
                /* Require known monsters */
-               if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights ) continue;
+               if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue;
 
                if (grp_unique)
                {
@@ -5194,7 +5250,7 @@ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
                else
                {
                        /* Check for race in the group */
-                       if (!strchr(group_char, r_ptr->d_char)) continue;
+                       if (!my_strchr(group_char, r_ptr->d_char)) continue;
                }
 
                /* Add the race */
@@ -5205,7 +5261,7 @@ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
        }
 
        /* Terminate the list */
-       mon_idx[mon_cnt] = 0;
+       mon_idx[mon_cnt] = -1;
 
        /* Select the sort method */
        ang_sort_comp = ang_sort_comp_monster_level;
@@ -5264,6 +5320,7 @@ static cptr object_group_text[] =
        "´§",   /* "Crowns" */
        "¥Ö¡¼¥Ä",       /* "Boots" */
        "ËâË¡½ñ",
+       "²¿¤«",
 #else
        "Mushrooms",
        "Potions",
@@ -5304,6 +5361,7 @@ static cptr object_group_text[] =
        "Crowns",
        "Boots",
        "Spellbooks",
+       "Something",
 #endif
        NULL
 };
@@ -5353,15 +5411,19 @@ static byte object_group_tval[] =
        TV_CROWN,
        TV_BOOTS,
        TV_LIFE_BOOK, /* Hack -- all spellbooks */
-       0
+       0,
+       0,
 };
 
 
 /*
- * Build a list of monster indexes in the given group. Return the number
- * of monsters in the group.
+ * Build a list of object indexes in the given group. Return the number
+ * of objects in the group.
+ *
+ * mode & 0x01 : check for non-empty group
+ * mode & 0x02 : visual operation only
  */
-static int collect_objects(int grp_cur, int object_idx[])
+static int collect_objects(int grp_cur, int object_idx[], byte mode)
 {
        int i, j, k, object_cnt = 0;
 
@@ -5371,43 +5433,58 @@ static int collect_objects(int grp_cur, int object_idx[])
        /* Check every object */
        for (i = 0; i < max_k_idx; i++)
        {
-               /* Access the race */
+               /* Access the object */
                object_kind *k_ptr = &k_info[i];
 
                /* Skip empty objects */
                if (!k_ptr->name) continue;
 
-               /* Skip non-flavoured objects */
-               if (!k_ptr->flavor && !p_ptr->wizard) continue;
-
-               /* Skip items with no distribution (special artifacts) */
-               for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
-               if (!(k))  continue; 
-
-               /* Require objects ever seen*/
-               if (!k_ptr->aware && !p_ptr->wizard) continue;
-
-               /* Check for race in the group */
+               if (mode & 0x02)
+               {
+                       /* Any objects will be displayed */
+               }
+               else
+               {
+                       if (!p_ptr->wizard)
+                       {
+                               /* Skip non-flavoured objects */
+                               if (!k_ptr->flavor) continue;
+
+                               /* Require objects ever seen */
+                               if (!k_ptr->aware) continue;
+                       }
+
+                       /* Skip items with no distribution (special artifacts) */
+                       for (j = 0, k = 0; j < 4; j++) k += k_ptr->chance[j];
+                       if (!k) continue;
+               }
+
+               /* Check for objects in the group */
                if (TV_LIFE_BOOK == group_tval)
                {
                        /* Hack -- All spell books */
                        if (TV_LIFE_BOOK <= k_ptr->tval && k_ptr->tval <= TV_HISSATSU_BOOK)
                        {
-                               /* Add the race */
+                               /* Add the object */
                                object_idx[object_cnt++] = i;
                        }
+                       else continue;
                }
                else if (k_ptr->tval == group_tval)
                {
-                       /* Add the race */
+                       /* Add the object */
                        object_idx[object_cnt++] = i;
                }
+               else continue;
+
+               /* XXX Hack -- Just checking for non-empty group */
+               if (mode & 0x01) break;
        }
 
        /* Terminate the list */
-       object_idx[object_cnt] = 0;
+       object_idx[object_cnt] = -1;
 
-       /* Return the number of races */
+       /* Return the number of objects */
        return object_cnt;
 }
 
@@ -5425,8 +5502,10 @@ static cptr feature_group_text[] =
 /*
  * Build a list of feature indexes in the given group. Return the number
  * of features in the group.
+ *
+ * mode & 0x01 : check for non-empty group
  */
-static int collect_features(int grp_cur, int *feat_idx)
+static int collect_features(int grp_cur, int *feat_idx, byte mode)
 {
        int i, feat_cnt = 0;
 
@@ -5434,7 +5513,7 @@ static int collect_features(int grp_cur, int *feat_idx)
        (void)grp_cur;
 
        /* Check every feature */
-       for (i = 1; i < max_f_idx; i++)
+       for (i = 0; i < max_f_idx; i++)
        {
                /* Access the index */
                feature_type *f_ptr = &f_info[i];
@@ -5447,10 +5526,13 @@ static int collect_features(int grp_cur, int *feat_idx)
 
                /* Add the index */
                feat_idx[feat_cnt++] = i;
+
+               /* XXX Hack -- Just checking for non-empty group */
+               if (mode & 0x01) break;
        }
 
        /* Terminate the list */
-       feat_idx[feat_cnt] = 0;
+       feat_idx[feat_cnt] = -1;
 
        /* Return the number of races */
        return feat_cnt;
@@ -5668,23 +5750,23 @@ static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, by
        if (o_ptr->tval != tval) return;
 
        /* Identified items only */
-       if (!object_known_p(o_ptr)) return;
+       if (!object_is_known(o_ptr)) return;
 
        /*
         * HACK:Ring of Lordly protection and Dragon equipment
         * have random resistances.
         */
-       if (((TV_EQUIP_BEGIN <= tval) && (tval <= TV_EQUIP_END) && o_ptr->name2)
+       if ((object_is_wearable(o_ptr) && object_is_ego(o_ptr))
            || ((tval == TV_AMULET) && (o_ptr->sval == SV_AMULET_RESISTANCE))
            || ((tval == TV_RING) && (o_ptr->sval == SV_RING_LORDLY))
            || ((tval == TV_SHIELD) && (o_ptr->sval == SV_DRAGON_SHIELD))
            || ((tval == TV_HELM) && (o_ptr->sval == SV_DRAGON_HELM))
            || ((tval == TV_GLOVES) && (o_ptr->sval == SV_SET_OF_DRAGON_GLOVES))
            || ((tval == TV_BOOTS) && (o_ptr->sval == SV_PAIR_OF_DRAGON_GREAVE))
-           || o_ptr->art_name || o_ptr->name1)
+           || object_is_artifact(o_ptr))
        {
                int i = 0;
-               object_desc(o_name, o_ptr, TRUE, 0);
+               object_desc(o_name, o_ptr, OD_NAME_ONLY);
 
                while (o_name[i] && (i < 26))
                {
@@ -5742,7 +5824,7 @@ static void do_cmd_knowledge_inven_aux(FILE *fff, object_type *o_ptr, int *j, by
                        print_flag(TR_TELEPATHY);
                        print_flag(TR_SLOW_DIGEST);
                        print_flag(TR_REGEN);
-                       print_flag(TR_FEATHER);
+                       print_flag(TR_LEVITATION);
 
                        fputc('\n', fff);
                }
@@ -5786,7 +5868,7 @@ static void do_cmd_knowledge_inven(void)
        }
        fprintf(fff, "%s\n", inven_res_label);
 
-       for (tval = TV_EQUIP_BEGIN; tval <= TV_EQUIP_END; tval++)
+       for (tval = TV_WEARABLE_BEGIN; tval <= TV_WEARABLE_END; tval++)
        {
                if (j != 0)
                {
@@ -6368,10 +6450,10 @@ static void do_cmd_knowledge_artifacts(void)
                                next_o_idx = o_ptr->next_o_idx;
 
                                /* Ignore non-artifacts */
-                               if (!artifact_p(o_ptr)) continue;
+                               if (!object_is_fixed_artifact(o_ptr)) continue;
 
                                /* Ignore known items */
-                               if (object_known_p(o_ptr)) continue;
+                               if (object_is_known(o_ptr)) continue;
 
                                /* Note the artifact */
                                okay[o_ptr->name1] = FALSE;
@@ -6388,10 +6470,10 @@ static void do_cmd_knowledge_artifacts(void)
                if (!o_ptr->k_idx) continue;
 
                /* Ignore non-artifacts */
-               if (!artifact_p(o_ptr)) continue;
+               if (!object_is_fixed_artifact(o_ptr)) continue;
 
                /* Ignore known items */
-               if (object_known_p(o_ptr)) continue;
+               if (object_is_known(o_ptr)) continue;
 
                /* Note the artifact */
                okay[o_ptr->name1] = FALSE;
@@ -6440,8 +6522,11 @@ static void do_cmd_knowledge_artifacts(void)
                        /* Make it an artifact */
                        q_ptr->name1 = (byte)who[k];
 
+                       /* Display as if known */
+                       q_ptr->ident |= IDENT_STORE;
+
                        /* Describe the artifact */
-                       object_desc_store(base_name, q_ptr, FALSE, 0);
+                       object_desc(base_name, q_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
                }
 
                /* Hack -- Build the artifact name */
@@ -6677,7 +6762,7 @@ static void do_cmd_knowledge_spell_exp(void)
                        if (s_ptr->slevel >= 99) continue;
                        spell_exp = p_ptr->spell_exp[i];
                        exp_level = spell_exp_level(spell_exp);
-                       fprintf(fff, "%-25s ", spell_names[technic2magic(p_ptr->realm1) - 1][i]);
+                       fprintf(fff, "%-25s ", do_spell(p_ptr->realm1, i, SPELL_NAME));
                        if (p_ptr->realm1 == REALM_HISSATSU)
                                fprintf(fff, "[--]");
                        else
@@ -6712,7 +6797,7 @@ static void do_cmd_knowledge_spell_exp(void)
 
                        spell_exp = p_ptr->spell_exp[i + 32];
                        exp_level = spell_exp_level(spell_exp);
-                       fprintf(fff, "%-25s ", spell_names[technic2magic(p_ptr->realm2) - 1][i]);
+                       fprintf(fff, "%-25s ", do_spell(p_ptr->realm2, i, SPELL_NAME));
                        if (exp_level >= EXP_LEVEL_EXPERT) fprintf(fff, "!");
                        else fprintf(fff, " ");
                        fprintf(fff, "%s", exp_level_str[exp_level]);
@@ -6799,25 +6884,25 @@ void plural_aux(char *Name)
 {
        int NameLen = strlen(Name);
 
-       if (strstr(Name, "Disembodied hand"))
+       if (my_strstr(Name, "Disembodied hand"))
        {
                strcpy(Name, "Disembodied hands that strangled people");
        }
-       else if (strstr(Name, "Colour out of space"))
+       else if (my_strstr(Name, "Colour out of space"))
        {
                strcpy(Name, "Colours out of space");
        }
-       else if (strstr(Name, "stairway to hell"))
+       else if (my_strstr(Name, "stairway to hell"))
        {
                strcpy(Name, "stairways to hell");
        }
-       else if (strstr(Name, "Dweller on the threshold"))
+       else if (my_strstr(Name, "Dweller on the threshold"))
        {
                strcpy(Name, "Dwellers on the threshold");
        }
-       else if (strstr(Name, " of "))
+       else if (my_strstr(Name, " of "))
        {
-               cptr aider = strstr(Name, " of ");
+               cptr aider = my_strstr(Name, " of ");
                char dummy[80];
                int i = 0;
                cptr ctr = Name;
@@ -6841,7 +6926,7 @@ void plural_aux(char *Name)
                strcpy(&(dummy[i+1]), aider);
                strcpy(Name, dummy);
        }
-       else if (strstr(Name, "coins"))
+       else if (my_strstr(Name, "coins"))
        {
                char dummy[80];
                strcpy(dummy, "piles of ");
@@ -6849,7 +6934,7 @@ void plural_aux(char *Name)
                strcpy(Name, dummy);
                return;
        }
-       else if (strstr(Name, "Manes"))
+       else if (my_strstr(Name, "Manes"))
        {
                return;
        }
@@ -7117,14 +7202,14 @@ static void do_cmd_knowledge_kill_count(void)
                        {
 #ifdef JP
                                /* p,t¤Ï¿Í¤È¿ô¤¨¤ë by ita*/
-                               if(strchr("pt",r_ptr->d_char))
+                               if(my_strchr("pt",r_ptr->d_char))
                                        fprintf(fff, "     %3d ¿Í¤Î %s\n", This, r_name + r_ptr->name);
                                else
                                        fprintf(fff, "     %3d É¤¤Î %s\n", This, r_name + r_ptr->name);
 #else
                                if (This < 2)
                                {
-                                       if (strstr(r_name + r_ptr->name, "coins"))
+                                       if (my_strstr(r_name + r_ptr->name, "coins"))
                                        {
                                                fprintf(fff, "     1 pile of %s\n", (r_name + r_ptr->name));
                                        }
@@ -7336,8 +7421,8 @@ static void display_visual_list(int col, int row, int height, int width, byte at
                /* Display columns until done */
                for (j = 0; j < width; j++)
                {
-                       byte a, a2;
-                       char c, c2;
+                       byte a;
+                       char c;
                        int x = col + j;
                        int y = row + i;
                        int ia, ic;
@@ -7359,13 +7444,8 @@ static void display_visual_list(int col, int row, int height, int width, byte at
                        /* Force correct code for both ASCII character and tile */
                        if (c & 0x80) a |= 0x80;
 
-                       if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
-
                        /* Display symbol */
-                       Term_putch(x, y, a, c);
-
-                       /* Second byte */
-                       if (use_bigtile) Term_putch(x + 1, y, a2, c2);
+                       Term_queue_bigchar(x, y, a, c, 0, 0);
                }
        }
 }
@@ -7396,13 +7476,17 @@ static void place_visual_list_cursor(int col, int row, byte a, byte c, byte attr
 static byte attr_idx = 0;
 static byte char_idx = 0;
 
+/* Hack -- for feature lighting */
+static byte attr_idx_feat[F_LIT_MAX];
+static byte char_idx_feat[F_LIT_MAX];
+
 /*
  *  Do visual mode command -- Change symbols
  */
-static bool visual_mode_command(char ch, bool *visual_list_ptr, 
-                               int height, int width, 
-                               byte *attr_top_ptr, byte *char_left_ptr, 
-                               byte *cur_attr_ptr, byte *cur_char_ptr)
+static bool visual_mode_command(char ch, bool *visual_list_ptr,
+                               int height, int width,
+                               byte *attr_top_ptr, byte *char_left_ptr,
+                               byte *cur_attr_ptr, byte *cur_char_ptr, bool *need_redraw)
 {
        static byte attr_old = 0, char_old = 0;
 
@@ -7418,7 +7502,6 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
 
                        return TRUE;
                }
-
                break;
 
        case '\n':
@@ -7427,6 +7510,7 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
                {
                        /* Accept change */
                        *visual_list_ptr = FALSE;
+                       *need_redraw = TRUE;
 
                        return TRUE;
                }
@@ -7450,19 +7534,30 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
 
        case 'C':
        case 'c':
-               /* Set the visual */
-               attr_idx = *cur_attr_ptr;
-               char_idx = *cur_char_ptr;
+               {
+                       int i;
 
+                       /* Set the visual */
+                       attr_idx = *cur_attr_ptr;
+                       char_idx = *cur_char_ptr;
+
+                       /* Hack -- for feature lighting */
+                       for (i = 0; i < F_LIT_MAX; i++)
+                       {
+                               attr_idx_feat[i] = 0;
+                               char_idx_feat[i] = 0;
+                       }
+               }
                return TRUE;
 
        case 'P':
        case 'p':
-               if (attr_idx)
+               if (attr_idx || (!(char_idx & 0x80) && char_idx)) /* Allow ATTR_DARK text */
                {
                        /* Set the char */
                        *cur_attr_ptr = attr_idx;
                        *attr_top_ptr = MAX(0, (*cur_attr_ptr & 0x7f) - 5);
+                       if (!*visual_list_ptr) *need_redraw = TRUE;
                }
 
                if (char_idx)
@@ -7470,6 +7565,7 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
                        /* Set the char */
                        *cur_char_ptr = char_idx;
                        *char_left_ptr = MAX(0, *cur_char_ptr - 10);
+                       if (!*visual_list_ptr) *need_redraw = TRUE;
                }
 
                return TRUE;
@@ -7484,7 +7580,7 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
 
                        if (use_bigtile) eff_width = width / 2;
                        else eff_width = width;
-                                       
+
                        /* Restrict direction */
                        if ((a == 0) && (ddy[d] < 0)) d = 0;
                        if ((c == 0) && (ddx[d] < 0)) d = 0;
@@ -7509,7 +7605,6 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
                        if ((ddy[d] > 0) && *attr_top_ptr + height < MIN(0x7f, (a & 0x7f) + 4)) (*attr_top_ptr)++;
                        return TRUE;
                }
-                               
                break;
        }
 
@@ -7522,16 +7617,14 @@ static bool visual_mode_command(char ch, bool *visual_list_ptr,
  * Display the monsters in a group.
  */
 static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
-       int mon_cur, int mon_top)
+       int mon_cur, int mon_top, bool visual_only)
 {
        int i;
 
        /* Display lines until done */
-       for (i = 0; i < per_page && mon_idx[mon_top + i]; i++)
+       for (i = 0; i < per_page && (mon_idx[mon_top + i] >= 0); i++)
        {
                byte attr;
-               byte a, a2;
-               char c, c2;
 
                /* Get the race index */
                int r_idx = mon_idx[mon_top + i] ;
@@ -7539,7 +7632,6 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
                /* Access the race */
                monster_race *r_ptr = &r_info[r_idx];
 
-
                /* Choose a color */
                attr = ((i + mon_top == mon_cur) ? TERM_L_BLUE : TERM_WHITE);
 
@@ -7549,31 +7641,29 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
                /* Hack -- visual_list mode */
                if (per_page == 1)
                {
-                       c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, 60);
+                       c_prt(attr, format("%02x/%02x", r_ptr->x_attr, r_ptr->x_char), row + i, (p_ptr->wizard || visual_only) ? 56 : 61);
                }
-               else if (p_ptr->wizard) 
+               if (p_ptr->wizard || visual_only)
                {
-                       c_prt(attr, format("%d", r_idx), row + i, 60);
+                       c_prt(attr, format("%d", r_idx), row + i, 62);
                }
 
-               a = r_ptr->x_attr;
-               c = r_ptr->x_char;
-               if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
+               /* Erase chars before overwritten by the race letter */
+               Term_erase(69, row + i, 255);
 
                /* Display symbol */
-               Term_putch(70, row + i, a, c);
+               Term_queue_bigchar(use_bigtile ? 69 : 70, row + i, r_ptr->x_attr, r_ptr->x_char, 0, 0);
 
-               /* Second byte */
-               if (use_bigtile) Term_putch(70 + 1, row + i, a2, c2);
-
-               /* Display kills */
-               if (!(r_ptr->flags1 & RF1_UNIQUE)) put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
+               if (!visual_only)
+               {
+                       /* Display kills */
+                       if (!(r_ptr->flags1 & RF1_UNIQUE)) put_str(format("%5d", r_ptr->r_pkills), row + i, 73);
 #ifdef JP
-               else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "»àË´" : "À¸Â¸"), row + i, 73);
+                       else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "»àË´" : "À¸Â¸"), row + i, 74);
 #else
-               else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? "dead" : "alive"), row + i, 73);
+                       else c_put_str((r_ptr->max_num == 0 ? TERM_L_DARK : TERM_WHITE), (r_ptr->max_num == 0 ? " dead" : "alive"), row + i, 73);
 #endif
-       
+               }
        }
 
        /* Clear remaining lines */
@@ -7587,7 +7677,7 @@ static void display_monster_list(int col, int row, int per_page, s16b mon_idx[],
 /*
  * Display known monsters.
  */
-static void do_cmd_knowledge_monsters(void)
+static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int direct_r_idx)
 {
        int i, len, max;
        int grp_cur, grp_top, old_grp_cur;
@@ -7595,7 +7685,7 @@ static void do_cmd_knowledge_monsters(void)
        int grp_cnt, grp_idx[100];
        int mon_cnt;
        s16b *mon_idx;
-       
+
        int column = 0;
        bool flag;
        bool redraw;
@@ -7606,6 +7696,8 @@ static void do_cmd_knowledge_monsters(void)
        int browser_rows;
        int wid, hgt;
 
+       byte mode;
+
        /* Get size */
        Term_get_size(&wid, &hgt);
 
@@ -7617,21 +7709,39 @@ static void do_cmd_knowledge_monsters(void)
        max = 0;
        grp_cnt = 0;
 
-       /* Check every group */
-       for (i = 0; monster_group_text[i] != NULL; i++)
+       if (direct_r_idx < 0)
        {
-               /* Measure the label */
-               len = strlen(monster_group_text[i]);
+               mode = visual_only ? 0x03 : 0x01;
 
-               /* Save the maximum length */
-               if (len > max) max = len;
-
-               /* See if any monsters are known */
-               if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, 0x01))
+               /* Check every group */
+               for (i = 0; monster_group_text[i] != NULL; i++)
                {
-                       /* Build a list of groups with known monsters */
-                       grp_idx[grp_cnt++] = i;
+                       /* Measure the label */
+                       len = strlen(monster_group_text[i]);
+
+                       /* Save the maximum length */
+                       if (len > max) max = len;
+
+                       /* See if any monsters are known */
+                       if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, mode))
+                       {
+                               /* Build a list of groups with known monsters */
+                               grp_idx[grp_cnt++] = i;
+                       }
                }
+
+               mon_cnt = 0;
+       }
+       else
+       {
+               mon_idx[0] = direct_r_idx;
+               mon_cnt = 1;
+
+               /* Terminate the list */
+               mon_idx[1] = -1;
+
+               (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
+                       &attr_top, &char_left, &r_info[direct_r_idx].x_attr, &r_info[direct_r_idx].x_char, need_redraw);
        }
 
        /* Terminate the list */
@@ -7640,11 +7750,12 @@ static void do_cmd_knowledge_monsters(void)
        old_grp_cur = -1;
        grp_cur = grp_top = 0;
        mon_cur = mon_top = 0;
-       mon_cnt = 0;
 
        flag = FALSE;
        redraw = TRUE;
 
+       mode = visual_only ? 0x02 : 0x00;
+
        while (!flag)
        {
                char ch;
@@ -7653,19 +7764,21 @@ static void do_cmd_knowledge_monsters(void)
                if (redraw)
                {
                        clear_from(0);
-               
+
 #ifdef JP
-                       prt("Ãμ± - ¥â¥ó¥¹¥¿¡¼", 2, 0);
-                       prt("¥°¥ë¡¼¥×", 4, 0);
+                       prt(format("%s - ¥â¥ó¥¹¥¿¡¼", !visual_only ? "Ãμ±" : "ɽ¼¨"), 2, 0);
+                       if (direct_r_idx < 0) prt("¥°¥ë¡¼¥×", 4, 0);
                        prt("̾Á°", 4, max + 3);
-                       if (p_ptr->wizard) prt("Idx", 4, 60);
-                       prt("ʸ»ú »¦³²¿ô", 4, 67);
+                       if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
+                       prt("ʸ»ú", 4, 67);
+                       if (!visual_only) prt("»¦³²¿ô", 4, 72);
 #else
-                       prt("Knowledge - Monsters", 2, 0);
-                       prt("Group", 4, 0);
+                       prt(format("%s - monsters", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
+                       if (direct_r_idx < 0) prt("Group", 4, 0);
                        prt("Name", 4, max + 3);
-                       if (p_ptr->wizard) prt("Idx", 4, 60);
-                       prt("Sym   Kills", 4, 67);
+                       if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
+                       prt("Sym  ", 4, 67);
+                       if (!visual_only) prt(" Kills", 4, 72);
 #endif
 
                        for (i = 0; i < 78; i++)
@@ -7673,46 +7786,52 @@ static void do_cmd_knowledge_monsters(void)
                                Term_putch(i, 5, TERM_WHITE, '=');
                        }
 
-                       for (i = 0; i < browser_rows; i++)
+                       if (direct_r_idx < 0)
                        {
-                               Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
+                               for (i = 0; i < browser_rows; i++)
+                               {
+                                       Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
+                               }
                        }
 
                        redraw = FALSE;
                }
 
-               /* Scroll group list */
-               if (grp_cur < grp_top) grp_top = grp_cur;
-               if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
+               if (direct_r_idx < 0)
+               {
+                       /* Scroll group list */
+                       if (grp_cur < grp_top) grp_top = grp_cur;
+                       if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
 
-               /* Display a list of monster groups */
-               display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
+                       /* Display a list of monster groups */
+                       display_group_list(0, 6, max, browser_rows, grp_idx, monster_group_text, grp_cur, grp_top);
 
-               if (old_grp_cur != grp_cur)
-               {
-                       old_grp_cur = grp_cur;
+                       if (old_grp_cur != grp_cur)
+                       {
+                               old_grp_cur = grp_cur;
 
-                       /* Get a list of monsters in the current group */
-                       mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, 0x00);
-               }
+                               /* Get a list of monsters in the current group */
+                               mon_cnt = collect_monsters(grp_idx[grp_cur], mon_idx, mode);
+                       }
 
-               /* Scroll monster list */
-               while (mon_cur < mon_top)
-                       mon_top = MAX(0, mon_top - browser_rows/2);
-               while (mon_cur >= mon_top + browser_rows)
-                       mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
+                       /* Scroll monster list */
+                       while (mon_cur < mon_top)
+                               mon_top = MAX(0, mon_top - browser_rows/2);
+                       while (mon_cur >= mon_top + browser_rows)
+                               mon_top = MIN(mon_cnt - browser_rows, mon_top + browser_rows/2);
+               }
 
                if (!visual_list)
                {
                        /* Display a list of monsters in the current group */
-                       display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top);
+                       display_monster_list(max + 3, 6, browser_rows, mon_idx, mon_cur, mon_top, visual_only);
                }
                else
                {
                        mon_top = mon_cur;
 
                        /* Display a monster name */
-                       display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top);
+                       display_monster_list(max + 3, 6, 1, mon_idx, mon_cur, mon_top, visual_only);
 
                        /* Display visual list below first monster */
                        display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
@@ -7720,19 +7839,30 @@ static void do_cmd_knowledge_monsters(void)
 
                /* Prompt */
 #ifdef JP
-               prt(format("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë%s%s, ESC", visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
+               prt(format("<Êý¸þ>%s%s%s, ESC",
+                       (!visual_list && !visual_only) ? ", 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë" : "",
+                       visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹",
+                       (attr_idx || char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"),
+                       hgt - 1, 0);
 #else
-               prt(format("<dir>, 'r' to recall%s%s, ESC", visual_list ? ", ENTER to accept" : ", 'v' for visuals", (attr_idx||char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"), hgt - 1, 0);
+               prt(format("<dir>%s%s%s, ESC",
+                       (!visual_list && !visual_only) ? ", 'r' to recall" : "",
+                       visual_list ? ", ENTER to accept" : ", 'v' for visuals",
+                       (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
+                       hgt - 1, 0);
 #endif
 
                /* Get the current monster */
                r_ptr = &r_info[mon_idx[mon_cur]];
 
-               /* Mega Hack -- track this monster race */
-               if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
+               if (!visual_only)
+               {
+                       /* Mega Hack -- track this monster race */
+                       if (mon_cnt) monster_race_track(mon_idx[mon_cur]);
 
-               /* Hack -- handle stuff */
-               handle_stuff();
+                       /* Hack -- handle stuff */
+                       handle_stuff();
+               }
 
                if (visual_list)
                {
@@ -7746,11 +7876,25 @@ static void do_cmd_knowledge_monsters(void)
                {
                        Term_gotoxy(max + 3, 6 + (mon_cur - mon_top));
                }
-       
+
                ch = inkey();
 
                /* Do visual mode command if needed */
-               if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &r_ptr->x_attr, &r_ptr->x_char)) continue;
+               if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &r_ptr->x_attr, &r_ptr->x_char, need_redraw))
+               {
+                       if (direct_r_idx >= 0)
+                       {
+                               switch (ch)
+                               {
+                               case '\n':
+                               case '\r':
+                               case ESCAPE:
+                                       flag = TRUE;
+                                       break;
+                               }
+                       }
+                       continue;
+               }
 
                switch (ch)
                {
@@ -7764,12 +7908,12 @@ static void do_cmd_knowledge_monsters(void)
                        case 'r':
                        {
                                /* Recall on screen */
-                               if (mon_idx[mon_cur])
+                               if (!visual_list && !visual_only && (mon_idx[mon_cur] > 0))
                                {
                                        screen_roff(mon_idx[mon_cur], 0);
 
                                        (void)inkey();
-       
+
                                        redraw = TRUE;
                                }
                                break;
@@ -7794,16 +7938,16 @@ static void do_cmd_knowledge_monsters(void)
  * Display the objects in a group.
  */
 static void display_object_list(int col, int row, int per_page, int object_idx[],
-       int object_cur, int object_top)
+       int object_cur, int object_top, bool visual_only)
 {
        int i;
 
        /* Display lines until done */
-       for (i = 0; i < per_page && object_idx[object_top + i]; i++)
+       for (i = 0; i < per_page && (object_idx[object_top + i] >= 0); i++)
        {
                char o_name[80];
-               byte a, a2;
-               char c, c2;
+               byte a, c;
+               object_kind *flavor_k_ptr;
 
                /* Get the object index */
                int k_idx = object_idx[object_top + i];
@@ -7812,13 +7956,35 @@ static void display_object_list(int col, int row, int per_page, int object_idx[]
                object_kind *k_ptr = &k_info[k_idx];
 
                /* Choose a color */
-               byte attr = (k_ptr->aware ? TERM_WHITE : TERM_SLATE);
-               byte cursor = (k_ptr->aware ? TERM_L_BLUE : TERM_BLUE);
+               byte attr = ((k_ptr->aware || visual_only) ? TERM_WHITE : TERM_SLATE);
+               byte cursor = ((k_ptr->aware || visual_only) ? TERM_L_BLUE : TERM_BLUE);
+
+
+               if (k_ptr->flavor)
+               {
+                       /* Appearance of this object is shuffled */
+                       flavor_k_ptr = &k_info[k_ptr->flavor];
+               }
+               else
+               {
+                       /* Appearance of this object is very normal */
+                       flavor_k_ptr = k_ptr;
+               }
+
+
 
                attr = ((i + object_top == object_cur) ? cursor : attr);
-               
-               /* Tidy name */
-               strip_name(o_name, k_idx);
+
+               if (!k_ptr->flavor || k_ptr->aware)
+               {
+                       /* Tidy name */
+                       strip_name(o_name, k_idx);
+               }
+               else
+               {
+                       /* Flavor name */
+                       strcpy(o_name, k_name + flavor_k_ptr->flavor_name);
+               }
 
                /* Display the name */
                c_prt(attr, o_name, row + i, col);
@@ -7826,30 +7992,18 @@ static void display_object_list(int col, int row, int per_page, int object_idx[]
                /* Hack -- visual_list mode */
                if (per_page == 1)
                {
-                       c_prt(attr, format("%02x/%02x", k_ptr->x_attr, k_ptr->x_char), row + i, 60);
-               }
-               else if (p_ptr->wizard)
-               {
-                       c_prt(attr, format ("%d", k_idx), row + i, 70);
+                       c_prt(attr, format("%02x/%02x", flavor_k_ptr->x_attr, flavor_k_ptr->x_char), row + i, (p_ptr->wizard || visual_only) ? 64 : 68);
                }
-
-               a = k_ptr->flavor ? misc_to_attr[k_ptr->flavor] : k_ptr->x_attr;
-               c = k_ptr->flavor ? misc_to_char[k_ptr->flavor] : k_ptr->x_char;
-
-               /* Symbol is unknown */ 
-               if (!k_ptr->aware && !p_ptr->wizard)
+               if (p_ptr->wizard || visual_only)
                {
-                       c = ' ';
-                       a = TERM_DARK;
+                       c_prt(attr, format("%d", k_idx), row + i, 70);
                }
 
-               if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
+               a = flavor_k_ptr->x_attr;
+               c = flavor_k_ptr->x_char;
 
                /* Display symbol */
-               Term_putch(76, row + i, a, c);
-
-               /* Second byte */
-               if (use_bigtile) Term_putch(76 + 1, row + i, a2, c2);
+               Term_queue_bigchar(use_bigtile ? 76 : 77, row + i, a, c, 0, 0);
        }
 
        /* Clear remaining lines */
@@ -7904,7 +8058,7 @@ static void desc_obj_fake(int k_idx)
 /*
  * Display known objects
  */
-static void do_cmd_knowledge_objects(void)
+static void do_cmd_knowledge_objects(bool *need_redraw, bool visual_only, int direct_k_idx)
 {
        int i, len, max;
        int grp_cur, grp_top, old_grp_cur;
@@ -7923,6 +8077,8 @@ static void do_cmd_knowledge_objects(void)
        int browser_rows;
        int wid, hgt;
 
+       byte mode;
+
        /* Get size */
        Term_get_size(&wid, &hgt);
 
@@ -7934,21 +8090,55 @@ static void do_cmd_knowledge_objects(void)
        max = 0;
        grp_cnt = 0;
 
-       /* Check every group */
-       for (i = 0; object_group_text[i] != NULL; i++)
+       if (direct_k_idx < 0)
        {
-               /* Measure the label */
-               len = strlen(object_group_text[i]);
+               mode = visual_only ? 0x03 : 0x01;
+
+               /* Check every group */
+               for (i = 0; object_group_text[i] != NULL; i++)
+               {
+                       /* Measure the label */
+                       len = strlen(object_group_text[i]);
 
-               /* Save the maximum length */
-               if (len > max) max = len;
+                       /* Save the maximum length */
+                       if (len > max) max = len;
+
+                       /* See if any monsters are known */
+                       if (collect_objects(i, object_idx, mode))
+                       {
+                               /* Build a list of groups with known monsters */
+                               grp_idx[grp_cnt++] = i;
+                       }
+               }
 
-               /* See if any monsters are known */
-               if (collect_objects(i, object_idx))
+               object_old = -1;
+               object_cnt = 0;
+       }
+       else
+       {
+               object_kind *k_ptr = &k_info[direct_k_idx];
+               object_kind *flavor_k_ptr;
+
+               if (k_ptr->flavor)
                {
-                       /* Build a list of groups with known monsters */
-                       grp_idx[grp_cnt++] = i;
+                       /* Appearance of this object is shuffled */
+                       flavor_k_ptr = &k_info[k_ptr->flavor];
                }
+               else
+               {
+                       /* Appearance of this object is very normal */
+                       flavor_k_ptr = k_ptr;
+               }
+
+               object_idx[0] = direct_k_idx;
+               object_old = direct_k_idx;
+               object_cnt = 1;
+
+               /* Terminate the list */
+               object_idx[1] = -1;
+
+               (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
+                       &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw);
        }
 
        /* Terminate the list */
@@ -7957,32 +8147,32 @@ static void do_cmd_knowledge_objects(void)
        old_grp_cur = -1;
        grp_cur = grp_top = 0;
        object_cur = object_top = 0;
-       object_old = -1;
-       object_cnt = 0;
 
        flag = FALSE;
        redraw = TRUE;
 
+       mode = visual_only ? 0x02 : 0x00;
+
        while (!flag)
        {
                char ch;
-               object_kind *k_ptr;
+               object_kind *k_ptr, *flavor_k_ptr;
 
                if (redraw)
                {
                        clear_from(0);
-               
+
 #ifdef JP
-                       prt("Ãμ± - ¥¢¥¤¥Æ¥à", 2, 0);
-                       prt("¥°¥ë¡¼¥×", 4, 0);
+                       prt(format("%s - ¥¢¥¤¥Æ¥à", !visual_only ? "Ãμ±" : "ɽ¼¨"), 2, 0);
+                       if (direct_k_idx < 0) prt("¥°¥ë¡¼¥×", 4, 0);
                        prt("̾Á°", 4, max + 3);
-                       if (p_ptr->wizard) prt("Idx", 4, 70);
-                       prt("ʸ»ú", 4, 75);
+                       if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
+                       prt("ʸ»ú", 4, 74);
 #else
-                       prt("Knowledge - objects", 2, 0);
-                       prt("Group", 4, 0);
+                       prt(format("%s - objects", !visual_only ? "Knowledge" : "Visuals"), 2, 0);
+                       if (direct_k_idx < 0) prt("Group", 4, 0);
                        prt("Name", 4, max + 3);
-                       if (p_ptr->wizard) prt("Idx", 4, 70);
+                       if (p_ptr->wizard || visual_only) prt("Idx", 4, 70);
                        prt("Sym", 4, 75);
 #endif
 
@@ -7991,46 +8181,52 @@ static void do_cmd_knowledge_objects(void)
                                Term_putch(i, 5, TERM_WHITE, '=');
                        }
 
-                       for (i = 0; i < browser_rows; i++)
+                       if (direct_k_idx < 0)
                        {
-                               Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
+                               for (i = 0; i < browser_rows; i++)
+                               {
+                                       Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
+                               }
                        }
 
                        redraw = FALSE;
                }
 
-               /* Scroll group list */
-               if (grp_cur < grp_top) grp_top = grp_cur;
-               if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
+               if (direct_k_idx < 0)
+               {
+                       /* Scroll group list */
+                       if (grp_cur < grp_top) grp_top = grp_cur;
+                       if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
 
-               /* Display a list of object groups */
-               display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
+                       /* Display a list of object groups */
+                       display_group_list(0, 6, max, browser_rows, grp_idx, object_group_text, grp_cur, grp_top);
 
-               if (old_grp_cur != grp_cur)
-               {
-                       old_grp_cur = grp_cur;
+                       if (old_grp_cur != grp_cur)
+                       {
+                               old_grp_cur = grp_cur;
 
-                       /* Get a list of objects in the current group */
-                       object_cnt = collect_objects(grp_idx[grp_cur], object_idx);
-               }
+                               /* Get a list of objects in the current group */
+                               object_cnt = collect_objects(grp_idx[grp_cur], object_idx, mode);
+                       }
 
-               /* Scroll object list */
-               while (object_cur < object_top)
-                       object_top = MAX(0, object_top - browser_rows/2);
-               while (object_cur >= object_top + browser_rows)
-                       object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
+                       /* Scroll object list */
+                       while (object_cur < object_top)
+                               object_top = MAX(0, object_top - browser_rows/2);
+                       while (object_cur >= object_top + browser_rows)
+                               object_top = MIN(object_cnt - browser_rows, object_top + browser_rows/2);
+               }
 
                if (!visual_list)
                {
                        /* Display a list of objects in the current group */
-                       display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top);
+                       display_object_list(max + 3, 6, browser_rows, object_idx, object_cur, object_top, visual_only);
                }
                else
                {
                        object_top = object_cur;
 
                        /* Display a list of objects in the current group */
-                       display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top);
+                       display_object_list(max + 3, 6, 1, object_idx, object_cur, object_top, visual_only);
 
                        /* Display visual list below first object */
                        display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
@@ -8039,29 +8235,51 @@ static void do_cmd_knowledge_objects(void)
                /* Get the current object */
                k_ptr = &k_info[object_idx[object_cur]];
 
-               /* Mega Hack -- track this object */
-               if (object_cnt) object_kind_track(object_idx[object_cur]);
+               if (k_ptr->flavor)
+               {
+                       /* Appearance of this object is shuffled */
+                       flavor_k_ptr = &k_info[k_ptr->flavor];
+               }
+               else
+               {
+                       /* Appearance of this object is very normal */
+                       flavor_k_ptr = k_ptr;
+               }
 
                /* Prompt */
 #ifdef JP
-               prt(format("<Êý¸þ>, 'r'¤Ç»×¤¤½Ð¤ò¸«¤ë%s%s, ESC", k_ptr->flavor ? "" : visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
+               prt(format("<Êý¸þ>%s%s%s, ESC",
+                       (!visual_list && !visual_only) ? ", 'r'¤Ç¾ÜºÙ¤ò¸«¤ë" : "",
+                       visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹",
+                       (attr_idx || char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"),
+                       hgt - 1, 0);
 #else
-               prt(format("<dir>, 'r' to recall%s%s, ESC", k_ptr->flavor ? "" : visual_list ? ", ENTER to accept" : ", 'v' for visuals", (attr_idx||char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"), hgt - 1, 0);
+               prt(format("<dir>%s%s%s, ESC",
+                       (!visual_list && !visual_only) ? ", 'r' to recall" : "",
+                       visual_list ? ", ENTER to accept" : ", 'v' for visuals",
+                       (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
+                       hgt - 1, 0);
 #endif
 
-               /* The "current" object changed */
-               if (object_old != object_idx[object_cur])
+               if (!visual_only)
                {
-                       /* Hack -- handle stuff */
-                       handle_stuff();
+                       /* Mega Hack -- track this object */
+                       if (object_cnt) object_kind_track(object_idx[object_cur]);
+
+                       /* The "current" object changed */
+                       if (object_old != object_idx[object_cur])
+                       {
+                               /* Hack -- handle stuff */
+                               handle_stuff();
 
-                       /* Remember the "current" object */
-                       object_old = object_idx[object_cur];
+                               /* Remember the "current" object */
+                               object_old = object_idx[object_cur];
+                       }
                }
 
                if (visual_list)
                {
-                       place_visual_list_cursor(max + 3, 7, k_ptr->x_attr, k_ptr->x_char, attr_top, char_left);
+                       place_visual_list_cursor(max + 3, 7, flavor_k_ptr->x_attr, flavor_k_ptr->x_char, attr_top, char_left);
                }
                else if (!column)
                {
@@ -8071,12 +8289,25 @@ static void do_cmd_knowledge_objects(void)
                {
                        Term_gotoxy(max + 3, 6 + (object_cur - object_top));
                }
-       
+
                ch = inkey();
 
                /* Do visual mode command if needed */
-               /* Symbol of objects with flavor cannot be changed */
-               if (!k_ptr->flavor && visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &k_ptr->x_attr, &k_ptr->x_char)) continue;
+               if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &flavor_k_ptr->x_attr, &flavor_k_ptr->x_char, need_redraw))
+               {
+                       if (direct_k_idx >= 0)
+                       {
+                               switch (ch)
+                               {
+                               case '\n':
+                               case '\r':
+                               case ESCAPE:
+                                       flag = TRUE;
+                                       break;
+                               }
+                       }
+                       continue;
+               }
 
                switch (ch)
                {
@@ -8090,10 +8321,11 @@ static void do_cmd_knowledge_objects(void)
                        case 'r':
                        {
                                /* Recall on screen */
-                               if (grp_cnt > 0)
+                               if (!visual_list && !visual_only && (grp_cnt > 0))
+                               {
                                        desc_obj_fake(object_idx[object_cur]);
-
-                               redraw = TRUE;
+                                       redraw = TRUE;
+                               }
                                break;
                        }
 
@@ -8111,20 +8343,23 @@ static void do_cmd_knowledge_objects(void)
 }
 
 
-
 /*
  * Display the features in a group.
  */
 static void display_feature_list(int col, int row, int per_page, int *feat_idx,
-       int feat_cur, int feat_top)
+       int feat_cur, int feat_top, bool visual_only, int lighting_level)
 {
-       int i;
+       int lit_col[F_LIT_MAX], i, j;
+       int f_idx_col = use_bigtile ? 62 : 64;
+
+       /* Correct columns 1 and 4 */
+       lit_col[F_LIT_STANDARD] = use_bigtile ? (71 - F_LIT_MAX) : 71;
+       for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
+               lit_col[i] = lit_col[F_LIT_STANDARD] + 2 + (i - F_LIT_NS_BEGIN) * 2 + (use_bigtile ? i : 0);
 
        /* Display lines until done */
-       for (i = 0; i < per_page && feat_idx[feat_top + i]; i++)
+       for (i = 0; i < per_page && (feat_idx[feat_top + i] >= 0); i++)
        {
-               byte a, a2;
-               char c, c2;
                byte attr;
 
                /* Get the index */
@@ -8133,28 +8368,42 @@ static void display_feature_list(int col, int row, int per_page, int *feat_idx,
                /* Access the index */
                feature_type *f_ptr = &f_info[f_idx];
 
+               int row_i = row + i;
+
                /* Choose a color */
                attr = ((i + feat_top == feat_cur) ? TERM_L_BLUE : TERM_WHITE);
 
                /* Display the name */
-               c_prt(attr, f_name + f_ptr->name, row + i, col);
+               c_prt(attr, f_name + f_ptr->name, row_i, col);
 
                /* Hack -- visual_list mode */
                if (per_page == 1)
                {
-                       c_prt(attr, format("%02x/%02x", f_ptr->x_attr, f_ptr->x_char), row + i, 60);
-               }
-
-               a = f_ptr->x_attr;
-               c = f_ptr->x_char;
+                       /* Display lighting level */
+                       c_prt(attr, format("(%s)", lighting_level_str[lighting_level]), row_i, col + 1 + strlen(f_name + f_ptr->name));
 
-               if (use_bigtile) bigtile_attr(&c, &a, &c2, &a2);
+                       c_prt(attr, format("%02x/%02x", f_ptr->x_attr[lighting_level], f_ptr->x_char[lighting_level]), row_i, f_idx_col - ((p_ptr->wizard || visual_only) ? 6 : 2));
+               }
+               if (p_ptr->wizard || visual_only)
+               {
+                       c_prt(attr, format("%d", f_idx), row_i, f_idx_col);
+               }
 
                /* Display symbol */
-               Term_putch(68, row + i, a, c);
+               Term_queue_bigchar(lit_col[F_LIT_STANDARD], row_i, f_ptr->x_attr[F_LIT_STANDARD], f_ptr->x_char[F_LIT_STANDARD], 0, 0);
 
-               /* Second byte */
-               if (use_bigtile) Term_putch(68 + 1, row + i, a2, c2);
+               Term_putch(lit_col[F_LIT_NS_BEGIN], row_i, TERM_SLATE, '(');
+               for (j = F_LIT_NS_BEGIN + 1; j < F_LIT_MAX; j++)
+               {
+                       Term_putch(lit_col[j], row_i, TERM_SLATE, '/');
+               }
+               Term_putch(lit_col[F_LIT_MAX - 1] + (use_bigtile ? 3 : 2), row_i, TERM_SLATE, ')');
+
+               /* Mega-hack -- Use non-standard colour */
+               for (j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++)
+               {
+                       Term_queue_bigchar(lit_col[j] + 1, row_i, f_ptr->x_attr[j], f_ptr->x_char[j], 0, 0);
+               }
        }
 
        /* Clear remaining lines */
@@ -8168,7 +8417,7 @@ static void display_feature_list(int col, int row, int per_page, int *feat_idx,
 /*
  * Interact with feature visuals.
  */
-static void do_cmd_knowledge_features(void)
+static void do_cmd_knowledge_features(bool *need_redraw, bool visual_only, int direct_f_idx, int *lighting_level)
 {
        int i, len, max;
        int grp_cur, grp_top, old_grp_cur;
@@ -8176,7 +8425,7 @@ static void do_cmd_knowledge_features(void)
        int grp_cnt, grp_idx[100];
        int feat_cnt;
        int *feat_idx;
-       
+
        int column = 0;
        bool flag;
        bool redraw;
@@ -8187,6 +8436,13 @@ static void do_cmd_knowledge_features(void)
        int browser_rows;
        int wid, hgt;
 
+       byte attr_old[F_LIT_MAX];
+       byte char_old[F_LIT_MAX];
+       byte *cur_attr_ptr, *cur_char_ptr;
+
+       C_WIPE(attr_old, F_LIT_MAX, byte);
+       C_WIPE(char_old, F_LIT_MAX, byte);
+
        /* Get size */
        Term_get_size(&wid, &hgt);
 
@@ -8198,20 +8454,44 @@ static void do_cmd_knowledge_features(void)
        max = 0;
        grp_cnt = 0;
 
-       /* Check every group */
-       for (i = 0; feature_group_text[i] != NULL; i++)
+       if (direct_f_idx < 0)
+       {
+               /* Check every group */
+               for (i = 0; feature_group_text[i] != NULL; i++)
+               {
+                       /* Measure the label */
+                       len = strlen(feature_group_text[i]);
+
+                       /* Save the maximum length */
+                       if (len > max) max = len;
+
+                       /* See if any features are known */
+                       if (collect_features(i, feat_idx, 0x01))
+                       {
+                               /* Build a list of groups with known features */
+                               grp_idx[grp_cnt++] = i;
+                       }
+               }
+
+               feat_cnt = 0;
+       }
+       else
        {
-               /* Measure the label */
-               len = strlen(feature_group_text[i]);
+               feature_type *f_ptr = &f_info[direct_f_idx];
+
+               feat_idx[0] = direct_f_idx;
+               feat_cnt = 1;
 
-               /* Save the maximum length */
-               if (len > max) max = len;
+               /* Terminate the list */
+               feat_idx[1] = -1;
 
-               /* See if any features are known */
-               if (collect_features(i, feat_idx))
+               (void)visual_mode_command('v', &visual_list, browser_rows - 1, wid - (max + 3),
+                       &attr_top, &char_left, &f_ptr->x_attr[*lighting_level], &f_ptr->x_char[*lighting_level], need_redraw);
+
+               for (i = 0; i < F_LIT_MAX; i++)
                {
-                       /* Build a list of groups with known features */
-                       grp_idx[grp_cnt++] = i;
+                       attr_old[i] = f_ptr->x_attr[i];
+                       char_old[i] = f_ptr->x_char[i];
                }
        }
 
@@ -8221,12 +8501,11 @@ static void do_cmd_knowledge_features(void)
        old_grp_cur = -1;
        grp_cur = grp_top = 0;
        feat_cur = feat_top = 0;
-       feat_cnt = 0;
 
        flag = FALSE;
        redraw = TRUE;
 
-       while ((!flag) && (grp_cnt))
+       while (!flag)
        {
                char ch;
                feature_type *f_ptr;
@@ -8234,57 +8513,88 @@ static void do_cmd_knowledge_features(void)
                if (redraw)
                {
                        clear_from(0);
-               
+
+#ifdef JP
+                       prt("ɽ¼¨ - ÃÏ·Á", 2, 0);
+                       if (direct_f_idx < 0) prt("¥°¥ë¡¼¥×", 4, 0);
+                       prt("̾Á°", 4, max + 3);
+                       if (use_bigtile)
+                       {
+                               if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
+                               prt("ʸ»ú ( l/ d)", 4, 66);
+                       }
+                       else
+                       {
+                               if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
+                               prt("ʸ»ú (l/d)", 4, 68);
+                       }
+#else
                        prt("Visuals - features", 2, 0);
-                       prt("Group", 4, 0);
+                       if (direct_f_idx < 0) prt("Group", 4, 0);
                        prt("Name", 4, max + 3);
-                       prt("Sym", 4, 67);
+                       if (use_bigtile)
+                       {
+                               if (p_ptr->wizard || visual_only) prt("Idx", 4, 62);
+                               prt("Sym ( l/ d)", 4, 67);
+                       }
+                       else
+                       {
+                               if (p_ptr->wizard || visual_only) prt("Idx", 4, 64);
+                               prt("Sym (l/d)", 4, 69);
+                       }
+#endif
 
                        for (i = 0; i < 78; i++)
                        {
                                Term_putch(i, 5, TERM_WHITE, '=');
                        }
 
-                       for (i = 0; i < browser_rows; i++)
+                       if (direct_f_idx < 0)
                        {
-                               Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
+                               for (i = 0; i < browser_rows; i++)
+                               {
+                                       Term_putch(max + 1, 6 + i, TERM_WHITE, '|');
+                               }
                        }
 
                        redraw = FALSE;
                }
 
-               /* Scroll group list */
-               if (grp_cur < grp_top) grp_top = grp_cur;
-               if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
+               if (direct_f_idx < 0)
+               {
+                       /* Scroll group list */
+                       if (grp_cur < grp_top) grp_top = grp_cur;
+                       if (grp_cur >= grp_top + browser_rows) grp_top = grp_cur - browser_rows + 1;
 
-               /* Display a list of feature groups */
-               display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
+                       /* Display a list of feature groups */
+                       display_group_list(0, 6, max, browser_rows, grp_idx, feature_group_text, grp_cur, grp_top);
 
-               if (old_grp_cur != grp_cur)
-               {
-                       old_grp_cur = grp_cur;
+                       if (old_grp_cur != grp_cur)
+                       {
+                               old_grp_cur = grp_cur;
 
-                       /* Get a list of features in the current group */
-                       feat_cnt = collect_features(grp_idx[grp_cur], feat_idx);
-               }
+                               /* Get a list of features in the current group */
+                               feat_cnt = collect_features(grp_idx[grp_cur], feat_idx, 0x00);
+                       }
 
-               /* Scroll feature list */
-               while (feat_cur < feat_top)
-                       feat_top = MAX(0, feat_top - browser_rows/2);
-               while (feat_cur >= feat_top + browser_rows)
-                       feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
+                       /* Scroll feature list */
+                       while (feat_cur < feat_top)
+                               feat_top = MAX(0, feat_top - browser_rows/2);
+                       while (feat_cur >= feat_top + browser_rows)
+                               feat_top = MIN(feat_cnt - browser_rows, feat_top + browser_rows/2);
+               }
 
                if (!visual_list)
                {
                        /* Display a list of features in the current group */
-                       display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top);
+                       display_feature_list(max + 3, 6, browser_rows, feat_idx, feat_cur, feat_top, visual_only, F_LIT_STANDARD);
                }
                else
                {
                        feat_top = feat_cur;
 
                        /* Display a list of features in the current group */
-                       display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top);
+                       display_feature_list(max + 3, 6, 1, feat_idx, feat_cur, feat_top, visual_only, *lighting_level);
 
                        /* Display visual list below first object */
                        display_visual_list(max + 3, 7, browser_rows-1, wid - (max + 3), attr_top, char_left);
@@ -8292,17 +8602,25 @@ static void do_cmd_knowledge_features(void)
 
                /* Prompt */
 #ifdef JP
-               prt(format("<Êý¸þ>%s%s, ESC", visual_list ? ", ENTER¤Ç·èÄê" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹", (attr_idx||char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"), hgt - 1, 0);
+               prt(format("<Êý¸þ>%s, 'd'¤Çɸ½à¸÷¸»¸ú²Ì%s, ESC",
+                       visual_list ? ", ENTER¤Ç·èÄê, 'a'¤ÇÂоÝÌÀÅÙÊѹ¹" : ", 'v'¤Ç¥·¥ó¥Ü¥ëÊѹ¹",
+                       (attr_idx || char_idx) ? ", 'c', 'p'¤Ç¥Ú¡¼¥¹¥È" : ", 'c'¤Ç¥³¥Ô¡¼"),
+                       hgt - 1, 0);
 #else
-               prt(format("<dir>%s%s, ESC", visual_list ? ", ENTER to accept" : ", 'v' for visuals", (attr_idx||char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"), hgt - 1, 0);
+               prt(format("<dir>%s, 'd' for default lighting%s, ESC",
+                       visual_list ? ", ENTER to accept, 'a' for lighting level" : ", 'v' for visuals",
+                       (attr_idx || char_idx) ? ", 'c', 'p' to paste" : ", 'c' to copy"),
+                       hgt - 1, 0);
 #endif
 
                /* Get the current feature */
                f_ptr = &f_info[feat_idx[feat_cur]];
+               cur_attr_ptr = &f_ptr->x_attr[*lighting_level];
+               cur_char_ptr = &f_ptr->x_char[*lighting_level];
 
                if (visual_list)
                {
-                       place_visual_list_cursor(max + 3, 7, f_ptr->x_attr, f_ptr->x_char, attr_top, char_left);
+                       place_visual_list_cursor(max + 3, 7, *cur_attr_ptr, *cur_char_ptr, attr_top, char_left);
                }
                else if (!column)
                {
@@ -8312,11 +8630,112 @@ static void do_cmd_knowledge_features(void)
                {
                        Term_gotoxy(max + 3, 6 + (feat_cur - feat_top));
                }
-       
+
                ch = inkey();
 
+               if (visual_list && ((ch == 'A') || (ch == 'a')))
+               {
+                       int prev_lighting_level = *lighting_level;
+
+                       if (ch == 'A')
+                       {
+                               if (*lighting_level <= 0) *lighting_level = F_LIT_MAX - 1;
+                               else (*lighting_level)--;
+                       }
+                       else
+                       {
+                               if (*lighting_level >= F_LIT_MAX - 1) *lighting_level = 0;
+                               else (*lighting_level)++;
+                       }
+
+                       if (f_ptr->x_attr[prev_lighting_level] != f_ptr->x_attr[*lighting_level])
+                               attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
+
+                       if (f_ptr->x_char[prev_lighting_level] != f_ptr->x_char[*lighting_level])
+                               char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
+
+                       continue;
+               }
+
+               else if ((ch == 'D') || (ch == 'd'))
+               {
+                       byte prev_x_attr = f_ptr->x_attr[*lighting_level];
+                       byte prev_x_char = f_ptr->x_char[*lighting_level];
+
+                       apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char);
+
+                       if (visual_list)
+                       {
+                               if (prev_x_attr != f_ptr->x_attr[*lighting_level])
+                                        attr_top = MAX(0, (f_ptr->x_attr[*lighting_level] & 0x7f) - 5);
+
+                               if (prev_x_char != f_ptr->x_char[*lighting_level])
+                                       char_left = MAX(0, f_ptr->x_char[*lighting_level] - 10);
+                       }
+                       else *need_redraw = TRUE;
+
+                       continue;
+               }
+
                /* Do visual mode command if needed */
-               if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, &f_ptr->x_attr, &f_ptr->x_char)) continue;
+               else if (visual_mode_command(ch, &visual_list, browser_rows-1, wid - (max + 3), &attr_top, &char_left, cur_attr_ptr, cur_char_ptr, need_redraw))
+               {
+                       switch (ch)
+                       {
+                       /* Restore previous visual settings */
+                       case ESCAPE:
+                               for (i = 0; i < F_LIT_MAX; i++)
+                               {
+                                       f_ptr->x_attr[i] = attr_old[i];
+                                       f_ptr->x_char[i] = char_old[i];
+                               }
+
+                               /* Fall through */
+
+                       case '\n':
+                       case '\r':
+                               if (direct_f_idx >= 0) flag = TRUE;
+                               else *lighting_level = F_LIT_STANDARD;
+                               break;
+
+                       /* Preserve current visual settings */
+                       case 'V':
+                       case 'v':
+                               for (i = 0; i < F_LIT_MAX; i++)
+                               {
+                                       attr_old[i] = f_ptr->x_attr[i];
+                                       char_old[i] = f_ptr->x_char[i];
+                               }
+                               *lighting_level = F_LIT_STANDARD;
+                               break;
+
+                       case 'C':
+                       case 'c':
+                               if (!visual_list)
+                               {
+                                       for (i = 0; i < F_LIT_MAX; i++)
+                                       {
+                                               attr_idx_feat[i] = f_ptr->x_attr[i];
+                                               char_idx_feat[i] = f_ptr->x_char[i];
+                                       }
+                               }
+                               break;
+
+                       case 'P':
+                       case 'p':
+                               if (!visual_list)
+                               {
+                                       /* Allow ATTR_DARK text */
+                                       for (i = F_LIT_NS_BEGIN; i < F_LIT_MAX; i++)
+                                       {
+                                               if (attr_idx_feat[i] || (!(char_idx_feat[i] & 0x80) && char_idx_feat[i])) f_ptr->x_attr[i] = attr_idx_feat[i];
+                                               if (char_idx_feat[i]) f_ptr->x_char[i] = char_idx_feat[i];
+                                       }
+                               }
+                               break;
+                       }
+                       continue;
+               }
 
                switch (ch)
                {
@@ -8335,9 +8754,6 @@ static void do_cmd_knowledge_features(void)
                }
        }
 
-       /* Prompt */
-       if (!grp_cnt) msg_print("No features known.");
-
        /* Free the "feat_idx" array */
        C_KILL(feat_idx, max_f_idx, int);
 }
@@ -9130,7 +9546,7 @@ static void do_cmd_knowledge_home(void)
                        {
 #ifdef JP
                                if ((i % 12) == 0) fprintf(fff, "\n ( %d ¥Ú¡¼¥¸ )\n", x++);
-                               object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
+                               object_desc(o_name, &st_ptr->stock[i], 0);
                                if (strlen(o_name) <= 80-3)
                                {
                                        fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
@@ -9147,7 +9563,7 @@ static void do_cmd_knowledge_home(void)
                                        fprintf(fff, "   %.77s\n", o_name+n);
                                }
 #else
-                               object_desc(o_name, &st_ptr->stock[i], TRUE, 3);
+                               object_desc(o_name, &st_ptr->stock[i], 0);
                                fprintf(fff, "%c%s %s\n", I2A(i%12), paren, o_name);
 #endif
 
@@ -9280,16 +9696,21 @@ static void do_cmd_knowledge_autopick(void)
  */
 void do_cmd_knowledge(void)
 {
-       int i,p=0;
+       int i, p = 0;
+       bool need_redraw = FALSE;
+
        /* File type is "TEXT" */
        FILE_TYPE(FILE_TYPE_TEXT);
+
        /* Save the screen */
        screen_save();
+
        /* Interact until done */
        while (1)
        {
                /* Clear screen */
                Term_clear();
+
                /* Ask for a choice */
 #ifdef JP
                prt(format("%d/2 ¥Ú¡¼¥¸", (p+1)), 2, 65);
@@ -9301,7 +9722,8 @@ void do_cmd_knowledge(void)
 
                /* Give some choices */
 #ifdef JP
-               if (p == 0) {
+               if (p == 0)
+               {
                        prt("(1) ´ûÃΤÎÅÁÀâ¤Î¥¢¥¤¥Æ¥à                 ¤Î°ìÍ÷", 6, 5);
                        prt("(2) ´ûÃΤΥ¢¥¤¥Æ¥à                       ¤Î°ìÍ÷", 7, 5);
                        prt("(3) ´ûÃΤÎÀ¸¤­¤Æ¤¤¤ë¥æ¥Ë¡¼¥¯¡¦¥â¥ó¥¹¥¿¡¼ ¤Î°ìÍ÷", 8, 5);
@@ -9312,7 +9734,9 @@ void do_cmd_knowledge(void)
                        prt("(8) ²æ¤¬²È¤Î¥¢¥¤¥Æ¥à                     ¤Î°ìÍ÷", 13, 5);
                        prt("(9) *´ÕÄê*ºÑ¤ßÁõÈ÷¤ÎÂÑÀ­                 ¤Î°ìÍ÷", 14, 5);
                        prt("(0) ÃÏ·Á¤Îɽ¼¨Ê¸»ú/¥¿¥¤¥ë                ¤Î°ìÍ÷", 15, 5);
-               } else {
+               }
+               else
+               {
                        prt("(a) ¼«Ê¬¤Ë´Ø¤¹¤ë¾ðÊó                     ¤Î°ìÍ÷", 6, 5);
                        prt("(b) ÆÍÁ³ÊÑ°Û                             ¤Î°ìÍ÷", 7, 5);
                        prt("(c) Éð´ï¤Î·Ð¸³ÃÍ                         ¤Î°ìÍ÷", 8, 5);
@@ -9324,7 +9748,8 @@ void do_cmd_knowledge(void)
                        prt("(i) ¸½ºß¤Î¼«Æ°½¦¤¤/Ç˲õÀßÄê              ¤Î°ìÍ÷", 14, 5);
                }
 #else
-               if (p == 0) {
+               if (p == 0)
+               {
                        prt("(1) Display known artifacts", 6, 5);
                        prt("(2) Display known objects", 7, 5);
                        prt("(3) Display remaining uniques", 8, 5);
@@ -9335,7 +9760,9 @@ void do_cmd_knowledge(void)
                        prt("(8) Display home inventory", 13, 5);
                        prt("(9) Display *identified* equip.", 14, 5);
                        prt("(0) Display terrain symbols.", 15, 5);
-               } else {
+               }
+               else
+               {
                        prt("(a) Display about yourself", 6, 5);
                        prt("(b) Display mutations", 7, 5);
                        prt("(c) Display weapon proficiency", 8, 5);
@@ -9364,6 +9791,7 @@ void do_cmd_knowledge(void)
 
                /* Prompt */
                i = inkey();
+
                /* Done */
                if (i == ESCAPE) break;
                switch (i)
@@ -9376,13 +9804,13 @@ void do_cmd_knowledge(void)
                        do_cmd_knowledge_artifacts();
                        break;
                case '2': /* Objects */
-                       do_cmd_knowledge_objects();
+                       do_cmd_knowledge_objects(&need_redraw, FALSE, -1);
                        break;
                case '3': /* Uniques */
                        do_cmd_knowledge_uniques();
                        break;
                case '4': /* Monsters */
-                       do_cmd_knowledge_monsters();
+                       do_cmd_knowledge_monsters(&need_redraw, FALSE, -1);
                        break;
                case '5': /* Kill count  */
                        do_cmd_knowledge_kill_count();
@@ -9400,7 +9828,10 @@ void do_cmd_knowledge(void)
                        do_cmd_knowledge_inven();
                        break;
                case '0': /* Feature list */
-                       do_cmd_knowledge_features();
+                       {
+                               int lighting_level = F_LIT_STANDARD;
+                               do_cmd_knowledge_features(&need_redraw, FALSE, -1, &lighting_level);
+                       }
                        break;
                /* Next page */
                case 'a': /* Max stat */
@@ -9433,11 +9864,15 @@ void do_cmd_knowledge(void)
                default: /* Unknown option */
                        bell();
                }
+
                /* Flush messages */
                msg_print(NULL);
        }
+
        /* Restore the screen */
        screen_load();
+
+       if (need_redraw) do_cmd_redraw();
 }