-
Notifications
You must be signed in to change notification settings - Fork 13
/
___26650h.c
397 lines (342 loc) · 9.6 KB
/
___26650h.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
#include "drally.h"
#include "drally_fonts.h"
#include "drally_structs_fixed.h"
#include "drally_structs_free.h"
#include "watcom106.h"
#include "assets.h"
extern __POINTER__ ___1a112ch__VESA101_ACTIVESCREEN_PTR;
extern __BYTE__ ___1a1ef8h[];
extern __BYTE__ ___1a01e0h[];
extern cardata_t ___18e298h[6];
extern __DWORD__ ___1862bch[][0x18];
extern __DWORD__ ___1864fch[][0x10];
extern __DWORD__ ___18643ch[][0xc];
extern __POINTER__ ___1a01d0h[4];
extern __POINTER__ ___1a0198h[4];
extern __POINTER__ ___1a01a8h[4];
extern __BYTE__ ___1a1eech[];
extern __BYTE__ ___1a1ec0h[];
extern __BYTE__ ___1a1ec8h[];
int ___25180h_cdecl(const char * A1);
void ___12f60h_cdecl(const char * A1, __DWORD__ A2);
void ___13248h_cdecl(__DWORD__, __DWORD__ ,__DWORD__, __DWORD__, __DWORD__);
void ___259e0h_cdecl(int dx, int dy, int aFrameIdx, __POINTER__ aEncoded, int * aOffsets);
// ENGINES
static const char40 ___191100h[4][6] = {
[0] = {
[0] = "[4 cylinder motor installed",
[1] = "",
[2] = "This engine genie will let you",
[3] = "win. It will grant your boy racer",
[4] = "wishes.",
[5] = ""
},
[1] = {
[0] = "[Enhanced 4 cylinder installed",
[1] = "",
[2] = "Now any bitter regrets are in the",
[3] = "past, just blurred, sweet street-",
[4] = "lights speeding past fast.",
[5] = ""
},
[2] = {
[0] = "[V6 Injection motor installed",
[1] = "",
[2] = "If speeding is the 8th deadly sin,",
[3] = "with this babe under your hood,",
[4] = "you are now past redemption.",
[5] = ""
},
[3] = {
[0] = "[V8 Turbo Injection",
[1] = "",
[2] = "Gleaming pistons pumping in chorus",
[3] = "with your hungry heart. This sweet",
[4] = "symbiosis can cause addiction.",
[5] = ""
}
};
// TIRES
static const char40 ___191880h[4][6] = {
[0] = {
[0] = "[Trackmaster 155 bought",
[1] = "",
[2] = "Warp 9, Captain. No problems with",
[3] = "traction now. The finish line,",
[4] = "she's closing fast.",
[5] = ""
},
[1] = {
[0] = "[Roadrunner NS 175 bought",
[1] = "",
[2] = "On these wheels, your vehicle",
[3] = "starts like a nuclear blast, and",
[4] = "stops you like a cardiac arrest.",
[5] = ""
},
[2] = {
[0] = "[Slidestop 200 bought",
[1] = "",
[2] = "Now fast talk to that asphalt,",
[3] = "motormouth. Time to make some",
[4] = "beautiful automobile poetry.",
[5] = ""
},
[3] = {
[0] = "[Racer-X230 bought",
[1] = "",
[2] = "Smart move, motorman. Now get out",
[3] = "there, and do some dashing, dare-",
[4] = "devilish damage.",
[5] = ""
}
};
static const char40 ___192000h[4][6] = {
[0] = {
[0] = "[Steel Triumph bought",
[1] = "",
[2] = "Straight from the best R&D Labs,",
[3] = "shielding Steel Triumph gives you",
[4] = "that extra edge you crave.",
[5] = ""
},
[1] = {
[0] = "[FerroChromium Armor",
[1] = "",
[2] = "Deflects bullets, and most other",
[3] = "bad stuff that goes bang in the",
[4] = "night, too.",
[5] = ""
},
[2] = {
[0] = "[Titanium Plates installed",
[1] = "",
[2] = "Shiny hard stuff. No explosive can",
[3] = "shadow its tanning radiance. Don't",
[4] = "forget your shades!",
[5] = ""
},
[3] = {
[0] = "[Accesteel Armor installed",
[1] = "",
[2] = "Not even a shell-shock serious",
[3] = "bazooka can faze the cool mirror",
[4] = "beauty of Accesteel.",
[5] = ""
}
};
static const char40 ___1914c0h[4][6] = {
[0] = {
[0] = "[Trackmaster 155",
[1] = "",
[2] = "These wheels will let you do some",
[3] = "rapid fire cornerings on that",
[4] = "shimmering silver street.",
[5] = ""
},
[1] = {
[0] = "[Roadrunner NS 175",
[1] = "",
[2] = "With these fat tires, you'll shoot",
[3] = "from the starting-line like a",
[4] = "blood lusting bullet.",
[5] = ""
},
[2] = {
[0] = "[Slidestop 200",
[1] = "",
[2] = "These fat bottomed tires'll kiss",
[3] = "the road like crazy, they just",
[4] = "can't get enough. They're hot.",
[5] = ""
},
[3] = {
[0] = "[Racer-X230",
[1] = "",
[2] = "Zorro's Zs were nothing. Carve",
[3] = "your whole signature, to the",
[4] = "rainbow-oiled road, doing 160.",
[5] = ""
}
};
static const char40 ___191c40h[4][6] = {
[0] = {
[0] = "[Steel Triumph Plating",
[1] = "",
[2] = "Steel Triumph won't stop the hurt,",
[3] = "but it just might keep you in one",
[4] = "piece to the finish line.",
[5] = ""
},
[1] = {
[0] = "[FerroChromium Armor",
[1] = "",
[2] = "What the rival guns give, this",
[3] = "armor can take, but you'd better",
[4] = "shoot back, there's a limit.",
[5] = ""
},
[2] = {
[0] = "[Titanium Plating",
[1] = "",
[2] = "See this big gun; see this armor.",
[3] = "[BANG!{ Now see the armor. Smile to",
[4] = "your reflection. Looking good.",
[5] = ""
},
[3] = {
[0] = "[Accesteel Armor",
[1] = "",
[2] = "All but the most extreme shots",
[3] = "bounce off like hail on hard",
[4] = "concrete.",
[5] = ""
}
};
static const char40 MaxUpgrades[3][6] = {
[0] = {
[0] = "[NO MORE ENGINE UPGRADES",
[1] = "",
[2] = "You've got the most beastly motor",
[3] = "monster this vehicle can carry.",
[4] = "Hear its powerful & sublime sound.",
[5] = ""
},
[1] = {
[0] = "[NO MORE TIRE UPGRADES",
[1] = "",
[2] = "You've got the best fat, sticky",
[3] = "tires this vehicle can boast. You",
[4] = "are in close touch with the road.",
[5] = ""
},
[2] = {
[0] = "[NO MORE ARMOR UPGRADES",
[1] = "",
[2] = "You got the best shining knight's",
[3] = "armor this warhorsepower chariot",
[4] = "can carry to any road battle.",
[5] = ""
}
};
enum { UPGRADE_ENGINE = 0, UPGRADE_TIRE = 1, UPGRADE_ARMOR = 2 };
static void helper_aa(int dst_offx, int dst_offy, int type){
int i, j;
__BYTE__ * bases4;
bases4 = getAssets(MENU_BASES4);
j = -1;
while(++j < 0x60){
i = -1;
while(++i < 0x60){
B(___1a112ch__VESA101_ACTIVESCREEN_PTR+0x280*(dst_offy+j)+(dst_offx+i)) = B(bases4+0x2400*type+0x60*j+i);
}
}
}
static void helper_yy(int idx, int dst_offx, int dst_offy, int type){
int i, j;
__BYTE__ * maxi1f;
maxi1f = getAssets(MENU_MAXI1F);
j = -1;
while(++j < 0x40){
i = -1;
while(++i < 0x60){
B(___1a112ch__VESA101_ACTIVESCREEN_PTR+0x280*(dst_offy+j)+(dst_offx+i)) = B(maxi1f+0x6000*type+0x1800*idx+0x60*j+i);
}
}
}
static void helper_xx(int price, int dst_x, int dst_y){
__BYTE__ esp[0x28];
itoa_watcom106(price, esp, 0xa);
strcat(strcpy(esp+0x14, "$"), esp);
___12f60h_cdecl(esp+0x14, ___25180h_cdecl(esp+0x14)+0x280*dst_y+dst_x);
}
static void helper_all(int n, int x1, int type, int lvl, int frame_n, __POINTER__ p, int * ip, int price, const char40 * info){
int i, j;
helper_aa(x1, 253, type);
if(n != lvl){
___259e0h_cdecl(x1, 269, frame_n, p, ip);
helper_xx(price, x1, 335);
}
else {
helper_yy(n, x1, 269, type);
}
___13248h_cdecl(144, 114, 384, 119, 1);
VESA101_16X16_FORMAT_PRINT(info[0], 170, 124);
VESA101_16X16_FORMAT_PRINT(info[1], 170, 140);
VESA101_16X16_FORMAT_PRINT(info[2], 170, 156);
VESA101_16X16_FORMAT_PRINT(info[3], 170, 172);
VESA101_16X16_FORMAT_PRINT(info[4], 170, 188);
VESA101_16X16_FORMAT_PRINT(info[5], 170, 204);
}
// SHOP ENGINES
void ___25e40h(void){
int n;
racer_t * s_6c;
const char40 * info;
cardata_t * cdp;
s_6c = (racer_t *)___1a01e0h;
cdp = (cardata_t *)&___18e298h[s_6c[D(___1a1ef8h)].car];
n = s_6c[D(___1a1ef8h)].engine;
info = (n < cdp->n_engine_upgrades )?cdp->txt_engine_upgrades[n]:MaxUpgrades[UPGRADE_ENGINE];
helper_all(n-1, 16, UPGRADE_ENGINE, cdp->n_engine_upgrades-1, D(___1a1ec8h), ___1a01a8h[n], ___1862bch[n], cdp->price_engine_upgrades[n], info);
}
// SHOP ENGINE UPGRADE INSTALLED
void ___273d8h(void){
int n;
racer_t * s_6c;
const char40 * info;
cardata_t * cdp;
s_6c = (racer_t *)___1a01e0h;
cdp = (cardata_t *)&___18e298h[s_6c[D(___1a1ef8h)].car];
n = s_6c[D(___1a1ef8h)].engine;
info = ___191100h[n];
helper_all(n, 16, UPGRADE_ENGINE, cdp->n_engine_upgrades-1, D(___1a1ec8h), ___1a01a8h[n], ___1862bch[n], cdp->price_engine_upgrades[n+1], info);
}
// SHOP TIRES
void ___262b4h(void){
int n;
racer_t * s_6c;
const char40 * info;
cardata_t * cdp;
s_6c = (racer_t *)___1a01e0h;
cdp = (cardata_t *)&___18e298h[s_6c[D(___1a1ef8h)].car];
n = s_6c[D(___1a1ef8h)].tires;
info = (n < cdp->n_tire_upgrades )?___1914c0h[n]:MaxUpgrades[UPGRADE_TIRE];
helper_all(n-1, 120, UPGRADE_TIRE, cdp->n_tire_upgrades-1, D(___1a1ec0h), ___1a0198h[n], ___18643ch[n], cdp->price_tire_upgrades[n], info);
}
// SHOP TIRES UPGRADE INSTALLED
void ___276f0h(void){
int n;
racer_t * s_6c;
const char40 * info;
cardata_t * cdp;
s_6c = (racer_t *)___1a01e0h;
cdp = (cardata_t *)&___18e298h[s_6c[D(___1a1ef8h)].car];
n = s_6c[D(___1a1ef8h)].tires;
info = ___191880h[n];
helper_all(n, 120, UPGRADE_TIRE, cdp->n_tire_upgrades-1, D(___1a1ec0h), ___1a0198h[n], ___18643ch[n], cdp->price_tire_upgrades[n+1], info);
}
// SHOP ARMOR
void ___26650h(void){
int n;
racer_t * s_6c;
const char40 * info;
cardata_t * cdp;
s_6c = (racer_t *)___1a01e0h;
cdp = (cardata_t *)&___18e298h[s_6c[D(___1a1ef8h)].car];
n = s_6c[D(___1a1ef8h)].armor;
info = (n < cdp->n_armor_upgrades)?___191c40h[n]:MaxUpgrades[UPGRADE_ARMOR];
helper_all(n-1, 224, UPGRADE_ARMOR, cdp->n_armor_upgrades-1, D(___1a1eech), ___1a01d0h[n], ___1864fch[n], cdp->price_armor_upgrades[n], info);
}
// SHOP ARMOR UPGRADE INSTALLED
void ___27a10h(void){
int n;
racer_t * s_6c;
const char40 * info;
cardata_t * cdp;
s_6c = (racer_t *)___1a01e0h;
cdp = (cardata_t *)&___18e298h[s_6c[D(___1a1ef8h)].car];
n = s_6c[D(___1a1ef8h)].armor;
info = ___192000h[n];
helper_all(n, 224, UPGRADE_ARMOR, cdp->n_armor_upgrades-1, D(___1a1eech), ___1a01d0h[n], ___1864fch[n], cdp->price_armor_upgrades[n+1], info);
}