EURO_SPT.CPP 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4. #include "eurodefs.h"
  5. #include "euro_fxd.h"
  6. #include "mallocx.h"
  7. #include "euro_sym.h"
  8. #include "euro_def.h"
  9. #include "euro_var.h"
  10. #include "euro_dsk.h"
  11. char *script_buffer;
  12. FILE *script_in;
  13. char line[512];
  14. char variable;
  15. int variable_value;
  16. void Getvariable( char *buf );
  17. int GetVariableValue( char *buf );
  18. void ConvertLine(char *buf);
  19. void GetTextString( char *buf);
  20. short GetClubString( char *buf );
  21. char GetFormationType( char *buf );
  22. char GetTeamsCodeNumber( char *buf );
  23. char GetPositionType( char *buf );
  24. void GetAscCharacter( char *buf );
  25. char GetCharacter( char *buf );
  26. short GetDefine( char *buf );
  27. short GetSwitch( char *buf );
  28. short ImageXcount = 0;
  29. short ImageYcount = 0;
  30. short ImageWcount = 0;
  31. short ImageHcount = 0;
  32. short Pagecount = 0;
  33. short Stringcount = 0;
  34. short Clubcount = 0;
  35. short Speechcount = 0;
  36. short Posncount = 0;
  37. short Capscount = 0;
  38. short Goalscount = 0;
  39. short Datecount = 0;
  40. short Starcount = 0;
  41. char Starplyr = 0;
  42. short Pacecount = 0;
  43. short Powercount = 0;
  44. short Controlcount = 0;
  45. short Flaircount = 0;
  46. short Visioncount = 0;
  47. short Accuracycount = 0;
  48. short Staminacount = 0;
  49. short Disciplinecount = 0;
  50. short Fitnesscount = 0;
  51. short LowerCasecount = 32;
  52. short Dialcount = 32;
  53. short Modemcount = 0;
  54. short ModemInitcount = 0;
  55. short ModemStrcount = 0;
  56. short Value;
  57. int StringOffset = 0;
  58. int TempOffset = 0;
  59. short Formationcount = 0;
  60. char GroupDrawcount = 0;
  61. short inst, tmpinst;
  62. #define ImgSym 0
  63. #define TxtSym 1
  64. char Switch[128];
  65. char Definition[16];
  66. char DefType = ImgSym;
  67. #define NO_INSTRUCTION 0
  68. #define IMAGE_xCOORD 1
  69. #define IMAGE_yCOORD 2
  70. #define IMAGE_WIDTH 3
  71. #define IMAGE_HEIGHT 4
  72. #define IMAGE_PAGE 5
  73. #define TEXT_STRING 10
  74. #define SPEECH_ID_STRING 11
  75. //#define STAR_MAN 12
  76. #define LOWER_CASE 13
  77. #define DIAL_TYPE 14
  78. #define FORMATION_TYPE 100
  79. #define GROUP_DRAW_TYPE 101
  80. #define PLAYERS_CLUB_NAME 102
  81. #define PLAYERS_POSITION 103
  82. #define CAPS_TYPE 104
  83. #define GOALS_TYPE 105
  84. #define PACE_TYPE 106
  85. #define POWER_TYPE 107
  86. #define CONTROL_TYPE 108
  87. #define FLAIR_TYPE 109
  88. #define VISION_TYPE 110
  89. #define ACCURACY_TYPE 111
  90. #define STAMINA_TYPE 112
  91. #define DISCIPLINE_TYPE 113
  92. #define FITNESS_TYPE 114
  93. #define DOB_TYPE 115
  94. #define MODEM_INIT_TYPE 116
  95. #define MODEM_STR_TYPE 117
  96. #define MODEM_TYPE 118
  97. #define DEFINITION_ID 127
  98. #define NULL_INSTRUCTION 255
  99. //********************************************************************************************************************************
  100. char process_script_file( char *file)
  101. {
  102. script_buffer = (char *) mallocx(32768);
  103. if( script_buffer==NULL )
  104. {
  105. printf ("þ ERROR.. Unable to allocate memory for script file.\n");
  106. fflush(stdout);
  107. return(1);
  108. }
  109. else
  110. {
  111. if( script_in = fopen ( file, "rt" ), script_in != NULL )
  112. {
  113. while( ReadLine ( script_in, &line[0] ) >= 0 )
  114. {
  115. inst = 0;
  116. ConvertLine(&line[0]);
  117. memset( line, 0, 256 );
  118. }
  119. fclose(script_in);
  120. printf ("þ %d Bytes used for script file text.\n", StringOffset);
  121. fflush(stdout);
  122. }
  123. else
  124. {
  125. printf ("þ ERROR.. Trying to read script file.\n");
  126. fflush(stdout);
  127. }
  128. freex(script_buffer);
  129. }
  130. // printf("ImageXcount = %d\n",ImageXcount);
  131. // printf("ImageYcount = %d\n",ImageYcount);
  132. // printf("ImageWcount = %d\n",ImageWcount);
  133. // printf("ImageHcount = %d\n",ImageHcount);
  134. // printf("Pagecount = %d\n",Pagecount);
  135. // printf("Stringcount = %d\n",Stringcount);
  136. // printf("Clubcount = %d\n",Clubcount);
  137. // printf("Speechcount = %d\n",Speechcount);
  138. // printf("Posncount = %d\n",Posncount);
  139. // printf("Capscount = %d\n",Capscount);
  140. // printf("Goalscount = %d\n",Goalscount);
  141. // printf("Datecount = %d\n",Datecount);
  142. // printf("Starcount = %d\n",Starcount);
  143. // printf("Starplyr = %d\n",Starplyr);
  144. // printf("Pacecount = %d\n",Pacecount);
  145. // printf("Powercount = %d\n",Powercount);
  146. // printf("Controlcount = %d\n",Controlcount);
  147. // printf("Flaircount = %d\n",Flaircount);
  148. // printf("Visioncount = %d\n",Visioncount);
  149. // printf("Accuracycount = %d\n",Accuracycount);
  150. // printf("Staminacount = %d\n",Staminacount);
  151. // printf("Disciplinecount = %d\n",Disciplinecount);
  152. // printf("Fitnesscount = %d\n",Fitnesscount);
  153. // printf("LowerCasecount = %d\n",LowerCasecount);
  154. //
  155. return(0);
  156. }
  157. //********************************************************************************************************************************
  158. void ConvertLine(char *buf)
  159. {
  160. Getvariable(buf);
  161. while( variable != NO_INSTRUCTION )
  162. {
  163. if ( variable == IMAGE_xCOORD )
  164. { Image_Xcoords[ImageXcount] = GetVariableValue(buf); ImageXcount++; }
  165. if ( variable == IMAGE_yCOORD )
  166. { Image_Ycoords[ImageYcount] = GetVariableValue(buf); ImageYcount++; }
  167. if ( variable == IMAGE_WIDTH )
  168. { Image_Widths[ImageWcount] = GetVariableValue(buf); ImageWcount++; }
  169. if ( variable == IMAGE_HEIGHT )
  170. { Image_Heights[ImageHcount] = GetVariableValue(buf); ImageHcount++; }
  171. if ( variable == IMAGE_PAGE )
  172. { Image_Pages[Pagecount] = GetVariableValue(buf); Pagecount++; }
  173. if ( variable == TEXT_STRING )
  174. {
  175. Text[Stringcount] = TextStrings+StringOffset;
  176. GetTextString(buf);
  177. if ( Stringcount < 320 )
  178. NamePREFIXtbl[Stringcount] = 0;
  179. Stringcount++;
  180. }
  181. // if ( variable == LOWER_CASE )
  182. // { GetAscCharacter(buf); LowerCasecount++;}
  183. if ( variable == DIAL_TYPE )
  184. { LegalDial[Dialcount] = GetCharacter(buf); Dialcount++;}
  185. if ( variable == FORMATION_TYPE )
  186. { FormationInfo[Formationcount] = GetFormationType(buf); Formationcount++; }
  187. if ( variable == GROUP_DRAW_TYPE )
  188. { GroupDrawInfo[GroupDrawcount] = GetTeamsCodeNumber(buf);
  189. GroupDrawDefaultInfo[GroupDrawcount] = GroupDrawInfo[GroupDrawcount];
  190. GroupDrawcount++; }
  191. if ( variable == PLAYERS_CLUB_NAME )
  192. {
  193. TempOffset = StringOffset;
  194. Clubnames[Clubcount] = TextStrings+StringOffset;
  195. short Clubnum = GetClubString(buf);
  196. if ( Clubnum != NOT_FOUND )
  197. StringOffset = TempOffset;
  198. Clubcount++;
  199. }
  200. if ( variable == PLAYERS_POSITION )
  201. { PlayerPosns[Posncount] = GetPositionType(buf); Posncount++; }
  202. if ( variable == CAPS_TYPE )
  203. { PlayersCaps[Capscount] = GetFormationType(buf); Capscount++; }
  204. if ( variable == GOALS_TYPE )
  205. { PlayersGoals[Goalscount] = GetFormationType(buf); Goalscount++; }
  206. if ( variable == DOB_TYPE )
  207. {
  208. DOBday[Datecount] = GetFormationType(buf);
  209. inst++;
  210. DOBmonth[Datecount] = GetFormationType(buf);
  211. inst++;
  212. DOByear[Datecount] = GetFormationType(buf);
  213. Datecount++;
  214. }
  215. if ( variable == PACE_TYPE )
  216. { Pace[Pacecount] = GetVariableValue(buf); Pacecount++; }
  217. if ( variable == POWER_TYPE )
  218. { Power[Powercount] = GetVariableValue(buf); Powercount++; }
  219. if ( variable == CONTROL_TYPE )
  220. { Control[Controlcount] = GetVariableValue(buf); Controlcount++; }
  221. if ( variable == FLAIR_TYPE )
  222. { Flair[Flaircount] = GetVariableValue(buf); Flaircount++; }
  223. if ( variable == VISION_TYPE )
  224. { Vision[Visioncount] = GetVariableValue(buf); Visioncount++; }
  225. if ( variable == ACCURACY_TYPE )
  226. { Accuracy[Accuracycount] = GetVariableValue(buf); Accuracycount++; }
  227. if ( variable == STAMINA_TYPE )
  228. { Stamina[Staminacount] = GetVariableValue(buf); Staminacount++; }
  229. if ( variable == DISCIPLINE_TYPE )
  230. { Discipline[Disciplinecount] = GetVariableValue(buf); Disciplinecount++; }
  231. if ( variable == FITNESS_TYPE )
  232. { Fitness[Fitnesscount] = GetVariableValue(buf);
  233. FitnessDefault[Fitnesscount] = Fitness[Fitnesscount];
  234. Fitnesscount++; }
  235. if ( variable == MODEM_TYPE )
  236. {
  237. Modems[Modemcount] = TextStrings+StringOffset;
  238. GetTextString(buf);
  239. Modemcount++;
  240. }
  241. if ( variable == MODEM_STR_TYPE )
  242. {
  243. ModemInitStrs[ModemStrcount] = TextStrings+StringOffset;
  244. GetTextString(buf);
  245. ModemStrcount++;
  246. }
  247. if ( variable == MODEM_INIT_TYPE )
  248. { ModemInitList[ModemInitcount] = GetVariableValue(buf); ModemInitcount++; }
  249. if ( variable == SPEECH_ID_STRING )
  250. {
  251. SPEECH_identifier[Speechcount] = TextStrings+StringOffset;
  252. GetTextString(buf);
  253. Speechcount++;
  254. Starplyr++;
  255. if ( Starplyr>=20 )
  256. Starplyr = 0;
  257. }
  258. // if ( variable == STAR_MAN )
  259. // {
  260. // StarPlayers[Starcount] = Starplyr;
  261. // Starcount++;
  262. // }
  263. //
  264. if ( variable == DEFINITION_ID )
  265. {
  266. Value = GetDefine(buf);
  267. fprintf( fp2, "#define %s %d\r\n", Definition, Value);
  268. }
  269. Getvariable(buf);
  270. }
  271. }
  272. //********************************************************************************************************************************
  273. int GetVariableValue( char *buf ) //, int inst )
  274. {
  275. int val, offset;
  276. char number[10];
  277. offset = 0;
  278. val = 0;
  279. if (buf[inst]==' ')
  280. inst++;
  281. while ( buf[inst] > ('0'-1) && buf[inst] < ('9'+1) )
  282. {
  283. number[offset] = buf[inst];
  284. inst++;
  285. offset++;
  286. }
  287. number[offset] = 0;
  288. val = atoi(number);
  289. return ( val );
  290. }
  291. //********************************************************************************************************************************
  292. char GetFormationType( char *buf )
  293. {
  294. int val, offset;
  295. char form = 0;
  296. char number[10];
  297. offset = 0;
  298. val = 0;
  299. if (buf[inst]==' ')
  300. inst++;
  301. while ( buf[inst] > ('0'-1) && buf[inst] < ('9'+1) )
  302. {
  303. number[offset] = buf[inst];
  304. inst++;
  305. if (buf[inst]=='-')
  306. inst++;
  307. offset++;
  308. }
  309. number[offset] = 0;
  310. val = atoi(number);
  311. if (val<200)
  312. form = val;
  313. switch (val)
  314. {
  315. case(316):
  316. form = 0;
  317. break;
  318. case(406):
  319. form = 1;
  320. break;
  321. case(415):
  322. form = 2;
  323. break;
  324. case(424):
  325. form = 3;
  326. break;
  327. case(433):
  328. form = 4;
  329. break;
  330. case(442):
  331. form = 5;
  332. break;
  333. case(514):
  334. form = 6;
  335. break;
  336. case(523):
  337. form = 7;
  338. break;
  339. case(532):
  340. form = 8;
  341. break;
  342. case(631):
  343. form = 9;
  344. break;
  345. }
  346. return ( form );
  347. }
  348. //********************************************************************************************************************************
  349. char GetTeamsCodeNumber( char *buf )
  350. {
  351. char val;
  352. val = 0;
  353. if (buf[inst]==' ')
  354. inst++;
  355. while ( buf[inst] > ('0'-1) && buf[inst] < ('9'+1) )
  356. {
  357. if ( buf[inst+1] < 'a' )
  358. val = ((buf[inst+1]-'A')*4);
  359. else
  360. val = ((buf[inst+1]-'a')*4);
  361. val+= (buf[inst]-'1');
  362. inst+= 2;
  363. }
  364. return( val );
  365. }
  366. //********************************************************************************************************************************
  367. char GetPositionType( char *buf )
  368. {
  369. char val;
  370. val = 0;
  371. if (buf[inst]==' ')
  372. inst++;
  373. if ( buf[inst] == 'D' && buf[inst+1] == 'F' )
  374. val = 1;
  375. if ( buf[inst] == 'M' && buf[inst+1] == 'D' )
  376. val = 2;
  377. if ( buf[inst] == 'F' && buf[inst+1] == 'D' )
  378. val = 3;
  379. return ( val );
  380. }
  381. //********************************************************************************************************************************
  382. short GetDefine( char *buf )
  383. {
  384. char Doffset = 0;
  385. short Value;
  386. if ( buf[inst] == ' ' )
  387. inst++;
  388. while ( buf[inst] > 32 )
  389. {
  390. Definition[Doffset] = buf[inst];
  391. if (Doffset<15)
  392. Doffset++;
  393. inst++;
  394. }
  395. Definition[Doffset] = 0;
  396. if ( DefType == ImgSym )
  397. Value = Pagecount;
  398. else
  399. if ( DefType == TxtSym )
  400. Value = Stringcount;
  401. return(Value);
  402. }
  403. //********************************************************************************************************************************
  404. short GetSwitch( char *buf )
  405. {
  406. char Soffset = 0;
  407. tmpinst = inst;
  408. strcpy( Switch, "No Switch" );
  409. if ( buf[inst] == '[' )
  410. {
  411. inst++;
  412. if ( buf[inst] == ' ' )
  413. inst++;
  414. while ( buf[inst]!=']' && Soffset< 127 )
  415. {
  416. Switch[Soffset] = buf[inst];
  417. if (Soffset<127)
  418. Soffset++;
  419. inst++;
  420. if ( buf[inst]==' ' && buf[inst+1]==']' )
  421. inst++;
  422. }
  423. Switch[Soffset] = 0;
  424. strupr( Switch );
  425. }
  426. inst = tmpinst;
  427. inst++;
  428. return(Value);
  429. }
  430. //********************************************************************************************************************************
  431. void GetTextString( char *buf ) //, int inst )
  432. {
  433. char CRflag = 2;
  434. while ( CRflag!=0 )
  435. {
  436. if ( buf[inst] == '"' )
  437. CRflag--;
  438. if ( buf[inst] > 31 && buf[inst] != '/' && buf[inst]!='"' && CRflag==1)
  439. {
  440. TextStrings[StringOffset] = buf[inst];
  441. StringOffset++;
  442. }
  443. if ( buf[inst+1] > 31 && buf[inst] == '/' && CRflag==1)
  444. {
  445. TextStrings[StringOffset] = buf[inst+1];
  446. StringOffset++;
  447. inst++;
  448. }
  449. if ( (buf[inst] < 31 && CRflag==1) || StringOffset> TEXT_STRING_BUFFER_LEN )
  450. CRflag = 0;
  451. inst++;
  452. }
  453. TextStrings[StringOffset] = 0;
  454. StringOffset++;
  455. }
  456. //********************************************************************************************************************************
  457. void GetAscCharacter( char *buf )
  458. {
  459. char CRflag = 1;
  460. while ( CRflag!=0 )
  461. {
  462. if ( buf[inst] == '"' && buf[inst+2]== '"' )
  463. {
  464. CRflag = 0;
  465. ToLower[LowerCasecount] = buf[inst+1];
  466. }
  467. inst++;
  468. }
  469. }
  470. //********************************************************************************************************************************
  471. char GetCharacter( char *buf )
  472. {
  473. char character;
  474. char CRflag = 1;
  475. while ( CRflag!=0 )
  476. {
  477. if ( buf[inst] == '"' && buf[inst+2]== '"' )
  478. {
  479. CRflag = 0;
  480. character = buf[inst+1];
  481. }
  482. inst++;
  483. }
  484. return(character);
  485. }
  486. //********************************************************************************************************************************
  487. short GetClubString( char *buf )
  488. {
  489. // ****** GET PLAYERS CLUB ******
  490. char PlayerClub[32];
  491. char string[32];
  492. int ClubOffset = 0;
  493. char CRflag = 2;
  494. int CompareOffset = 0;
  495. short ClubFound = NOT_FOUND;
  496. while ( CRflag!=0 )
  497. {
  498. if ( buf[inst] == '"' )
  499. CRflag--;
  500. if ( buf[inst] > 31 && buf[inst]!='"' && CRflag==1)
  501. {
  502. PlayerClub[ClubOffset] = buf[inst];
  503. ClubOffset++;
  504. }
  505. if ( buf[inst] < 31 && CRflag==1 )
  506. CRflag = 0;
  507. inst++;
  508. }
  509. PlayerClub[ClubOffset] = 0;
  510. ClubOffset++;
  511. // ****** SEARCH THROUGH STRING LIST FOR REPEAT OF CLUB NAME ******
  512. for ( short s=0; s < Stringcount ; s++ )
  513. {
  514. int CopyOffset = 0;
  515. CRflag = 1;
  516. Clubnames[Clubcount] = TextStrings+CompareOffset;
  517. while ( CRflag!=0 )
  518. {
  519. if ( TextStrings[CompareOffset] == 0 )
  520. {
  521. string[CopyOffset] = 0;
  522. CRflag = 0;
  523. }
  524. else
  525. {
  526. string[CopyOffset] = TextStrings[CompareOffset];
  527. }
  528. CopyOffset++;
  529. CompareOffset++;
  530. }
  531. if ( strcmpi( PlayerClub, string ) == 0 )
  532. {
  533. ClubFound = s;
  534. break;
  535. }
  536. }
  537. // ****** THROW CLUB STRING INTO TEXT LIST ******
  538. if ( ClubFound == NOT_FOUND )
  539. {
  540. Clubnames[Clubcount] = TextStrings+StringOffset;
  541. for ( char t=0; t < (strlen(PlayerClub)); t++ )
  542. {
  543. TextStrings[StringOffset] = PlayerClub[t];
  544. StringOffset++;
  545. }
  546. TextStrings[StringOffset] = 0;
  547. StringOffset++;
  548. }
  549. return(ClubFound);
  550. }
  551. //********************************************************************************************************************************
  552. void Getvariable( char *buf )
  553. {
  554. variable = NO_INSTRUCTION;
  555. while ( buf[inst] != 0 && variable == NO_INSTRUCTION )
  556. {
  557. if ( buf[inst+1] == ':' && buf[inst-1] <= ' ')
  558. {
  559. if ( buf[inst] == 'x' )
  560. {variable = IMAGE_xCOORD; inst+=2;}
  561. if ( buf[inst] == 'y' )
  562. {variable = IMAGE_yCOORD; inst+=2;}
  563. if ( buf[inst] == 'w' )
  564. {variable = IMAGE_WIDTH; inst+=2;}
  565. if ( buf[inst] == 'h' )
  566. {variable = IMAGE_HEIGHT; inst+=2;}
  567. if ( buf[inst] == 'p' )
  568. {variable = IMAGE_PAGE; inst+=2;}
  569. if ( buf[inst] == 't' )
  570. {variable = TEXT_STRING; inst+=2;}
  571. }
  572. if ( buf[inst] == '' && EUROsymbol == 1 )
  573. {variable = DEFINITION_ID; inst+=2;}
  574. if ( buf[inst+4] == ':' || buf[inst+3] == ':' || buf[inst+5] == ':' )
  575. {
  576. if ( buf[inst] == 'f' && buf[inst+1] == 'o' && buf[inst+2] == 'r' && buf[inst+3] == 'm' )
  577. {variable = FORMATION_TYPE; inst+=5; break;}
  578. if ( buf[inst] == 'd' && buf[inst+1] == 'r' && buf[inst+2] == 'a' && buf[inst+3] == 'w' )
  579. {variable = GROUP_DRAW_TYPE; inst+=5; break;}
  580. if ( buf[inst] == 'c' && buf[inst+1] == 'l' && buf[inst+2] == 'u' && buf[inst+3] == 'b' && Datecount < 320 )
  581. {variable = PLAYERS_CLUB_NAME; inst+=5; break;}
  582. if ( buf[inst] == 'p' && buf[inst+1] == 'o' && buf[inst+2] == 's' && buf[inst+3] == 'n' && Posncount < 320 )
  583. {variable = PLAYERS_POSITION; inst+=5; break;}
  584. if ( buf[inst] == 'c' && buf[inst+1] == 'a' && buf[inst+2] == 'p' && buf[inst+3] == 's' && Capscount < 320 )
  585. {variable = CAPS_TYPE; inst+=5; break;}
  586. if ( buf[inst] == 'g' && buf[inst+1] == 'o' && buf[inst+2] == 'a' && buf[inst+3] == 'l' && Goalscount < 320 )
  587. {variable = GOALS_TYPE; inst+=5; break;}
  588. if ( buf[inst] == 'p' && buf[inst+1] == 'a' && buf[inst+2] == 'c' && buf[inst+3] == 'e' && Pacecount < 320 )
  589. {variable = PACE_TYPE; inst+=5; break;}
  590. if ( buf[inst] == 'p' && buf[inst+1] == 'o' && buf[inst+2] == 'w' && Powercount < 320 )
  591. {variable = POWER_TYPE; inst+=4; break;}
  592. if ( buf[inst] == 'c' && buf[inst+1] == 'n' && buf[inst+2] == 't' && buf[inst+3] == 'l' && Controlcount < 320 )
  593. {variable = CONTROL_TYPE; inst+=5; break;}
  594. if ( buf[inst] == 'f' && buf[inst+1] == 'l' && buf[inst+2] == 'a' && buf[inst+3] == 'r' && Flaircount < 320 )
  595. {variable = FLAIR_TYPE; inst+=5; break;}
  596. if ( buf[inst] == 'v' && buf[inst+1] == 'i' && buf[inst+2] == 's' && buf[inst+3] == 'n' && Visioncount < 320 )
  597. {variable = VISION_TYPE; inst+=5; break;}
  598. if ( buf[inst] == 'a' && buf[inst+1] == 'c' && buf[inst+2] == 'c' && Accuracycount < 320 )
  599. {variable = ACCURACY_TYPE; inst+=4; break;}
  600. if ( buf[inst] == 's' && buf[inst+1] == 't' && buf[inst+2] == 'a' && buf[inst+3] == 'm' && Staminacount < 320 )
  601. {variable = STAMINA_TYPE; inst+=5; break;}
  602. if ( buf[inst] == 'd' && buf[inst+1] == 'i' && buf[inst+2] == 's' && buf[inst+3] == 'c' && Disciplinecount < 320 )
  603. {variable = DISCIPLINE_TYPE; inst+=5; break;}
  604. if ( buf[inst] == 'f' && buf[inst+1] == 'i' && buf[inst+2] == 't' && Fitnesscount < 320 )
  605. {variable = FITNESS_TYPE; inst+=4; break;}
  606. if ( buf[inst] == 'd' && buf[inst+1] == 'o' && buf[inst+2] == 'b' && Datecount < 320 )
  607. {variable = DOB_TYPE; inst+=4; break;}
  608. if ( buf[inst] == 'n' && buf[inst+1] == 'a' && buf[inst+2] == 'm' && buf[inst+3] == 'e' && Speechcount < 320 )
  609. {variable = SPEECH_ID_STRING; inst+=5; break;}
  610. if ( buf[inst] == 'l' && buf[inst+1] == 'o' && buf[inst+2] == 'w' )
  611. {variable = LOWER_CASE; inst+=4; break;}
  612. if ( buf[inst] == 'd' && buf[inst+1] == 'i' && buf[inst+2] == 'a' && buf[inst+3] == 'l' &&
  613. Dialcount < 129 )
  614. {variable = DIAL_TYPE; inst+=5; break;}
  615. if ( buf[inst] == 'i' && buf[inst+1] == 'n' && buf[inst+2] == 'i' && buf[inst+3] == 't' )
  616. {variable = MODEM_INIT_TYPE; inst+=5;break;}
  617. if ( buf[inst] == 'm' && buf[inst+1] == 'o' && buf[inst+2] == 'd' && buf[inst+3] == 'e'
  618. && buf[inst+4] == 'm' )
  619. {variable = MODEM_TYPE; inst+=6; break;}
  620. if ( buf[inst] == 'm' && buf[inst+1] == 's' && buf[inst+2] == 't' && buf[inst+3] == 'r' )
  621. {variable = MODEM_STR_TYPE; inst+=5; break;}
  622. }
  623. // if ( buf[inst] == '(' && buf[inst+1] == '*' && buf[inst+2] == ')' )
  624. // {variable = STAR_MAN; inst+=3; break;}
  625. // *** Preccess SWITCH Command ***
  626. if (variable == NO_INSTRUCTION)
  627. {
  628. GetSwitch(buf);
  629. if ( !strcmp( Switch, "IMAGE DATA") )
  630. DefType = ImgSym;
  631. if ( !strcmp( Switch, "TEXT DATA") )
  632. DefType = TxtSym;
  633. if ( !strcmp( Switch, "ANDY'S TEXT DATA") )
  634. {
  635. Stringcount = ANDYF_TEXT_START;
  636. DefType = TxtSym;
  637. }
  638. if ( !strcmp( Switch, "LAURENT'S TEXT DATA") )
  639. {
  640. Stringcount = LAURENT_TEXT_START;
  641. DefType = TxtSym;
  642. }
  643. if ( (!strcmp( Switch, "MC")) ||
  644. (!strcmp( Switch, "LE")) )
  645. NamePREFIXtbl[Stringcount-1] = 1;
  646. if ( !strcmp( Switch, "*") )
  647. {
  648. StarPlayers[Starcount] = Starplyr;
  649. Starcount++;
  650. }
  651. }
  652. }
  653. }
  654. //********************************************************************************************************************************