-
Notifications
You must be signed in to change notification settings - Fork 13
/
___223c4h.c
182 lines (142 loc) · 3.84 KB
/
___223c4h.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
#include "drally.h"
#include "drally_fonts.h"
#include "drally_structs_fixed.h"
extern __POINTER__ ___1a1138h__VESA101_BACKGROUND;
extern __POINTER__ ___1a112ch__VESA101_ACTIVESCREEN_PTR;
extern __POINTER__ ___1a10dch;
extern __BYTE__ ___1a1ef8h[];
extern __BYTE__ ___1a0e28h[];
extern __BYTE__ ___1a01e0h[];
extern __DWORD__ ___196a94h_difficulty;
extern __BYTE__ ___185c7ah[];
extern __POINTER__ ___1a10b8h;
extern char ___18768ah[][0x18];
#if defined(DR_MULTIPLAYER)
extern __DWORD__ ___19bd60h;
#endif // DR_MULTIPLAYER
#if defined(DR_MULTIPLAYER)
void ___23758h(void);
#endif // DR_MULTIPLAYER
void ___135fch(__DWORD__, __DWORD__, __DWORD__, __DWORD__);
void ___3e03ch(void);
void ___23230h(void);
void ___12cb8h__VESA101_PRESENTSCREEN(void);
void ___2b318h(void);
void ___3d1f0h(void);
__BYTE__ ___5994ch(void);
__BYTE__ ___59b3ch(void);
void ___2ab50h(void);
char * itoa_watcom106(int value, char * buffer, int radix);
void ___27d24h_cdecl(__DWORD__, __DWORD__, __DWORD__, __DWORD__);
void CONFIG_WRITE(void);
char * strupr_watcom106(char * s);
void ___223c4h(void){
__DWORD__ eax, ebx, ecx, edx, edi, esi, ebp;
__BYTE__ esp[0x44];
int i, j, n, x, y;
__BYTE__ px;
racer_t * s_6c;
s_6c = (racer_t *)___1a01e0h;
memcpy(___1a112ch__VESA101_ACTIVESCREEN_PTR, ___1a1138h__VESA101_BACKGROUND, 0x4b000);
___135fch(0, 0x173, 0x27f, 0x6d);
___3e03ch();
___23230h();
j = -1;
while(++j < 0x36){
i = -1;
while(++i < 0x280){
if((px = B(___1a10dch+0x280*j+i)) != 0) B(___1a112ch__VESA101_ACTIVESCREEN_PTR+0x280*(j+0x54)+i) = px;
}
}
n = s_6c[D(___1a1ef8h)].races;
D(esp+0x2c) = -1;
eax = 0;
edx = 0;
if(n >= (int)D(___1a0e28h+0xc)){
while(1){
edx += 0x14;
eax++;
if((int)edx >= 0xc8) break;
if(n < (int)D(___1a0e28h+edx+0xc)){
D(esp+0x2c) = eax;
break;
}
}
}
else {
D(esp+0x2c) = 0;
}
if((int)D(esp+0x2c) >= 0){
if((int)D(esp+0x2c) < 9){
n = 9;
while(1){
memcpy(___1a0e28h+0x14*n, ___1a0e28h+0x14*(n-1), 0x14);
n--;
if(n <= (int)D(esp+0x2c)) break;
}
}
strcpy(___1a0e28h+0x14*D(esp+0x2c), s_6c[D(___1a1ef8h)].name);
strupr_watcom106(___1a0e28h+0x14*D(esp+0x2c));
D(___1a0e28h+0x14*D(esp+0x2c)+0xc) = s_6c[D(___1a1ef8h)].races;
D(___1a0e28h+0x14*D(esp+0x2c)+0x10) = ___196a94h_difficulty;
___27d24h_cdecl(0x11, 0x16*D(esp+0x2c)+0x8a, 0x25b, 0x18);
CONFIG_WRITE();
}
n = -1;
while(++n < 0xa){
itoa_watcom106(n+1, esp, 10);
strcat(esp, ".");
ecx = 0x280*(0x16*n+0x90)+0x24;
if(n == 9) ecx -= 8;
___12e78h_v3(___1a10b8h___185c7ah, esp, ecx%0x280, ecx/0x280);
strcpy(esp, ___1a0e28h+0x14*n);
strupr_watcom106(esp);
esi = 0x280*(0x16*n+0x90);
x = 7817+0x3700*(n+6);
y = x/0x280;
x = x%0x280;
___12e78h_v3(___1a10b8h___185c7ah, esp, x, y);
itoa_watcom106(D(___1a0e28h+0x14*n+0xc), esp, 10);
if(((int)D(___1a0e28h+0x14*n+0xc) >= 0)&&((int)D(___1a0e28h+0x14*n+0xc) < 0xa)){
x = esi+0x158;
y = x/0x280;
x = x%0x280;
___12e78h_v3(___1a10b8h___185c7ah, esp, x, y);
}
if(((int)D(___1a0e28h+0x14*n+0xc) >= 0xa)&&((int)D(___1a0e28h+0x14*n+0xc) < 0x64)){
x = 8016+0x3700*(n+6);
y = x/0x280;
x = x%0x280;
___12e78h_v3(___1a10b8h___185c7ah, esp, x, y);
}
if((int)D(___1a0e28h+0x14*n+0xc) >= 0x64){
x = 8008+0x3700*(n+6);
y = x/0x280;
x = x%0x280;
___12e78h_v3(___1a10b8h___185c7ah, esp, x, y);
}
strcpy(esp, ___18768ah[D(___1a0e28h+0x14*n+0x10)]);
x = 8109+0x3700*(n+6);
y = x/0x280;
x = x%0x280;
___12e78h_v3(___1a10b8h___185c7ah, strupr_watcom106(esp), x, y);
}
___12cb8h__VESA101_PRESENTSCREEN();
___2b318h();
___3d1f0h();
___5994ch();
___59b3ch();
while(1){
___2ab50h();
H(eax) = ___5994ch();
#if defined(DR_MULTIPLAYER)
if((___19bd60h != 0)&&(H(eax) == 0x3b)){
___23758h();
H(eax) = 0;
}
#endif // DR_MULTIPLAYER
if(H(eax) != 0) break;
}
___5994ch();
___59b3ch();
}