Rev 1 | Rev 10 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1 | Rev 9 | ||
|---|---|---|---|
| Line 27... | Line 27... | ||
| 27 | #include "syssnd.h" |
27 | #include "syssnd.h" |
| 28 | 28 | ||
| 29 | int sysarg_args_period = 0; |
29 | int sysarg_args_period = 0; |
| 30 | int sysarg_args_map = 0; |
30 | int sysarg_args_map = 0; |
| 31 | int sysarg_args_submap = 0; |
31 | int sysarg_args_submap = 0; |
| - | 32 | int sysarg_args_score = 0; |
|
| 32 | int sysarg_args_nosound = 0; |
33 | int sysarg_args_nosound = 0; |
| 33 | int sysarg_args_vol = 0; |
34 | int sysarg_args_vol = 0; |
| 34 | 35 | ||
| 35 | 36 | ||
| 36 | extern U8 want_infinitelives; |
37 | extern U8 want_infinitelives; |
| - | 38 | extern U8 want_fullscreen; |
|
| - | 39 | extern U8 want_filter; |
|
| 37 | 40 | ||
| 38 | 41 | ||
| 39 | /* |
42 | /* |
| 40 | * Fail |
43 | * Fail |
| 41 | */ |
44 | */ |
| Line 43... | Line 46... | ||
| 43 | { |
46 | { |
| 44 | sys_printf ("Rick Dangerous: %s\n" |
47 | sys_printf ("Rick Dangerous: %s\n" |
| 45 | "usage: Rick Dangerous [<options>]\n" |
48 | "usage: Rick Dangerous [<options>]\n" |
| 46 | "options:\n" |
49 | "options:\n" |
| 47 | " -h, --help : Display this information.\n" |
50 | " -h, --help : Display this information.\n" |
| - | 51 | " -f, --fullscreen : Start fullscreen.\n" |
|
| 48 | " -episode <1-4> : Start directly at the first map of the specified episode.\n" |
52 | " -episode <1-4> : Start directly at the first map of the specified episode.\n" |
| 49 | " -map <1-47> : Start directly at the specified map.\n" |
53 | " -map <1-47> : Start directly at the specified map.\n" |
| - | 54 | " -score <N> : Start directly with score N.\n" |
|
| 50 | " -s <0-99>, --speed <0-99> : Set the game speed to a given value.\n" |
55 | " -s <0-99>, --speed <0-99> : Set the game speed to a given value.\n" |
| 51 | " -vol <0-10> : Set the sound volume to a given value.\n" |
56 | " -vol <0-10> : Set the sound volume to a given value.\n" |
| 52 | " -n, --nosound : Disable sound completely.\n" |
57 | " -n, --nosound : Disable sound completely.\n" |
| - | 58 | " -x, --togglefilter : Start with xBRZ filter disabled (F7 to enable).\n" |
|
| 53 | " -i, --infinitelives : Enable infinite lives.\n", |
59 | " -i, --infinitelives : Enable infinite lives.\n", |
| 54 | msg); |
60 | msg); |
| 55 | exit (1); |
61 | exit (1); |
| 56 | } |
62 | } |
| 57 | 63 | ||
| Line 65... | Line 71... | ||
| 65 | 71 | ||
| 66 | for (i = 1; i < argc; i++) |
72 | for (i = 1; i < argc; i++) |
| 67 | { |
73 | { |
| 68 | if (!strcmp (argv[i], "-h") || !strcmp (argv[i], "--help")) |
74 | if (!strcmp (argv[i], "-h") || !strcmp (argv[i], "--help")) |
| 69 | sysarg_fail ("help"); |
75 | sysarg_fail ("help"); |
| - | 76 | ||
| - | 77 | else if (!strcmp(argv[i], "-f") || !strcmp(argv[i], "--fullscreen")) |
|
| - | 78 | want_fullscreen = TRUE; |
|
| 70 | 79 | ||
| 71 | else if (!strcmp(argv[i], "-episode")) |
80 | else if (!strcmp(argv[i], "-episode")) |
| 72 | { |
81 | { |
| 73 | if (++i == argc) |
82 | if (++i == argc) |
| 74 | sysarg_fail ("missing episode number"); |
83 | sysarg_fail ("missing episode number"); |
| Line 82... | Line 91... | ||
| 82 | if (++i == argc) |
91 | if (++i == argc) |
| 83 | sysarg_fail ("missing submap number"); |
92 | sysarg_fail ("missing submap number"); |
| 84 | sysarg_args_submap = atoi(argv[i]) - 1; |
93 | sysarg_args_submap = atoi(argv[i]) - 1; |
| 85 | if (sysarg_args_submap < 0 || sysarg_args_submap >= MAP_NBR_SUBMAPS) |
94 | if (sysarg_args_submap < 0 || sysarg_args_submap >= MAP_NBR_SUBMAPS) |
| 86 | sysarg_fail ("invalid submap number"); |
95 | sysarg_fail ("invalid submap number"); |
| - | 96 | } |
|
| - | 97 | ||
| - | 98 | // Pierre-Marie Baty -- addition: start score |
|
| - | 99 | else if (!strcmp(argv[i], "-score")) |
|
| - | 100 | { |
|
| - | 101 | if (++i == argc) |
|
| - | 102 | sysarg_fail ("missing start score number"); |
|
| - | 103 | sysarg_args_score = atoi(argv[i]) - 1; |
|
| 87 | } |
104 | } |
| 88 | 105 | ||
| 89 | else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--speed")) |
106 | else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--speed")) |
| 90 | { |
107 | { |
| 91 | if (++i == argc) |
108 | if (++i == argc) |
| Line 98... | Line 115... | ||
| 98 | else if (!strcmp(argv[i], "-vol")) |
115 | else if (!strcmp(argv[i], "-vol")) |
| 99 | { |
116 | { |
| 100 | if (++i == argc) |
117 | if (++i == argc) |
| 101 | sysarg_fail ("missing volume"); |
118 | sysarg_fail ("missing volume"); |
| 102 | sysarg_args_vol = atoi(argv[i]) - 1; |
119 | sysarg_args_vol = atoi(argv[i]) - 1; |
| 103 | if ( |
120 | if (sysarg_args_vol < 0 || sysarg_args_vol >= SYSSND_MAXVOL) |
| 104 | sysarg_fail ("invalid volume"); |
121 | sysarg_fail ("invalid volume"); |
| 105 | } |
122 | } |
| 106 | 123 | ||
| 107 | else if (!strcmp(argv[i], "-n") || !strcmp(argv[i], "--nosound")) |
124 | else if (!strcmp(argv[i], "-n") || !strcmp(argv[i], "--nosound")) |
| 108 | sysarg_args_nosound = 1; |
125 | sysarg_args_nosound = 1; |
| - | 126 | ||
| - | 127 | else if (!strcmp(argv[i], "-x") || !strcmp(argv[i], "--togglefilter")) |
|
| - | 128 | want_filter = FALSE; |
|
| 109 | 129 | ||
| 110 | else if (!strcmp(argv[i], "-i") || !strcmp(argv[i], "--infinitelives")) |
130 | else if (!strcmp(argv[i], "-i") || !strcmp(argv[i], "--infinitelives")) |
| 111 | want_infinitelives = TRUE; |
131 | want_infinitelives = TRUE; |
| 112 | 132 | ||
| 113 | else |
133 | else |
| Line 124... | Line 144... | ||
| 124 | if (sysarg_args_submap >= 38) |
144 | if (sysarg_args_submap >= 38) |
| 125 | sysarg_args_map = 3; |
145 | sysarg_args_map = 3; |
| 126 | 146 | ||
| 127 | if (sysarg_args_submap == 9 || sysarg_args_submap == 20 || sysarg_args_submap == 38) |
147 | if (sysarg_args_submap == 9 || sysarg_args_submap == 20 || sysarg_args_submap == 38) |
| 128 | sysarg_args_submap = 0; |
148 | sysarg_args_submap = 0; |
| 129 |
|
149 | //if (sysarg_args_submap == 18) |
| 130 | sysarg_args_submap |
150 | // sysarg_args_submap = 19; |
| 131 | } |
151 | } |