-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheuro_int.cpp
238 lines (178 loc) · 7.69 KB
/
euro_int.cpp
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
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "eurodefs.h"
#include "euro_sym.h"
#include "euro_def.h"
#include "euro_int.h"
#include "euro_mem.h"
#include "euro_dsk.h"
#include "euro_spt.h"
//�������������������ͻ
//� �
//� EURO 96 LINK DATA �
//� �
//�������������������ͼ
interface_data EUROmatch_info;
extern char EUROsymbol;
extern BYTE *TextStringMemHandle;
extern void Euro96initialise();
extern char EUROteamA, EUROteamB;
extern void TransferDataToMatchInfo();
void TempFrontend() {
#ifdef IMPLEMENT_ME
EUROsymbol = 1;
TextStringMemHandle = 0;
TextStringMemHandle = // Set up memory handle.
AllocateTextStringMemory(); // Allocate memory for text strings..
printf("%d Bytes allocated for script file text.\n", TEXT_STRING_BUFFER_LEN);
fflush(stdout);
if (EUROsymbol == 1) {
printf("Symbol creation flag set.\n");
fp2 = fopen("euro_sym.h", "wb");
if (fp2 == NULL) {
EUROsymbol = 0;
printf("Error trying to create symbol table.\n");
fflush(stdout);
}
}
process_script_file("..\\script\\script.96"); // Reads script file and compiles relevent data for game.
if (EUROsymbol == 1) {
fclose(fp2);
printf("Symbol table created.\n");
fflush(stdout);
}
Euro96initialise();
// additions for laurent.
strcpy(&EUROmatch_info.TeamAname[0], GetTEAMname(0, 11));
strcpy(&EUROmatch_info.TeamBname[0], GetTEAMname(1, 11));
for (char t = 0; t < 16; t++) // Reset all squads, making team
{ for (char p = 0; p < 20; p++) { SquadInfo[(t * 20) + p] = p; }} // lists run from plyr 1 to 20.
TransferDataToMatchInfo();
#endif
}
void ExitFrontend() {
DeAllocateMemory(TextStringMemHandle);
}
//********************************************************************************************************************************
void TransferDataToMatchInfo() {
short PlyrIndex1, PlyrIndex2;
for (char p = 0; p < 20; p++) {
PlyrIndex1 = NormalisePlayer(p, EUROteamA);
PlyrIndex2 = NormalisePlayer(p, EUROteamB);
EUROmatch_info.TeamA[p].pace = Pace[PlyrIndex1];
EUROmatch_info.TeamA[p].power = Power[PlyrIndex1];
EUROmatch_info.TeamA[p].control = Control[PlyrIndex1];
EUROmatch_info.TeamA[p].flair = Flair[PlyrIndex1];
EUROmatch_info.TeamA[p].vision = Vision[PlyrIndex1];
EUROmatch_info.TeamA[p].accuracy = Accuracy[PlyrIndex1];
EUROmatch_info.TeamA[p].stamina = Stamina[PlyrIndex1];
EUROmatch_info.TeamA[p].discipline = Discipline[PlyrIndex1];
EUROmatch_info.TeamA[p].fitness = Fitness[PlyrIndex1];
EUROmatch_info.TeamB[p].pace = Pace[PlyrIndex2];
EUROmatch_info.TeamB[p].power = Power[PlyrIndex2];
EUROmatch_info.TeamB[p].control = Control[PlyrIndex2];
EUROmatch_info.TeamB[p].flair = Flair[PlyrIndex2];
EUROmatch_info.TeamB[p].vision = Vision[PlyrIndex2];
EUROmatch_info.TeamB[p].accuracy = Accuracy[PlyrIndex2];
EUROmatch_info.TeamB[p].stamina = Stamina[PlyrIndex2];
EUROmatch_info.TeamB[p].discipline = Discipline[PlyrIndex2];
EUROmatch_info.TeamB[p].fitness = Fitness[PlyrIndex2];
}
}
//********************************************************************************************************************************
short NormalisePlayer(char plyr, char team) {
short PlyrIndex, P;
P = (team * 20) + plyr;
PlyrIndex = (team * 20) + SquadInfo[P];
return (PlyrIndex);
}
//********************************************************************************************************************************
char *GetTEXT(short StringNumber) {
return ((char *) Text[StringNumber]);
}
//********************************************************************************************************************************
char *GetPLAYERSname(char player, char team, char format) {
#ifdef IMPLEMENT_ME
short Prefix = (short) ((team * 20) + player);
char *Search = GetTEXT((short) (PLYR_NMES + Prefix));
char NAMEoffset = 0;
char Searchlen = (char) strlen(&Search[0]);
unsigned char c;
if (format == FULL_NAME) {
char x;
for (x = 0; x < Searchlen; x++) { StringBuffer[x] = *(Search + x); }
StringBuffer[x] = 0;
}
if (format == INITIAL_SURNAME) {
// *** Get players initials ***
for (char x = 0; x < Searchlen; x++) {
if (IsUpper[*(Search + x)] == up &&
IsUpper[*(Search + (x + 1))] == lw &&
NAMEoffset < (NAME_BUFFER_LEN - 3)) {
StringBuffer[NAMEoffset] = *(Search + x);
NAMEoffset++;
if ((*(Search + x)) == '-')
StringBuffer[NAMEoffset] = '-';
else
StringBuffer[NAMEoffset] = '.';
StringBuffer[NAMEoffset + 1] = 32;
NAMEoffset += 2;
}
if ((*(Search + x)) == '-' && NAMEoffset > 1) {
StringBuffer[NAMEoffset - 2] = '-';
NAMEoffset--;
}
}
}
if (format == INITIAL_SURNAME || format == SURNAME) {
// *** Get players surname ***
for (char y = 0; y < Searchlen; y++) {
if (IsUpper[*(Search + y)] == up &&
IsUpper[*(Search + (y + 1))] == up &&
NAMEoffset < (NAME_BUFFER_LEN - 3)) {
StringBuffer[NAMEoffset] = *(Search + y);
// if ( (IsUpper[ *(Search+(y-1) ) ] == up && y>0) &&
// NamePREFIXtbl[Prefix] == 1 &&
// ( (StringBuffer[NAMEoffset-1]!='c' ||
// StringBuffer[NAMEoffset-2]!='M' && NAMEoffset>1 ) ) )
// {
// c = StringBuffer[NAMEoffset];
// StringBuffer[NAMEoffset] = ToLower[c];
// }
if ((IsUpper[*(Search + (y - 1))] == up && y > 0)) {
c = (unsigned char) StringBuffer[NAMEoffset];
if ((StringBuffer[NAMEoffset - 2] == 'M' &&
StringBuffer[NAMEoffset - 1] == 'c' &&
NAMEoffset > 1 && NamePREFIXtbl[Prefix] == 1)
)
c = (unsigned char) StringBuffer[NAMEoffset];
else {
c = (unsigned char) StringBuffer[NAMEoffset];
StringBuffer[NAMEoffset] = ToLower[c];
}
}
NAMEoffset++;
} else if (IsUpper[*(Search + y)] == up &&
IsUpper[*(Search + (y - 1))] == up &&
NAMEoffset < (NAME_BUFFER_LEN - 3) && y > 0) {
StringBuffer[NAMEoffset] = *(Search + y);
if (IsUpper[*(Search + (y - 1))] == up && y > 0) {
c = StringBuffer[NAMEoffset];
StringBuffer[NAMEoffset] = ToLower[c];
}
NAMEoffset++;
if ((*(Search + (y + 1))) == ' ') {
StringBuffer[NAMEoffset] = 32;
NAMEoffset++;
}
}
}
StringBuffer[NAMEoffset] = 0; // end of line.
}
return (&StringBuffer[0]);
#else
return 0;
#endif
}
//********************************************************************************************************************************