Debian Codegraph @

src/game_menu.c

raw symbols SCIP
1 /*
2 * OpenTyrian: A modern cross-platform port of Tyrian
3 * Copyright (C) 2007-2009 The OpenTyrian Development Team
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19 #include "game_menu.h"cxx . . $ `<file>/src/game_menu.h`/
20
21 #include "backgrnd.h"cxx . . $ `<file>/src/backgrnd.h`/
22 #include "config.h"cxx . . $ `<file>/src/config.h`/
23 #include "file.h"cxx . . $ `<file>/src/file.h`/
24 #include "fonthand.h"cxx . . $ `<file>/src/fonthand.h`/
25 #include "joystick.h"cxx . . $ `<file>/src/joystick.h`/
26 #include "keyboard.h"cxx . . $ `<file>/src/keyboard.h`/
27 #include "loudness.h"cxx . . $ `<file>/src/loudness.h`/
28 #include "mainint.h"cxx . . $ `<file>/src/mainint.h`/
29 #include "mouse.h"cxx . . $ `<file>/src/mouse.h`/
30 #include "musmast.h"cxx . . $ `<file>/src/musmast.h`/
31 #include "network.h"cxx . . $ `<file>/src/network.h`/
32 #include "nortsong.h"cxx . . $ `<file>/src/nortsong.h`/
33 #include "nortvars.h"cxx . . $ `<file>/src/nortvars.h`/
34 #include "params.h"cxx . . $ `<file>/src/params.h`/
35 #include "pcxmast.h"cxx . . $ `<file>/src/pcxmast.h`/
36 #include "picload.h"cxx . . $ `<file>/src/picload.h`/
37 #include "player.h"cxx . . $ `<file>/src/player.h`/
38 #include "shots.h"cxx . . $ `<file>/src/shots.h`/
39 #include "sprite.h"cxx . . $ `<file>/src/sprite.h`/
40 #include "tyrian2.h"cxx . . $ `<file>/src/tyrian2.h`/
41 #include "varz.h"cxx . . $ `<file>/src/varz.h`/
42 #include "vga256d.h"cxx . . $ `<file>/src/vga256d.h`/
43 #include "video.h"cxx . . $ `<file>/src/video.h`/
44
45 #include <assert.h>
46
47 enumcxx . . $ $anonymous_type_bb284e59bc20ccd9_0#
48 {
49 MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME. = 0,
50 MENU_UPGRADEScxx . . $ MENU_UPGRADES. = 1,
51 MENU_OPTIONScxx . . $ MENU_OPTIONS. = 2,
52 MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL. = 3,
53 MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. = 4,
54 MENU_KEYBOARD_CONFIGcxx . . $ MENU_KEYBOARD_CONFIG. = 5,
55 MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE. = 6,
56 MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES. = 7,
57 MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB. = 8,
58 MENU_2_PLAYER_ARCADEcxx . . $ MENU_2_PLAYER_ARCADE. = 9,
59 MENU_1_PLAYER_ARCADEcxx . . $ MENU_1_PLAYER_ARCADE. = 10, // Also networked games.
60 MENU_LIMITED_OPTIONScxx . . $ MENU_LIMITED_OPTIONS. = 11, // Hides save/load menus.
61 MENU_JOYSTICK_CONFIGcxx . . $ MENU_JOYSTICK_CONFIG. = 12,
62 MENU_SUPER_TYRIANcxx . . $ MENU_SUPER_TYRIAN. = 13,
63 };
64
65 /*** Structs ***/
66 struct cube_structcxx . . $ cube_struct#
67 {
68 char titlecxx . . $ cube_struct#title.[81];
69 char headercxx . . $ cube_struct#header.[13];
70 int face_spritecxx . . $ cube_struct#face_sprite.;
71 char textcxx . . $ cube_struct#text.[90][36];
72 int last_linecxx . . $ cube_struct#last_line.;
73 };
74
75 /*** Globals ***/
76 static int joystick_configcxx . . $ joystick_config. = 0; // which joystick is being configured in menu
77
78 static JE_wordcxx . . $ JE_word# yLoccxx . . $ yLoc.;
79 static JE_shortintcxx . . $ JE_shortint# yChgcxx . . $ yChg.;
80 static int newPalcxx . . $ newPal., curPalcxx . . $ curPal., oldPalcxx . . $ oldPal.;
81 static JE_booleancxx . . $ JE_boolean# quikSavecxx . . $ quikSave.;
82 static JE_bytecxx . . $ JE_byte# oldMenucxx . . $ oldMenu.;
83 static JE_booleancxx . . $ JE_boolean# backFromHelpcxx . . $ backFromHelp.;
84 static JE_integercxx . . $ JE_integer# lastDirectioncxx . . $ lastDirection.;
85 static JE_booleancxx . . $ JE_boolean# firstMenu9cxx . . $ firstMenu9., paletteChangedcxx . . $ paletteChanged.;
86 static JE_MenuChoiceTypecxx . . $ JE_MenuChoiceType# menuChoicescxx . . $ menuChoices.;
87 static JE_integercxx . . $ JE_integer# colcxx . . $ col., colCcxx . . $ colC.;
88 static JE_bytecxx . . $ JE_byte# lastCurSelcxx . . $ lastCurSel.;
89 static JE_integercxx . . $ JE_integer# curMenucxx . . $ curMenu.;
90 static JE_bytecxx . . $ JE_byte# curSelcxx . . $ curSel.[MENU_MAXcxx . . $ `src/helptext.h:28:9`!]; /* [1..maxmenu] */
91 static JE_bytecxx . . $ JE_byte# curItemTypecxx . . $ curItemType., curItemcxx . . $ curItem., cursorcxx . . $ cursor.;
92 static JE_booleancxx . . $ JE_boolean# leftPowercxx . . $ leftPower., rightPowercxx . . $ rightPower., rightPowerAffordcxx . . $ rightPowerAfford.;
93 static JE_bytecxx . . $ JE_byte# currentCubecxx . . $ currentCube.;
94 static JE_booleancxx . . $ JE_boolean# keyboardUsedcxx . . $ keyboardUsed.;
95
96 static JE_bytecxx . . $ JE_byte# planetAnicxx . . $ planetAni., planetAniWaitcxx . . $ planetAniWait.;
97 static JE_bytecxx . . $ JE_byte# currentDotNumcxx . . $ currentDotNum., currentDotWaitcxx . . $ currentDotWait.;
98 static JE_realcxx . . $ JE_real# navXcxx . . $ navX., navYcxx . . $ navY., newNavXcxx . . $ newNavX., newNavYcxx . . $ newNavY.;
99 static JE_integercxx . . $ JE_integer# tempNavXcxx . . $ tempNavX., tempNavYcxx . . $ tempNavY.;
100 static JE_bytecxx . . $ JE_byte# planetDotscxx . . $ planetDots.[5]; /* [1..5] */
101 static JE_integercxx . . $ JE_integer# planetDotXcxx . . $ planetDotX.[5][10], planetDotYcxx . . $ planetDotY.[5][10]; /* [1..5, 1..10] */
102 static PlayerItemscxx . . $ PlayerItems# old_itemscxx . . $ old_items.[2]; // TODO: should not be global if possible
103
104 static struct cube_structcxx . . $ cube_struct# cubecxx . . $ cube.[4];
105
106 static const JE_MenuChoiceTypecxx . . $ JE_MenuChoiceType# menuChoicesDefaultcxx . . $ menuChoicesDefault. = { 7, 9, 8, 0, 0, 11, (SAVE_FILES_NUMcxx . . $ `src/config.h:29:9`! / 2) + 2, 0, 0, 6, 4, 6, 7, 5 };
107 static const JE_bytecxx . . $ JE_byte# menuEsccxx . . $ menuEsc.[MENU_MAXcxx . . $ `src/helptext.h:28:9`!] = { 0, 1, 1, 1, 2, 3, 3, 1, 8, 0, 0, 11, 3, 0 };
108 static const JE_bytecxx . . $ JE_byte# itemAvailMapcxx . . $ itemAvailMap.[7] = { 1, 2, 3, 9, 4, 6, 7 };
109 static const JE_wordcxx . . $ JE_word# planetXcxx . . $ planetX.[21] = { 200, 150, 240, 300, 270, 280, 320, 260, 220, 150, 160, 210, 80, 240, 220, 180, 310, 330, 150, 240, 200 };
110 static const JE_wordcxx . . $ JE_word# planetYcxx . . $ planetY.[21] = { 40, 90, 90, 80, 170, 30, 50, 130, 120, 150, 220, 200, 80, 50, 160, 10, 55, 55, 90, 90, 40 };
111 static const uintcxx . . $ uint# cube_line_charscxx . . $ cube_line_chars. = sizeof(*cubecxx . . $ cube.->textcxx . . $ cube_struct#text.) - 1;
112 static const uintcxx . . $ uint# cube_line_widthcxx . . $ cube_line_width. = 150;
113
114 /*** Functions ***/
115 static Uint8cxx . . $ Uint8# *playeritem_mapcxx . . $ playeritem_map(16bd7c477ce26027).(PlayerItemscxx . . $ PlayerItems# *items, uintcxx . . $ uint# i)
116 {
117 Uint8cxx . . $ Uint8# *const map[] =
118 {
119 &items->shipcxx . . $ $anonymous_type_55bed0e189d5bed_2#ship.,
120 &items->weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[FRONT_WEAPONcxx . . $ FRONT_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.,
121 &items->weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[REAR_WEAPONcxx . . $ REAR_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.,
122 &items->shieldcxx . . $ $anonymous_type_55bed0e189d5bed_2#shield.,
123 &items->generatorcxx . . $ $anonymous_type_55bed0e189d5bed_2#generator.,
124 &items->sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_2#sidekick.[LEFT_SIDEKICKcxx . . $ LEFT_SIDEKICK.],
125 &items->sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_2#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.],
126 };
127 assertcxx . . $ `/usr/include/assert.h:50:10`!(i < COUNTOF(map));
128 return map[i];
129 }
130
131 JE_longintcxx . . $ JE_longint# JE_cashLeftcxx . . $ JE_cashLeft(b126dc7c1de90089).(void)
132 {
133 JE_longintcxx . . $ JE_longint# tempL = playercxx . . $ player.[0].cashcxx . . $ $anonymous_type_55bed0e189d5bed_4#cash.;
134 JE_wordcxx . . $ JE_word# itemNum = *playeritem_mapcxx . . $ playeritem_map(16bd7c477ce26027).(&playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items., curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] - 2);
135
136 tempL -= JE_getCostcxx . . $ JE_getCost(787d21ae4415b813).(curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.], itemNum);
137
138 tempWcxx . . $ tempW. = 0;
139
140 switch (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.])
141 {
142 case 3:
143 case 4:
144 for (uintcxx . . $ uint# i = 1; i < playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-3].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power.; ++i)
145 {
146 tempWcxx . . $ tempW. += weaponPortcxx . . $ weaponPort.[itemNum].costcxx . . $ $anonymous_type_66fcae0887b82ce8_1#cost. * i;
147 tempL -= tempWcxx . . $ tempW.;
148 }
149 break;
150 }
151
152 return tempL;
153 }
154
155 void JE_itemScreencxx . . $ JE_itemScreen(49f6e7a06ebc5aa8).(void)
156 {
157 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! quit = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
158
159 if (shopSpriteSheetcxx . . $ shopSpriteSheet..datacxx . . $ $anonymous_type_297934740aeafb7d_2#data. == NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!)
160 JE_loadCompShapescxx . . $ JE_loadCompShapes(676db0deaa5c5c40).(&shopSpriteSheetcxx . . $ shopSpriteSheet., '1');
161
162 load_cubescxx . . $ load_cubes(49f6e7a06ebc5aa8).();
163
164 VGAScreencxx . . $ VGAScreen. = VGAScreenSegcxx . . $ VGAScreenSeg.;
165
166 memcpycxx . . $ memcpy(cc817cb175f282d).(menuChoicescxx . . $ menuChoices., menuChoicesDefaultcxx . . $ menuChoicesDefault., sizeof(menuChoicescxx . . $ menuChoices.));
167
168 play_songcxx . . $ play_song(cb2f890c2fdad230).(songBuycxx . . $ songBuy.);
169
170 JE_loadPiccxx . . $ JE_loadPic(4846ed2ea5b0a844).(VGAScreencxx . . $ VGAScreen., 1, falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
171
172 curPalcxx . . $ curPal. = 1;
173 newPalcxx . . $ newPal. = 0;
174
175 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).();
176
177 set_palettecxx . . $ set_palette(e7c4d2139a064c7f).(colorscxx . . $ colors., 0, 255);
178
179 colcxx . . $ col. = 1;
180 gameLoadedcxx . . $ gameLoaded. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
181 curItemTypecxx . . $ curItemType. = 1;
182 cursorcxx . . $ cursor. = 1;
183 curItemcxx . . $ curItem. = 0;
184
185 for (unsigned int i = 0; i < COUNTOFcxx . . $ `src/opentyr.h:27:9`!(curSel); ++i)
186 curSelcxx . . $ curSel.[i] = 2;
187
188 curMenucxx . . $ curMenu. = MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.;
189
190 int temp_weapon_power[7]; // assumes there'll never be more than 6 weapons to choose from, 7th is "Done"
191
192 /* JE: (* Check for where Pitems and Select match up - if no match then add to the itemavail list *) */
193 for (int i = 0; i < 7; i++)
194 {
195 int item = *playeritem_mapcxx . . $ playeritem_map(16bd7c477ce26027).(&playercxx . . $ player.[0].last_itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#last_items., i);
196
197 int slot = 0;
198
199 for (; slot < itemAvailMaxcxx . . $ itemAvailMax.[itemAvailMapcxx . . $ itemAvailMap.[i]-1]; ++slot)
200 {
201 if (itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[i]-1][slot] == item)
202 break;
203 }
204
205 if (slot == itemAvailMaxcxx . . $ itemAvailMax.[itemAvailMapcxx . . $ itemAvailMap.[i]-1])
206 {
207 itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[i]-1][slot] = item;
208 itemAvailMaxcxx . . $ itemAvailMax.[itemAvailMapcxx . . $ itemAvailMap.[i]-1]++;
209 }
210 }
211
212 memcpycxx . . $ memcpy(cc817cb175f282d).(VGAScreen2cxx . . $ VGAScreen2.->pixelscxx . . $ SDL_Surface#pixels., VGAScreencxx . . $ VGAScreen.->pixelscxx . . $ SDL_Surface#pixels., VGAScreen2cxx . . $ VGAScreen2.->pitchcxx . . $ SDL_Surface#pitch. * VGAScreen2cxx . . $ VGAScreen2.->hcxx . . $ SDL_Surface#h.);
213
214 keyboardUsedcxx . . $ keyboardUsed. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
215 firstMenu9cxx . . $ firstMenu9. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
216 backFromHelpcxx . . $ backFromHelp. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
217
218 /* JE: Sort items in merchant inventory */
219 for (int x = 0; x < 9; x++)
220 {
221 if (itemAvailMaxcxx . . $ itemAvailMax.[x] > 1)
222 {
223 for (tempcxx . . $ temp. = 0; tempcxx . . $ temp. < itemAvailMaxcxx . . $ itemAvailMax.[x] - 1; tempcxx . . $ temp.++)
224 {
225 for (temp2cxx . . $ temp2. = tempcxx . . $ temp.; temp2cxx . . $ temp2. < itemAvailMaxcxx . . $ itemAvailMax.[x]; temp2cxx . . $ temp2.++)
226 {
227 if (itemAvailcxx . . $ itemAvail.[x][tempcxx . . $ temp.] == 0 || (itemAvailcxx . . $ itemAvail.[x][tempcxx . . $ temp.] > itemAvailcxx . . $ itemAvail.[x][temp2cxx . . $ temp2.] && itemAvailcxx . . $ itemAvail.[x][temp2cxx . . $ temp2.] != 0))
228 {
229 temp3cxx . . $ temp3. = itemAvailcxx . . $ itemAvail.[x][tempcxx . . $ temp.];
230 itemAvailcxx . . $ itemAvail.[x][tempcxx . . $ temp.] = itemAvailcxx . . $ itemAvail.[x][temp2cxx . . $ temp2.];
231 itemAvailcxx . . $ itemAvail.[x][temp2cxx . . $ temp2.] = temp3cxx . . $ temp3.;
232 }
233 }
234 }
235 }
236 }
237
238 do
239 {
240 quit = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
241
242 JE_getShipInfocxx . . $ JE_getShipInfo(49f6e7a06ebc5aa8).();
243
244 if (curMenucxx . . $ curMenu. == MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.)
245 {
246 if (twoPlayerModecxx . . $ twoPlayerMode.)
247 curMenucxx . . $ curMenu. = MENU_2_PLAYER_ARCADEcxx . . $ MENU_2_PLAYER_ARCADE.;
248
249 if (isNetworkGamecxx . . $ isNetworkGame. || onePlayerActioncxx . . $ onePlayerAction.)
250 curMenucxx . . $ curMenu. = MENU_1_PLAYER_ARCADEcxx . . $ MENU_1_PLAYER_ARCADE.;
251
252 if (superTyriancxx . . $ superTyrian.)
253 curMenucxx . . $ curMenu. = MENU_SUPER_TYRIANcxx . . $ MENU_SUPER_TYRIAN.;
254 }
255
256 paletteChangedcxx . . $ paletteChanged. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
257
258 leftPowercxx . . $ leftPower. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
259 rightPowercxx . . $ rightPower. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
260
261 /* SYN: note reindexing... "firstMenu9" refers to Menu 8 here :( */
262 if (curMenucxx . . $ curMenu. != MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB. || firstMenu9cxx . . $ firstMenu9.)
263 {
264 memcpycxx . . $ memcpy(cc817cb175f282d).(VGAScreencxx . . $ VGAScreen.->pixelscxx . . $ SDL_Surface#pixels., VGAScreen2cxx . . $ VGAScreen2.->pixelscxx . . $ SDL_Surface#pixels., VGAScreencxx . . $ VGAScreen.->pitchcxx . . $ SDL_Surface#pitch. * VGAScreencxx . . $ VGAScreen.->hcxx . . $ SDL_Surface#h.);
265 }
266
267 if (curMenucxx . . $ curMenu. == MENU_UPGRADEScxx . . $ MENU_UPGRADES. &&
268 (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] == 3 || curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] == 4))
269 {
270 // reset temp_weapon_power[] every time we select upgrading front or back
271 const uintcxx . . $ uint# item = playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] - 3].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.,
272 item_power = playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] - 3].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power.,
273 i = curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] - 2; // 1 or 2 (front or rear)
274
275 // set power level of owned weapon
276 for (int slot = 0; slot < itemAvailMaxcxx . . $ itemAvailMax.[itemAvailMapcxx . . $ itemAvailMap.[i]-1]; ++slot)
277 {
278 if (itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[i]-1][slot] == item)
279 temp_weapon_power[slot] = item_power;
280 else
281 temp_weapon_power[slot] = 1;
282 }
283
284 // set power level for "Done"
285 temp_weapon_power[itemAvailMaxcxx . . $ itemAvailMax.[itemAvailMapcxx . . $ itemAvailMap.[i]-1]] = item_power;
286 }
287
288 if (curMenucxx . . $ curMenu. == MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.)
289 {
290 planetAnicxx . . $ planetAni. = 0;
291 keyboardUsedcxx . . $ keyboardUsed. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
292 currentDotNumcxx . . $ currentDotNum. = 0;
293 currentDotWaitcxx . . $ currentDotWait. = 8;
294 planetAniWaitcxx . . $ planetAniWait. = 3;
295 JE_updateNavScreencxx . . $ JE_updateNavScreen(49f6e7a06ebc5aa8).();
296 }
297
298 /* Draw menu title for everything but upgrade ship submenus */
299 if (curMenucxx . . $ curMenu. != MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.)
300 {
301 JE_drawMenuHeadercxx . . $ JE_drawMenuHeader(49f6e7a06ebc5aa8).();
302 }
303
304 /* Draw menu choices for simple menus */
305 if ((curMenucxx . . $ curMenu. >= MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME. && curMenucxx . . $ curMenu. <= MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.) ||
306 (curMenucxx . . $ curMenu. >= MENU_2_PLAYER_ARCADEcxx . . $ MENU_2_PLAYER_ARCADE. && curMenucxx . . $ curMenu. <= MENU_LIMITED_OPTIONScxx . . $ MENU_LIMITED_OPTIONS.) ||
307 curMenucxx . . $ curMenu. == MENU_SUPER_TYRIANcxx . . $ MENU_SUPER_TYRIAN.)
308 {
309 JE_drawMenuChoicescxx . . $ JE_drawMenuChoices(49f6e7a06ebc5aa8).();
310 }
311
312 /* Data cube icons */
313 if (curMenucxx . . $ curMenu. == MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.)
314 {
315 for (int i = 1; i <= cubeMaxcxx . . $ cubeMax.; i++)
316 {
317 blit_sprite_darkcxx . . $ blit_sprite_dark(34bc9a7b28a4eeec).(VGAScreencxx . . $ VGAScreen., 190 + i * 18 + 2, 37 + 1, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 34, falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
318 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreencxx . . $ VGAScreen., 190 + i * 18, 37, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 34); // data cube
319 }
320 }
321
322 /* load/save menu */
323 if (curMenucxx . . $ curMenu. == MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE.)
324 {
325 int min, max;
326
327 if (twoPlayerModecxx . . $ twoPlayerMode.)
328 {
329 min = 13;
330 max = 24;
331 }
332 else
333 {
334 min = 2;
335 max = 13;
336 }
337
338 for (int x = min; x <= max; x++)
339 {
340 /* Highlight if current selection */
341 temp2cxx . . $ temp2. = (x - min + 2 == curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.]) ? 15 : 28;
342
343 /* Write save game slot */
344 if (x == max)
345 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., miscTextcxx . . $ miscText.[6-1]);
346 else if (saveFilescxx . . $ saveFiles.[x-2].levelcxx . . $ $anonymous_type_5227559294d527ce_2#level. == 0)
347 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., miscTextcxx . . $ miscText.[3-1]);
348 else
349 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., saveFilescxx . . $ saveFiles.[x-2].namecxx . . $ $anonymous_type_5227559294d527ce_2#name.);
350
351 int tempY = 38 + (x - min)*11;
352
353 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 163, tempY, tempStrcxx . . $ tempStr., temp2cxx . . $ temp2. / 16, temp2cxx . . $ temp2. % 16 - 8, DARKENcxx . . $ `src/fonthand.h:28:9`!);
354
355 if (x < max) /* x == max isn't a save slot */
356 {
357 /* Highlight if current selection */
358 temp2cxx . . $ temp2. = (x - min + 2 == curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.]) ? 252 : 250;
359
360 if (saveFilescxx . . $ saveFiles.[x-2].levelcxx . . $ $anonymous_type_5227559294d527ce_2#level. == 0)
361 {
362 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., "-----"); /* Empty save slot */
363 }
364 else
365 {
366 char buf[20];
367
368 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., saveFilescxx . . $ saveFiles.[x-2].levelNamecxx . . $ $anonymous_type_5227559294d527ce_2#levelName.);
369
370 snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, sizeof buf, "%s%d", miscTextBcxx . . $ miscTextB.[1-1], saveFilescxx . . $ saveFiles.[x-2].episodecxx . . $ $anonymous_type_5227559294d527ce_2#episode.);
371 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 297, tempY, buf, temp2cxx . . $ temp2. / 16, temp2cxx . . $ temp2. % 16 - 8, DARKENcxx . . $ `src/fonthand.h:28:9`!);
372 }
373
374 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 245, tempY, tempStrcxx . . $ tempStr., temp2cxx . . $ temp2. / 16, temp2cxx . . $ temp2. % 16 - 8, DARKENcxx . . $ `src/fonthand.h:28:9`!);
375 }
376
377 JE_drawMenuHeadercxx . . $ JE_drawMenuHeader(49f6e7a06ebc5aa8).();
378 }
379 }
380
381 if (curMenucxx . . $ curMenu. == MENU_KEYBOARD_CONFIGcxx . . $ MENU_KEYBOARD_CONFIG.)
382 {
383 for (int x = 2; x <= 11; x++)
384 {
385 if (x == curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
386 {
387 temp2cxx . . $ temp2. = 15;
388 }
389 else
390 {
391 temp2cxx . . $ temp2. = 28;
392 }
393
394 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 166, 38 + (x - 2)*12, menuIntcxx . . $ menuInt.[curMenucxx . . $ curMenu. + 1][x-1], temp2cxx . . $ temp2. / 16, temp2cxx . . $ temp2. % 16 - 8, DARKENcxx . . $ `src/fonthand.h:28:9`!);
395
396 if (x < 10) /* 10 = reset to defaults, 11 = done */
397 {
398 temp2cxx . . $ temp2. = (x == curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.]) ? 252 : 250;
399 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 236, 38 + (x - 2)*12, SDL_GetScancodeNamecxx . . $ SDL_GetScancodeName(784ff5cdfe45052d).(keySettingscxx . . $ keySettings.[x-2]), temp2cxx . . $ temp2. / 16, temp2cxx . . $ temp2. % 16 - 8, DARKENcxx . . $ `src/fonthand.h:28:9`!);
400 }
401 }
402
403 menuChoicescxx . . $ menuChoices.[MENU_KEYBOARD_CONFIGcxx . . $ MENU_KEYBOARD_CONFIG.] = 11;
404 }
405
406 if (curMenucxx . . $ curMenu. == MENU_JOYSTICK_CONFIGcxx . . $ MENU_JOYSTICK_CONFIG.)
407 {
408 const char *const menu_item[] =
409 {
410 "JOYSTICK",
411 "ANALOG AXES",
412 " SENSITIVITY",
413 " THRESHOLD",
414 menuIntcxx . . $ menuInt.[6][1],
415 menuIntcxx . . $ menuInt.[6][4],
416 menuIntcxx . . $ menuInt.[6][2],
417 menuIntcxx . . $ menuInt.[6][3],
418 menuIntcxx . . $ menuInt.[6][5],
419 menuIntcxx . . $ menuInt.[6][6],
420 menuIntcxx . . $ menuInt.[6][7],
421 menuIntcxx . . $ menuInt.[6][8],
422 "MENU",
423 "PAUSE",
424 menuIntcxx . . $ menuInt.[6][9],
425 menuIntcxx . . $ menuInt.[6][10]
426 };
427
428 for (uintcxx . . $ uint# i = 0; i < COUNTOFcxx . . $ `src/opentyr.h:27:9`!(menu_item); i++)
429 {
430 int temp = (i == curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] - 2u) ? 15 : 28;
431
432 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 166, 38 + i * 8, menu_item[i], temp / 16, temp % 16 - 8, DARKENcxx . . $ `src/fonthand.h:28:9`!);
433
434 temp = (i == curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] - 2u) ? 252 : 250;
435
436 char value[30] = "";
437 if (joystickscxx . . $ joysticks. == 0 && i < 14) // no joysticks, everything disabled
438 {
439 sprintfcxx . . $ sprintf(26c8642d26409d6d).(value, "-");
440 }
441 else if (i == 0) // joystick number
442 {
443 sprintfcxx . . $ sprintf(26c8642d26409d6d).(value, "%d", joystick_configcxx . . $ joystick_config. + 1);
444 }
445 else if (i == 1) // joystick is analog
446 {
447 sprintfcxx . . $ sprintf(26c8642d26409d6d).(value, "%s", joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog. ? "TRUE" : "FALSE");
448 }
449 else if (i < 4) // joystick analog settings
450 {
451 if (!joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog.)
452 temp -= 3;
453 sprintfcxx . . $ sprintf(26c8642d26409d6d).(value, "%d", i == 2 ? joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].sensitivitycxx . . $ $anonymous_type_abd17893024d7112_2#sensitivity. : joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].thresholdcxx . . $ $anonymous_type_abd17893024d7112_2#threshold.);
454 }
455 else if (i < 14) // assignments
456 {
457 joystick_assignments_to_stringcxx . . $ joystick_assignments_to_string(20ca3e504103fe2).(value, sizeof(value), joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].assignmentcxx . . $ $anonymous_type_abd17893024d7112_2#assignment.[i - 4]);
458 }
459
460 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 236, 38 + i * 8, value, temp / 16, temp % 16 - 8, DARKENcxx . . $ `src/fonthand.h:28:9`!);
461 }
462
463 menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.] = COUNTOFcxx . . $ `src/opentyr.h:27:9`!(menu_item) + 1;
464 }
465
466 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.)
467 {
468 /* Move cursor until we hit either "Done" or a weapon the player can afford */
469 while (curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] < menuChoicescxx . . $ menuChoices.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] &&
470 JE_getCostcxx . . $ JE_getCost(787d21ae4415b813).(curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.], itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-2]-1][curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2]) > playercxx . . $ player.[0].cashcxx . . $ $anonymous_type_55bed0e189d5bed_4#cash.)
471 {
472 curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] += lastDirectioncxx . . $ lastDirection.;
473 if (curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] < 2)
474 curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] = menuChoicescxx . . $ menuChoices.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.];
475 else if (curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] > menuChoicescxx . . $ menuChoices.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.])
476 curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] = 2;
477 }
478
479 if (curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] == menuChoicescxx . . $ menuChoices.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.])
480 {
481 /* If cursor on "Done", use previous weapon */
482 *playeritem_mapcxx . . $ playeritem_map(16bd7c477ce26027).(&playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items., curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] - 2) = *playeritem_mapcxx . . $ playeritem_map(16bd7c477ce26027).(&old_itemscxx . . $ old_items.[0], curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] - 2);
483 }
484 else
485 {
486 /* Otherwise display the selected weapon */
487 *playeritem_mapcxx . . $ playeritem_map(16bd7c477ce26027).(&playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items., curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] - 2) = itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-2]-1][curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2];
488 }
489
490 /* Get power level info for front and rear weapons */
491 if ((curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 3 || curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4) && // front or rear weapon
492 curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] < menuChoicescxx . . $ menuChoices.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] && // not "Done"
493 itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-2]-1][curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2] != 0) // not "None"
494 {
495 const uintcxx . . $ uint# port = curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] - 3, // 0 or 1 (front or back)
496 item_level = playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[port].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power.;
497
498 // calculate upgradeCost
499 JE_getCostcxx . . $ JE_getCost(787d21ae4415b813).(curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.], itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-2]-1][curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2]);
500
501 leftPowercxx . . $ leftPower. = item_level > 1; // can downgrade
502 rightPowercxx . . $ rightPower. = item_level < 11; // can upgrade
503
504 if (rightPowercxx . . $ rightPower.)
505 rightPowerAffordcxx . . $ rightPowerAfford. = JE_cashLeftcxx . . $ JE_cashLeft(b126dc7c1de90089).() >= upgradeCostcxx . . $ upgradeCost.; // can afford upgrade
506 }
507 else
508 {
509 /* Nothing else can be upgraded / downgraded */
510 leftPowercxx . . $ leftPower. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
511 rightPowercxx . . $ rightPower. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
512 }
513
514 /* submenu title e.g., "Left Sidekick" */
515 JE_dStringcxx . . $ JE_dString(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 74 + JE_fontCentercxx . . $ JE_fontCenter(1df18506ef0a631b).(menuIntcxx . . $ menuInt.[2][curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-1], FONT_SHAPEScxx . . $ `src/sprite.h:29:9`!), 10, menuIntcxx . . $ menuInt.[2][curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-1], FONT_SHAPEScxx . . $ `src/sprite.h:29:9`!);
516
517 /* Iterate through all submenu options */
518 for (tempWcxx . . $ tempW. = 1; tempWcxx . . $ tempW. < menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.]; tempWcxx . . $ tempW.++)
519 {
520 int tempY = 40 + (tempWcxx . . $ tempW.-1) * 26; /* Calculate y position */
521 uintcxx . . $ uint# temp_cost;
522
523 /* Is this a item or None/DONE? */
524 if (tempWcxx . . $ tempW. < menuChoicescxx . . $ menuChoices.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] - 1)
525 {
526 /* Get base cost for choice */
527 temp_cost = JE_getCostcxx . . $ JE_getCost(787d21ae4415b813).(curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.], itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-2]-1][tempWcxx . . $ tempW.-1]);
528 }
529 else
530 {
531 /* "None" is free :) */
532 temp_cost = 0;
533 }
534
535 int afford_shade = (temp_cost > playercxx . . $ player.[0].cashcxx . . $ $anonymous_type_55bed0e189d5bed_4#cash.) ? 4 : 0; // can player afford current weapon at all
536
537 tempcxx . . $ temp. = itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-2]-1][tempWcxx . . $ tempW.-1]; /* Item ID */
538 switch (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-1)
539 {
540 case 1: /* ship */
541 if (tempcxx . . $ temp. > 90)
542 snprintfcxx . . $ snprintf(ea502d73e74c754c).(tempStrcxx . . $ tempStr., sizeof(tempStrcxx . . $ tempStr.), "Custom Ship %d", tempcxx . . $ temp. - 90);
543 else
544 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., shipscxx . . $ ships.[tempcxx . . $ temp.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_6#name.);
545 break;
546 case 2: /* front and rear weapon */
547 case 3:
548 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., weaponPortcxx . . $ weaponPort.[tempcxx . . $ temp.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_1#name.);
549 break;
550 case 4: /* shields */
551 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., shieldscxx . . $ shields.[tempcxx . . $ temp.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_5#name.);
552 break;
553 case 5: /* generator */
554 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., powerSyscxx . . $ powerSys.[tempcxx . . $ temp.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_2#name.);
555 break;
556 case 6: /* sidekicks */
557 case 7:
558 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., optionscxx . . $ options.[tempcxx . . $ temp.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_4#name.);
559 break;
560 }
561 if (tempWcxx . . $ tempW. == curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.]-1)
562 temp2cxx . . $ temp2. = 15;
563 else
564 temp2cxx . . $ temp2. = 28;
565
566 JE_getShipInfocxx . . $ JE_getShipInfo(49f6e7a06ebc5aa8).();
567
568 /* item-owned marker */
569 if (tempcxx . . $ temp. == *playeritem_mapcxx . . $ playeritem_map(16bd7c477ce26027).(&old_itemscxx . . $ old_items.[0], curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] - 2) && tempcxx . . $ temp. != 0 && tempWcxx . . $ tempW. != menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.]-1)
570 {
571 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 160, tempY+7, 300, tempY+11, 227);
572 blit_sprite2cxx . . $ blit_sprite2(b5d0f2be3b000a5b).(VGAScreencxx . . $ VGAScreen., 298, tempY+2, shopSpriteSheetcxx . . $ shopSpriteSheet., 247);
573 }
574
575 /* Draw DONE */
576 if (tempWcxx . . $ tempW. == menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.]-1)
577 {
578 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., miscTextcxx . . $ miscText.[13]);
579 }
580 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 185, tempY, tempStrcxx . . $ tempStr., temp2cxx . . $ temp2. / 16, temp2cxx . . $ temp2. % 16 - 8 - afford_shade, DARKENcxx . . $ `src/fonthand.h:28:9`!);
581
582 /* Draw icon if not DONE. NOTE: None is a normal item with a blank icon. */
583 if (tempWcxx . . $ tempW. < menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.]-1)
584 {
585 JE_drawItemcxx . . $ JE_drawItem(4685b0c8ee28a575).(curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-1, tempcxx . . $ temp., 160, tempY-4);
586 }
587
588 /* Make selected text brighter */
589 temp2cxx . . $ temp2. = (tempWcxx . . $ tempW. == curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.]-1) ? 15 : 28;
590
591 /* Draw Cost: if it's not the DONE option */
592 if (tempWcxx . . $ tempW. != menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.]-1)
593 {
594 char buf[20];
595
596 snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, sizeof buf, "Cost: %d", temp_cost);
597 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 187, tempY+10, buf, temp2cxx . . $ temp2. / 16, temp2cxx . . $ temp2. % 16 - 8 - afford_shade, DARKENcxx . . $ `src/fonthand.h:28:9`!);
598 }
599 }
600 }
601
602 /* Draw current money and shield/armor bars, when appropriate */
603 if (((curMenucxx . . $ curMenu. <= MENU_OPTIONScxx . . $ MENU_OPTIONS. ||
604 curMenucxx . . $ curMenu. == MENU_KEYBOARD_CONFIGcxx . . $ MENU_KEYBOARD_CONFIG. ||
605 curMenucxx . . $ curMenu. == MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE. ||
606 curMenucxx . . $ curMenu. >= MENU_1_PLAYER_ARCADEcxx . . $ MENU_1_PLAYER_ARCADE.) &&
607 !twoPlayerModecxx . . $ twoPlayerMode.) ||
608 (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. &&
609 (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] >= 1 && curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] <= 6)))
610 {
611 if (curMenucxx . . $ curMenu. != MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.)
612 {
613 char buf[20];
614
615 snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, sizeof buf, "%lu", playercxx . . $ player.[0].cashcxx . . $ $anonymous_type_55bed0e189d5bed_4#cash.);
616 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 65, 173, buf, 1, 6, DARKENcxx . . $ `src/fonthand.h:28:9`!);
617 }
618 JE_barDrawShadowcxx . . $ JE_barDrawShadow(2b5d735fb21d70c8).(VGAScreencxx . . $ VGAScreen., 42, 152, 3, 14, playercxx . . $ player.[0].armorcxx . . $ $anonymous_type_55bed0e189d5bed_4#armor., 2, 13);
619 JE_barDrawShadowcxx . . $ JE_barDrawShadow(2b5d735fb21d70c8).(VGAScreencxx . . $ VGAScreen., 104, 152, 2, 14, shieldscxx . . $ shields.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..shieldcxx . . $ $anonymous_type_55bed0e189d5bed_2#shield.].mpwrcxx . . $ $anonymous_type_66fcae0887b82ce8_5#mpwr. * 2, 2, 13);
620 }
621
622 /* Draw crap on the left side of the screen, i.e. two player scores, ship graphic, etc. */
623 if ((curMenucxx . . $ curMenu. >= MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME. && curMenucxx . . $ curMenu. <= MENU_OPTIONScxx . . $ MENU_OPTIONS.) ||
624 curMenucxx . . $ curMenu. == MENU_KEYBOARD_CONFIGcxx . . $ MENU_KEYBOARD_CONFIG. ||
625 curMenucxx . . $ curMenu. == MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE. ||
626 curMenucxx . . $ curMenu. >= MENU_2_PLAYER_ARCADEcxx . . $ MENU_2_PLAYER_ARCADE. ||
627 (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. &&
628 (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 2 || curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 5)))
629 {
630 if (twoPlayerModecxx . . $ twoPlayerMode.)
631 {
632 char buf[50];
633
634 for (uintcxx . . $ uint# i = 0; i < 2; ++i)
635 {
636 snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, sizeof(buf), "%s %lu", miscTextcxx . . $ miscText.[40 + i], playercxx . . $ player.[i].cashcxx . . $ $anonymous_type_55bed0e189d5bed_4#cash.);
637 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 25, 50 + 10 * i, buf, 15, 0, FULL_SHADEcxx . . $ `src/fonthand.h:27:9`!);
638 }
639 }
640 else if (superArcadeModecxx . . $ superArcadeMode. != SA_NONEcxx . . $ SA_NONE. || superTyriancxx . . $ superTyrian.)
641 {
642 helpBoxColorcxx . . $ helpBoxColor. = 15;
643 helpBoxBrightnesscxx . . $ helpBoxBrightness. = 4;
644 if (!superTyriancxx . . $ superTyrian.)
645 JE_helpBoxcxx . . $ JE_helpBox(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 35, 25, superShipscxx . . $ superShips.[superArcadeModecxx . . $ superArcadeMode.], 18);
646 else
647 JE_helpBoxcxx . . $ JE_helpBox(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 35, 25, superShipscxx . . $ superShips.[SAcxx . . $ `src/varz.h:29:9`!+3], 18);
648 helpBoxBrightnesscxx . . $ helpBoxBrightness. = 1;
649
650 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 25, 50, superShipscxx . . $ superShips.[SAcxx . . $ `src/varz.h:29:9`!+1], 15, 0, FULL_SHADEcxx . . $ `src/fonthand.h:27:9`!);
651 JE_helpBoxcxx . . $ JE_helpBox(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 25, 60, weaponPortcxx . . $ weaponPort.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[FRONT_WEAPONcxx . . $ FRONT_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_1#name., 22);
652 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 25, 120, superShipscxx . . $ superShips.[SAcxx . . $ `src/varz.h:29:9`!+2], 15, 0, FULL_SHADEcxx . . $ `src/fonthand.h:27:9`!);
653 JE_helpBoxcxx . . $ JE_helpBox(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 25, 130, specialcxx . . $ special.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..specialcxx . . $ $anonymous_type_55bed0e189d5bed_2#special.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_3#name., 22);
654 }
655 else
656 {
657 draw_ship_illustrationcxx . . $ draw_ship_illustration(49f6e7a06ebc5aa8).();
658 }
659 }
660
661 /* Changing the volume? */
662 if (curMenucxx . . $ curMenu. == MENU_OPTIONScxx . . $ MENU_OPTIONS. ||
663 curMenucxx . . $ curMenu. == MENU_LIMITED_OPTIONScxx . . $ MENU_LIMITED_OPTIONS.)
664 {
665 JE_barDrawShadowcxx . . $ JE_barDrawShadow(2b5d735fb21d70c8).(VGAScreencxx . . $ VGAScreen., 225, 70, 1, music_disabledcxx . . $ music_disabled. ? 12 : 16, tyrMusicVolumecxx . . $ tyrMusicVolume. / 12, 3, 13);
666 JE_barDrawShadowcxx . . $ JE_barDrawShadow(2b5d735fb21d70c8).(VGAScreencxx . . $ VGAScreen., 225, 86, 1, samples_disabledcxx . . $ samples_disabled. ? 12 : 16, fxVolumecxx . . $ fxVolume. / 12, 3, 13);
667 }
668
669 /* "firstmenu9" refers to menu 8 because of reindexing */
670 if (curMenucxx . . $ curMenu. == MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES. ||
671 (curMenucxx . . $ curMenu. == MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB. && (firstMenu9cxx . . $ firstMenu9. || backFromHelpcxx . . $ backFromHelp.)))
672 {
673 firstMenu9cxx . . $ firstMenu9. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
674 menuChoicescxx . . $ menuChoices.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] = cubeMaxcxx . . $ cubeMax. + 2;
675 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 1, 1, 145, 170, 0);
676
677 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., 1, 1, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 20); /* Portrait area background */
678
679 if (curMenucxx . . $ curMenu. == MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.)
680 {
681 if (cubeMaxcxx . . $ cubeMax. == 0)
682 {
683 JE_helpBoxcxx . . $ JE_helpBox(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 166, 80, miscTextcxx . . $ miscText.[16 - 1], 30);
684 tempWcxx . . $ tempW. = 160;
685 temp2cxx . . $ temp2. = 252;
686 }
687 else
688 {
689 for (int x = 1; x <= cubeMaxcxx . . $ cubeMax.; x++)
690 {
691 JE_drawCubecxx . . $ JE_drawCube(bea9694d51014729).(VGAScreenSegcxx . . $ VGAScreenSeg., 166, 38 + (x - 1) * 28, 13, 0);
692 if (x + 1 == curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
693 {
694 temp2cxx . . $ temp2. = 252;
695 }
696 else
697 {
698 temp2cxx . . $ temp2. = 250;
699 }
700
701 helpBoxColorcxx . . $ helpBoxColor. = temp2cxx . . $ temp2. / 16;
702 helpBoxBrightnesscxx . . $ helpBoxBrightness. = (temp2cxx . . $ temp2. % 16) - 8;
703 helpBoxShadeTypecxx . . $ helpBoxShadeType. = DARKENcxx . . $ `src/fonthand.h:28:9`!;
704 JE_helpBoxcxx . . $ JE_helpBox(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 192, 44 + (x - 1) * 28, cubecxx . . $ cube.[x - 1].titlecxx . . $ cube_struct#title., 24);
705 }
706 int x = cubeMaxcxx . . $ cubeMax. + 1;
707 if (x + 1 == curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
708 {
709 temp2cxx . . $ temp2. = 252;
710 }
711 else
712 {
713 temp2cxx . . $ temp2. = 250;
714 }
715 tempWcxx . . $ tempW. = 44 + (x - 1) * 28;
716 }
717
718 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 172, tempWcxx . . $ tempW., miscTextcxx . . $ miscText.[6 - 1], temp2cxx . . $ temp2. / 16, (temp2cxx . . $ temp2. % 16) - 8, DARKENcxx . . $ `src/fonthand.h:28:9`!);
719 }
720
721 if (curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] < menuChoicescxx . . $ menuChoices.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.])
722 {
723 const int face_sprite = cubecxx . . $ cube.[curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] - 2].face_spritecxx . . $ cube_struct#face_sprite.;
724
725 if (face_sprite != -1)
726 {
727 const int face_x = 77 - (spritecxx . . $ sprite(d067a90ab23634af).(FACE_SHAPEScxx . . $ `src/sprite.h:33:9`!, face_sprite)->widthcxx . . $ $anonymous_type_297934740aeafb7d_0#width. / 2),
728 face_y = 92 - (spritecxx . . $ sprite(d067a90ab23634af).(FACE_SHAPEScxx . . $ `src/sprite.h:33:9`!, face_sprite)->heightcxx . . $ $anonymous_type_297934740aeafb7d_0#height. / 2);
729
730 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., face_x, face_y, FACE_SHAPEScxx . . $ `src/sprite.h:33:9`!, face_sprite); // datacube face
731
732 // modify palette for face
733 paletteChangedcxx . . $ paletteChanged. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
734 temp2cxx . . $ temp2. = facepalcxx . . $ facepal.[face_sprite];
735 newPalcxx . . $ newPal. = 0;
736
737 for (tempcxx . . $ temp. = 1; tempcxx . . $ temp. <= 255 - (3 * 16); tempcxx . . $ temp.++)
738 colorscxx . . $ colors.[tempcxx . . $ temp.] = palettescxx . . $ palettes.[temp2cxx . . $ temp2.][tempcxx . . $ temp.];
739 }
740 }
741 }
742
743 /* 2 player input devices */
744 if (curMenucxx . . $ curMenu. == MENU_2_PLAYER_ARCADEcxx . . $ MENU_2_PLAYER_ARCADE.)
745 {
746 for (uintcxx . . $ uint# i = 0; i < COUNTOFcxx . . $ `src/opentyr.h:27:9`!(inputDevice); i++)
747 {
748 if (inputDevicecxx . . $ inputDevice.[i] > 2 + joystickscxx . . $ joysticks.)
749 inputDevicecxx . . $ inputDevice.[i] = inputDevicecxx . . $ inputDevice.[i == 0 ? 1 : 0] == 1 ? 2 : 1;
750
751 char temp[64];
752 if (joystickscxx . . $ joysticks. > 1 && inputDevicecxx . . $ inputDevice.[i] > 2)
753 sprintfcxx . . $ sprintf(26c8642d26409d6d).(temp, "%s %d", inputDevicescxx . . $ inputDevices.[2], inputDevicecxx . . $ inputDevice.[i] - 2);
754 else
755 sprintfcxx . . $ sprintf(26c8642d26409d6d).(temp, "%s", inputDevicescxx . . $ inputDevices.[inputDevicecxx . . $ inputDevice.[i] - 1]);
756 JE_dStringcxx . . $ JE_dString(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 186, 38 + 2 * (i + 1) * 16, temp, SMALL_FONT_SHAPEScxx . . $ `src/sprite.h:30:9`!);
757 }
758 }
759
760 /* JE: { - Step VI - Help text for current cursor location } */
761
762 flashcxx . . $ flash. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
763
764 /* JE: {Reset player weapons} */
765 memsetcxx . . $ memset(d1de1e4fb215f1c6).(shotMultiPoscxx . . $ shotMultiPos., 0, sizeof(shotMultiPoscxx . . $ shotMultiPos.));
766
767 JE_drawScorecxx . . $ JE_drawScore(49f6e7a06ebc5aa8).();
768
769 JE_drawMainMenuHelpTextcxx . . $ JE_drawMainMenuHelpText(49f6e7a06ebc5aa8).();
770
771 if (newPalcxx . . $ newPal. > 0) /* can't reindex this :( */
772 {
773 curPalcxx . . $ curPal. = newPalcxx . . $ newPal.;
774 memcpycxx . . $ memcpy(cc817cb175f282d).(colorscxx . . $ colors., palettescxx . . $ palettes.[newPalcxx . . $ newPal. - 1], sizeof(colorscxx . . $ colors.));
775 set_palettecxx . . $ set_palette(e7c4d2139a064c7f).(palettescxx . . $ palettes.[newPalcxx . . $ newPal. - 1], 0, 255);
776 newPalcxx . . $ newPal. = 0;
777 }
778
779 /* datacube title under face */
780 if ((curMenucxx . . $ curMenu. == MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES. || curMenucxx . . $ curMenu. == MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.) &&
781 curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] < menuChoicescxx . . $ menuChoices.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.])
782 {
783 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 75 - JE_textWidthcxx . . $ JE_textWidth(1df18506ef0a631b).(cubecxx . . $ cube.[curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] - 2].headercxx . . $ cube_struct#header., TINY_FONTcxx . . $ `src/sprite.h:31:9`!) / 2, 173, cubecxx . . $ cube.[curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] - 2].headercxx . . $ cube_struct#header., 14, 3, DARKENcxx . . $ `src/fonthand.h:28:9`!);
784 }
785
786 /* SYN: Everything above was just drawing the screen. In the rest of it, we process
787 any user input (and do a few other things) */
788
789 /* SYN: Let's start by getting fresh events from SDL */
790 service_SDL_eventscxx . . $ service_SDL_events(b45ddcbc8423892c).(truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
791
792 if (constantPlaycxx . . $ constantPlay.)
793 {
794 mainLevelcxx . . $ mainLevel. = mapSectioncxx . . $ mapSection.[mapPNumcxx . . $ mapPNum.-1];
795 jumpSectioncxx . . $ jumpSection. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
796 }
797 else
798 {
799 do
800 {
801 /* Inner loop -- this handles animations on menus that need them and handles
802 some keyboard events. Events it can't handle end the loop and fall through
803 to the main keyboard handler below.
804
805 Also, I think all timing is handled in here. Somehow. */
806
807 NETWORK_KEEP_ALIVEcxx . . $ `src/network.h:88:9`!();
808
809 mouseCursorcxx . . $ mouseCursor. = MOUSE_POINTER_NORMALcxx . . $ MOUSE_POINTER_NORMAL.;
810
811 colcxx . . $ col. += colCcxx . . $ colC.;
812 if (colcxx . . $ col. < -2 || colcxx . . $ col. > 6)
813 {
814 colCcxx . . $ colC. = (-1 * colCcxx . . $ colC.);
815 }
816
817 // data cube reading
818 if (curMenucxx . . $ curMenu. == MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.)
819 {
820 if (mouseXcxx . . $ mouseX. > 164 && mouseXcxx . . $ mouseX. < 299 && mouseYcxx . . $ mouseY. > 47 && mouseYcxx . . $ mouseY. < 153)
821 {
822 if (mouseYcxx . . $ mouseY. > 100)
823 mouseCursorcxx . . $ mouseCursor. = MOUSE_POINTER_DOWNcxx . . $ MOUSE_POINTER_DOWN.;
824 else
825 mouseCursorcxx . . $ mouseCursor. = MOUSE_POINTER_UPcxx . . $ MOUSE_POINTER_UP.;
826 }
827
828 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 160, 49, 310, 158, 228);
829 if (yLoccxx . . $ yLoc. + yChgcxx . . $ yChg. < 0)
830 {
831 yChgcxx . . $ yChg. = 0;
832 yLoccxx . . $ yLoc. = 0;
833 }
834
835 yLoccxx . . $ yLoc. += yChgcxx . . $ yChg.;
836 tempcxx . . $ temp. = yLoccxx . . $ yLoc. / 12;
837 temp2cxx . . $ temp2. = yLoccxx . . $ yLoc. % 12;
838 tempWcxx . . $ tempW. = 38 + 12 - temp2cxx . . $ temp2.;
839 temp3cxx . . $ temp3. = cubecxx . . $ cube.[curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] - 2].last_linecxx . . $ cube_struct#last_line.;
840
841 for (int x = tempcxx . . $ temp. + 1; x <= tempcxx . . $ temp. + 10; x++)
842 {
843 if (x <= temp3cxx . . $ temp3.)
844 {
845 JE_outTextAndDarkencxx . . $ JE_outTextAndDarken(6303b30c6464185e).(VGAScreencxx . . $ VGAScreen., 161, tempWcxx . . $ tempW., cubecxx . . $ cube.[curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] - 2].textcxx . . $ cube_struct#text.[x-1], 14, 3, TINY_FONTcxx . . $ `src/sprite.h:31:9`!);
846 tempWcxx . . $ tempW. += 12;
847 }
848 }
849
850 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 160, 39, 310, 48, 228);
851 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 160, 157, 310, 166, 228);
852
853 int percent_read = (cubecxx . . $ cube.[currentCubecxx . . $ currentCube.].last_linecxx . . $ cube_struct#last_line. <= 9)
854 ? 100
855 : (yLoccxx . . $ yLoc. * 100) / ((cubecxx . . $ cube.[currentCubecxx . . $ currentCube.].last_linecxx . . $ cube_struct#last_line. - 9) * 12);
856
857 char buf[55];
858 snprintfcxx . . $ snprintf(ea502d73e74c754c).(buf, sizeof(buf), "%s %d%%", miscTextcxx . . $ miscText.[11], percent_read);
859 JE_outTextAndDarkencxx . . $ JE_outTextAndDarken(6303b30c6464185e).(VGAScreencxx . . $ VGAScreen., 176, 160, buf, 14, 1, TINY_FONTcxx . . $ `src/sprite.h:31:9`!);
860
861 JE_dStringcxx . . $ JE_dString(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 260, 160, miscTextcxx . . $ miscText.[12], SMALL_FONT_SHAPEScxx . . $ `src/sprite.h:30:9`!);
862
863 if (temp2cxx . . $ temp2. == 0)
864 yChgcxx . . $ yChg. = 0;
865
866 JE_mouseStartcxx . . $ JE_mouseStart(49f6e7a06ebc5aa8).();
867
868 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).();
869
870 if (backFromHelpcxx . . $ backFromHelp.)
871 {
872 fade_palettecxx . . $ fade_palette(59ab901998e00635).(colorscxx . . $ colors., 10, 0, 255);
873 backFromHelpcxx . . $ backFromHelp. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
874 }
875 JE_mouseReplacecxx . . $ JE_mouseReplace(49f6e7a06ebc5aa8).();
876
877 setDelaycxx . . $ setDelay(d4f767463ce0a6b3).(1);
878 }
879 else
880 {
881 /* current menu is not 8 (read data cube) */
882
883 if (curMenucxx . . $ curMenu. == MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.)
884 {
885 JE_updateNavScreencxx . . $ JE_updateNavScreen(49f6e7a06ebc5aa8).();
886 JE_drawMainMenuHelpTextcxx . . $ JE_drawMainMenuHelpText(49f6e7a06ebc5aa8).();
887 JE_drawMenuHeadercxx . . $ JE_drawMenuHeader(49f6e7a06ebc5aa8).();
888 JE_drawMenuChoicescxx . . $ JE_drawMenuChoices(49f6e7a06ebc5aa8).();
889 if (extraGamecxx . . $ extraGame.)
890 JE_dStringcxx . . $ JE_dString(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 170, 140, miscTextcxx . . $ miscText.[68 - 1], FONT_SHAPEScxx . . $ `src/sprite.h:29:9`!);
891 }
892
893 if (curMenucxx . . $ curMenu. == MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES. &&
894 curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] < menuChoicescxx . . $ menuChoices.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.])
895 {
896 /* Draw flashy cube */
897 blit_sprite_hv_blendcxx . . $ blit_sprite_hv_blend(62f96868ab2f1929).(VGAScreenSegcxx . . $ VGAScreenSeg., 166, 38 + (curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] - 2) * 28, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 25, 13, colcxx . . $ col.);
898 }
899
900 /* IF (curmenu = 5) AND (cursel [2] IN [3, 4, 6, 7, 8]) */
901 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. &&
902 (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 3 ||
903 curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4 ||
904 (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] >= 6 &&
905 curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] <= 8)))
906 {
907 setDelaycxx . . $ setDelay(d4f767463ce0a6b3).(3);
908 JE_weaponSimUpdatecxx . . $ JE_weaponSimUpdate(49f6e7a06ebc5aa8).();
909 JE_drawScorecxx . . $ JE_drawScore(49f6e7a06ebc5aa8).();
910 service_SDL_eventscxx . . $ service_SDL_events(b45ddcbc8423892c).(falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
911
912 if (newPalcxx . . $ newPal. > 0)
913 {
914 curPalcxx . . $ curPal. = newPalcxx . . $ newPal.;
915 set_palettecxx . . $ set_palette(e7c4d2139a064c7f).(palettescxx . . $ palettes.[newPalcxx . . $ newPal. - 1], 0, 255);
916 newPalcxx . . $ newPal. = 0;
917 }
918
919 JE_mouseStartcxx . . $ JE_mouseStart(49f6e7a06ebc5aa8).();
920
921 if (paletteChangedcxx . . $ paletteChanged.)
922 {
923 set_palettecxx . . $ set_palette(e7c4d2139a064c7f).(colorscxx . . $ colors., 0, 255);
924 paletteChangedcxx . . $ paletteChanged. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
925 }
926
927 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).(); /* SYN: This is where it updates the screen for the weapon sim */
928
929 if (backFromHelpcxx . . $ backFromHelp.)
930 {
931 fade_palettecxx . . $ fade_palette(59ab901998e00635).(colorscxx . . $ colors., 10, 0, 255);
932 backFromHelpcxx . . $ backFromHelp. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
933 }
934
935 JE_mouseReplacecxx . . $ JE_mouseReplace(49f6e7a06ebc5aa8).();
936
937 }
938 else /* current menu is anything but weapon sim or datacube */
939 {
940 setDelaycxx . . $ setDelay(d4f767463ce0a6b3).(2);
941
942 JE_drawScorecxx . . $ JE_drawScore(49f6e7a06ebc5aa8).();
943
944 if (newPalcxx . . $ newPal. > 0)
945 {
946 curPalcxx . . $ curPal. = newPalcxx . . $ newPal.;
947 set_palettecxx . . $ set_palette(e7c4d2139a064c7f).(palettescxx . . $ palettes.[newPalcxx . . $ newPal. - 1], 0, 255);
948 newPalcxx . . $ newPal. = 0;
949 }
950
951 JE_mouseStartcxx . . $ JE_mouseStart(49f6e7a06ebc5aa8).();
952
953 if (paletteChangedcxx . . $ paletteChanged.)
954 {
955 set_palettecxx . . $ set_palette(e7c4d2139a064c7f).(colorscxx . . $ colors., 0, 255);
956 paletteChangedcxx . . $ paletteChanged. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
957 }
958
959 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).(); /* SYN: This is the where the screen updates for most menus */
960
961 JE_mouseReplacecxx . . $ JE_mouseReplace(49f6e7a06ebc5aa8).();
962
963 if (backFromHelpcxx . . $ backFromHelp.)
964 {
965 fade_palettecxx . . $ fade_palette(59ab901998e00635).(colorscxx . . $ colors., 10, 0, 255);
966 backFromHelpcxx . . $ backFromHelp. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
967 }
968
969 }
970 }
971
972 wait_delaycxx . . $ wait_delay(49f6e7a06ebc5aa8).();
973
974 push_joysticks_as_keyboardcxx . . $ push_joysticks_as_keyboard(49f6e7a06ebc5aa8).();
975 service_SDL_eventscxx . . $ service_SDL_events(b45ddcbc8423892c).(falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
976 mouseButtoncxx . . $ mouseButton. = JE_mousePositioncxx . . $ JE_mousePosition(2aa6fbd8d75b91c).(&mouseXcxx . . $ mouseX., &mouseYcxx . . $ mouseY.);
977 inputDetectedcxx . . $ inputDetected. = newkeycxx . . $ newkey. || mouseButtoncxx . . $ mouseButton. > 0;
978
979 if (curMenucxx . . $ curMenu. != MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE.)
980 {
981 if (keysactivecxx . . $ keysactive.[SDL_SCANCODE_Scxx . . $ SDL_SCANCODE_S.] && (keysactivecxx . . $ keysactive.[SDL_SCANCODE_LALTcxx . . $ SDL_SCANCODE_LALT.] || keysactivecxx . . $ keysactive.[SDL_SCANCODE_RALTcxx . . $ SDL_SCANCODE_RALT.]))
982 {
983 if (curMenucxx . . $ curMenu. == MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB. ||
984 curMenucxx . . $ curMenu. == MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.)
985 {
986 curMenucxx . . $ curMenu. = MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.;
987 }
988 quikSavecxx . . $ quikSave. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
989 oldMenucxx . . $ oldMenu. = curMenucxx . . $ curMenu.;
990 curMenucxx . . $ curMenu. = MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE.;
991 performSavecxx . . $ performSave. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
992 newPalcxx . . $ newPal. = 1;
993 oldPalcxx . . $ oldPal. = curPalcxx . . $ curPal.;
994 }
995 if (keysactivecxx . . $ keysactive.[SDL_SCANCODE_Lcxx . . $ SDL_SCANCODE_L.] && (keysactivecxx . . $ keysactive.[SDL_SCANCODE_LALTcxx . . $ SDL_SCANCODE_LALT.] || keysactivecxx . . $ keysactive.[SDL_SCANCODE_RALTcxx . . $ SDL_SCANCODE_RALT.]))
996 {
997 if (curMenucxx . . $ curMenu. == MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB. ||
998 curMenucxx . . $ curMenu. == MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.)
999 {
1000 curMenucxx . . $ curMenu. = MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.;
1001 }
1002 quikSavecxx . . $ quikSave. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
1003 oldMenucxx . . $ oldMenu. = curMenucxx . . $ curMenu.;
1004 curMenucxx . . $ curMenu. = MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE.;
1005 performSavecxx . . $ performSave. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1006 newPalcxx . . $ newPal. = 1;
1007 oldPalcxx . . $ oldPal. = curPalcxx . . $ curPal.;
1008 }
1009 }
1010
1011 if (curMenucxx . . $ curMenu. == MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.)
1012 {
1013 if (mouseButtoncxx . . $ mouseButton. > 0 && mouseCursorcxx . . $ mouseCursor. != MOUSE_POINTER_NORMALcxx . . $ MOUSE_POINTER_NORMAL.)
1014 {
1015 inputDetectedcxx . . $ inputDetected. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1016 if (mouseCursorcxx . . $ mouseCursor. == MOUSE_POINTER_UPcxx . . $ MOUSE_POINTER_UP.)
1017 yChgcxx . . $ yChg. = -1;
1018 else
1019 yChgcxx . . $ yChg. = 1;
1020 }
1021
1022 if (keysactivecxx . . $ keysactive.[SDL_SCANCODE_PAGEUPcxx . . $ SDL_SCANCODE_PAGEUP.])
1023 {
1024 yChgcxx . . $ yChg. = -2;
1025 inputDetectedcxx . . $ inputDetected. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1026 }
1027 if (keysactivecxx . . $ keysactive.[SDL_SCANCODE_PAGEDOWNcxx . . $ SDL_SCANCODE_PAGEDOWN.])
1028 {
1029 yChgcxx . . $ yChg. = 2;
1030 inputDetectedcxx . . $ inputDetected. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1031 }
1032
1033 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! joystick_up = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, joystick_down = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1034 for (int j = 0; j < joystickscxx . . $ joysticks.; j++)
1035 {
1036 joystick_up |= joystickcxx . . $ joystick.[j].directioncxx . . $ $anonymous_type_abd17893024d7112_2#direction.[0];
1037 joystick_down |= joystickcxx . . $ joystick.[j].directioncxx . . $ $anonymous_type_abd17893024d7112_2#direction.[2];
1038 }
1039
1040 if (keysactivecxx . . $ keysactive.[SDL_SCANCODE_UPcxx . . $ SDL_SCANCODE_UP.] || joystick_up)
1041 {
1042 yChgcxx . . $ yChg. = -1;
1043 inputDetectedcxx . . $ inputDetected. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1044 }
1045
1046 if (keysactivecxx . . $ keysactive.[SDL_SCANCODE_DOWNcxx . . $ SDL_SCANCODE_DOWN.] || joystick_down)
1047 {
1048 yChgcxx . . $ yChg. = 1;
1049 inputDetectedcxx . . $ inputDetected. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1050 }
1051
1052 if (yChgcxx . . $ yChg. < 0 && yLoccxx . . $ yLoc. == 0)
1053 {
1054 yChgcxx . . $ yChg. = 0;
1055 }
1056 if (yChgcxx . . $ yChg. > 0 && (yLoccxx . . $ yLoc. / 12) > cubecxx . . $ cube.[currentCubecxx . . $ currentCube.].last_linecxx . . $ cube_struct#last_line. - 10)
1057 {
1058 yChgcxx . . $ yChg. = 0;
1059 }
1060 }
1061
1062 } while (!inputDetectedcxx . . $ inputDetected.);
1063 }
1064
1065 keyboardUsedcxx . . $ keyboardUsed. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1066
1067 /* The rest of this just grabs input events, handles them, then proceeds on. */
1068
1069 if (mouseButtoncxx . . $ mouseButton. > 0)
1070 {
1071 lastDirectioncxx . . $ lastDirection. = 1;
1072
1073 mouseButtoncxx . . $ mouseButton. = JE_mousePositioncxx . . $ JE_mousePosition(2aa6fbd8d75b91c).(&mouseXcxx . . $ mouseX., &mouseYcxx . . $ mouseY.);
1074
1075 if (curMenucxx . . $ curMenu. == MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES. && cubeMaxcxx . . $ cubeMax. == 0)
1076 {
1077 curMenucxx . . $ curMenu. = MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.;
1078 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_SPRINGcxx . . $ S_SPRING.);
1079 newPalcxx . . $ newPal. = 1;
1080 JE_wipeKeycxx . . $ JE_wipeKey(49f6e7a06ebc5aa8).();
1081 }
1082
1083 if (curMenucxx . . $ curMenu. == MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.)
1084 {
1085 if ((mouseXcxx . . $ mouseX. > 258) && (mouseXcxx . . $ mouseX. < 290) && (mouseYcxx . . $ mouseY. > 159) && (mouseYcxx . . $ mouseY. < 171))
1086 {
1087 curMenucxx . . $ curMenu. = MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.;
1088 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_SPRINGcxx . . $ S_SPRING.);
1089 }
1090 }
1091
1092 if (curMenucxx . . $ curMenu. == MENU_OPTIONScxx . . $ MENU_OPTIONS. ||
1093 curMenucxx . . $ curMenu. == MENU_LIMITED_OPTIONScxx . . $ MENU_LIMITED_OPTIONS.)
1094 {
1095 if ((mouseXcxx . . $ mouseX. >= (225 - 4)) && (mouseYcxx . . $ mouseY. >= 70) && (mouseYcxx . . $ mouseY. <= 82))
1096 {
1097 if (music_disabledcxx . . $ music_disabled.)
1098 {
1099 music_disabledcxx . . $ music_disabled. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1100 restart_songcxx . . $ restart_song(49f6e7a06ebc5aa8).();
1101 }
1102
1103 curSelcxx . . $ curSel.[MENU_OPTIONScxx . . $ MENU_OPTIONS.] = 4;
1104
1105 tyrMusicVolumecxx . . $ tyrMusicVolume. = (mouseXcxx . . $ mouseX. - (225 - 4)) / 4 * 12;
1106 if (tyrMusicVolumecxx . . $ tyrMusicVolume. > 255)
1107 tyrMusicVolumecxx . . $ tyrMusicVolume. = 255;
1108 }
1109
1110 if ((mouseXcxx . . $ mouseX. >= (225 - 4)) && (mouseYcxx . . $ mouseY. >= 86) && (mouseYcxx . . $ mouseY. <= 98))
1111 {
1112 samples_disabledcxx . . $ samples_disabled. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1113
1114 curSelcxx . . $ curSel.[MENU_OPTIONScxx . . $ MENU_OPTIONS.] = 5;
1115
1116 fxVolumecxx . . $ fxVolume. = (mouseXcxx . . $ mouseX. - (225 - 4)) / 4 * 12;
1117 if (fxVolumecxx . . $ fxVolume. > 255)
1118 fxVolumecxx . . $ fxVolume. = 255;
1119 }
1120
1121 set_volumecxx . . $ set_volume(8fbe6856f5410d23).(tyrMusicVolumecxx . . $ tyrMusicVolume., fxVolumecxx . . $ fxVolume.);
1122
1123 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CURSORcxx . . $ S_CURSOR.);
1124 }
1125
1126 if (mouseYcxx . . $ mouseY. > 20 &&
1127 mouseXcxx . . $ mouseX. > 170 &&
1128 mouseXcxx . . $ mouseX. < 308 &&
1129 curMenucxx . . $ curMenu. != MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.)
1130 {
1131 const JE_bytecxx . . $ JE_byte# mouseSelectionY[MENU_MAXcxx . . $ `src/helptext.h:28:9`!] = { 16, 16, 16, 16, 26, 12, 11, 28, 0, 16, 16, 16, 8, 16 };
1132
1133 int selection = (mouseYcxx . . $ mouseY. - 38) / mouseSelectionY[curMenucxx . . $ curMenu.]+2;
1134
1135 if (curMenucxx . . $ curMenu. == MENU_2_PLAYER_ARCADEcxx . . $ MENU_2_PLAYER_ARCADE.)
1136 {
1137 if (selection > 5)
1138 selection--;
1139 if (selection > 3)
1140 selection--;
1141 }
1142
1143 if (curMenucxx . . $ curMenu. == MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.)
1144 {
1145 if (selection > 7)
1146 selection = 7;
1147 }
1148
1149 // is play next level screen?
1150 if (curMenucxx . . $ curMenu. == MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.)
1151 {
1152 if (selection == menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.] + 1)
1153 selection = menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.];
1154 }
1155
1156 if (selection <= menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.])
1157 {
1158 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. &&
1159 selection == menuChoicescxx . . $ menuChoices.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.])
1160 {
1161 playercxx . . $ player.[0].cashcxx . . $ $anonymous_type_55bed0e189d5bed_4#cash. = JE_cashLeftcxx . . $ JE_cashLeft(b126dc7c1de90089).();
1162 curMenucxx . . $ curMenu. = MENU_UPGRADEScxx . . $ MENU_UPGRADES.;
1163 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_ITEMcxx . . $ S_ITEM.);
1164 }
1165 else
1166 {
1167 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CLICKcxx . . $ S_CLICK.);
1168 if (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] == selection)
1169 {
1170 JE_menuFunctioncxx . . $ JE_menuFunction(ac50b47256ae7414).(curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.]);
1171 }
1172 else
1173 {
1174 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. &&
1175 JE_getCostcxx . . $ JE_getCost(787d21ae4415b813).(curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.], itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-2]-1][selection-2]) > playercxx . . $ player.[0].cashcxx . . $ $anonymous_type_55bed0e189d5bed_4#cash.)
1176 {
1177 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CLINKcxx . . $ S_CLINK.);
1178 }
1179 else
1180 {
1181 if (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4)
1182 playercxx . . $ player.[0].weapon_modecxx . . $ $anonymous_type_55bed0e189d5bed_4#weapon_mode. = 1;
1183
1184 curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] = selection;
1185 }
1186
1187 // in front or rear weapon upgrade screen?
1188 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. &&
1189 (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 3 || curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4))
1190 {
1191 playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-3].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power. = temp_weapon_power[curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2];
1192 }
1193 }
1194 }
1195 }
1196
1197 wait_noinputcxx . . $ wait_noinput(9e113dd3a0d25c95).(falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
1198 }
1199
1200 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. &&
1201 (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 3 || curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4))
1202 {
1203 if ((mouseXcxx . . $ mouseX. >= 23) && (mouseXcxx . . $ mouseX. <= 36) && (mouseYcxx . . $ mouseY. >= 149) && (mouseYcxx . . $ mouseY. <= 168))
1204 {
1205 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CURSORcxx . . $ S_CURSOR.);
1206 switch (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.])
1207 {
1208 case 3:
1209 case 4:
1210 if (leftPowercxx . . $ leftPower.)
1211 playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-3].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power. = --temp_weapon_power[curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2];
1212 else
1213 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CLINKcxx . . $ S_CLINK.);
1214
1215 break;
1216 }
1217 wait_noinputcxx . . $ wait_noinput(9e113dd3a0d25c95).(falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
1218 }
1219
1220 if ((mouseXcxx . . $ mouseX. >= 119) && (mouseXcxx . . $ mouseX. <= 131) && (mouseYcxx . . $ mouseY. >= 149) && (mouseYcxx . . $ mouseY. <= 168))
1221 {
1222 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CURSORcxx . . $ S_CURSOR.);
1223 switch (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.])
1224 {
1225 case 3:
1226 case 4:
1227 if (rightPowercxx . . $ rightPower. && rightPowerAffordcxx . . $ rightPowerAfford.)
1228 playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-3].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power. = ++temp_weapon_power[curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2];
1229 else
1230 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CLINKcxx . . $ S_CLINK.);
1231
1232 break;
1233 }
1234 wait_noinputcxx . . $ wait_noinput(9e113dd3a0d25c95).(falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
1235 }
1236 }
1237 }
1238 else if (newkeycxx . . $ newkey.)
1239 {
1240 switch (lastkey_scancxx . . $ lastkey_scan.)
1241 {
1242 case SDL_SCANCODE_SLASHcxx . . $ SDL_SCANCODE_SLASH.:
1243 // if in rear weapon upgrade screen
1244 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. && curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4)
1245 {
1246 // cycle weapon modes
1247 if (++playercxx . . $ player.[0].weapon_modecxx . . $ $anonymous_type_55bed0e189d5bed_4#weapon_mode. > weaponPortcxx . . $ weaponPort.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[REAR_WEAPONcxx . . $ REAR_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.].opnumcxx . . $ $anonymous_type_66fcae0887b82ce8_1#opnum.)
1248 playercxx . . $ player.[0].weapon_modecxx . . $ $anonymous_type_55bed0e189d5bed_4#weapon_mode. = 1;
1249 }
1250 break;
1251
1252 case SDL_SCANCODE_SPACEcxx . . $ SDL_SCANCODE_SPACE.:
1253 case SDL_SCANCODE_RETURNcxx . . $ SDL_SCANCODE_RETURN.:
1254 keyboardUsedcxx . . $ keyboardUsed. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
1255
1256 // if front or rear weapon, update "Done" power level
1257 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. && (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 3 || curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4))
1258 temp_weapon_power[itemAvailMaxcxx . . $ itemAvailMax.[itemAvailMapcxx . . $ itemAvailMap.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-2]-1]] = playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-3].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power.;
1259
1260 JE_menuFunctioncxx . . $ JE_menuFunction(ac50b47256ae7414).(curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.]);
1261 break;
1262
1263 case SDL_SCANCODE_ESCAPEcxx . . $ SDL_SCANCODE_ESCAPE.:
1264 keyboardUsedcxx . . $ keyboardUsed. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
1265
1266 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_SPRINGcxx . . $ S_SPRING.);
1267 if (curMenucxx . . $ curMenu. == MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE. && quikSavecxx . . $ quikSave.)
1268 {
1269 curMenucxx . . $ curMenu. = oldMenucxx . . $ oldMenu.;
1270 newPalcxx . . $ newPal. = oldPalcxx . . $ oldPal.;
1271 }
1272 else if (menuEsccxx . . $ menuEsc.[curMenucxx . . $ curMenu.] == 0)
1273 {
1274 if (JE_quitRequestcxx . . $ JE_quitRequest(c9857a73d68e59ba).())
1275 {
1276 gameLoadedcxx . . $ gameLoaded. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
1277 mainLevelcxx . . $ mainLevel. = 0;
1278 }
1279 }
1280 else
1281 {
1282 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.) // leaving upgrade menu without buying
1283 {
1284 playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items. = old_itemscxx . . $ old_items.[0];
1285 curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] = lastCurSelcxx . . $ lastCurSel.;
1286 playercxx . . $ player.[0].cashcxx . . $ $anonymous_type_55bed0e189d5bed_4#cash. = JE_cashLeftcxx . . $ JE_cashLeft(b126dc7c1de90089).();
1287 }
1288
1289 if (curMenucxx . . $ curMenu. != MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.)
1290 newPalcxx . . $ newPal. = 1;
1291
1292 curMenucxx . . $ curMenu. = menuEsccxx . . $ menuEsc.[curMenucxx . . $ curMenu.] - 1;
1293 }
1294 break;
1295
1296 case SDL_SCANCODE_F1cxx . . $ SDL_SCANCODE_F1.:
1297 if (!isNetworkGamecxx . . $ isNetworkGame.)
1298 {
1299 fade_blackcxx . . $ fade_black(d4f767463ce0a6b3).(10);
1300 JE_helpSystemcxx . . $ JE_helpSystem(ac50b47256ae7414).(2);
1301
1302 play_songcxx . . $ play_song(cb2f890c2fdad230).(songBuycxx . . $ songBuy.);
1303
1304 JE_loadPiccxx . . $ JE_loadPic(4846ed2ea5b0a844).(VGAScreencxx . . $ VGAScreen., 1, falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
1305 newPalcxx . . $ newPal. = 1;
1306
1307 switch (curMenucxx . . $ curMenu.)
1308 {
1309 case 3:
1310 newPalcxx . . $ newPal. = 18;
1311 break;
1312 case 7:
1313 case 8:
1314 break;
1315 }
1316
1317 memcpycxx . . $ memcpy(cc817cb175f282d).(VGAScreen2cxx . . $ VGAScreen2.->pixelscxx . . $ SDL_Surface#pixels., VGAScreencxx . . $ VGAScreen.->pixelscxx . . $ SDL_Surface#pixels., VGAScreen2cxx . . $ VGAScreen2.->pitchcxx . . $ SDL_Surface#pitch. * VGAScreen2cxx . . $ VGAScreen2.->hcxx . . $ SDL_Surface#h.);
1318
1319 curPalcxx . . $ curPal. = newPalcxx . . $ newPal.;
1320 memcpycxx . . $ memcpy(cc817cb175f282d).(colorscxx . . $ colors., palettescxx . . $ palettes.[newPalcxx . . $ newPal.-1], sizeof(colorscxx . . $ colors.));
1321 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).();
1322 newPalcxx . . $ newPal. = 0;
1323 backFromHelpcxx . . $ backFromHelp. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
1324 }
1325 break;
1326
1327 case SDL_SCANCODE_UPcxx . . $ SDL_SCANCODE_UP.:
1328 keyboardUsedcxx . . $ keyboardUsed. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
1329 lastDirectioncxx . . $ lastDirection. = -1;
1330
1331 if (curMenucxx . . $ curMenu. != MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.)
1332 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CURSORcxx . . $ S_CURSOR.);
1333
1334 curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.]--;
1335 if (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] < 2)
1336 curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] = menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.];
1337
1338 // if in front or rear weapon upgrade screen
1339 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. &&
1340 (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 3 || curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4))
1341 {
1342 playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-3].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power. = temp_weapon_power[curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2];
1343 if (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4)
1344 playercxx . . $ player.[0].weapon_modecxx . . $ $anonymous_type_55bed0e189d5bed_4#weapon_mode. = 1;
1345 }
1346
1347 // if joystick config, skip disabled items when digital
1348 if (curMenucxx . . $ curMenu. == MENU_JOYSTICK_CONFIGcxx . . $ MENU_JOYSTICK_CONFIG. &&
1349 joystickscxx . . $ joysticks. > 0 &&
1350 !joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog. &&
1351 curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] == 5)
1352 {
1353 curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] = 3;
1354 }
1355
1356 break;
1357
1358 case SDL_SCANCODE_DOWNcxx . . $ SDL_SCANCODE_DOWN.:
1359 keyboardUsedcxx . . $ keyboardUsed. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
1360 lastDirectioncxx . . $ lastDirection. = 1;
1361
1362 if (curMenucxx . . $ curMenu. != MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.)
1363 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CURSORcxx . . $ S_CURSOR.);
1364
1365 curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.]++;
1366 if (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] > menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.])
1367 curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] = 2;
1368
1369 // if in front or rear weapon upgrade screen
1370 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. &&
1371 (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 3 || curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4))
1372 {
1373 playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-3].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power. = temp_weapon_power[curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2];
1374 if (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4)
1375 playercxx . . $ player.[0].weapon_modecxx . . $ $anonymous_type_55bed0e189d5bed_4#weapon_mode. = 1;
1376 }
1377
1378 // if in joystick config, skip disabled items when digital
1379 if (curMenucxx . . $ curMenu. == MENU_JOYSTICK_CONFIGcxx . . $ MENU_JOYSTICK_CONFIG. &&
1380 joystickscxx . . $ joysticks. > 0 &&
1381 !joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog. &&
1382 curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] == 4)
1383 {
1384 curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] = 6;
1385 }
1386
1387 break;
1388
1389 case SDL_SCANCODE_HOMEcxx . . $ SDL_SCANCODE_HOME.:
1390 if (curMenucxx . . $ curMenu. == MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.)
1391 yLoccxx . . $ yLoc. = 0;
1392 break;
1393
1394 case SDL_SCANCODE_ENDcxx . . $ SDL_SCANCODE_END.:
1395 if (curMenucxx . . $ curMenu. == MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.)
1396 yLoccxx . . $ yLoc. = (cubecxx . . $ cube.[currentCubecxx . . $ currentCube.].last_linecxx . . $ cube_struct#last_line. - 9) * 12;
1397 break;
1398
1399 case SDL_SCANCODE_LEFTcxx . . $ SDL_SCANCODE_LEFT.:
1400 if (curMenucxx . . $ curMenu. == MENU_JOYSTICK_CONFIGcxx . . $ MENU_JOYSTICK_CONFIG.)
1401 {
1402 if (joystickscxx . . $ joysticks. > 0)
1403 {
1404 switch (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
1405 {
1406 case 2:
1407 if (joystick_configcxx . . $ joystick_config. == 0)
1408 joystick_configcxx . . $ joystick_config. = joystickscxx . . $ joysticks.;
1409 joystick_configcxx . . $ joystick_config.--;
1410 break;
1411 case 3:
1412 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog. = !joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog.;
1413 break;
1414 case 4:
1415 if (joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].sensitivitycxx . . $ $anonymous_type_abd17893024d7112_2#sensitivity. == 0)
1416 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].sensitivitycxx . . $ $anonymous_type_abd17893024d7112_2#sensitivity. = 10;
1417 else
1418 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].sensitivitycxx . . $ $anonymous_type_abd17893024d7112_2#sensitivity.--;
1419 break;
1420 case 5:
1421 if (joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].thresholdcxx . . $ $anonymous_type_abd17893024d7112_2#threshold. == 0)
1422 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].thresholdcxx . . $ $anonymous_type_abd17893024d7112_2#threshold. = 10;
1423 else
1424 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].thresholdcxx . . $ $anonymous_type_abd17893024d7112_2#threshold.--;
1425 break;
1426 default:
1427 break;
1428 }
1429 }
1430 }
1431
1432 if (curMenucxx . . $ curMenu. == MENU_2_PLAYER_ARCADEcxx . . $ MENU_2_PLAYER_ARCADE.)
1433 {
1434 switch (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
1435 {
1436 case 3:
1437 case 4:
1438 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CURSORcxx . . $ S_CURSOR.);
1439
1440 int temp = curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] - 3;
1441 do
1442 {
1443 if (joystickscxx . . $ joysticks. == 0)
1444 inputDevicecxx . . $ inputDevice.[temp == 0 ? 1 : 0] = inputDevicecxx . . $ inputDevice.[temp]; // swap controllers
1445 if (inputDevicecxx . . $ inputDevice.[temp] <= 1)
1446 inputDevicecxx . . $ inputDevice.[temp] = 2 + joystickscxx . . $ joysticks.;
1447 else
1448 inputDevicecxx . . $ inputDevice.[temp]--;
1449 } while (inputDevicecxx . . $ inputDevice.[temp] == inputDevicecxx . . $ inputDevice.[temp == 0 ? 1 : 0]);
1450 break;
1451 }
1452 }
1453
1454 if (curMenucxx . . $ curMenu. == MENU_OPTIONScxx . . $ MENU_OPTIONS. ||
1455 curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. ||
1456 curMenucxx . . $ curMenu. == MENU_LIMITED_OPTIONScxx . . $ MENU_LIMITED_OPTIONS.)
1457 {
1458 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CURSORcxx . . $ S_CURSOR.);
1459 }
1460
1461 switch (curMenucxx . . $ curMenu.)
1462 {
1463 case 2:
1464 case 11:
1465 switch (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
1466 {
1467 case 4:
1468 JE_changeVolumecxx . . $ JE_changeVolume(b690d98fa3ee2e89).(&tyrMusicVolumecxx . . $ tyrMusicVolume., -12, &fxVolumecxx . . $ fxVolume., 0);
1469 if (music_disabledcxx . . $ music_disabled.)
1470 {
1471 music_disabledcxx . . $ music_disabled. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1472 restart_songcxx . . $ restart_song(49f6e7a06ebc5aa8).();
1473 }
1474 break;
1475 case 5:
1476 JE_changeVolumecxx . . $ JE_changeVolume(b690d98fa3ee2e89).(&tyrMusicVolumecxx . . $ tyrMusicVolume., 0, &fxVolumecxx . . $ fxVolume., -12);
1477 samples_disabledcxx . . $ samples_disabled. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1478 break;
1479 }
1480 break;
1481 case 4:
1482 switch (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.])
1483 {
1484 case 3:
1485 case 4:
1486 if (leftPowercxx . . $ leftPower.)
1487 playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-3].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power. = --temp_weapon_power[curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2];
1488 else
1489 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CLINKcxx . . $ S_CLINK.);
1490
1491 break;
1492 }
1493 break;
1494 }
1495 break;
1496
1497 case SDL_SCANCODE_RIGHTcxx . . $ SDL_SCANCODE_RIGHT.:
1498 if (curMenucxx . . $ curMenu. == MENU_JOYSTICK_CONFIGcxx . . $ MENU_JOYSTICK_CONFIG.)
1499 {
1500 if (joystickscxx . . $ joysticks. > 0)
1501 {
1502 switch (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
1503 {
1504 case 2:
1505 joystick_configcxx . . $ joystick_config.++;
1506 joystick_configcxx . . $ joystick_config. %= joystickscxx . . $ joysticks.;
1507 break;
1508 case 3:
1509 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog. = !joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog.;
1510 break;
1511 case 4:
1512 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].sensitivitycxx . . $ $anonymous_type_abd17893024d7112_2#sensitivity.++;
1513 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].sensitivitycxx . . $ $anonymous_type_abd17893024d7112_2#sensitivity. %= 11;
1514 break;
1515 case 5:
1516 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].thresholdcxx . . $ $anonymous_type_abd17893024d7112_2#threshold.++;
1517 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].thresholdcxx . . $ $anonymous_type_abd17893024d7112_2#threshold. %= 11;
1518 break;
1519 default:
1520 break;
1521 }
1522 }
1523 }
1524
1525 if (curMenucxx . . $ curMenu. == MENU_2_PLAYER_ARCADEcxx . . $ MENU_2_PLAYER_ARCADE.)
1526 {
1527 switch (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
1528 {
1529 case 3:
1530 case 4:
1531 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CURSORcxx . . $ S_CURSOR.);
1532
1533 int temp = curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] - 3;
1534 do
1535 {
1536 if (joystickscxx . . $ joysticks. == 0)
1537 inputDevicecxx . . $ inputDevice.[temp == 0 ? 1 : 0] = inputDevicecxx . . $ inputDevice.[temp]; // swap controllers
1538 if (inputDevicecxx . . $ inputDevice.[temp] >= 2 + joystickscxx . . $ joysticks.)
1539 inputDevicecxx . . $ inputDevice.[temp] = 1;
1540 else
1541 inputDevicecxx . . $ inputDevice.[temp]++;
1542 } while (inputDevicecxx . . $ inputDevice.[temp] == inputDevicecxx . . $ inputDevice.[temp == 0 ? 1 : 0]);
1543 break;
1544 }
1545 }
1546
1547 if (curMenucxx . . $ curMenu. == MENU_OPTIONScxx . . $ MENU_OPTIONS. ||
1548 curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB. ||
1549 curMenucxx . . $ curMenu. == MENU_LIMITED_OPTIONScxx . . $ MENU_LIMITED_OPTIONS.)
1550 {
1551 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CURSORcxx . . $ S_CURSOR.);
1552 }
1553
1554 switch (curMenucxx . . $ curMenu.)
1555 {
1556 case 2:
1557 case 11:
1558 switch (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
1559 {
1560 case 4:
1561 JE_changeVolumecxx . . $ JE_changeVolume(b690d98fa3ee2e89).(&tyrMusicVolumecxx . . $ tyrMusicVolume., 12, &fxVolumecxx . . $ fxVolume., 0);
1562 if (music_disabledcxx . . $ music_disabled.)
1563 {
1564 music_disabledcxx . . $ music_disabled. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1565 restart_songcxx . . $ restart_song(49f6e7a06ebc5aa8).();
1566 }
1567 break;
1568 case 5:
1569 JE_changeVolumecxx . . $ JE_changeVolume(b690d98fa3ee2e89).(&tyrMusicVolumecxx . . $ tyrMusicVolume., 0, &fxVolumecxx . . $ fxVolume., 12);
1570 samples_disabledcxx . . $ samples_disabled. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1571 break;
1572 }
1573 break;
1574 case 4:
1575 switch (curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.])
1576 {
1577 case 3:
1578 case 4:
1579 if (rightPowercxx . . $ rightPower. && rightPowerAffordcxx . . $ rightPowerAfford.)
1580 playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-3].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power. = ++temp_weapon_power[curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2];
1581 else
1582 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CLINKcxx . . $ S_CLINK.);
1583
1584 break;
1585 }
1586 break;
1587 }
1588 break;
1589
1590 default:
1591 break;
1592 }
1593 }
1594
1595 } while (!(quit || gameLoadedcxx . . $ gameLoaded. || jumpSectioncxx . . $ jumpSection.));
1596
1597 #ifdef WITH_NETWORKcxx . . $ `<built-in>:413:9`!
1598 if (!quit && isNetworkGamecxx . . $ isNetworkGame.)
1599 {
1600 JE_barShadecxx . . $ JE_barShade(ad548318d53dbf5e).(VGAScreencxx . . $ VGAScreen., 3, 3, 316, 196);
1601 JE_barShadecxx . . $ JE_barShade(ad548318d53dbf5e).(VGAScreencxx . . $ VGAScreen., 1, 1, 318, 198);
1602 JE_dStringcxx . . $ JE_dString(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 10, 160, "Waiting for other player.", SMALL_FONT_SHAPEScxx . . $ `src/sprite.h:30:9`!);
1603
1604 network_preparecxx . . $ network_prepare(ed53e3bbd3fa2f69).(PACKET_WAITINGcxx . . $ `src/network.h:36:9`!);
1605 network_sendcxx . . $ network_send(83c267b20bac841a).(4); // PACKET_WAITING
1606
1607 while (truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!)
1608 {
1609 service_SDL_eventscxx . . $ service_SDL_events(b45ddcbc8423892c).(falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
1610 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).();
1611
1612 if (packet_incxx . . $ packet_in.[0] && SDLNet_Read16cxx . . $ `<external>/5426831044093305371/SDL_net.h:1019:9`!(&packet_in[0]->data[0]) == PACKET_WAITINGcxx . . $ `src/network.h:36:9`!)
1613 {
1614 network_updatecxx . . $ network_update(c9857a73d68e59ba).();
1615 break;
1616 }
1617
1618 network_updatecxx . . $ network_update(c9857a73d68e59ba).();
1619 network_checkcxx . . $ network_check(b126dc7c1de90089).();
1620
1621 SDL_Delaycxx . . $ SDL_Delay(cb2f890c2fdad230).(16);
1622 }
1623
1624 network_state_resetcxx . . $ network_state_reset(49f6e7a06ebc5aa8).();
1625 }
1626
1627 if (isNetworkGamecxx . . $ isNetworkGame.)
1628 {
1629 while (!network_is_synccxx . . $ network_is_sync(c9857a73d68e59ba).())
1630 {
1631 service_SDL_eventscxx . . $ service_SDL_events(b45ddcbc8423892c).(falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
1632 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).();
1633
1634 network_checkcxx . . $ network_check(b126dc7c1de90089).();
1635 SDL_Delaycxx . . $ SDL_Delay(cb2f890c2fdad230).(16);
1636 }
1637 }
1638 #endif
1639
1640 if (gameLoadedcxx . . $ gameLoaded.)
1641 fade_blackcxx . . $ fade_black(d4f767463ce0a6b3).(10);
1642 }
1643
1644 void draw_ship_illustrationcxx . . $ draw_ship_illustration(49f6e7a06ebc5aa8).(void)
1645 {
1646 // full of evil hardcoding
1647
1648 // ship
1649 {
1650 assertcxx . . $ `/usr/include/assert.h:50:10`!(player[0].items.ship > 0);
1651
1652 const int sprite_id = (playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..shipcxx . . $ $anonymous_type_55bed0e189d5bed_2#ship. < COUNTOFcxx . . $ `src/opentyr.h:27:9`!(ships)) // shipedit ships get a default
1653 ? shipscxx . . $ ships.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..shipcxx . . $ $anonymous_type_55bed0e189d5bed_2#ship.].bigshipgraphiccxx . . $ $anonymous_type_66fcae0887b82ce8_6#bigshipgraphic. - 1
1654 : 31;
1655
1656 const int ship_x[6] = { 31, 0, 0, 0, 35, 31 },
1657 ship_y[6] = { 36, 0, 0, 0, 33, 35 };
1658
1659 const int x = ship_x[sprite_id - 27],
1660 y = ship_y[sprite_id - 27];
1661
1662 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., x, y, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, sprite_id);
1663 }
1664
1665 // generator
1666 {
1667 assertcxx . . $ `/usr/include/assert.h:50:10`!(player[0].items.generator > 0 && player[0].items.generator < 7);
1668
1669 const int sprite_id = (playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..generatorcxx . . $ $anonymous_type_55bed0e189d5bed_2#generator. == 1) // generator 1 and generator 2 have the same sprite
1670 ? playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..generatorcxx . . $ $anonymous_type_55bed0e189d5bed_2#generator. + 15
1671 : playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..generatorcxx . . $ $anonymous_type_55bed0e189d5bed_2#generator. + 14;
1672
1673 const int generator_x[5] = { 62, 64, 67, 66, 63 },
1674 generator_y[5] = { 84, 85, 86, 84, 97 };
1675 const int x = generator_x[sprite_id - 16],
1676 y = generator_y[sprite_id - 16];
1677
1678 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., x, y, WEAPON_SHAPEScxx . . $ `src/sprite.h:35:9`!, sprite_id);
1679 }
1680
1681 const int weapon_sprites[43] =
1682 {
1683 -1, 0, 1, 2, 3, 4, 5, 6, 7, 8,
1684 9, 10, 11, 21, 5, 13, -1, 14, 15, 0,
1685 14, 9, 8, 2, 15, 0, 13, 0, 8, 8,
1686 11, 1, 0, 0, 0, 0, 0, 0, 0, 0,
1687 0, 2, 1
1688 };
1689
1690 // front weapon
1691 if (playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[FRONT_WEAPONcxx . . $ FRONT_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id. > 0)
1692 {
1693 const int front_weapon_xy_list[43] =
1694 {
1695 -1, 4, 9, 3, 8, 2, 5, 10, 1, -1,
1696 -1, -1, -1, 7, 8, -1, -1, 0, -1, 4,
1697 0, -1, -1, 3, -1, 4, -1, 4, -1, -1,
1698 -1, 9, 0, 0, 0, 0, 0, 0, 0, 0,
1699 0, 3, 9
1700 };
1701
1702 const int front_weapon_x[12] = { 59, 66, 66, 54, 61, 51, 58, 51, 61, 52, 53, 58 };
1703 const int front_weapon_y[12] = { 38, 53, 41, 36, 48, 35, 41, 35, 53, 41, 39, 31 };
1704 const int x = front_weapon_x[front_weapon_xy_list[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[FRONT_WEAPONcxx . . $ FRONT_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.]],
1705 y = front_weapon_y[front_weapon_xy_list[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[FRONT_WEAPONcxx . . $ FRONT_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.]];
1706
1707 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., x, y, WEAPON_SHAPEScxx . . $ `src/sprite.h:35:9`!, weapon_sprites[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[FRONT_WEAPONcxx . . $ FRONT_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.]); // ship illustration: front weapon
1708 }
1709
1710 // rear weapon
1711 if (playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[REAR_WEAPONcxx . . $ REAR_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id. > 0)
1712 {
1713 const int rear_weapon_xy_list[43] =
1714 {
1715 -1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
1716 1, 2, 3, -1, 4, 5, -1, -1, 6, -1,
1717 -1, 1, 0, -1, 6, -1, 5, -1, 0, 0,
1718 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1719 0, -1, -1
1720 };
1721
1722 const int rear_weapon_x[7] = { 41, 27, 49, 43, 51, 39, 41 };
1723 const int rear_weapon_y[7] = { 92, 92, 113, 102, 97, 96, 76 };
1724 const int x = rear_weapon_x[rear_weapon_xy_list[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[REAR_WEAPONcxx . . $ REAR_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.]],
1725 y = rear_weapon_y[rear_weapon_xy_list[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[REAR_WEAPONcxx . . $ REAR_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.]];
1726
1727 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., x, y, WEAPON_SHAPEScxx . . $ `src/sprite.h:35:9`!, weapon_sprites[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[REAR_WEAPONcxx . . $ REAR_WEAPON.].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.]);
1728 }
1729
1730 // sidekicks
1731 JE_drawItemcxx . . $ JE_drawItem(4685b0c8ee28a575).(6, playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_2#sidekick.[LEFT_SIDEKICKcxx . . $ LEFT_SIDEKICK.], 3, 84);
1732 JE_drawItemcxx . . $ JE_drawItem(4685b0c8ee28a575).(7, playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_2#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.], 129, 84);
1733
1734 // shield
1735 blit_sprite_hvcxx . . $ blit_sprite_hv(62f96868ab2f1929).(VGAScreenSegcxx . . $ VGAScreenSeg., 28, 23, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 26, 15, shieldscxx . . $ shields.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..shieldcxx . . $ $anonymous_type_55bed0e189d5bed_2#shield.].mpwrcxx . . $ $anonymous_type_66fcae0887b82ce8_5#mpwr. - 10);
1736 }
1737
1738 void load_cubescxx . . $ load_cubes(49f6e7a06ebc5aa8).(void)
1739 {
1740 for (int cube_slot = 0; cube_slot < cubeMaxcxx . . $ cubeMax.; ++cube_slot)
1741 {
1742 memsetcxx . . $ memset(d1de1e4fb215f1c6).(cubecxx . . $ cube.[cube_slot].textcxx . . $ cube_struct#text., 0, sizeof(cubecxx . . $ cube.->textcxx . . $ cube_struct#text.));
1743
1744 load_cubecxx . . $ load_cube(cf9ef193275fa6d8).(cube_slot, cubeListcxx . . $ cubeList.[cube_slot]);
1745 }
1746 }
1747
1748 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! load_cubecxx . . $ load_cube(cf9ef193275fa6d8).(int cube_slot, int cube_index)
1749 {
1750 FILEcxx . . $ FILE# *f = dir_fopen_diecxx . . $ dir_fopen_die(2493aa730c89ee72).(data_dircxx . . $ data_dir(33a1f659e94feb42).(), cube_filecxx . . $ cube_file., "rb");
1751
1752 char buf[256];
1753
1754 // seek to the cube
1755 while (cube_index > 0)
1756 {
1757 read_encrypted_pascal_stringcxx . . $ read_encrypted_pascal_string(5eeaf57e1be5eb1d).(buf, sizeof(buf), f);
1758 if (buf[0] == '*')
1759 --cube_index;
1760 }
1761
1762 str_pop_intcxx . . $ str_pop_int(9114e84560875b2b).(&buf[4], &cubecxx . . $ cube.[cube_slot].face_spritecxx . . $ cube_struct#face_sprite.);
1763 --cubecxx . . $ cube.[cube_slot].face_spritecxx . . $ cube_struct#face_sprite.;
1764
1765 read_encrypted_pascal_stringcxx . . $ read_encrypted_pascal_string(5eeaf57e1be5eb1d).(cubecxx . . $ cube.[cube_slot].titlecxx . . $ cube_struct#title., sizeof(cubecxx . . $ cube.[cube_slot].titlecxx . . $ cube_struct#title.), f);
1766 read_encrypted_pascal_stringcxx . . $ read_encrypted_pascal_string(5eeaf57e1be5eb1d).(cubecxx . . $ cube.[cube_slot].headercxx . . $ cube_struct#header., sizeof(cubecxx . . $ cube.[cube_slot].headercxx . . $ cube_struct#header.), f);
1767
1768 uintcxx . . $ uint# line = 0, line_chars = 0, line_width = 0;
1769
1770 // for each line of decrypted text, split the line into words
1771 // and add them individually to the lines of wrapped text
1772 for (; ; )
1773 {
1774 read_encrypted_pascal_stringcxx . . $ read_encrypted_pascal_string(5eeaf57e1be5eb1d).(buf, sizeof(buf), f);
1775
1776 // end of data
1777 if (buf[0] == '*')
1778 break;
1779
1780 // new paragraph
1781 if (strlencxx . . $ strlen(751346f8406fd082).(buf) == 0)
1782 {
1783 if (line_chars == 0)
1784 line += 4; // subsequent new paragaphs indicate 4-line break
1785 else
1786 ++line;
1787 line_chars = 0;
1788 line_width = 0;
1789
1790 continue;
1791 }
1792
1793 uintcxx . . $ uint# word_start = 0;
1794 for (uintcxx . . $ uint# i = 0; ; ++i)
1795 {
1796 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! end_of_line = (buf[i] == '\0'),
1797 end_of_word = end_of_line || (buf[i] == ' ');
1798
1799 if (end_of_word)
1800 {
1801 buf[i] = '\0';
1802
1803 char *word = &buf[word_start];
1804 word_start = i + 1;
1805
1806 uintcxx . . $ uint# word_chars = strlencxx . . $ strlen(751346f8406fd082).(word),
1807 word_width = JE_textWidthcxx . . $ JE_textWidth(1df18506ef0a631b).(word, TINY_FONTcxx . . $ `src/sprite.h:31:9`!);
1808
1809 // word won't fit; no can do
1810 if (word_chars > cube_line_charscxx . . $ cube_line_chars. || word_width > cube_line_widthcxx . . $ cube_line_width.)
1811 break;
1812
1813 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! prepend_space = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
1814
1815 line_chars += word_chars + (prepend_space ? 1 : 0);
1816 line_width += word_width + (prepend_space ? 6 : 0);
1817
1818 // word won't fit on current line; use next
1819 if (line_chars > cube_line_charscxx . . $ cube_line_chars. || line_width > cube_line_widthcxx . . $ cube_line_width.)
1820 {
1821 ++line;
1822 line_chars = word_chars;
1823 line_width = word_width;
1824
1825 prepend_space = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
1826 }
1827
1828 // append word
1829 if (line < COUNTOFcxx . . $ `src/opentyr.h:27:9`!(cube->text))
1830 {
1831 if (prepend_space)
1832 strcatcxx . . $ strcat(b7b3a83273496486).(cubecxx . . $ cube.[cube_slot].textcxx . . $ cube_struct#text.[line], " ");
1833 strcatcxx . . $ strcat(b7b3a83273496486).(cubecxx . . $ cube.[cube_slot].textcxx . . $ cube_struct#text.[line], word);
1834
1835 // track last line with text
1836 cubecxx . . $ cube.[cube_slot].last_linecxx . . $ cube_struct#last_line. = line + 1;
1837 }
1838 }
1839
1840 if (end_of_line)
1841 break;
1842 }
1843 }
1844
1845 fclosecxx . . $ fclose(89bc1efcdac0ca22).(f);
1846
1847 return truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
1848 }
1849
1850 void JE_drawItemcxx . . $ JE_drawItem(4685b0c8ee28a575).(JE_bytecxx . . $ JE_byte# itemType, JE_wordcxx . . $ JE_word# itemNum, JE_wordcxx . . $ JE_word# x, JE_wordcxx . . $ JE_word# y)
1851 {
1852 JE_wordcxx . . $ JE_word# tempW = 0;
1853
1854 if (itemNum > 0)
1855 {
1856 switch (itemType)
1857 {
1858 case 2:
1859 case 3:
1860 tempW = weaponPortcxx . . $ weaponPort.[itemNum].itemgraphiccxx . . $ $anonymous_type_66fcae0887b82ce8_1#itemgraphic.;
1861 break;
1862 case 5:
1863 tempW = powerSyscxx . . $ powerSys.[itemNum].itemgraphiccxx . . $ $anonymous_type_66fcae0887b82ce8_2#itemgraphic.;
1864 break;
1865 case 6:
1866 case 7:
1867 tempW = optionscxx . . $ options.[itemNum].itemgraphiccxx . . $ $anonymous_type_66fcae0887b82ce8_4#itemgraphic.;
1868 break;
1869 case 4:
1870 tempW = shieldscxx . . $ shields.[itemNum].itemgraphiccxx . . $ $anonymous_type_66fcae0887b82ce8_5#itemgraphic.;
1871 break;
1872 }
1873
1874 if (itemType == 1)
1875 {
1876 if (itemNum > 90)
1877 {
1878 shipGrPtrcxx . . $ shipGrPtr. = &spriteSheet9cxx . . $ spriteSheet9.;
1879 shipGrcxx . . $ shipGr. = JE_SGrcxx . . $ JE_SGr(638b2d25147dc206).(itemNum - 90, &shipGrPtrcxx . . $ shipGrPtr.);
1880 blit_sprite2x2cxx . . $ blit_sprite2x2(b5d0f2be3b000a5b).(VGAScreencxx . . $ VGAScreen., x, y, *shipGrPtrcxx . . $ shipGrPtr., shipGrcxx . . $ shipGr.);
1881 }
1882 else
1883 {
1884 blit_sprite2x2cxx . . $ blit_sprite2x2(b5d0f2be3b000a5b).(VGAScreencxx . . $ VGAScreen., x, y, spriteSheet9cxx . . $ spriteSheet9., shipscxx . . $ ships.[itemNum].shipgraphiccxx . . $ $anonymous_type_66fcae0887b82ce8_6#shipgraphic.);
1885 }
1886 }
1887 else if (tempW > 0)
1888 {
1889 blit_sprite2x2cxx . . $ blit_sprite2x2(b5d0f2be3b000a5b).(VGAScreencxx . . $ VGAScreen., x, y, shopSpriteSheetcxx . . $ shopSpriteSheet., tempW);
1890 }
1891 }
1892 }
1893
1894 void JE_drawMenuHeadercxx . . $ JE_drawMenuHeader(49f6e7a06ebc5aa8).(void)
1895 {
1896 switch (curMenucxx . . $ curMenu.)
1897 {
1898 case MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.:
1899 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., cubecxx . . $ cube.[curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.]-2].headercxx . . $ cube_struct#header.);
1900 break;
1901 case MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.:
1902 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., menuIntcxx . . $ menuInt.[1][1]);
1903 break;
1904 case MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE.:
1905 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., menuIntcxx . . $ menuInt.[3][performSavecxx . . $ performSave. + 1]);
1906 break;
1907 default:
1908 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., menuIntcxx . . $ menuInt.[curMenucxx . . $ curMenu. + 1][0]);
1909 break;
1910 }
1911 JE_dStringcxx . . $ JE_dString(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 74 + JE_fontCentercxx . . $ JE_fontCenter(1df18506ef0a631b).(tempStrcxx . . $ tempStr., FONT_SHAPEScxx . . $ `src/sprite.h:29:9`!), 10, tempStrcxx . . $ tempStr., FONT_SHAPEScxx . . $ `src/sprite.h:29:9`!);
1912 }
1913
1914 void JE_drawMenuChoicescxx . . $ JE_drawMenuChoices(49f6e7a06ebc5aa8).(void)
1915 {
1916 JE_bytecxx . . $ JE_byte# x;
1917 char *str;
1918
1919 for (x = 2; x <= menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.]; x++)
1920 {
1921 int tempY = 38 + (x-1) * 16;
1922
1923 if (curMenucxx . . $ curMenu. == MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.)
1924 {
1925 if (x == 7)
1926 {
1927 tempY += 16;
1928 }
1929 }
1930
1931 if (curMenucxx . . $ curMenu. == MENU_2_PLAYER_ARCADEcxx . . $ MENU_2_PLAYER_ARCADE.)
1932 {
1933 if (x > 3)
1934 {
1935 tempY += 16;
1936 }
1937 if (x > 4)
1938 {
1939 tempY += 16;
1940 }
1941 }
1942
1943 if (!(curMenucxx . . $ curMenu. == MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL. &&
1944 x == menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.]))
1945 {
1946 tempY -= 16;
1947 }
1948
1949 str = malloccxx . . $ malloc(bfcfa4d6b7f7ef64).(strlencxx . . $ strlen(751346f8406fd082).(menuIntcxx . . $ menuInt.[curMenucxx . . $ curMenu. + 1][x-1])+2);
1950 if (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] == x)
1951 {
1952 str[0] = '~';
1953 strcpycxx . . $ strcpy(b7b3a83273496486).(str+1, menuIntcxx . . $ menuInt.[curMenucxx . . $ curMenu. + 1][x-1]);
1954 }
1955 else
1956 {
1957 strcpycxx . . $ strcpy(b7b3a83273496486).(str, menuIntcxx . . $ menuInt.[curMenucxx . . $ curMenu. + 1][x-1]);
1958 }
1959 JE_dStringcxx . . $ JE_dString(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 166, tempY, str, SMALL_FONT_SHAPEScxx . . $ `src/sprite.h:30:9`!);
1960 freecxx . . $ free(5d22bdacc48458e8).(str);
1961 }
1962 }
1963
1964 void JE_updateNavScreencxx . . $ JE_updateNavScreen(49f6e7a06ebc5aa8).(void)
1965 {
1966 JE_bytecxx . . $ JE_byte# x;
1967
1968 /* minor issues: */
1969 /* TODO: The scroll to the new planet is too fast, I think */
1970 /* TODO: The starting coordinates for the scrolling effect may be wrong, the
1971 yellowish planet below Tyrian isn't visible for as many frames as in the
1972 original. */
1973
1974 tempNavXcxx . . $ tempNavX. = roundf(navXcxx . . $ navX.);
1975 tempNavYcxx . . $ tempNavY. = roundf(navYcxx . . $ navY.);
1976 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 19, 16, 135, 169, 2);
1977 JE_drawNavLinescxx . . $ JE_drawNavLines(b45ddcbc8423892c).(truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
1978 JE_drawNavLinescxx . . $ JE_drawNavLines(b45ddcbc8423892c).(falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
1979 JE_drawDotscxx . . $ JE_drawDots(49f6e7a06ebc5aa8).();
1980
1981 for (x = 0; x < 11; x++)
1982 JE_drawPlanetcxx . . $ JE_drawPlanet(ac50b47256ae7414).(x);
1983
1984 for (x = 0; x < menuChoicescxx . . $ menuChoices.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.]-1; x++)
1985 {
1986 if (mapPlanetcxx . . $ mapPlanet.[x] > 11)
1987 JE_drawPlanetcxx . . $ JE_drawPlanet(ac50b47256ae7414).(mapPlanetcxx . . $ mapPlanet.[x] - 1);
1988 }
1989
1990 if (mapOrigincxx . . $ mapOrigin. > 11)
1991 JE_drawPlanetcxx . . $ JE_drawPlanet(ac50b47256ae7414).(mapOrigincxx . . $ mapOrigin. - 1);
1992
1993 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., 0, 0, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 28); // navigation screen interface
1994
1995 if (curSelcxx . . $ curSel.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.] < menuChoicescxx . . $ menuChoices.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.])
1996 {
1997 const unsigned int origin_x_offset = spritecxx . . $ sprite(d067a90ab23634af).(PLANET_SHAPEScxx . . $ `src/sprite.h:32:9`!, PGRcxx . . $ PGR.[mapOrigincxx . . $ mapOrigin.-1]-1)->widthcxx . . $ $anonymous_type_297934740aeafb7d_0#width. / 2,
1998 origin_y_offset = spritecxx . . $ sprite(d067a90ab23634af).(PLANET_SHAPEScxx . . $ `src/sprite.h:32:9`!, PGRcxx . . $ PGR.[mapOrigincxx . . $ mapOrigin.-1]-1)->heightcxx . . $ $anonymous_type_297934740aeafb7d_0#height. / 2,
1999 dest_x_offset = spritecxx . . $ sprite(d067a90ab23634af).(PLANET_SHAPEScxx . . $ `src/sprite.h:32:9`!, PGRcxx . . $ PGR.[mapPlanetcxx . . $ mapPlanet.[curSelcxx . . $ curSel.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.]-2] - 1]-1)->widthcxx . . $ $anonymous_type_297934740aeafb7d_0#width. / 2,
2000 dest_y_offset = spritecxx . . $ sprite(d067a90ab23634af).(PLANET_SHAPEScxx . . $ `src/sprite.h:32:9`!, PGRcxx . . $ PGR.[mapPlanetcxx . . $ mapPlanet.[curSelcxx . . $ curSel.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.]-2] - 1]-1)->heightcxx . . $ $anonymous_type_297934740aeafb7d_0#height. / 2;
2001
2002 newNavXcxx . . $ newNavX. = (planetXcxx . . $ planetX.[mapOrigincxx . . $ mapOrigin.-1] - origin_x_offset
2003 + planetXcxx . . $ planetX.[mapPlanetcxx . . $ mapPlanet.[curSelcxx . . $ curSel.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.]-2] - 1] - dest_x_offset) / 2.0f;
2004 newNavYcxx . . $ newNavY. = (planetYcxx . . $ planetY.[mapOrigincxx . . $ mapOrigin.-1] - origin_y_offset
2005 + planetYcxx . . $ planetY.[mapPlanetcxx . . $ mapPlanet.[curSelcxx . . $ curSel.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.]-2] - 1] - dest_y_offset) / 2.0f;
2006 }
2007
2008 navXcxx . . $ navX. = navXcxx . . $ navX. + (newNavXcxx . . $ newNavX. - navXcxx . . $ navX.) / 2.0f;
2009 navYcxx . . $ navY. = navYcxx . . $ navY. + (newNavYcxx . . $ newNavY. - navYcxx . . $ navY.) / 2.0f;
2010
2011 if (fabsf(newNavXcxx . . $ newNavX. - navXcxx . . $ navX.) < 1)
2012 navXcxx . . $ navX. = newNavXcxx . . $ newNavX.;
2013 if (fabsf(newNavYcxx . . $ newNavY. - navYcxx . . $ navY.) < 1)
2014 navYcxx . . $ navY. = newNavYcxx . . $ newNavY.;
2015
2016 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 314, 0, 319, 199, 230);
2017
2018 if (planetAniWaitcxx . . $ planetAniWait. > 0)
2019 {
2020 planetAniWaitcxx . . $ planetAniWait.--;
2021 }
2022 else
2023 {
2024 planetAnicxx . . $ planetAni.++;
2025 if (planetAnicxx . . $ planetAni. > 14)
2026 planetAnicxx . . $ planetAni. = 0;
2027 planetAniWaitcxx . . $ planetAniWait. = 3;
2028 }
2029
2030 if (currentDotWaitcxx . . $ currentDotWait. > 0)
2031 {
2032 currentDotWaitcxx . . $ currentDotWait.--;
2033 }
2034 else
2035 {
2036 if (currentDotNumcxx . . $ currentDotNum. < planetDotscxx . . $ planetDots.[curSelcxx . . $ curSel.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.]-2])
2037 currentDotNumcxx . . $ currentDotNum.++;
2038 currentDotWaitcxx . . $ currentDotWait. = 5;
2039 }
2040 }
2041
2042 void JE_drawLinescxx . . $ JE_drawLines(6f9b0be6b9606bac).(SDL_Surfacecxx . . $ SDL_Surface# *surface, JE_booleancxx . . $ JE_boolean# dark)
2043 {
2044 JE_bytecxx . . $ JE_byte# x, y;
2045 JE_integercxx . . $ JE_integer# tempX, tempY;
2046 JE_integercxx . . $ JE_integer# tempX2, tempY2;
2047 JE_wordcxx . . $ JE_word# tempW, tempW2;
2048
2049 tempX2 = -10;
2050 tempY2 = 0;
2051
2052 tempW = 0;
2053 for (x = 0; x < 20; x++)
2054 {
2055 tempW += 15;
2056 tempX = tempW - tempX2;
2057
2058 if (tempX > 18 && tempX < 135)
2059 {
2060 if (dark)
2061 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(surface, tempX + 1, 0, tempX + 1, 199, 32+3);
2062 else
2063 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(surface, tempX, 0, tempX, 199, 32+5);
2064 }
2065 }
2066
2067 tempW = 0;
2068 for (y = 0; y < 20; y++)
2069 {
2070 tempW += 15;
2071 tempY = tempW - tempY2;
2072
2073 if (tempY > 15 && tempY < 169)
2074 {
2075 if (dark)
2076 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(surface, 0, tempY + 1, 319, tempY + 1, 32+3);
2077 else
2078 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(surface, 0, tempY, 319, tempY, 32+5);
2079
2080 tempW2 = 0;
2081
2082 for (x = 0; x < 20; x++)
2083 {
2084 tempW2 += 15;
2085 tempX = tempW2 - tempX2;
2086 if (tempX > 18 && tempX < 135)
2087 {
2088 JE_pix3cxx . . $ JE_pix3(a8f544383a9967e9).(surface, tempX, tempY, 32+6);
2089 }
2090 }
2091 }
2092 }
2093 }
2094
2095 /* SYN: This was originally PROC drawlines... yes, there were two different procs called
2096 drawlines in different scopes in the same file. Dammit, Jason, why do you do this to me? */
2097
2098 void JE_drawNavLinescxx . . $ JE_drawNavLines(b45ddcbc8423892c).(JE_booleancxx . . $ JE_boolean# dark)
2099 {
2100 JE_bytecxx . . $ JE_byte# x, y;
2101 JE_integercxx . . $ JE_integer# tempX, tempY;
2102 JE_integercxx . . $ JE_integer# tempX2, tempY2;
2103 JE_wordcxx . . $ JE_word# tempW, tempW2;
2104
2105 tempX2 = tempNavXcxx . . $ tempNavX. >> 1;
2106 tempY2 = tempNavYcxx . . $ tempNavY. >> 1;
2107
2108 tempW = 0;
2109 for (x = 1; x <= 20; x++)
2110 {
2111 tempW += 15;
2112 tempX = tempW - tempX2;
2113
2114 if (tempX > 18 && tempX < 135)
2115 {
2116 if (dark)
2117 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(VGAScreencxx . . $ VGAScreen., tempX + 1, 16, tempX + 1, 169, 1);
2118 else
2119 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(VGAScreencxx . . $ VGAScreen., tempX, 16, tempX, 169, 5);
2120 }
2121 }
2122
2123 tempW = 0;
2124 for (y = 1; y <= 20; y++)
2125 {
2126 tempW += 15;
2127 tempY = tempW - tempY2;
2128
2129 if (tempY > 15 && tempY < 169)
2130 {
2131 if (dark)
2132 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(VGAScreencxx . . $ VGAScreen., 19, tempY + 1, 135, tempY + 1, 1);
2133 else
2134 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(VGAScreencxx . . $ VGAScreen., 8, tempY, 160, tempY, 5);
2135
2136 tempW2 = 0;
2137
2138 for (x = 0; x < 20; x++)
2139 {
2140 tempW2 += 15;
2141 tempX = tempW2 - tempX2;
2142 if (tempX > 18 && tempX < 135)
2143 JE_pix3cxx . . $ JE_pix3(a8f544383a9967e9).(VGAScreencxx . . $ VGAScreen., tempX, tempY, 7);
2144 }
2145 }
2146 }
2147 }
2148
2149 void JE_drawDotscxx . . $ JE_drawDots(49f6e7a06ebc5aa8).(void)
2150 {
2151 JE_bytecxx . . $ JE_byte# x, y;
2152 JE_integercxx . . $ JE_integer# tempX, tempY;
2153
2154 for (x = 0; x < mapPNumcxx . . $ mapPNum.; x++)
2155 {
2156 for (y = 0; y < planetDotscxx . . $ planetDots.[x]; y++)
2157 {
2158 tempX = planetDotXcxx . . $ planetDotX.[x][y] - tempNavXcxx . . $ tempNavX. + 66 - 2;
2159 tempY = planetDotYcxx . . $ planetDotY.[x][y] - tempNavYcxx . . $ tempNavY. + 85 - 2;
2160 if (tempX > 0 && tempX < 140 && tempY > 0 && tempY < 168)
2161 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., tempX, tempY, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, (x == curSelcxx . . $ curSel.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.]-2 && y < currentDotNumcxx . . $ currentDotNum.) ? 30 : 29); // navigation dots
2162 }
2163 }
2164 }
2165
2166 void JE_drawPlanetcxx . . $ JE_drawPlanet(ac50b47256ae7414).(JE_bytecxx . . $ JE_byte# planetNum)
2167 {
2168 JE_integercxx . . $ JE_integer# tempZ = PGRcxx . . $ PGR.[planetNum]-1,
2169 tempX = planetXcxx . . $ planetX.[planetNum] + 66 - tempNavXcxx . . $ tempNavX. - spritecxx . . $ sprite(d067a90ab23634af).(PLANET_SHAPEScxx . . $ `src/sprite.h:32:9`!, tempZ)->widthcxx . . $ $anonymous_type_297934740aeafb7d_0#width. / 2,
2170 tempY = planetYcxx . . $ planetY.[planetNum] + 85 - tempNavYcxx . . $ tempNavY. - spritecxx . . $ sprite(d067a90ab23634af).(PLANET_SHAPEScxx . . $ `src/sprite.h:32:9`!, tempZ)->heightcxx . . $ $anonymous_type_297934740aeafb7d_0#height. / 2;
2171
2172 if (tempX > -7 && tempX + spritecxx . . $ sprite(d067a90ab23634af).(PLANET_SHAPEScxx . . $ `src/sprite.h:32:9`!, tempZ)->widthcxx . . $ $anonymous_type_297934740aeafb7d_0#width. < 170 && tempY > 0 && tempY < 160)
2173 {
2174 if (PAnicxx . . $ PAni.[planetNum])
2175 tempZ += planetAnicxx . . $ planetAni.;
2176
2177 blit_sprite_darkcxx . . $ blit_sprite_dark(34bc9a7b28a4eeec).(VGAScreenSegcxx . . $ VGAScreenSeg., tempX + 3, tempY + 3, PLANET_SHAPEScxx . . $ `src/sprite.h:32:9`!, tempZ, falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
2178 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., tempX, tempY, PLANET_SHAPEScxx . . $ `src/sprite.h:32:9`!, tempZ); // planets
2179 }
2180 }
2181
2182 void JE_scaleBitmapcxx . . $ JE_scaleBitmap(649bbc045d77a124).(SDL_Surfacecxx . . $ SDL_Surface# *dst_bitmap, const SDL_Surfacecxx . . $ SDL_Surface# *src_bitmap, int x1, int y1, int x2, int y2)
2183 {
2184 /* This function scales one screen and writes the result to another.
2185 * The only code that calls it is the code run when you select 'ship
2186 * specs' from the main menu.
2187 *
2188 * Originally this used fixed point math. I haven't seen that in ages :).
2189 * But we're well past the point of needing that.*/
2190
2191 assertcxx . . $ `/usr/include/assert.h:50:10`!(src_bitmap != NULL && dst_bitmap != NULL);
2192 assertcxx . . $ `/usr/include/assert.h:50:10`!(x1 >= 0 && y1 >= 0 && x2 < src_bitmap->pitch && y2 < src_bitmap->h);
2193
2194 int w = x2 - x1 + 1,
2195 h = y2 - y1 + 1;
2196 float base_skip_w = src_bitmap->pitchcxx . . $ SDL_Surface#pitch. / (float)w,
2197 base_skip_h = src_bitmap->hcxx . . $ SDL_Surface#h. / (float)h;
2198 float cumulative_skip_w, cumulative_skip_h;
2199
2200 //Okay, it's time to loop through and add bits of A to a rectangle in B
2201 Uint8cxx . . $ Uint8# *dst = dst_bitmap->pixelscxx . . $ SDL_Surface#pixels.; /* 8-bit specific */
2202 const Uint8cxx . . $ Uint8# *src, *src_w; /* 8-bit specific */
2203
2204 dst += y1 * dst_bitmap->pitchcxx . . $ SDL_Surface#pitch. + x1;
2205 cumulative_skip_h = 0;
2206
2207 for (int i = 0; i < h; i++)
2208 {
2209 //this sets src to the beginning of our desired line
2210 src = src_w = (Uint8cxx . . $ Uint8# *)(src_bitmap->pixelscxx . . $ SDL_Surface#pixels.) + (src_bitmap->wcxx . . $ SDL_Surface#w. * ((unsigned int)cumulative_skip_h));
2211 cumulative_skip_h += base_skip_h;
2212 cumulative_skip_w = 0;
2213
2214 for (int j = 0; j < w; j++)
2215 {
2216 //copy and move pointers
2217 *dst = *src;
2218 dst++;
2219
2220 cumulative_skip_w += base_skip_w;
2221 src = src_w + ((unsigned int)cumulative_skip_w); //value is floored
2222 }
2223
2224 dst += dst_bitmap->pitchcxx . . $ SDL_Surface#pitch. - w;
2225 }
2226 }
2227
2228 void JE_initWeaponViewcxx . . $ JE_initWeaponView(49f6e7a06ebc5aa8).(void)
2229 {
2230 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 8, 8, 144, 177, 0);
2231
2232 playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[LEFT_SIDEKICKcxx . . $ LEFT_SIDEKICK.].xcxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#x. = 72 - 15;
2233 playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[LEFT_SIDEKICKcxx . . $ LEFT_SIDEKICK.].ycxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#y. = 120;
2234 playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.].xcxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#x. = 72 + 15;
2235 playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.].ycxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#y. = 120;
2236
2237 playercxx . . $ player.[0].xcxx . . $ $anonymous_type_55bed0e189d5bed_4#x. = 72;
2238 playercxx . . $ player.[0].ycxx . . $ $anonymous_type_55bed0e189d5bed_4#y. = 110;
2239 playercxx . . $ player.[0].delta_x_shot_movecxx . . $ $anonymous_type_55bed0e189d5bed_4#delta_x_shot_move. = 0;
2240 playercxx . . $ player.[0].delta_y_shot_movecxx . . $ $anonymous_type_55bed0e189d5bed_4#delta_y_shot_move. = 0;
2241 playercxx . . $ player.[0].last_x_explosion_followcxx . . $ $anonymous_type_55bed0e189d5bed_4#last_x_explosion_follow. = 72;
2242 playercxx . . $ player.[0].last_y_explosion_followcxx . . $ $anonymous_type_55bed0e189d5bed_4#last_y_explosion_follow. = 110;
2243 powercxx . . $ power. = 500;
2244 lastPowercxx . . $ lastPower. = 500;
2245
2246 memsetcxx . . $ memset(d1de1e4fb215f1c6).(shotAvailcxx . . $ shotAvail., 0, sizeof(shotAvailcxx . . $ shotAvail.));
2247
2248 memsetcxx . . $ memset(d1de1e4fb215f1c6).(shotRepeatcxx . . $ shotRepeat., 1, sizeof(shotRepeatcxx . . $ shotRepeat.));
2249 memsetcxx . . $ memset(d1de1e4fb215f1c6).(shotMultiPoscxx . . $ shotMultiPos., 0, sizeof(shotMultiPoscxx . . $ shotMultiPos.));
2250
2251 initialize_starfieldcxx . . $ initialize_starfield(49f6e7a06ebc5aa8).();
2252 }
2253
2254 void JE_computeDotscxx . . $ JE_computeDots(49f6e7a06ebc5aa8).(void)
2255 {
2256 JE_integercxx . . $ JE_integer# tempX, tempY;
2257 JE_longintcxx . . $ JE_longint# distX, distY;
2258 JE_bytecxx . . $ JE_byte# x, y;
2259
2260 for (x = 0; x < mapPNumcxx . . $ mapPNum.; x++)
2261 {
2262 distX = (int)(planetXcxx . . $ planetX.[mapPlanetcxx . . $ mapPlanet.[x]-1]) - (int)(planetXcxx . . $ planetX.[mapOrigincxx . . $ mapOrigin.-1]);
2263 distY = (int)(planetYcxx . . $ planetY.[mapPlanetcxx . . $ mapPlanet.[x]-1]) - (int)(planetYcxx . . $ planetY.[mapOrigincxx . . $ mapOrigin.-1]);
2264 tempX = abscxx . . $ abs(7864480464b09eea).(distX) + abscxx . . $ abs(7864480464b09eea).(distY);
2265
2266 if (tempX != 0)
2267 planetDotscxx . . $ planetDots.[x] = roundf(sqrtf(sqrtf((distX * distX) + (distY * distY)))) - 1;
2268 else
2269 planetDotscxx . . $ planetDots.[x] = 0;
2270
2271 if (planetDotscxx . . $ planetDots.[x] > 10)
2272 planetDotscxx . . $ planetDots.[x] = 10;
2273
2274 for (y = 0; y < planetDotscxx . . $ planetDots.[x]; y++)
2275 {
2276 tempX = JE_partWaycxx . . $ JE_partWay(781555ebe2c58edf).(planetXcxx . . $ planetX.[mapOrigincxx . . $ mapOrigin.-1], planetXcxx . . $ planetX.[mapPlanetcxx . . $ mapPlanet.[x]-1], planetDotscxx . . $ planetDots.[x], y);
2277 tempY = JE_partWaycxx . . $ JE_partWay(781555ebe2c58edf).(planetYcxx . . $ planetY.[mapOrigincxx . . $ mapOrigin.-1], planetYcxx . . $ planetY.[mapPlanetcxx . . $ mapPlanet.[x]-1], planetDotscxx . . $ planetDots.[x], y);
2278 /* ??? Why does it use temp? =P */
2279 planetDotXcxx . . $ planetDotX.[x][y] = tempX;
2280 planetDotYcxx . . $ planetDotY.[x][y] = tempY;
2281 }
2282 }
2283 }
2284
2285 JE_integercxx . . $ JE_integer# JE_partWaycxx . . $ JE_partWay(781555ebe2c58edf).(JE_integercxx . . $ JE_integer# start, JE_integercxx . . $ JE_integer# finish, JE_bytecxx . . $ JE_byte# dots, JE_bytecxx . . $ JE_byte# dist)
2286 {
2287 return (finish - start) / (dots + 2) * (dist + 1) + start;
2288 }
2289
2290 void JE_doShipSpecscxx . . $ JE_doShipSpecs(49f6e7a06ebc5aa8).(void)
2291 {
2292 /* This function is called whenever you select 'ship specs' in the
2293 * game menu. It draws the nice green tech screen and scales it onto
2294 * the main window. To do this we need two temp buffers, so we're going
2295 * to use VGAScreen and game_screen for the purpose (making things more
2296 * complex than they would be if we just malloc'd, but faster)
2297 *
2298 * Originally the whole system was pretty oddly designed. So I changed it.
2299 * Currently drawFunkyScreen creates the image, scaleInPicture draws it,
2300 * and doFunkyScreen ties everything together. Before it was more like
2301 * an oddly designed, unreusable, global sharing hierarchy. */
2302
2303 //create the image we want
2304 wait_noinputcxx . . $ wait_noinput(9e113dd3a0d25c95).(truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
2305 JE_drawShipSpecscxx . . $ JE_drawShipSpecs(fac4f6e207c3be86).(game_screencxx . . $ game_screen., VGAScreen2cxx . . $ VGAScreen2.);
2306
2307 //reset VGAScreen2, which we clobbered
2308 JE_loadPiccxx . . $ JE_loadPic(4846ed2ea5b0a844).(VGAScreen2cxx . . $ VGAScreen2., 1, falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
2309
2310 //draw it
2311 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_SPRINGcxx . . $ S_SPRING.);
2312 JE_scaleInPicturecxx . . $ JE_scaleInPicture(d9ac4e94ed841e45).(VGAScreencxx . . $ VGAScreen., game_screencxx . . $ game_screen.);
2313 wait_inputcxx . . $ wait_input(9e113dd3a0d25c95).(truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
2314 }
2315
2316 void JE_drawMainMenuHelpTextcxx . . $ JE_drawMainMenuHelpText(49f6e7a06ebc5aa8).(void)
2317 {
2318 char tempStr[67];
2319 JE_bytecxx . . $ JE_byte# temp;
2320
2321 temp = curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] - 2;
2322 if (curMenucxx . . $ curMenu. == MENU_JOYSTICK_CONFIGcxx . . $ MENU_JOYSTICK_CONFIG.) // joystick settings menu help
2323 {
2324 const int help[16] = { 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 24, 11 };
2325 memcpycxx . . $ memcpy(cc817cb175f282d).(tempStr, mainMenuHelpcxx . . $ mainMenuHelp.[help[curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] - 2]], sizeof(tempStr));
2326 }
2327 else if (curMenucxx . . $ curMenu. < MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL. ||
2328 curMenucxx . . $ curMenu. == MENU_2_PLAYER_ARCADEcxx . . $ MENU_2_PLAYER_ARCADE. ||
2329 curMenucxx . . $ curMenu. > MENU_1_PLAYER_ARCADEcxx . . $ MENU_1_PLAYER_ARCADE.)
2330 {
2331 memcpycxx . . $ memcpy(cc817cb175f282d).(tempStr, mainMenuHelpcxx . . $ mainMenuHelp.[(menuHelpcxx . . $ menuHelp.[curMenucxx . . $ curMenu.][temp])-1], sizeof(tempStr));
2332 }
2333 else if (curMenucxx . . $ curMenu. == MENU_KEYBOARD_CONFIGcxx . . $ MENU_KEYBOARD_CONFIG. &&
2334 curSelcxx . . $ curSel.[MENU_KEYBOARD_CONFIGcxx . . $ MENU_KEYBOARD_CONFIG.] == 10)
2335 {
2336 memcpycxx . . $ memcpy(cc817cb175f282d).(tempStr, mainMenuHelpcxx . . $ mainMenuHelp.[25-1], sizeof(tempStr));
2337 }
2338 else if (leftPowercxx . . $ leftPower. || rightPowercxx . . $ rightPower.)
2339 {
2340 memcpycxx . . $ memcpy(cc817cb175f282d).(tempStr, mainMenuHelpcxx . . $ mainMenuHelp.[24-1], sizeof(tempStr));
2341 }
2342 else if (temp == menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.] - 2 ||
2343 (curMenucxx . . $ curMenu. == MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES. && cubeMaxcxx . . $ cubeMax. == 0))
2344 {
2345 memcpycxx . . $ memcpy(cc817cb175f282d).(tempStr, mainMenuHelpcxx . . $ mainMenuHelp.[12-1], sizeof(tempStr));
2346 }
2347 else
2348 {
2349 memcpycxx . . $ memcpy(cc817cb175f282d).(tempStr, mainMenuHelpcxx . . $ mainMenuHelp.[17 + curMenucxx . . $ curMenu. - 3], sizeof(tempStr));
2350 }
2351
2352 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 10, 187, tempStr, 14, 1, DARKENcxx . . $ `src/fonthand.h:28:9`!);
2353 }
2354
2355 JE_booleancxx . . $ JE_boolean# JE_quitRequestcxx . . $ JE_quitRequest(c9857a73d68e59ba).(void)
2356 {
2357 boolcxx . . $ `<external>/14268322491693841775/stdbool.h:36:9`! quit_selected = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, done = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
2358
2359 JE_clearKeyboardcxx . . $ JE_clearKeyboard(49f6e7a06ebc5aa8).();
2360 JE_wipeKeycxx . . $ JE_wipeKey(49f6e7a06ebc5aa8).();
2361 wait_noinputcxx . . $ wait_noinput(9e113dd3a0d25c95).(truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
2362
2363 JE_barShadecxx . . $ JE_barShade(ad548318d53dbf5e).(VGAScreencxx . . $ VGAScreen., 65, 55, 255, 155);
2364
2365 while (!done)
2366 {
2367 Uint8cxx . . $ Uint8# col = 8;
2368 int colC = 1;
2369
2370 do
2371 {
2372 service_SDL_eventscxx . . $ service_SDL_events(b45ddcbc8423892c).(truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
2373 setDelaycxx . . $ setDelay(d4f767463ce0a6b3).(4);
2374
2375 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreencxx . . $ VGAScreen., 50, 50, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 35); // message box
2376 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 70, 60, miscTextcxx . . $ miscText.[28], 0, 5, FULL_SHADEcxx . . $ `src/fonthand.h:27:9`!);
2377 JE_helpBoxcxx . . $ JE_helpBox(19e4cd32eb7ad4fc).(VGAScreencxx . . $ VGAScreen., 70, 90, miscTextcxx . . $ miscText.[30], 30);
2378
2379 col += colC;
2380 if (col > 8 || col < 2)
2381 colC = -colC;
2382
2383 int temp_x, temp_c;
2384
2385 temp_x = 54 + 45 - (JE_textWidthcxx . . $ JE_textWidth(1df18506ef0a631b).(miscTextcxx . . $ miscText.[9], FONT_SHAPEScxx . . $ `src/sprite.h:29:9`!) / 2);
2386 temp_c = quit_selected ? col - 12 : -5;
2387
2388 JE_outTextAdjustcxx . . $ JE_outTextAdjust(f31fd28f47a6d6f4).(VGAScreencxx . . $ VGAScreen., temp_x, 128, miscTextcxx . . $ miscText.[9], 15, temp_c, FONT_SHAPEScxx . . $ `src/sprite.h:29:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
2389
2390 temp_x = 149 + 45 - (JE_textWidthcxx . . $ JE_textWidth(1df18506ef0a631b).(miscTextcxx . . $ miscText.[10], FONT_SHAPEScxx . . $ `src/sprite.h:29:9`!) / 2);
2391 temp_c = !quit_selected ? col - 12 : -5;
2392
2393 JE_outTextAdjustcxx . . $ JE_outTextAdjust(f31fd28f47a6d6f4).(VGAScreencxx . . $ VGAScreen., temp_x, 128, miscTextcxx . . $ miscText.[10], 15, temp_c, FONT_SHAPEScxx . . $ `src/sprite.h:29:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
2394
2395 if (has_mousecxx . . $ has_mouse.)
2396 {
2397 JE_mouseStartcxx . . $ JE_mouseStart(49f6e7a06ebc5aa8).();
2398 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).();
2399 JE_mouseReplacecxx . . $ JE_mouseReplace(49f6e7a06ebc5aa8).();
2400 }
2401 else
2402 {
2403 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).();
2404 }
2405
2406 wait_delaycxx . . $ wait_delay(49f6e7a06ebc5aa8).();
2407
2408 push_joysticks_as_keyboardcxx . . $ push_joysticks_as_keyboard(49f6e7a06ebc5aa8).();
2409 service_SDL_eventscxx . . $ service_SDL_events(b45ddcbc8423892c).(falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
2410
2411 } while (!newkeycxx . . $ newkey. && !mousedowncxx . . $ mousedown.);
2412
2413 if (mousedowncxx . . $ mousedown.)
2414 {
2415 if (lastmouse_ycxx . . $ lastmouse_y. > 123 && lastmouse_ycxx . . $ lastmouse_y. < 149)
2416 {
2417 if (lastmouse_xcxx . . $ lastmouse_x. > 56 && lastmouse_xcxx . . $ lastmouse_x. < 142)
2418 {
2419 quit_selected = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2420 done = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2421 }
2422 else if (lastmouse_xcxx . . $ lastmouse_x. > 151 && lastmouse_xcxx . . $ lastmouse_x. < 237)
2423 {
2424 quit_selected = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
2425 done = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2426 }
2427 }
2428 mousedowncxx . . $ mousedown. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
2429 }
2430 else if (newkeycxx . . $ newkey.)
2431 {
2432 switch (lastkey_scancxx . . $ lastkey_scan.)
2433 {
2434 case SDL_SCANCODE_LEFTcxx . . $ SDL_SCANCODE_LEFT.:
2435 case SDL_SCANCODE_RIGHTcxx . . $ SDL_SCANCODE_RIGHT.:
2436 case SDL_SCANCODE_TABcxx . . $ SDL_SCANCODE_TAB.:
2437 quit_selected = !quit_selected;
2438 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CURSORcxx . . $ S_CURSOR.);
2439 break;
2440 case SDL_SCANCODE_RETURNcxx . . $ SDL_SCANCODE_RETURN.:
2441 case SDL_SCANCODE_SPACEcxx . . $ SDL_SCANCODE_SPACE.:
2442 done = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2443 break;
2444 case SDL_SCANCODE_ESCAPEcxx . . $ SDL_SCANCODE_ESCAPE.:
2445 quit_selected = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
2446 done = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2447 break;
2448 default:
2449 break;
2450 }
2451 }
2452 }
2453
2454 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(quit_selected ? S_SPRINGcxx . . $ S_SPRING. : S_CLICKcxx . . $ S_CLICK.);
2455
2456 #ifdef WITH_NETWORKcxx . . $ `<built-in>:413:9`!
2457 if (isNetworkGamecxx . . $ isNetworkGame. && quit_selected)
2458 {
2459 network_preparecxx . . $ network_prepare(ed53e3bbd3fa2f69).(PACKET_QUITcxx . . $ `src/network.h:35:9`!);
2460 network_sendcxx . . $ network_send(83c267b20bac841a).(4); // PACKET QUIT
2461
2462 network_tyrian_haltcxx . . $ network_tyrian_halt(ee2069353d7cc01f).(0, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
2463 }
2464 #endif
2465
2466 return quit_selected;
2467 }
2468
2469 void JE_genItemMenucxx . . $ JE_genItemMenu(ac50b47256ae7414).(JE_bytecxx . . $ JE_byte# itemNum)
2470 {
2471 menuChoicescxx . . $ menuChoices.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] = itemAvailMaxcxx . . $ itemAvailMax.[itemAvailMapcxx . . $ itemAvailMap.[itemNum - 2] - 1] + 2;
2472
2473 temp3cxx . . $ temp3. = 2;
2474 temp2cxx . . $ temp2. = *playeritem_mapcxx . . $ playeritem_map(16bd7c477ce26027).(&playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items., itemNum - 2);
2475
2476 strcpycxx . . $ strcpy(b7b3a83273496486).(menuIntcxx . . $ menuInt.[5][0], menuIntcxx . . $ menuInt.[2][itemNum - 1]);
2477
2478 for (tempWcxx . . $ tempW. = 0; tempWcxx . . $ tempW. < itemAvailMaxcxx . . $ itemAvailMax.[itemAvailMapcxx . . $ itemAvailMap.[itemNum - 2] - 1]; tempWcxx . . $ tempW.++)
2479 {
2480 tempcxx . . $ temp. = itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[itemNum - 2] - 1][tempWcxx . . $ tempW.];
2481 switch (itemNum)
2482 {
2483 case 2:
2484 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., shipscxx . . $ ships.[tempcxx . . $ temp.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_6#name.);
2485 break;
2486 case 3:
2487 case 4:
2488 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., weaponPortcxx . . $ weaponPort.[tempcxx . . $ temp.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_1#name.);
2489 break;
2490 case 5:
2491 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., shieldscxx . . $ shields.[tempcxx . . $ temp.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_5#name.);
2492 break;
2493 case 6:
2494 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., powerSyscxx . . $ powerSys.[tempcxx . . $ temp.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_2#name.);
2495 break;
2496 case 7:
2497 case 8:
2498 strcpycxx . . $ strcpy(b7b3a83273496486).(tempStrcxx . . $ tempStr., optionscxx . . $ options.[tempcxx . . $ temp.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_4#name.);
2499 break;
2500 }
2501 if (tempcxx . . $ temp. == temp2cxx . . $ temp2.)
2502 {
2503 temp3cxx . . $ temp3. = tempWcxx . . $ tempW. + 2;
2504 }
2505 strcpycxx . . $ strcpy(b7b3a83273496486).(menuIntcxx . . $ menuInt.[5][tempWcxx . . $ tempW.], tempStrcxx . . $ tempStr.);
2506 }
2507
2508 strcpycxx . . $ strcpy(b7b3a83273496486).(menuIntcxx . . $ menuInt.[5][tempWcxx . . $ tempW.], miscTextcxx . . $ miscText.[13]);
2509
2510 curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] = temp3cxx . . $ temp3.;
2511 }
2512
2513 void JE_scaleInPicturecxx . . $ JE_scaleInPicture(d9ac4e94ed841e45).(SDL_Surfacecxx . . $ SDL_Surface# *dst, const SDL_Surfacecxx . . $ SDL_Surface# *src)
2514 {
2515 for (int i = 2; i <= 160; i += 2)
2516 {
2517 if (JE_anyButtoncxx . . $ JE_anyButton(c9857a73d68e59ba).())
2518 break;
2519
2520 JE_scaleBitmapcxx . . $ JE_scaleBitmap(649bbc045d77a124).(dst, src, 160 - i, 0, 160 + i - 1, 100 + roundf(i * 0.625f) - 1);
2521 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).();
2522
2523 SDL_Delaycxx . . $ SDL_Delay(cb2f890c2fdad230).(1);
2524 }
2525 }
2526
2527 void JE_drawScorecxx . . $ JE_drawScore(49f6e7a06ebc5aa8).(void)
2528 {
2529 char cl[24];
2530 if (curMenucxx . . $ curMenu. == MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.)
2531 {
2532 sprintfcxx . . $ sprintf(26c8642d26409d6d).(cl, "%d", JE_cashLeftcxx . . $ JE_cashLeft(b126dc7c1de90089).());
2533 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 65, 173, cl, 1, 6, DARKENcxx . . $ `src/fonthand.h:28:9`!);
2534 }
2535 }
2536
2537 void JE_menuFunctioncxx . . $ JE_menuFunction(ac50b47256ae7414).(JE_bytecxx . . $ JE_byte# select)
2538 {
2539 JE_bytecxx . . $ JE_byte# x;
2540 JE_wordcxx . . $ JE_word# curSelect;
2541
2542 colcxx . . $ col. = 0;
2543 colCcxx . . $ colC. = -1;
2544 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CLICKcxx . . $ S_CLICK.);
2545
2546 curSelect = curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.];
2547
2548 switch (curMenucxx . . $ curMenu.)
2549 {
2550 case MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.:
2551 switch (select)
2552 {
2553 case 2: //cubes
2554 curMenucxx . . $ curMenu. = MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.;
2555 curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] = 2;
2556 break;
2557 case 3: //shipspecs
2558 JE_doShipSpecscxx . . $ JE_doShipSpecs(49f6e7a06ebc5aa8).();
2559 break;
2560 case 4://upgradeship
2561 curMenucxx . . $ curMenu. = MENU_UPGRADEScxx . . $ MENU_UPGRADES.;
2562 break;
2563 case 5: //options
2564 curMenucxx . . $ curMenu. = MENU_OPTIONScxx . . $ MENU_OPTIONS.;
2565 break;
2566 case 6: //nextlevel
2567 curMenucxx . . $ curMenu. = MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.;
2568 newPalcxx . . $ newPal. = 18;
2569 JE_computeDotscxx . . $ JE_computeDots(49f6e7a06ebc5aa8).();
2570 navXcxx . . $ navX. = planetXcxx . . $ planetX.[mapOrigincxx . . $ mapOrigin. - 1];
2571 navYcxx . . $ navY. = planetYcxx . . $ planetY.[mapOrigincxx . . $ mapOrigin. - 1];
2572 newNavXcxx . . $ newNavX. = navXcxx . . $ navX.;
2573 newNavYcxx . . $ newNavY. = navYcxx . . $ navY.;
2574 menuChoicescxx . . $ menuChoices.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.] = mapPNumcxx . . $ mapPNum. + 2;
2575 curSelcxx . . $ curSel.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.] = 2;
2576 strcpycxx . . $ strcpy(b7b3a83273496486).(menuIntcxx . . $ menuInt.[4][0], "Next Level");
2577 for (x = 0; x < mapPNumcxx . . $ mapPNum.; x++)
2578 {
2579 tempcxx . . $ temp. = mapPlanetcxx . . $ mapPlanet.[x];
2580 strcpycxx . . $ strcpy(b7b3a83273496486).(menuIntcxx . . $ menuInt.[4][x + 1], pNamecxx . . $ pName.[tempcxx . . $ temp. - 1]);
2581 }
2582 strcpycxx . . $ strcpy(b7b3a83273496486).(menuIntcxx . . $ menuInt.[4][x + 1], miscTextcxx . . $ miscText.[5]);
2583 break;
2584 case 7: //quit
2585 if (JE_quitRequestcxx . . $ JE_quitRequest(c9857a73d68e59ba).())
2586 {
2587 gameLoadedcxx . . $ gameLoaded. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2588 mainLevelcxx . . $ mainLevel. = 0;
2589 }
2590 break;
2591 }
2592 break;
2593
2594 case MENU_UPGRADEScxx . . $ MENU_UPGRADES.:
2595 if (select == 9) //done
2596 {
2597 curMenucxx . . $ curMenu. = MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.;
2598 }
2599 else // selected item to upgrade
2600 {
2601 old_itemscxx . . $ old_items.[0] = playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items.;
2602
2603 lastDirectioncxx . . $ lastDirection. = 1;
2604 JE_genItemMenucxx . . $ JE_genItemMenu(ac50b47256ae7414).(select);
2605 JE_initWeaponViewcxx . . $ JE_initWeaponView(49f6e7a06ebc5aa8).();
2606 curMenucxx . . $ curMenu. = MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.;
2607 lastCurSelcxx . . $ lastCurSel. = curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.];
2608 playercxx . . $ player.[0].cashcxx . . $ $anonymous_type_55bed0e189d5bed_4#cash. = playercxx . . $ player.[0].cashcxx . . $ $anonymous_type_55bed0e189d5bed_4#cash. * 2 - JE_cashLeftcxx . . $ JE_cashLeft(b126dc7c1de90089).();
2609 }
2610 break;
2611
2612 case MENU_OPTIONScxx . . $ MENU_OPTIONS.:
2613 switch (select)
2614 {
2615 case 2:
2616 curMenucxx . . $ curMenu. = MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE.;
2617 performSavecxx . . $ performSave. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
2618 quikSavecxx . . $ quikSave. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
2619 break;
2620 case 3:
2621 curMenucxx . . $ curMenu. = MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE.;
2622 performSavecxx . . $ performSave. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2623 quikSavecxx . . $ quikSave. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
2624 break;
2625 case 6:
2626 curMenucxx . . $ curMenu. = MENU_JOYSTICK_CONFIGcxx . . $ MENU_JOYSTICK_CONFIG.;
2627 break;
2628 case 7:
2629 curMenucxx . . $ curMenu. = MENU_KEYBOARD_CONFIGcxx . . $ MENU_KEYBOARD_CONFIG.;
2630 break;
2631 case 8:
2632 curMenucxx . . $ curMenu. = MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.;
2633 break;
2634 }
2635 break;
2636
2637 case MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.:
2638 if (select == menuChoicescxx . . $ menuChoices.[MENU_PLAY_NEXT_LEVELcxx . . $ MENU_PLAY_NEXT_LEVEL.]) //exit
2639 {
2640 curMenucxx . . $ curMenu. = MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.;
2641 newPalcxx . . $ newPal. = 1;
2642 }
2643 else
2644 {
2645 mainLevelcxx . . $ mainLevel. = mapSectioncxx . . $ mapSection.[curSelect - 2];
2646 jumpSectioncxx . . $ jumpSection. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2647 }
2648 break;
2649
2650 case MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.:
2651 if (curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] < menuChoicescxx . . $ menuChoices.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.])
2652 {
2653 // select done
2654 curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] = menuChoicescxx . . $ menuChoices.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.];
2655 }
2656 else // if done is selected
2657 {
2658 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_ITEMcxx . . $ S_ITEM.);
2659
2660 playercxx . . $ player.[0].cashcxx . . $ $anonymous_type_55bed0e189d5bed_4#cash. = JE_cashLeftcxx . . $ JE_cashLeft(b126dc7c1de90089).();
2661 curMenucxx . . $ curMenu. = MENU_UPGRADEScxx . . $ MENU_UPGRADES.;
2662 }
2663 break;
2664
2665 case MENU_KEYBOARD_CONFIGcxx . . $ MENU_KEYBOARD_CONFIG.:
2666 if (curSelect == 10) /* reset to defaults */
2667 {
2668 memcpycxx . . $ memcpy(cc817cb175f282d).(keySettingscxx . . $ keySettings., defaultKeySettingscxx . . $ defaultKeySettings., sizeof(keySettingscxx . . $ keySettings.));
2669 }
2670 else if (curSelect == 11) /* done */
2671 {
2672 curMenucxx . . $ curMenu. = isNetworkGamecxx . . $ isNetworkGame.
2673 ? MENU_LIMITED_OPTIONScxx . . $ MENU_LIMITED_OPTIONS.
2674 : MENU_OPTIONScxx . . $ MENU_OPTIONS.;
2675 }
2676 else /* change key */
2677 {
2678 temp2cxx . . $ temp2. = 254;
2679 int tempY = 38 + (curSelect - 2) * 12;
2680 JE_textShadecxx . . $ JE_textShade(bb6cf87f29d3df77).(VGAScreencxx . . $ VGAScreen., 236, tempY, SDL_GetScancodeNamecxx . . $ SDL_GetScancodeName(784ff5cdfe45052d).(keySettingscxx . . $ keySettings.[curSelect-2]), (temp2cxx . . $ temp2. / 16), (temp2cxx . . $ temp2. % 16) - 8, DARKENcxx . . $ `src/fonthand.h:28:9`!);
2681 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).();
2682
2683 wait_noinputcxx . . $ wait_noinput(9e113dd3a0d25c95).(truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
2684
2685 colcxx . . $ col. = 248;
2686 colCcxx . . $ colC. = 1;
2687
2688 do
2689 {
2690 setDelaycxx . . $ setDelay(d4f767463ce0a6b3).(1);
2691
2692 colcxx . . $ col. += colCcxx . . $ colC.;
2693 if (colcxx . . $ col. < 243 || colcxx . . $ col. > 248)
2694 {
2695 colCcxx . . $ colC. *= -1;
2696 }
2697 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(VGAScreencxx . . $ VGAScreen., 230, tempY - 2, 300, tempY + 7, colcxx . . $ col.);
2698
2699 poll_joystickscxx . . $ poll_joysticks(49f6e7a06ebc5aa8).();
2700 service_SDL_eventscxx . . $ service_SDL_events(b45ddcbc8423892c).(truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
2701
2702 JE_showVGAcxx . . $ JE_showVGA(49f6e7a06ebc5aa8).();
2703
2704 wait_delaycxx . . $ wait_delay(49f6e7a06ebc5aa8).();
2705 } while (!newkeycxx . . $ newkey. && !mousedowncxx . . $ mousedown. && !joydowncxx . . $ joydown.);
2706
2707 if (newkeycxx . . $ newkey.)
2708 {
2709 // already used? then swap
2710 for (uintcxx . . $ uint# i = 0; i < COUNTOFcxx . . $ `src/opentyr.h:27:9`!(keySettings); ++i)
2711 {
2712 if (keySettingscxx . . $ keySettings.[i] == lastkey_scancxx . . $ lastkey_scan.)
2713 {
2714 keySettingscxx . . $ keySettings.[i] = keySettingscxx . . $ keySettings.[curSelect-2];
2715 break;
2716 }
2717 }
2718
2719 if (lastkey_scancxx . . $ lastkey_scan. != SDL_SCANCODE_ESCAPEcxx . . $ SDL_SCANCODE_ESCAPE. && // reserved for menu
2720 lastkey_scancxx . . $ lastkey_scan. != SDL_SCANCODE_F11cxx . . $ SDL_SCANCODE_F11. && // reserved for gamma
2721 lastkey_scancxx . . $ lastkey_scan. != SDL_SCANCODE_Pcxx . . $ SDL_SCANCODE_P.) // reserved for pause
2722 {
2723 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CLICKcxx . . $ S_CLICK.);
2724 keySettingscxx . . $ keySettings.[curSelect-2] = lastkey_scancxx . . $ lastkey_scan.;
2725 ++curSelect;
2726 }
2727
2728 JE_wipeKeycxx . . $ JE_wipeKey(49f6e7a06ebc5aa8).();
2729 }
2730 }
2731 break;
2732
2733 case MENU_LOAD_SAVEcxx . . $ MENU_LOAD_SAVE.:
2734 if (curSelect == 13)
2735 {
2736 if (quikSavecxx . . $ quikSave.)
2737 {
2738 curMenucxx . . $ curMenu. = oldMenucxx . . $ oldMenu.;
2739 newPalcxx . . $ newPal. = oldPalcxx . . $ oldPal.;
2740 }
2741 else
2742 {
2743 curMenucxx . . $ curMenu. = MENU_OPTIONScxx . . $ MENU_OPTIONS.;
2744 }
2745 }
2746 else
2747 {
2748 if (twoPlayerModecxx . . $ twoPlayerMode.)
2749 tempcxx . . $ temp. = 11;
2750 else
2751 tempcxx . . $ temp. = 0;
2752 JE_operationcxx . . $ JE_operation(ac50b47256ae7414).(curSelect - 1 + tempcxx . . $ temp.);
2753 if (quikSavecxx . . $ quikSave.)
2754 {
2755 curMenucxx . . $ curMenu. = oldMenucxx . . $ oldMenu.;
2756 newPalcxx . . $ newPal. = oldPalcxx . . $ oldPal.;
2757 }
2758 }
2759 break;
2760
2761 case MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.:
2762 if (curSelect == menuChoicescxx . . $ menuChoices.[curMenucxx . . $ curMenu.])
2763 {
2764 curMenucxx . . $ curMenu. = MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.;
2765 newPalcxx . . $ newPal. = 1;
2766 }
2767 else
2768 {
2769 if (cubeMaxcxx . . $ cubeMax. > 0)
2770 {
2771 firstMenu9cxx . . $ firstMenu9. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2772 curMenucxx . . $ curMenu. = MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.;
2773 yLoccxx . . $ yLoc. = 0;
2774 yChgcxx . . $ yChg. = 0;
2775 currentCubecxx . . $ currentCube. = curSelcxx . . $ curSel.[MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.] - 2;
2776 }
2777 else
2778 {
2779 curMenucxx . . $ curMenu. = MENU_FULL_GAMEcxx . . $ MENU_FULL_GAME.;
2780 newPalcxx . . $ newPal. = 1;
2781 }
2782 }
2783 break;
2784
2785 case MENU_DATA_CUBE_SUBcxx . . $ MENU_DATA_CUBE_SUB.:
2786 curMenucxx . . $ curMenu. = MENU_DATA_CUBEScxx . . $ MENU_DATA_CUBES.;
2787 break;
2788
2789 case MENU_2_PLAYER_ARCADEcxx . . $ MENU_2_PLAYER_ARCADE.:
2790 switch (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
2791 {
2792 case 2:
2793 mainLevelcxx . . $ mainLevel. = mapSectioncxx . . $ mapSection.[mapPNumcxx . . $ mapPNum.-1];
2794 jumpSectioncxx . . $ jumpSection. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2795 break;
2796 case 3:
2797 case 4:
2798 JE_playSampleNumcxx . . $ JE_playSampleNum(ac50b47256ae7414).(S_CURSORcxx . . $ S_CURSOR.);
2799
2800 int temp = curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.] - 3;
2801 do
2802 {
2803 if (joystickscxx . . $ joysticks. == 0)
2804 inputDevicecxx . . $ inputDevice.[temp == 0 ? 1 : 0] = inputDevicecxx . . $ inputDevice.[temp]; // swap controllers
2805 if (inputDevicecxx . . $ inputDevice.[temp] >= 2 + joystickscxx . . $ joysticks.)
2806 inputDevicecxx . . $ inputDevice.[temp] = 1;
2807 else
2808 inputDevicecxx . . $ inputDevice.[temp]++;
2809 } while (inputDevicecxx . . $ inputDevice.[temp] == inputDevicecxx . . $ inputDevice.[temp == 0 ? 1 : 0]);
2810 break;
2811 case 5:
2812 curMenucxx . . $ curMenu. = MENU_OPTIONScxx . . $ MENU_OPTIONS.;
2813 break;
2814 case 6:
2815 if (JE_quitRequestcxx . . $ JE_quitRequest(c9857a73d68e59ba).())
2816 {
2817 gameLoadedcxx . . $ gameLoaded. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2818 mainLevelcxx . . $ mainLevel. = 0;
2819 }
2820 break;
2821 }
2822 break;
2823
2824 case MENU_1_PLAYER_ARCADEcxx . . $ MENU_1_PLAYER_ARCADE.:
2825 switch (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
2826 {
2827 case 2:
2828 mainLevelcxx . . $ mainLevel. = mapSectioncxx . . $ mapSection.[mapPNumcxx . . $ mapPNum.-1];
2829 jumpSectioncxx . . $ jumpSection. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2830 break;
2831 case 3:
2832 curMenucxx . . $ curMenu. = isNetworkGamecxx . . $ isNetworkGame.
2833 ? MENU_LIMITED_OPTIONScxx . . $ MENU_LIMITED_OPTIONS.
2834 : MENU_OPTIONScxx . . $ MENU_OPTIONS.;
2835 break;
2836 case 4:
2837 if (JE_quitRequestcxx . . $ JE_quitRequest(c9857a73d68e59ba).())
2838 {
2839 gameLoadedcxx . . $ gameLoaded. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2840 mainLevelcxx . . $ mainLevel. = 0;
2841 }
2842 break;
2843 }
2844 break;
2845
2846 case MENU_LIMITED_OPTIONScxx . . $ MENU_LIMITED_OPTIONS.:
2847 switch (select)
2848 {
2849 case 2:
2850 curMenucxx . . $ curMenu. = MENU_JOYSTICK_CONFIGcxx . . $ MENU_JOYSTICK_CONFIG.;
2851 break;
2852 case 3:
2853 curMenucxx . . $ curMenu. = MENU_KEYBOARD_CONFIGcxx . . $ MENU_KEYBOARD_CONFIG.;
2854 break;
2855 case 6:
2856 curMenucxx . . $ curMenu. = MENU_1_PLAYER_ARCADEcxx . . $ MENU_1_PLAYER_ARCADE.;
2857 break;
2858 }
2859 break;
2860
2861 case MENU_JOYSTICK_CONFIGcxx . . $ MENU_JOYSTICK_CONFIG.:
2862 if (joystickscxx . . $ joysticks. == 0 && select != 17)
2863 break;
2864
2865 switch (select)
2866 {
2867 case 2:
2868 joystick_configcxx . . $ joystick_config.++;
2869 joystick_configcxx . . $ joystick_config. %= joystickscxx . . $ joysticks.;
2870 break;
2871 case 3:
2872 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog. = !joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog.;
2873 break;
2874 case 4:
2875 if (joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog.)
2876 {
2877 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].sensitivitycxx . . $ $anonymous_type_abd17893024d7112_2#sensitivity.++;
2878 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].sensitivitycxx . . $ $anonymous_type_abd17893024d7112_2#sensitivity. %= 11;
2879 }
2880 break;
2881 case 5:
2882 if (joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].analogcxx . . $ $anonymous_type_abd17893024d7112_2#analog.)
2883 {
2884 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].thresholdcxx . . $ $anonymous_type_abd17893024d7112_2#threshold.++;
2885 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].thresholdcxx . . $ $anonymous_type_abd17893024d7112_2#threshold. %= 11;
2886 }
2887 break;
2888 case 16:
2889 reset_joystick_assignmentscxx . . $ reset_joystick_assignments(d4f767463ce0a6b3).(joystick_configcxx . . $ joystick_config.);
2890 break;
2891 case 17:
2892 curMenucxx . . $ curMenu. = isNetworkGamecxx . . $ isNetworkGame.
2893 ? MENU_LIMITED_OPTIONScxx . . $ MENU_LIMITED_OPTIONS.
2894 : MENU_OPTIONScxx . . $ MENU_OPTIONS.;
2895 break;
2896 default:
2897 if (joystickscxx . . $ joysticks. == 0)
2898 break;
2899
2900 // int temp = 254;
2901 // JE_textShade(VGAScreen, 236, 38 + i * 8, value, temp / 16, temp % 16 - 8, DARKEN);
2902
2903 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(VGAScreencxx . . $ VGAScreen., 235, 21 + select * 8, 310, 30 + select * 8, 248);
2904
2905 Joystick_assignmentcxx . . $ Joystick_assignment# temp;
2906 if (detect_joystick_assignmentcxx . . $ detect_joystick_assignment(8994ef2eb854becc).(joystick_configcxx . . $ joystick_config., &temp))
2907 {
2908 // if the detected assignment was already set, unset it
2909 for (uintcxx . . $ uint# i = 0; i < COUNTOFcxx . . $ `src/opentyr.h:27:9`!(*joystick->assignment); i++)
2910 {
2911 if (joystick_assignment_cmpcxx . . $ joystick_assignment_cmp(168eefc3be700665).(&temp, &joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].assignmentcxx . . $ $anonymous_type_abd17893024d7112_2#assignment.[select - 6][i]))
2912 {
2913 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].assignmentcxx . . $ $anonymous_type_abd17893024d7112_2#assignment.[select - 6][i].typecxx . . $ $anonymous_type_abd17893024d7112_1#type. = NONEcxx . . $ NONE.;
2914 goto joystick_assign_done;
2915 }
2916 }
2917
2918 // if there is an empty assignment, set it
2919 for (uintcxx . . $ uint# i = 0; i < COUNTOFcxx . . $ `src/opentyr.h:27:9`!(*joystick->assignment); i++)
2920 {
2921 if (joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].assignmentcxx . . $ $anonymous_type_abd17893024d7112_2#assignment.[select - 6][i].typecxx . . $ $anonymous_type_abd17893024d7112_1#type. == NONEcxx . . $ NONE.)
2922 {
2923 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].assignmentcxx . . $ $anonymous_type_abd17893024d7112_2#assignment.[select - 6][i] = temp;
2924 goto joystick_assign_done;
2925 }
2926 }
2927
2928 // if no assignments are empty, shift them all forward and set the last one
2929 for (uintcxx . . $ uint# i = 0; i < COUNTOFcxx . . $ `src/opentyr.h:27:9`!(*joystick->assignment); i++)
2930 {
2931 if (i == COUNTOFcxx . . $ `src/opentyr.h:27:9`!(*joystick->assignment) - 1)
2932 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].assignmentcxx . . $ $anonymous_type_abd17893024d7112_2#assignment.[select - 6][i] = temp;
2933 else
2934 joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].assignmentcxx . . $ $anonymous_type_abd17893024d7112_2#assignment.[select - 6][i] = joystickcxx . . $ joystick.[joystick_configcxx . . $ joystick_config.].assignmentcxx . . $ $anonymous_type_abd17893024d7112_2#assignment.[select - 6][i + 1];
2935 }
2936
2937 joystick_assign_done:
2938 curSelect++;
2939
2940 poll_joystickscxx . . $ poll_joysticks(49f6e7a06ebc5aa8).();
2941 }
2942 }
2943 break;
2944
2945 case MENU_SUPER_TYRIANcxx . . $ MENU_SUPER_TYRIAN.:
2946 switch (curSelcxx . . $ curSel.[curMenucxx . . $ curMenu.])
2947 {
2948 case 2:
2949 mainLevelcxx . . $ mainLevel. = mapSectioncxx . . $ mapSection.[mapPNumcxx . . $ mapPNum.-1];
2950 jumpSectioncxx . . $ jumpSection. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2951 break;
2952 case 3:
2953 JE_doShipSpecscxx . . $ JE_doShipSpecs(49f6e7a06ebc5aa8).();
2954 break;
2955 case 4:
2956 curMenucxx . . $ curMenu. = MENU_OPTIONScxx . . $ MENU_OPTIONS.;
2957 break;
2958 case 5:
2959 if (JE_quitRequestcxx . . $ JE_quitRequest(c9857a73d68e59ba).())
2960 {
2961 if (isNetworkGamecxx . . $ isNetworkGame.)
2962 {
2963 JE_tyrianHaltcxx . . $ JE_tyrianHalt(ac50b47256ae7414).(0);
2964 }
2965 gameLoadedcxx . . $ gameLoaded. = truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!;
2966 mainLevelcxx . . $ mainLevel. = 0;
2967 }
2968 }
2969 break;
2970 }
2971
2972 old_itemscxx . . $ old_items.[0] = playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items.;
2973 }
2974
2975 void JE_drawShipSpecscxx . . $ JE_drawShipSpecs(fac4f6e207c3be86).(SDL_Surfacecxx . . $ SDL_Surface# * screen, SDL_Surfacecxx . . $ SDL_Surface# * temp_screen)
2976 {
2977 /* In this function we create our ship description image.
2978 *
2979 * We use a temp screen for convenience. Bad design maybe (Jason!),
2980 * but it'll be okay (and the alternative is malloc/a large stack) */
2981
2982 int temp_x = 0, temp_y = 0, temp_index;
2983 Uint8cxx . . $ Uint8# *src, *dst;
2984
2985 //first, draw the text and other assorted flavoring.
2986 JE_clr256cxx . . $ JE_clr256(60a0b30a00b4fc6d).(screen);
2987 JE_drawLinescxx . . $ JE_drawLines(6f9b0be6b9606bac).(screen, truecxx . . $ `<external>/14268322491693841775/stdbool.h:37:9`!);
2988 JE_drawLinescxx . . $ JE_drawLines(6f9b0be6b9606bac).(screen, falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!);
2989 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(screen, 0, 0, 319, 199, 37);
2990 JE_rectanglecxx . . $ JE_rectangle(fa5faf37b232239e).(screen, 1, 1, 318, 198, 35);
2991
2992 verticalHeightcxx . . $ verticalHeight. = 9;
2993 JE_outTextcxx . . $ JE_outText(894c69c4be246b6e).(screen, 10, 2, shipscxx . . $ ships.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..shipcxx . . $ $anonymous_type_55bed0e189d5bed_2#ship.].namecxx . . $ $anonymous_type_66fcae0887b82ce8_6#name., 12, 3);
2994 JE_helpBoxcxx . . $ JE_helpBox(19e4cd32eb7ad4fc).(screen, 100, 20, shipInfocxx . . $ shipInfo.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..shipcxx . . $ $anonymous_type_55bed0e189d5bed_2#ship.-1][0], 40);
2995 JE_helpBoxcxx . . $ JE_helpBox(19e4cd32eb7ad4fc).(screen, 100, 100, shipInfocxx . . $ shipInfo.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..shipcxx . . $ $anonymous_type_55bed0e189d5bed_2#ship.-1][1], 40);
2996 verticalHeightcxx . . $ verticalHeight. = 7;
2997
2998 JE_outTextcxx . . $ JE_outText(894c69c4be246b6e).(screen, JE_fontCentercxx . . $ JE_fontCenter(1df18506ef0a631b).(miscTextcxx . . $ miscText.[4], TINY_FONTcxx . . $ `src/sprite.h:31:9`!), 190, miscTextcxx . . $ miscText.[4], 12, 2);
2999
3000 //now draw the green ship over that.
3001 //This hardcoded stuff is for positioning our little ship graphic
3002 if (playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..shipcxx . . $ $anonymous_type_55bed0e189d5bed_2#ship. > 90)
3003 {
3004 temp_index = 32;
3005 }
3006 else if (playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..shipcxx . . $ $anonymous_type_55bed0e189d5bed_2#ship. > 0)
3007 {
3008 temp_index = shipscxx . . $ ships.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..shipcxx . . $ $anonymous_type_55bed0e189d5bed_2#ship.].bigshipgraphiccxx . . $ $anonymous_type_66fcae0887b82ce8_6#bigshipgraphic.;
3009 }
3010 else
3011 {
3012 temp_index = shipscxx . . $ ships.[old_itemscxx . . $ old_items.[0].shipcxx . . $ $anonymous_type_55bed0e189d5bed_2#ship.].bigshipgraphiccxx . . $ $anonymous_type_66fcae0887b82ce8_6#bigshipgraphic.;
3013 }
3014
3015 switch (temp_index)
3016 {
3017 case 32:
3018 temp_x = 35;
3019 temp_y = 33;
3020 break;
3021 case 28:
3022 temp_x = 31;
3023 temp_y = 36;
3024 break;
3025 case 33:
3026 temp_x = 31;
3027 temp_y = 35;
3028 break;
3029 default:
3030 assertcxx . . $ `/usr/include/assert.h:50:10`!(0);
3031 }
3032 temp_x -= 30;
3033
3034 //draw the ship into our temp buffer.
3035 JE_clr256cxx . . $ JE_clr256(60a0b30a00b4fc6d).(temp_screen);
3036 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(temp_screen, temp_x, temp_y, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, temp_index - 1); // ship illustration
3037
3038 /* But wait! Our ship is fully colored, not green!
3039 * With a little work we could get the sprite dimensions and greenify
3040 * the area it resides in. For now, let's just greenify the (almost
3041 * entirely) black screen.
3042
3043 * We can't work in place. In fact we'll need to overlay the result
3044 * To avoid our temp screen dependence this has been rewritten to
3045 * only write one line at a time.*/
3046 dst = screen->pixelscxx . . $ SDL_Surface#pixels.;
3047 src = temp_screen->pixelscxx . . $ SDL_Surface#pixels.;
3048 for (int y = 0; y < screen->hcxx . . $ SDL_Surface#h.; y++)
3049 {
3050 for (int x = 0; x < screen->pitchcxx . . $ SDL_Surface#pitch.; x++)
3051 {
3052 int avg = 0;
3053 if (y > 0)
3054 avg += *(src - screen->pitchcxx . . $ SDL_Surface#pitch.) & 0x0f;
3055 if (y < screen->hcxx . . $ SDL_Surface#h. - 1)
3056 avg += *(src + screen->pitchcxx . . $ SDL_Surface#pitch.) & 0x0f;
3057 if (x > 0)
3058 avg += *(src - 1) & 0x0f;
3059 if (x < screen->pitchcxx . . $ SDL_Surface#pitch. - 1)
3060 avg += *(src + 1) & 0x0f;
3061 avg /= 4;
3062
3063 if ((*src & 0x0f) > avg)
3064 *dst = (*src & 0x0f) | 0xc0;
3065 //else
3066 // *dst = 0;
3067
3068 src++;
3069 dst++;
3070 }
3071 }
3072 }
3073
3074 void JE_weaponSimUpdatecxx . . $ JE_weaponSimUpdate(49f6e7a06ebc5aa8).(void)
3075 {
3076 char buf[32];
3077
3078 JE_weaponViewFramecxx . . $ JE_weaponViewFrame(49f6e7a06ebc5aa8).();
3079
3080 if ((curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 3 || curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.] == 4) && // front or rear weapon
3081 curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] < menuChoicescxx . . $ menuChoices.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.] && // not "Done"
3082 itemAvailcxx . . $ itemAvail.[itemAvailMapcxx . . $ itemAvailMap.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-2]-1][curSelcxx . . $ curSel.[MENU_UPGRADE_SUBcxx . . $ MENU_UPGRADE_SUB.]-2] != 0) // not "None"
3083 {
3084 if (leftPowercxx . . $ leftPower.)
3085 {
3086 sprintfcxx . . $ sprintf(26c8642d26409d6d).(buf, "%d", downgradeCostcxx . . $ downgradeCost.);
3087 JE_outTextcxx . . $ JE_outText(894c69c4be246b6e).(VGAScreencxx . . $ VGAScreen., 26, 137, buf, 1, 4);
3088 }
3089 else
3090 {
3091 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., 24, 149, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 13); // downgrade disabled
3092 }
3093
3094 if (rightPowercxx . . $ rightPower.)
3095 {
3096 if (!rightPowerAffordcxx . . $ rightPowerAfford.)
3097 {
3098 sprintfcxx . . $ sprintf(26c8642d26409d6d).(buf, "%d", upgradeCostcxx . . $ upgradeCost.);
3099 JE_outTextcxx . . $ JE_outText(894c69c4be246b6e).(VGAScreencxx . . $ VGAScreen., 108, 137, buf, 7, 4);
3100 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., 119, 149, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 14); // upgrade disabled
3101 }
3102 else
3103 {
3104 sprintfcxx . . $ sprintf(26c8642d26409d6d).(buf, "%d", upgradeCostcxx . . $ upgradeCost.);
3105 JE_outTextcxx . . $ JE_outText(894c69c4be246b6e).(VGAScreencxx . . $ VGAScreen., 108, 137, buf, 1, 4);
3106 }
3107 }
3108 else
3109 {
3110 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., 119, 149, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 14); // upgrade disabled
3111 }
3112
3113 tempcxx . . $ temp. = playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[curSelcxx . . $ curSel.[MENU_UPGRADEScxx . . $ MENU_UPGRADES.]-3].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power.;
3114
3115 for (int x = 1; x <= tempcxx . . $ temp.; x++)
3116 {
3117 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 39 + x * 6, 151, 39 + x * 6 + 4, 151, 251);
3118 JE_pixcxx . . $ JE_pix(a8f544383a9967e9).(VGAScreencxx . . $ VGAScreen., 39 + x * 6, 151, 252);
3119 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 39 + x * 6, 152, 39 + x * 6 + 4, 164, 250);
3120 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 39 + x * 6, 165, 39 + x * 6 + 4, 165, 249);
3121 }
3122
3123 sprintfcxx . . $ sprintf(26c8642d26409d6d).(buf, "POWER: %d", tempcxx . . $ temp.);
3124 JE_outTextcxx . . $ JE_outText(894c69c4be246b6e).(VGAScreencxx . . $ VGAScreen., 58, 137, buf, 15, 4);
3125 }
3126 else
3127 {
3128 leftPowercxx . . $ leftPower. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
3129 rightPowercxx . . $ rightPower. = falsecxx . . $ `<external>/14268322491693841775/stdbool.h:38:9`!;
3130 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., 20, 146, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 17); // hide power level interface
3131 }
3132
3133 JE_drawItemcxx . . $ JE_drawItem(4685b0c8ee28a575).(1, playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..shipcxx . . $ $anonymous_type_55bed0e189d5bed_2#ship., playercxx . . $ player.[0].xcxx . . $ $anonymous_type_55bed0e189d5bed_4#x. - 5, playercxx . . $ player.[0].ycxx . . $ $anonymous_type_55bed0e189d5bed_4#y. - 7);
3134 }
3135
3136 void JE_weaponViewFramecxx . . $ JE_weaponViewFrame(49f6e7a06ebc5aa8).(void)
3137 {
3138 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 8, 8, 143, 182, 0);
3139
3140 /* JE: (* Port Configuration Display *)
3141 (* drawportconfigbuttons;*/
3142
3143 update_and_draw_starfieldcxx . . $ update_and_draw_starfield(114b59e033bfc6fe).(VGAScreencxx . . $ VGAScreen., 1);
3144
3145 mouseXcxx . . $ mouseX. = playercxx . . $ player.[0].xcxx . . $ $anonymous_type_55bed0e189d5bed_4#x.;
3146 mouseYcxx . . $ mouseY. = playercxx . . $ player.[0].ycxx . . $ $anonymous_type_55bed0e189d5bed_4#y.;
3147
3148 // create shots in weapon simulator
3149 for (uintcxx . . $ uint# i = 0; i < 2; ++i)
3150 {
3151 if (shotRepeatcxx . . $ shotRepeat.[i] > 0)
3152 {
3153 --shotRepeatcxx . . $ shotRepeat.[i];
3154 }
3155 else
3156 {
3157 const uintcxx . . $ uint# item = playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[i].idcxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#id.,
3158 item_power = playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..weaponcxx . . $ $anonymous_type_55bed0e189d5bed_2#weapon.[i].powercxx . . $ $anonymous_type_55bed0e189d5bed_2#$anonymous_type_3#power. - 1,
3159 item_mode = (i == REAR_WEAPONcxx . . $ REAR_WEAPON.) ? playercxx . . $ player.[0].weapon_modecxx . . $ $anonymous_type_55bed0e189d5bed_4#weapon_mode. - 1 : 0;
3160
3161 bcxx . . $ b. = player_shot_createcxx . . $ player_shot_create(47a6dcf6307ecf82).(item, i, playercxx . . $ player.[0].xcxx . . $ $anonymous_type_55bed0e189d5bed_4#x., playercxx . . $ player.[0].ycxx . . $ $anonymous_type_55bed0e189d5bed_4#y., mouseXcxx . . $ mouseX., mouseYcxx . . $ mouseY., weaponPortcxx . . $ weaponPort.[item].opcxx . . $ $anonymous_type_66fcae0887b82ce8_1#op.[item_mode][item_power], 1);
3162 }
3163 }
3164
3165 if (optionscxx . . $ options.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_2#sidekick.[LEFT_SIDEKICKcxx . . $ LEFT_SIDEKICK.]].wportcxx . . $ $anonymous_type_66fcae0887b82ce8_4#wport. > 0)
3166 {
3167 if (shotRepeatcxx . . $ shotRepeat.[SHOT_LEFT_SIDEKICKcxx . . $ SHOT_LEFT_SIDEKICK.] > 0)
3168 {
3169 --shotRepeatcxx . . $ shotRepeat.[SHOT_LEFT_SIDEKICKcxx . . $ SHOT_LEFT_SIDEKICK.];
3170 }
3171 else
3172 {
3173 const uintcxx . . $ uint# item = playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_2#sidekick.[LEFT_SIDEKICKcxx . . $ LEFT_SIDEKICK.];
3174 const int x = playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[LEFT_SIDEKICKcxx . . $ LEFT_SIDEKICK.].xcxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#x.,
3175 y = playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[LEFT_SIDEKICKcxx . . $ LEFT_SIDEKICK.].ycxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#y.;
3176
3177 bcxx . . $ b. = player_shot_createcxx . . $ player_shot_create(47a6dcf6307ecf82).(optionscxx . . $ options.[item].wportcxx . . $ $anonymous_type_66fcae0887b82ce8_4#wport., SHOT_LEFT_SIDEKICKcxx . . $ SHOT_LEFT_SIDEKICK., x, y, mouseXcxx . . $ mouseX., mouseYcxx . . $ mouseY., optionscxx . . $ options.[item].wpnumcxx . . $ $anonymous_type_66fcae0887b82ce8_4#wpnum., 1);
3178 }
3179 }
3180
3181 if (optionscxx . . $ options.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_2#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.]].trcxx . . $ $anonymous_type_66fcae0887b82ce8_4#tr. == 2)
3182 {
3183 playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.].xcxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#x. = playercxx . . $ player.[0].xcxx . . $ $anonymous_type_55bed0e189d5bed_4#x.;
3184 playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.].ycxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#y. = MAXcxx . . $ `src/opentyr.h:29:9`!(10, player[0].y - 20);
3185 }
3186 else
3187 {
3188 playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.].xcxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#x. = 72 + 15;
3189 playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.].ycxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#y. = 120;
3190 }
3191
3192 if (optionscxx . . $ options.[playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_2#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.]].wportcxx . . $ $anonymous_type_66fcae0887b82ce8_4#wport. > 0)
3193 {
3194 if (shotRepeatcxx . . $ shotRepeat.[SHOT_RIGHT_SIDEKICKcxx . . $ SHOT_RIGHT_SIDEKICK.] > 0)
3195 {
3196 --shotRepeatcxx . . $ shotRepeat.[SHOT_RIGHT_SIDEKICKcxx . . $ SHOT_RIGHT_SIDEKICK.];
3197 }
3198 else
3199 {
3200 const uintcxx . . $ uint# item = playercxx . . $ player.[0].itemscxx . . $ $anonymous_type_55bed0e189d5bed_4#items..sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_2#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.];
3201 const int x = playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.].xcxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#x.,
3202 y = playercxx . . $ player.[0].sidekickcxx . . $ $anonymous_type_55bed0e189d5bed_4#sidekick.[RIGHT_SIDEKICKcxx . . $ RIGHT_SIDEKICK.].ycxx . . $ $anonymous_type_55bed0e189d5bed_4#$anonymous_type_5#y.;
3203
3204 bcxx . . $ b. = player_shot_createcxx . . $ player_shot_create(47a6dcf6307ecf82).(optionscxx . . $ options.[item].wportcxx . . $ $anonymous_type_66fcae0887b82ce8_4#wport., SHOT_RIGHT_SIDEKICKcxx . . $ SHOT_RIGHT_SIDEKICK., x, y, mouseXcxx . . $ mouseX., mouseYcxx . . $ mouseY., optionscxx . . $ options.[item].wpnumcxx . . $ $anonymous_type_66fcae0887b82ce8_4#wpnum., 1);
3205 }
3206 }
3207
3208 simulate_player_shotscxx . . $ simulate_player_shots(49f6e7a06ebc5aa8).();
3209
3210 blit_spritecxx . . $ blit_sprite(ee201c8e1efc2766).(VGAScreenSegcxx . . $ VGAScreenSeg., 0, 0, OPTION_SHAPEScxx . . $ `src/sprite.h:34:9`!, 12); // upgrade interface
3211
3212 /*========================Power Bar=========================*/
3213
3214 powercxx . . $ power. += powerAddcxx . . $ powerAdd.;
3215 if (powercxx . . $ power. > 900)
3216 powercxx . . $ power. = 900;
3217
3218 tempcxx . . $ temp. = powercxx . . $ power. / 10;
3219
3220 for (tempcxx . . $ temp. = 147 - tempcxx . . $ temp.; tempcxx . . $ temp. <= 146; tempcxx . . $ temp.++)
3221 {
3222 temp2cxx . . $ temp2. = 113 + (146 - tempcxx . . $ temp.) / 9 + 2;
3223 temp3cxx . . $ temp3. = (tempcxx . . $ temp. + 1) % 6;
3224 if (temp3cxx . . $ temp3. == 1)
3225 temp2cxx . . $ temp2. += 3;
3226 else if (temp3cxx . . $ temp3. != 0)
3227 temp2cxx . . $ temp2. += 2;
3228
3229 JE_pixcxx . . $ JE_pix(a8f544383a9967e9).(VGAScreencxx . . $ VGAScreen., 141, tempcxx . . $ temp., temp2cxx . . $ temp2. - 3);
3230 JE_pixcxx . . $ JE_pix(a8f544383a9967e9).(VGAScreencxx . . $ VGAScreen., 142, tempcxx . . $ temp., temp2cxx . . $ temp2. - 3);
3231 JE_pixcxx . . $ JE_pix(a8f544383a9967e9).(VGAScreencxx . . $ VGAScreen., 143, tempcxx . . $ temp., temp2cxx . . $ temp2. - 2);
3232 JE_pixcxx . . $ JE_pix(a8f544383a9967e9).(VGAScreencxx . . $ VGAScreen., 144, tempcxx . . $ temp., temp2cxx . . $ temp2. - 1);
3233 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 145, tempcxx . . $ temp., 149, tempcxx . . $ temp., temp2cxx . . $ temp2.);
3234
3235 if (temp2cxx . . $ temp2. - 3 < 112)
3236 temp2cxx . . $ temp2.++;
3237 }
3238
3239 tempcxx . . $ temp. = 147 - (powercxx . . $ power. / 10);
3240 temp2cxx . . $ temp2. = 113 + (146 - tempcxx . . $ temp.) / 9 + 4;
3241
3242 JE_pixcxx . . $ JE_pix(a8f544383a9967e9).(VGAScreencxx . . $ VGAScreen., 141, tempcxx . . $ temp. - 1, temp2cxx . . $ temp2. - 1);
3243 JE_pixcxx . . $ JE_pix(a8f544383a9967e9).(VGAScreencxx . . $ VGAScreen., 142, tempcxx . . $ temp. - 1, temp2cxx . . $ temp2. - 1);
3244 JE_pixcxx . . $ JE_pix(a8f544383a9967e9).(VGAScreencxx . . $ VGAScreen., 143, tempcxx . . $ temp. - 1, temp2cxx . . $ temp2. - 1);
3245 JE_pixcxx . . $ JE_pix(a8f544383a9967e9).(VGAScreencxx . . $ VGAScreen., 144, tempcxx . . $ temp. - 1, temp2cxx . . $ temp2. - 1);
3246
3247 fill_rectangle_xycxx . . $ fill_rectangle_xy(da1d960d0d6e485d).(VGAScreencxx . . $ VGAScreen., 145, tempcxx . . $ temp.-1, 149, tempcxx . . $ temp.-1, temp2cxx . . $ temp2.);
3248
3249 lastPowercxx . . $ lastPower. = tempcxx . . $ temp.;
3250
3251 //JE_waitFrameCount(); TODO: didn't do anything?
3252 }