-/* player setup */
-#define SETUP_TOKEN_USE_JOYSTICK 13
-#define SETUP_TOKEN_JOY_DEVICE_NAME 14
-#define SETUP_TOKEN_JOY_XLEFT 15
-#define SETUP_TOKEN_JOY_XMIDDLE 16
-#define SETUP_TOKEN_JOY_XRIGHT 17
-#define SETUP_TOKEN_JOY_YUPPER 18
-#define SETUP_TOKEN_JOY_YMIDDLE 19
-#define SETUP_TOKEN_JOY_YLOWER 20
-#define SETUP_TOKEN_JOY_SNAP 21
-#define SETUP_TOKEN_JOY_BOMB 22
-#define SETUP_TOKEN_KEY_LEFT 23
-#define SETUP_TOKEN_KEY_RIGHT 24
-#define SETUP_TOKEN_KEY_UP 25
-#define SETUP_TOKEN_KEY_DOWN 26
-#define SETUP_TOKEN_KEY_SNAP 27
-#define SETUP_TOKEN_KEY_BOMB 28
-
-/* level directory info */
-#define LEVELINFO_TOKEN_NAME 29
-#define LEVELINFO_TOKEN_LEVELS 30
-#define LEVELINFO_TOKEN_SORT_PRIORITY 31
-#define LEVELINFO_TOKEN_READONLY 32
-
-#define FIRST_GLOBAL_SETUP_TOKEN SETUP_TOKEN_PLAYER_NAME
-#define LAST_GLOBAL_SETUP_TOKEN SETUP_TOKEN_TEAM_MODE
-
-#define FIRST_PLAYER_SETUP_TOKEN SETUP_TOKEN_USE_JOYSTICK
-#define LAST_PLAYER_SETUP_TOKEN SETUP_TOKEN_KEY_BOMB
-
-#define FIRST_LEVELINFO_TOKEN LEVELINFO_TOKEN_NAME
-#define LAST_LEVELINFO_TOKEN LEVELINFO_TOKEN_READONLY
-
-#define TYPE_BOOLEAN 1
-#define TYPE_SWITCH 2
-#define TYPE_KEYSYM 3
-#define TYPE_INTEGER 4
-#define TYPE_STRING 5
-
-static struct SetupInfo si;
-static struct SetupInputInfo sii;
-struct LevelDirInfo ldi;
-static struct
-{
- int type;
- void *value;
- char *text;
-} token_info[] =
-{
- /* global setup */
- { TYPE_STRING, &si.player_name, "player_name" },
- { TYPE_SWITCH, &si.sound, "sound" },
- { TYPE_SWITCH, &si.sound_loops, "repeating_sound_loops" },
- { TYPE_SWITCH, &si.sound_music, "background_music" },
- { TYPE_SWITCH, &si.sound_simple, "simple_sound_effects" },
- { TYPE_SWITCH, &si.toons, "toons" },
- { TYPE_SWITCH, &si.double_buffering, "double_buffering" },
- { TYPE_SWITCH, &si.scroll_delay, "scroll_delay" },
- { TYPE_SWITCH, &si.soft_scrolling, "soft_scrolling" },
- { TYPE_SWITCH, &si.fading, "screen_fading" },
- { TYPE_SWITCH, &si.autorecord, "automatic_tape_recording" },
- { TYPE_SWITCH, &si.quick_doors, "quick_doors" },
- { TYPE_SWITCH, &si.team_mode, "team_mode" },
-
- /* player setup */
- { TYPE_BOOLEAN, &sii.use_joystick, ".use_joystick" },
- { TYPE_STRING, &sii.joy.device_name, ".joy.device_name" },
- { TYPE_INTEGER, &sii.joy.xleft, ".joy.xleft" },
- { TYPE_INTEGER, &sii.joy.xmiddle, ".joy.xmiddle" },
- { TYPE_INTEGER, &sii.joy.xright, ".joy.xright" },
- { TYPE_INTEGER, &sii.joy.yupper, ".joy.yupper" },
- { TYPE_INTEGER, &sii.joy.ymiddle, ".joy.ymiddle" },
- { TYPE_INTEGER, &sii.joy.ylower, ".joy.ylower" },
- { TYPE_INTEGER, &sii.joy.snap, ".joy.snap_field" },
- { TYPE_INTEGER, &sii.joy.bomb, ".joy.place_bomb" },
- { TYPE_KEYSYM, &sii.key.left, ".key.move_left" },
- { TYPE_KEYSYM, &sii.key.right, ".key.move_right" },
- { TYPE_KEYSYM, &sii.key.up, ".key.move_up" },
- { TYPE_KEYSYM, &sii.key.down, ".key.move_down" },
- { TYPE_KEYSYM, &sii.key.snap, ".key.snap_field" },
- { TYPE_KEYSYM, &sii.key.bomb, ".key.place_bomb" },
-
- /* level directory info */
- { TYPE_STRING, &ldi.name, "name" },
- { TYPE_INTEGER, &ldi.levels, "levels" },
- { TYPE_INTEGER, &ldi.sort_priority, "sort_priority" },
- { TYPE_BOOLEAN, &ldi.readonly, "readonly" }
-};
-
-static char *string_tolower(char *s)
-{
- static char s_lower[100];
- int i;
-
- if (strlen(s) >= 100)
- return s;