Changeset 463

Show
Ignore:
Timestamp:
08/07/07 18:33:42 (1 year ago)
Author:
takkaria
Message:

Split option definitions out into option.h, and option tables out into option.c. Take the opportunity to add a little abstraction into the system. (part of #65)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/Makefile.src

    r455 r463  
    99 
    1010HDRS = h-basic.h 
    11 INCS = angband.h config.h defines.h externs.h types.h
     11INCS = angband.h config.h defines.h externs.h types.h option.h
    1212       z-term.h z-rand.h z-type.h z-util.h z-virt.h z-form.h 
    1313 
     
    4040        monster1.o \ 
    4141        monster2.o \ 
    42         obj-info.o \ 
    4342        object1.o \ 
    4443        object2.o \ 
     44        obj-info.o \ 
     45        option.o \ 
    4546        randart.o \ 
    4647        randname.o \ 
  • trunk/src/angband.h

    r455 r463  
    3333#include "config.h" 
    3434#include "defines.h" 
     35#include "option.h" 
    3536#include "types.h" 
    3637#include "ui.h" 
  • trunk/src/cmd4.c

    r399 r463  
    1818 */ 
    1919#include "angband.h" 
     20#include "option.h" 
    2021#include "ui.h" 
    2122 
     
    22462247        byte attr = curs_attrs[CURS_KNOWN][(int)cursor]; 
    22472248 
    2248         c_prt(attr, format("%-45s: %s  (%s)", option_desc[oid]
    2249                            op_ptr->opt[oid] ? "yes" : "no ", option_text[oid]), 
     2249        c_prt(attr, format("%-45s: %s  (%s)", option_desc(oid)
     2250                           op_ptr->opt[oid] ? "yes" : "no ", option_name(oid)), 
    22502251                           row, col); 
    22512252} 
     
    22762277                case '?': 
    22772278                { 
    2278                         show_file(format("option.txt#%s", option_text[oid]), NULL, 0, 0); 
     2279                        show_file(format("option.txt#%s", option_name(oid)), NULL, 0, 0); 
    22792280                        break; 
    22802281                } 
     
    28212822        for (i = 0; i < OPT_CHEAT; i++) 
    28222823        { 
    2823                 /* Require a real option */ 
    2824                 if (!option_text[i]) continue; 
     2824                const char *name = option_name(i); 
     2825                if (!name) continue; 
    28252826 
    28262827                /* Comment */ 
    2827                 fprintf(fff, "# Option '%s'\n", option_desc[i]); 
     2828                fprintf(fff, "# Option '%s'\n", option_desc(i)); 
    28282829 
    28292830                /* Dump the option */ 
    28302831                if (op_ptr->opt[i]) 
    2831                 { 
    2832                         fprintf(fff, "Y:%s\n", option_text[i]); 
    2833                 } 
     2832                        fprintf(fff, "Y:%s\n", name); 
    28342833                else 
    2835                 { 
    2836                         fprintf(fff, "X:%s\n", option_text[i]); 
    2837                 } 
     2834                        fprintf(fff, "X:%s\n", name); 
    28382835 
    28392836                /* Skip a line */ 
  • trunk/src/defines.h

    r455 r463  
    1 /* File: defines.h */ 
    2  
    31#ifndef INCLUDED_DEFINES_H 
    42#define INCLUDED_DEFINES_H 
     
    23732371 
    23742372 
    2375  
    2376 /*** Option Definitions ***/ 
    2377  
    2378 /* 
    2379  * Option indexes (offsets) 
    2380  * 
    2381  * These values are hard-coded by savefiles (and various pieces of code). 
    2382  */ 
    2383 #define OPT_BIRTH                                       128 
    2384 #define OPT_CHEAT                                       160 
    2385 #define OPT_ADULT                                       192 
    2386 #define OPT_SCORE                                       224 
    2387 #define OPT_NONE                                        255 
    2388 #define OPT_MAX                                         256 
    2389  
    2390  
    2391 /* 
    2392  * Option indexes (normal) 
    2393  * 
    2394  * These values are hard-coded by savefiles. 
    2395  */ 
    2396 #define OPT_rogue_like_commands         0 
    2397 #define OPT_quick_messages                      1 
    2398 #define OPT_use_sound               2 
    2399 #define OPT_pickup_detail                       3 
    2400 #define OPT_use_old_target                      4 
    2401 #define OPT_pickup_always                       5 
    2402 #define OPT_pickup_inven                        6 
    2403 #define OPT_depth_in_feet                       7 
    2404  
    2405 #define OPT_show_labels                         10 
    2406 #define OPT_show_lists              11 
    2407  
    2408 #define OPT_ring_bell                           14 
    2409 #define OPT_show_flavors                        15 
    2410  
    2411 #define OPT_disturb_move                        20 
    2412 #define OPT_disturb_near                        21 
    2413 #define OPT_disturb_detect                      22 
    2414 #define OPT_disturb_state                       23 
    2415 #define OPT_disturb_minor                       24 
    2416  
    2417 #define OPT_view_perma_grids            38 
    2418 #define OPT_view_torch_grids            39 
    2419  
    2420 #define OPT_flush_failure                       52 
    2421 #define OPT_flush_disturb                       53 
    2422  
    2423 #define OPT_hilite_player                       59 
    2424 #define OPT_view_yellow_lite            60 
    2425 #define OPT_view_bright_lite            61 
    2426 #define OPT_view_granite_lite           62 
    2427 #define OPT_view_special_lite           63 
    2428 #define OPT_easy_open                           64 
    2429 #define OPT_easy_alter                          65 
    2430 #define OPT_show_piles                          67 
    2431 #define OPT_center_player                       68 
    2432 #define OPT_auto_more                   71 
    2433 #define OPT_hp_changes_color            74 
    2434 #define OPT_hide_squelchable            75 
    2435 #define OPT_squelch_worthless           76 
    2436 #define OPT_mouse_movement              77 
    2437  
    2438  
    2439 #define OPT_birth_maximize          (OPT_BIRTH+0) 
    2440 #define OPT_birth_randarts          (OPT_BIRTH+1) 
    2441 #define OPT_birth_autoscum          (OPT_BIRTH+2) 
    2442 #define OPT_birth_ironman           (OPT_BIRTH+3) 
    2443 #define OPT_birth_no_stores         (OPT_BIRTH+4) 
    2444 #define OPT_birth_no_artifacts      (OPT_BIRTH+5) 
    2445 #define OPT_birth_no_stacking       (OPT_BIRTH+6) 
    2446 #define OPT_birth_no_preserve       (OPT_BIRTH+7) 
    2447 #define OPT_birth_no_stairs                     (OPT_BIRTH+8) 
    2448 /* leave four spaces for future */ 
    2449 #define OPT_birth_ai_sound                      (OPT_BIRTH+13) 
    2450 #define OPT_birth_ai_smell                      (OPT_BIRTH+14) 
    2451 #define OPT_birth_ai_packs                      (OPT_BIRTH+15) 
    2452 #define OPT_birth_ai_learn                      (OPT_BIRTH+16) 
    2453 #define OPT_birth_ai_cheat                      (OPT_BIRTH+17) 
    2454 #define OPT_birth_ai_smart                      (OPT_BIRTH+18) 
    2455  
    2456 #define OPT_cheat_peek                          (OPT_CHEAT+0) 
    2457 #define OPT_cheat_hear                          (OPT_CHEAT+1) 
    2458 #define OPT_cheat_room                          (OPT_CHEAT+2) 
    2459 #define OPT_cheat_xtra                          (OPT_CHEAT+3) 
    2460 #define OPT_cheat_know                          (OPT_CHEAT+4) 
    2461 #define OPT_cheat_live                          (OPT_CHEAT+5) 
    2462  
    2463 #define OPT_adult_maximize          (OPT_ADULT+0) 
    2464 #define OPT_adult_randarts          (OPT_ADULT+1) 
    2465 #define OPT_adult_autoscum          (OPT_ADULT+2) 
    2466 #define OPT_adult_ironman           (OPT_ADULT+3) 
    2467 #define OPT_adult_no_stores         (OPT_ADULT+4) 
    2468 #define OPT_adult_no_artifacts      (OPT_ADULT+5) 
    2469 #define OPT_adult_no_stacking       (OPT_ADULT+6) 
    2470 #define OPT_adult_no_preserve       (OPT_ADULT+7) 
    2471 #define OPT_adult_no_stairs                     (OPT_ADULT+8) 
    2472 /* leave four spaces for future */ 
    2473 #define OPT_adult_ai_sound                      (OPT_ADULT+13) 
    2474 #define OPT_adult_ai_smell                      (OPT_ADULT+14) 
    2475 #define OPT_adult_ai_packs                      (OPT_ADULT+15) 
    2476 #define OPT_adult_ai_learn                      (OPT_ADULT+16) 
    2477 #define OPT_adult_ai_cheat                      (OPT_ADULT+17) 
    2478 #define OPT_adult_ai_smart                      (OPT_ADULT+18) 
    2479  
    2480 #define OPT_score_peek                          (OPT_SCORE+0) 
    2481 #define OPT_score_hear                          (OPT_SCORE+1) 
    2482 #define OPT_score_room                          (OPT_SCORE+2) 
    2483 #define OPT_score_xtra                          (OPT_SCORE+3) 
    2484 #define OPT_score_know                          (OPT_SCORE+4) 
    2485 #define OPT_score_live                          (OPT_SCORE+5) 
    2486  
    2487  
    2488 /* 
    2489  * Hack -- Option symbols 
    2490  */ 
    2491 #define OPT(opt_name)   op_ptr->opt[OPT_##opt_name] 
    2492  
    2493 #define rogue_like_commands             OPT(rogue_like_commands) 
    2494 #define quick_messages                  OPT(quick_messages) 
    2495 #define use_sound                               OPT(use_sound) 
    2496 #define pickup_detail                   OPT(pickup_detail) 
    2497 #define use_old_target                  OPT(use_old_target) 
    2498 #define pickup_always                   OPT(pickup_always) 
    2499 #define pickup_inven                    OPT(pickup_inven) 
    2500 #define depth_in_feet                   OPT(depth_in_feet) 
    2501 #define show_labels                             OPT(show_labels) 
    2502 #define ring_bell                               OPT(ring_bell) 
    2503 #define show_flavors                    OPT(show_flavors) 
    2504 #define run_ignore_doors                OPT(run_ignore_doors) 
    2505 #define disturb_move                    OPT(disturb_move) 
    2506 #define disturb_near                    OPT(disturb_near) 
    2507 #define disturb_detect                  OPT(disturb_detect) 
    2508 #define disturb_state                   OPT(disturb_state) 
    2509 #define disturb_minor                   OPT(disturb_minor) 
    2510 #define view_perma_grids                OPT(view_perma_grids) 
    2511 #define view_torch_grids                OPT(view_torch_grids) 
    2512 #define flush_failure                   OPT(flush_failure) 
    2513 #define flush_disturb                   OPT(flush_disturb) 
    2514 #define hilite_player                   OPT(hilite_player) 
    2515 #define view_yellow_lite                OPT(view_yellow_lite) 
    2516 #define view_bright_lite                OPT(view_bright_lite) 
    2517 #define view_granite_lite               OPT(view_granite_lite) 
    2518 #define view_special_lite               OPT(view_special_lite) 
    2519 #define easy_open                               OPT(easy_open) 
    2520 #define easy_alter                              OPT(easy_alter) 
    2521 #define show_piles                              OPT(show_piles) 
    2522 #define center_player                   OPT(center_player) 
    2523 #define auto_more                               OPT(auto_more) 
    2524 #define hp_changes_color                OPT(hp_changes_color) 
    2525 #define hide_squelchable                OPT(hide_squelchable) 
    2526 #define mouse_movement                  OPT(mouse_movement) 
    2527  
    2528 #define birth_maximize                  OPT(birth_maximize) 
    2529 #define birth_randarts                  OPT(birth_randarts) 
    2530 #define birth_autoscum                  OPT(birth_autoscum) 
    2531 #define birth_ironman                   OPT(birth_ironman) 
    2532 #define birth_no_stores                 OPT(birth_no_stores) 
    2533 #define birth_no_artifacts              OPT(birth_no_artifacts) 
    2534 #define birth_no_stacking       OPT(birth_no_stacking) 
    2535 #define birth_no_preserve       OPT(birth_no_preserve) 
    2536 #define birth_no_stairs                 OPT(birth_no_stairs) 
    2537 #define birth_ai_sound                  OPT(birth_ai_sound) 
    2538 #define birth_ai_smell                  OPT(birth_ai_smell) 
    2539 #define birth_ai_packs                  OPT(birth_ai_packs) 
    2540 #define birth_ai_learn                  OPT(birth_ai_learn) 
    2541 #define birth_ai_cheat                  OPT(birth_ai_cheat) 
    2542 #define birth_ai_smart                  OPT(birth_ai_smart) 
    2543  
    2544 #define cheat_peek                              OPT(cheat_peek) 
    2545 #define cheat_hear                              OPT(cheat_hear) 
    2546 #define cheat_room                              OPT(cheat_room) 
    2547 #define cheat_xtra                              OPT(cheat_xtra) 
    2548 #define cheat_know                              OPT(cheat_know) 
    2549 #define cheat_live                              OPT(cheat_live) 
    2550  
    2551 #define adult_maximize                  OPT(adult_maximize) 
    2552 #define adult_randarts                  OPT(adult_randarts) 
    2553 #define adult_autoscum                  OPT(adult_autoscum) 
    2554 #define adult_ironman                   OPT(adult_ironman) 
    2555 #define adult_no_stores                 OPT(adult_no_stores) 
    2556 #define adult_no_artifacts              OPT(adult_no_artifacts) 
    2557 #define adult_no_stacking               OPT(adult_no_stacking) 
    2558 #define adult_no_preserve               OPT(adult_no_preserve) 
    2559 #define adult_no_stairs                 OPT(adult_no_stairs) 
    2560 #define adult_ai_sound                  OPT(adult_ai_sound) 
    2561 #define adult_ai_smell                  OPT(adult_ai_smell) 
    2562 #define adult_ai_packs                  OPT(adult_ai_packs) 
    2563 #define adult_ai_learn                  OPT(adult_ai_learn) 
    2564 #define adult_ai_cheat                  OPT(adult_ai_cheat) 
    2565 #define adult_ai_smart                  OPT(adult_ai_smart) 
    2566  
    2567 #define score_peek                              OPT(score_peek) 
    2568 #define score_hear                              OPT(score_hear) 
    2569 #define score_room                              OPT(score_room) 
    2570 #define score_xtra                              OPT(score_xtra) 
    2571 #define score_know                              OPT(score_know) 
    2572 #define score_live                              OPT(score_live) 
    2573  
    2574  
    2575 /* 
    2576  * Information for "do_cmd_options()". 
    2577  */ 
    2578 #define OPT_PAGE_MAX                            5 
    2579 #define OPT_PAGE_PER                            15 
    25802373 
    25812374 
  • trunk/src/externs.h

    r462 r463  
    7474extern cptr stat_names_reduced[A_MAX]; 
    7575extern cptr stat_names_full[A_MAX]; 
    76 extern cptr window_flag_desc[32]; 
    77 extern cptr option_text[OPT_MAX]; 
    78 extern cptr option_desc[OPT_MAX]; 
    79 extern const bool option_norm[OPT_MAX]; 
    80 extern const byte option_page[OPT_PAGE_MAX][OPT_PAGE_PER]; 
     76extern const char *window_flag_desc[32]; 
    8177extern cptr inscrip_text[MAX_INSCRIP]; 
    8278extern const grouper object_text_order[]; 
  • trunk/src/files.c

    r433 r463  
    1111#include "angband.h" 
    1212#include "cmds.h" 
     13#include "option.h" 
    1314 
    1415#define MAX_PANEL 12 
     
    543544                for (i = 0; i < OPT_ADULT; i++) 
    544545                { 
    545                         if (option_text[i] && streq(option_text[i], buf + 2)) 
    546                         { 
    547                                 op_ptr->opt[i] = FALSE
     546                        if (option_name(i) && streq(option_name(i), buf + 2)) 
     547                        { 
     548                                option_set(i, FALSE)
    548549                                return (0); 
    549550                        } 
     
    560561                for (i = 0; i < OPT_ADULT; i++) 
    561562                { 
    562                         if (option_text[i] && streq(option_text[i], buf + 2)) 
    563                         { 
    564                                 op_ptr->opt[i] = TRUE
     563                        if (option_name(i) && streq(option_name(i), buf + 2)) 
     564                        { 
     565                                option_set(i, TRUE)
    565566                                return (0); 
    566567                        } 
     
    19471948        for (i = OPT_ADULT; i < OPT_MAX; i++) 
    19481949        { 
    1949                 if (option_desc[i]
     1950                if (option_name(i)
    19501951                { 
    19511952                        fprintf(fff, "%-45s: %s (%s)\n", 
    1952                                 option_desc[i]
     1953                                option_desc(i)
    19531954                                op_ptr->opt[i] ? "yes" : "no ", 
    1954                                 option_text[i]); 
     1955                                option_name(i)); 
    19551956                } 
    19561957        } 
  • trunk/src/init2.c

    r410 r463  
    1515#include "script.h" 
    1616#include "cmds.h" 
     17#include "option.h" 
    1718 
    1819/* 
     
    12431244 
    12441245        /*** Prepare the options ***/ 
    1245  
    1246         /* Initialize the options */ 
    1247         for (i = 0; i < OPT_MAX; i++) 
    1248         { 
    1249                 /* Default value */ 
    1250                 op_ptr->opt[i] = option_norm[i]; 
    1251         } 
     1246        option_set_defaults(); 
    12521247 
    12531248        /* Initialize the window flags */ 
  • trunk/src/save.c

    r404 r463  
    1010 
    1111#include "angband.h" 
     12#include "option.h" 
    1213 
    1314 
     
    345346 
    346347                /* Process real entries */ 
    347                 if (option_text[i]
     348                if (option_name(i)
    348349                { 
    349350                        /* Set flag */ 
  • trunk/src/tables.c

    r399 r463  
    13551355 * Character screen, Small scale map, Previous Messages, Store screen, etc. 
    13561356 */ 
    1357 cptr window_flag_desc[32] = 
     1357const char *window_flag_desc[32] = 
    13581358{ 
    13591359        "Display inven/equip", 
     
    13891389        NULL, 
    13901390        NULL 
    1391 }; 
    1392  
    1393  
    1394 /* 
    1395  * Options -- textual names (where defined) 
    1396  */ 
    1397 cptr option_text[OPT_MAX] = 
    1398 { 
    1399         "rogue_like_commands",          /* OPT_rogue_like_commands */ 
    1400         "quick_messages",                       /* OPT_quick_messages */ 
    1401         "use_sound",                            /* OPT_use_sound */ 
    1402         "pickup_detail",                        /* OPT_pickup_detail */ 
    1403         "use_old_target",                       /* OPT_use_old_target */ 
    1404         "pickup_always",                        /* OPT_pickup_always */ 
    1405         "pickup_inven",                         /* OPT_pickup_inven */ 
    1406         "depth_in_feet",                        /* OPT_depth_in_feet */ 
    1407         NULL,                                           /* xxx stack_force_notes */ 
    1408         NULL,                                           /* xxx stack_force_costs */ 
    1409         "show_labels",                          /* OPT_show_labels */ 
    1410         "show_lists",                           /* OPT_show_lists */ 
    1411         NULL,                                           /* xxx show_choices */ 
    1412         NULL,                                           /* xxx show_details */ 
    1413         "ring_bell",                            /* OPT_ring_bell */ 
    1414         "show_flavors",                         /* OPT_flavors */ 
    1415         NULL,                                           /* xxx run_ignore_stairs */ 
    1416         NULL,                                           /* xxx run_ignore_doors */ 
    1417         NULL,                                           /* xxx run_cut_corners */ 
    1418         NULL,                                           /* xxx run_use_corners */ 
    1419         "disturb_move",                         /* OPT_disturb_move */ 
    1420         "disturb_near",                         /* OPT_disturb_near */ 
    1421         "disturb_detect",                       /* OPT_disturb_detect */ 
    1422         "disturb_state",                        /* OPT_disturb_state */ 
    1423         "disturb_minor",                        /* OPT_disturb_minor */ 
    1424         NULL,                                           /* xxx next_xp */ 
    1425         NULL,                                           /* xxx alert_hitpoint */ 
    1426         NULL,                                           /* xxx alert_failure */ 
    1427         NULL,                                           /* xxx verify_destroy */ 
    1428         NULL,                                           /* xxx verify_special */ 
    1429         NULL,                                           /* xxx allow_quantity */ 
    1430         NULL,                                           /* xxx */ 
    1431         NULL,                                           /* xxx auto_haggle */ 
    1432         NULL,                                           /* xxx auto_scum */ 
    1433         NULL,                                           /* xxx testing_stack */ 
    1434         NULL,                                           /* xxx testing_carry */ 
    1435         NULL,                                           /* xxx expand_look */ 
    1436         NULL,                                           /* xxx expand_list */ 
    1437         "view_perma_grids",                     /* OPT_view_perma_grids */ 
    1438         "view_torch_grids",                     /* OPT_view_torch_grids */ 
    1439         NULL,                                           /* xxx dungeon_align */ 
    1440         NULL,                                           /* xxx dungeon_stair */ 
    1441         NULL,                                           /* xxx flow_by_sound */ 
    1442         NULL,                                           /* xxx flow_by_smell */ 
    1443         NULL,                                           /* xxx track_follow */ 
    1444         NULL,                                           /* xxx track_target */ 
    1445         NULL,                                           /* xxx smart_learn */ 
    1446         NULL,                                           /* xxx smart_cheat */ 
    1447         NULL,                                           /* xxx view_reduce_lite */ 
    1448         NULL,                                           /* xxx hidden_player */ 
    1449         NULL,                                           /* xxx avoid_abort */ 
    1450         NULL,                                           /* xxx avoid_other */ 
    1451         "flush_failure",                        /* OPT_flush_failure */ 
    1452         "flush_disturb",                        /* OPT_flush_disturb */ 
    1453         NULL,                                           /* xxx flush_command */ 
    1454         NULL,                                           /* xxx fresh_before */ 
    1455         NULL,                                           /* xxx fresh_after */ 
    1456         NULL,                                           /* xxx fresh_message */ 
    1457         NULL,                                           /* xxx compress_savefile */ 
    1458         "hilite_player",                        /* OPT_hilite_player */ 
    1459         "view_yellow_lite",                     /* OPT_view_yellow_lite */ 
    1460         "view_bright_lite",                     /* OPT_view_bright_lite */ 
    1461         "view_granite_lite",            /* OPT_view_granite_lite */ 
    1462         "view_special_lite",            /* OPT_view_special_lite */ 
    1463         "easy_open",                            /* OPT_easy_open */ 
    1464         "easy_alter",                           /* OPT_easy_alter */ 
    1465         NULL,                                           /* xxx easy_floor */ 
    1466         "show_piles",                           /* OPT_show_piles */ 
    1467         "center_player",                        /* OPT_center_player */ 
    1468         NULL,                                           /* xxx run_avoid_center */ 
    1469         NULL,                                           /* xxx scroll_target */ 
    1470         "auto_more",                            /* OPT_auto_more */ 
    1471         NULL,                                           /* xxx smart_monsters */ 
    1472         NULL,                                           /* xxx smart_packs */ 
    1473         "hp_changes_color",                     /* OPT_hp_changes_color */ 
    1474         "hide_squelchable",                     /* OPT_hide_squelchable */ 
    1475         "squelch_worthless",                    /* OPT_squelch_worthless */ 
    1476         "mouse_movement",                       /* OPT_mouse_movement */ 
    1477         NULL,                                           /* xxx */ 
    1478         NULL,                                           /* xxx */ 
    1479         NULL,                                           /* xxx */ 
    1480         NULL,                                           /* xxx */ 
    1481         NULL,                                           /* xxx */ 
    1482         NULL,                                           /* xxx */ 
    1483         NULL,                                           /* xxx */ 
    1484         NULL,                                           /* xxx */ 
    1485         NULL,                                           /* xxx */ 
    1486         NULL,                                           /* xxx */ 
    1487         NULL,                                           /* xxx */ 
    1488         NULL,                                           /* xxx */ 
    1489         NULL,                                           /* xxx */ 
    1490         NULL,                                           /* xxx */ 
    1491         NULL,                                           /* xxx */ 
    1492         NULL,                                           /* xxx */ 
    1493         NULL,                                           /* xxx */ 
    1494         NULL,                                           /* xxx */ 
    1495         NULL,                                           /* xxx */ 
    1496         NULL,                                           /* xxx */ 
    1497         NULL,                                           /* xxx */ 
    1498         NULL,                                           /* xxx */ 
    1499         NULL,                                           /* xxx */ 
    1500         NULL,                                           /* xxx */ 
    1501         NULL,                                           /* xxx */ 
    1502         NULL,                                           /* xxx */ 
    1503         NULL,                                           /* xxx */ 
    1504         NULL,                                           /* xxx */ 
    1505         NULL,                                           /* xxx */ 
    1506         NULL,                                           /* xxx */ 
    1507         NULL,                                           /* xxx */ 
    1508         NULL,                                           /* xxx */ 
    1509         NULL,                                           /* xxx */ 
    1510         NULL,                                           /* xxx */ 
    1511         NULL,                                           /* xxx */ 
    1512         NULL,                                           /* xxx */ 
    1513         NULL,                                           /* xxx */ 
    1514         NULL,                                           /* xxx */ 
    1515         NULL,                                           /* xxx */ 
    1516         NULL,                                           /* xxx */ 
    1517         NULL,                                           /* xxx */ 
    1518         NULL,                                           /* xxx */ 
    1519         NULL,                                           /* xxx */ 
    1520         NULL,                                           /* xxx */ 
    1521         NULL,                                           /* xxx */ 
    1522         NULL,                                           /* xxx */ 
    1523         NULL,                                           /* xxx */ 
    1524         NULL,                                           /* xxx */ 
    1525         NULL,                                           /* xxx */ 
    1526         NULL,                                           /* xxx */ 
    1527         "birth_maximize", 
    1528         "birth_randarts", 
    1529         "birth_autoscum", 
    1530         "birth_ironman", 
    1531         "birth_no_stores", 
    1532         "birth_no_artifacts", 
    1533         "birth_no_stacking", 
    1534         "birth_no_preserve", 
    1535         "birth_no_stairs", 
    1536         NULL,                                           /* xxx */ 
    1537         NULL,                                           /* xxx */ 
    1538         NULL,                                           /* xxx */ 
    1539         NULL,                                           /* xxx */ 
    1540         "birth_ai_sound", 
    1541         "birth_ai_smell", 
    1542         "birth_ai_packs", 
    1543         "birth_ai_learn", 
    1544         "birth_ai_cheat", 
    1545         "birth_ai_smart", 
    1546         NULL,                                           /* xxx */ 
    1547         NULL,                                           /* xxx */ 
    1548         NULL,                                           /* xxx */ 
    1549         NULL,                                           /* xxx */ 
    1550         NULL,                                           /* xxx */ 
    1551         NULL,                                           /* xxx */ 
    1552         NULL,                                           /* xxx */ 
    1553         NULL,                                           /* xxx */ 
    1554         NULL,                                           /* xxx */ 
    1555         NULL,                                           /* xxx */ 
    1556         NULL,                                           /* xxx */ 
    1557         NULL,                                           /* xxx */ 
    1558         NULL,                                           /* xxx */ 
    1559         "cheat_peek",                           /* OPT_cheat_peek */ 
    1560         "cheat_hear",                           /* OPT_cheat_hear */ 
    1561         "cheat_room",                           /* OPT_cheat_room */ 
    1562         "cheat_xtra",                           /* OPT_cheat_xtra */ 
    1563         "cheat_know",                           /* OPT_cheat_know */ 
    1564         "cheat_live",                           /* OPT_cheat_live */ 
    1565         NULL,                                           /* xxx */ 
    1566         NULL,                                           /* xxx */ 
    1567         NULL,                                           /* xxx */ 
    1568         NULL,                                           /* xxx */ 
    1569         NULL,                                           /* xxx */ 
    1570         NULL,                                           /* xxx */ 
    1571         NULL,                                           /* xxx */ 
    1572         NULL,                                           /* xxx */ 
    1573         NULL,                                           /* xxx */ 
    1574         NULL,                                           /* xxx */ 
    1575         NULL,                                           /* xxx */ 
    1576         NULL,                                           /* xxx */ 
    1577         NULL,                                           /* xxx */ 
    1578         NULL,                                           /* xxx */ 
    1579         NULL,                                           /* xxx */ 
    1580         NULL,                                           /* xxx */ 
    1581         NULL,                                           /* xxx */ 
    1582         NULL,                                           /* xxx */ 
    1583         NULL,                                           /* xxx */ 
    1584         NULL,                                           /* xxx */ 
    1585         NULL,                                           /* xxx */ 
    1586         NULL,                                           /* xxx */ 
    1587         NULL,                                           /* xxx */ 
    1588         NULL,                                           /* xxx */ 
    1589         NULL,                                           /* xxx */ 
    1590         NULL,                                           /* xxx */ 
    1591         "adult_maximize", 
    1592         "adult_randarts", 
    1593         "adult_autoscum", 
    1594         "adult_ironman", 
    1595         "adult_no_stores", 
    1596         "adult_no_artifacts", 
    1597         "adult_no_stacking", 
    1598         "adult_no_preserve", 
    1599         "adult_no_stairs", 
    1600         NULL,                                           /* xxx */ 
    1601         NULL,                                           /* xxx */ 
    1602         NULL,                                           /* xxx */ 
    1603         NULL,                                           /* xxx */ 
    1604         "adult_ai_sound", 
    1605         "adult_ai_smell", 
    1606         "adult_ai_packs", 
    1607         "adult_ai_learn", 
    1608         "adult_ai_cheat", 
    1609         "adult_ai_smart", 
    1610         NULL,                                           /* xxx */ 
    1611         NULL,                                           /* xxx */ 
    1612         NULL,                                           /* xxx */ 
    1613         NULL,                                           /* xxx */ 
    1614         NULL,                                           /* xxx */ 
    1615         NULL,                                           /* xxx */ 
    1616         NULL,                                           /* xxx */ 
    1617         NULL,                                           /* xxx */ 
    1618         NULL,                                           /* xxx */ 
    1619         NULL,                                           /* xxx */ 
    1620         NULL,                                           /* xxx */ 
    1621         NULL,                                           /* xxx */ 
    1622         NULL,                                           /* xxx */ 
    1623         "score_peek",                           /* OPT_score_peek */ 
    1624         "score_hear",                           /* OPT_score_hear */ 
    1625         "score_room",                           /* OPT_score_room */ 
    1626         "score_xtra",                           /* OPT_score_xtra */ 
    1627         "score_know",                           /* OPT_score_know */ 
    1628         "score_live",                           /* OPT_score_live */ 
    1629         NULL,                                           /* xxx */ 
    1630         NULL,                                           /* xxx */ 
    1631         NULL,                                           /* xxx */ 
    1632         NULL,                                           /* xxx */ 
    1633         NULL,                                           /* xxx */ 
    1634         NULL,                                           /* xxx */ 
    1635         NULL,                                           /* xxx */ 
    1636         NULL,                                           /* xxx */ 
    1637         NULL,                                           /* xxx */ 
    1638         NULL,                                           /* xxx */ 
    1639         NULL,                                           /* xxx */ 
    1640         NULL,                                           /* xxx */ 
    1641         NULL,                                           /* xxx */ 
    1642         NULL,                                           /* xxx */ 
    1643         NULL,                                           /* xxx */ 
    1644         NULL,                                           /* xxx */ 
    1645         NULL,                                    &nb