TEST.CPP 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165
  1. #include <iostream.h>
  2. #include <stdlib.h>
  3. #include <stdio.h>
  4. #include <graph.h>
  5. #include <i86.h>
  6. #include <dos.h>
  7. #include <conio.h>
  8. #include <float.h>
  9. #include <time.h>
  10. #include <math.h>
  11. #include <string.h>
  12. #include "defines.h"
  13. #include "data.equ"
  14. #include "3deng.h"
  15. #include "results.h"
  16. #include "video.h"
  17. #include "intronet.h"
  18. #include "sos.h"
  19. #include "audio.h"
  20. #include "digi.h"
  21. #include "midi.h"
  22. #include "config.h"
  23. #include "timer.h"
  24. #include "mallocx.h"
  25. #include "unmangle.h"
  26. #include "gamedata.h"
  27. #include "eurodefs.h"
  28. #include "euro_fxd.h"
  29. #include "euro.equ"
  30. #include "euro_def.h"
  31. #include "euro_var.h"
  32. #include "euro_mem.h"
  33. #include "euro_spt.h"
  34. #include "euro_gen.h"
  35. #include "euro_grf.h"
  36. #include "euro_cnt.h"
  37. #include "euro_dsk.h"
  38. #include "euro_sqd.h"
  39. #include "euro_sel.h"
  40. #include "euro_fix.h"
  41. #include "euro_usr.h"
  42. #include "euro_inf.h"
  43. #include "euro_gdv.h"
  44. #include "euro_win.h"
  45. #include "euro_net.h"
  46. #include "euro_mod.h"
  47. #include "euro_cmd.h"
  48. #include "euro_mat.h"
  49. #include "euro_rnd.h"
  50. #include "euro_sym.h"
  51. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  52. //º º
  53. //º EURO '96 - FRONT END º
  54. //º º
  55. //º Start date: 14/12/1995 º
  56. //º End date: º
  57. //º º
  58. //º º
  59. //º Christine's new work number: 2784293 º
  60. //º My new mobile number: 0973 868837 º
  61. //º Caroline: 0589 665323 º
  62. //º 2446227 º
  63. //º Andy Finlay: 2390248 º
  64. //º Justin Longden's mobile number: 0973 169931 º
  65. //º Philip Durbidge work number: 2734391 º
  66. //º Jason Wragg's Home number: 2352544 º
  67. //º º
  68. //º º
  69. //º º
  70. //º Changes to formation types: º
  71. //º º
  72. //º England 4-4-2 done º
  73. //º Bulgaria 1-3-3-3 º
  74. //º Croatia 5-3-2 done º
  75. //º Czech Rep. 5-3-2 done º
  76. //º Denmark 5-4-1 º
  77. //º France 4-4-2 done º
  78. //º Germany 5-3-2 done º
  79. //º Holland 3-4-3 º
  80. //º Italy 4-4-2 done º
  81. //º Portugal 4-5-1 º
  82. //º Romania 5-4-1 º
  83. //º Russia 5-3-2 done º
  84. //º Scotland 5-3-2 done º
  85. //º Spain 4-5-1 º
  86. //º Switzerland 4-4-2 done º
  87. //º Turkey 5-3-2 done º
  88. //º º
  89. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  90. long SndsValid = 1;
  91. int lookv;
  92. offset_file load_offsets[256];
  93. // BYTE *background_buffer;
  94. BYTE *gremlin_buffer;
  95. // BYTE *psudo_buffer;
  96. BYTE *sprite_buffer;
  97. BYTE *sfont_buffer;
  98. BYTE *mfont_buffer;
  99. BYTE *bfont_buffer;
  100. BYTE *spool_buffer;
  101. BYTE *unpack_buffer;
  102. BYTE *texture_buffer;
  103. BYTE *proptab_buffer;
  104. BYTE palette_buffer[768];
  105. BYTE work_buffer[768];
  106. extern unsigned char pal[768];
  107. BYTE filter_buffer[256];
  108. BYTE mouseBKGbuffer[30*30];
  109. BYTE shirtBKGbuffer[51*62];
  110. short OldMouseX,OldMouseY,OldMouseWidth,OldMouseHeight;
  111. int key_velocity = 0;
  112. // old actua int InitialiseMan, InitialiseFlag;
  113. int MouseFlags;
  114. int Button_pressed = 0;
  115. int VIDEOstatus;
  116. int array_test = 1;
  117. int CursorXposn;
  118. char wheelgoes = 0;
  119. char redefine_flag = 255;
  120. char CarryControl;
  121. int keep_demo_time,keep_demo_Gtype;
  122. int keep_demo_teama;
  123. int keep_demo_teamb;
  124. int keep_x_posn, keep_y_posn;
  125. int keep_demo_comp;
  126. short keep_demo_offside;
  127. short keep_demo_subs;
  128. short keep_demo_freekicks;
  129. short keep_demo_bookings;
  130. short keep_demo_wind;
  131. int keep_demo_referee;
  132. char german_man;
  133. char wheel[18] = "";
  134. int last_menu = NULL;
  135. int selected_player = 0;
  136. int selected_team = 0;
  137. short selected_formation = 0;
  138. short display_formation = selected_formation;
  139. char *TextBuffer;
  140. int quit = NULL;
  141. int menu_update = NULL;
  142. char rerun_menu = NULL;
  143. int MarkSquadPlayer = NULL;
  144. int MarkSlotNumber = NULL;
  145. int MarkControlType = NULL;
  146. int current_spool = NULL;
  147. int proportional_change = 0;
  148. int music_state = 0;
  149. char suspend_audio = 0;
  150. char OldKEY = 0;
  151. short OldShirtX,OldShirtY,OldShirtWidth,OldShirtHeight;
  152. int ClickXposn,ClickYposn;
  153. int ShirtFlags;
  154. short ShirtXposn,ShirtYposn;
  155. char menu_initialised = OFF;
  156. char keyboard = 0;
  157. int last_ticks;
  158. int resolution,header_y;
  159. int firstrun = NULL;
  160. int NetworkType = NULL;
  161. int NetworkType_toggle = NetworkType;
  162. int Competition_limit;
  163. int NoOfTeamsFlag = NULL;
  164. int Players_Team_Choice;
  165. short TabX,lineY;
  166. int Lastnetwork = -1;
  167. int Laststarts = -1;
  168. int WheelOuter,WheelInner,WindowNumber;
  169. char OverlayFlag;
  170. // old actua int DrawMan;
  171. int formdata;
  172. int pulsating_colour = 0;
  173. int formation_toggle;
  174. char compute_a,compute_b;
  175. char newgame;
  176. int music_fade_flag,music_volume;
  177. int ref_vision = 50;
  178. int ref_disc = 50;
  179. int ref_vision_add = 1;
  180. int ref_disc_add = -1;
  181. char GDVavailable,StartGDVavailable;
  182. char *time_message;
  183. char *slot_text[25];
  184. char *slot_TITLE[25];
  185. char RetestNet;
  186. float angle = -PI/4; //(3*PI)/4;
  187. float anim = 0.4;
  188. int PC_speed = 34;
  189. char tune;
  190. char cal0,cal1;
  191. char which_key_message;
  192. extern void write_config_file();
  193. extern int timing();
  194. extern "C" signed char key1[6];
  195. extern "C" signed char key2[6];
  196. extern "C" volatile int hold_loop;
  197. extern "C" volatile int count;
  198. extern "C" int netsetup_on; // In network setup
  199. extern "C" int network_on;
  200. extern char return_doskey;
  201. extern match(int argc, char **argv);
  202. extern "C" int CheckFORnet();
  203. extern "C" void DeinitialiseNET(int netflag);
  204. extern char audio_version;
  205. extern void claim_key_int(void);
  206. extern void release_key_int(void);
  207. int go_audio();
  208. char team_a_okay, team_b_okay;
  209. extern void init_keyboard();
  210. extern void init_users();
  211. extern void init_team();
  212. extern "C" volatile char net_half;
  213. extern "C" char joystick1_on;
  214. extern "C" char joystick2_on;
  215. extern "C" unsigned short joy1_cnt_x,joy1_cnt_y;
  216. extern "C" unsigned short joy2_cnt_x,joy2_cnt_y;
  217. extern "C" char old_mf;
  218. int new_menu, current_menu;
  219. char lastTGAstate;
  220. int AutoSTARTgame;
  221. int RESET_MEMORY;
  222. int bomb_message = NULL;
  223. char force_res;
  224. char sub_version;
  225. short GDVtimer;
  226. int __far criticalhandler(unsigned deverror,unsigned errcode, unsigned __far * devhdr);
  227. int GetFirstCDDrive();
  228. int CheckCD(int CD);
  229. char no_cd;
  230. char keep_language;
  231. int InsertKey(int SourceKEY);
  232. extern int gdv_gran;
  233. extern "C" int x1ok;
  234. extern "C" int y1ok;
  235. extern "C" int x2ok;
  236. extern "C" int y2ok;
  237. extern "C" int bitaccept;
  238. extern void PlayGDV();
  239. char testfile[128];
  240. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  241. //º º
  242. //º Euro '96 addition. º
  243. //º º
  244. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  245. extern int testVESA;
  246. extern int VESAmode(int *);
  247. extern void near svgacpy( char unsigned near *, short, short, short, short, short );
  248. void main(int argc, char **argv)
  249. {
  250. version = 1;
  251. sub_version = 0;
  252. day = 15;
  253. month = 12;
  254. year = 1995;
  255. EUROsymbol = 0;
  256. EUROfrontend = 1;
  257. printf ("\n\n\n\nEURO '96\n");
  258. fflush(stdout);
  259. printf ("\(C\) Gremlin Interactive 1995,96\n");
  260. fflush(stdout);
  261. printf ("þ Version: %d.%d %d/%d/%d\n", version, sub_version, day, month, year);
  262. fflush(stdout);
  263. TestForWindows95();
  264. Test_640x480_VideoMode();
  265. LogicState = BLANK_SCREEN;
  266. Team = England;
  267. Menu = MAIN;
  268. NoOfSubs = 4;
  269. UsableSubs = 4;
  270. WinPts = 3;
  271. DrawPts = 1;
  272. MatchNumber = 0;
  273. ChangeMenu = -2;
  274. EUROday = 2;
  275. EUROmonth = 2;
  276. EUROyear = 96;
  277. EUROgameType = EURO_championship; //friendly;
  278. EUROteamA = 0; //England;
  279. EUROteamB = 1; //Scotland;
  280. EUROteamView = 0;
  281. ResetUsers();
  282. EUROnoOfMatchPlyrs = 1;
  283. EUROplyrSetup = 0;
  284. CommPort = 2;
  285. BaudRate = 9600;
  286. RunMatch = No;
  287. ProcessCommandLine( argc, argv);
  288. if ( EUROverbose != 0 )
  289. {
  290. printf ("þ Memory check: %d\n",get_mem_info() );
  291. fflush(stdout);
  292. }
  293. EUROmaxPlayers = SetupControlMethods();
  294. InitEUROnet();
  295. if ( EUROnetInitialise == No && EUROgameType == EURO_network_game )
  296. EUROgameType = EURO_friendly;
  297. //********************************************************************************************************************************
  298. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  299. //º º
  300. //º Checks to see make sure a mouse driver is present before continuing. º
  301. //º º
  302. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  303. bomb_message = 0;
  304. _harderr(criticalhandler);
  305. GetFirstCDDrive();
  306. //********************************************************************************************************************************
  307. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  308. //º º
  309. //º Euro '96 addition. º
  310. //º º
  311. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  312. ReadDataOffsetFile( &EuroOFFSETfile[0] ); // Load data offset file.
  313. Euro96_MemoryInitialise(); // Resets all Euro memory handles.
  314. TextStringMemHandle = // Set up memory handle.
  315. AllocateTextStringMemory(); // Allocate memory for text strings..
  316. printf ("þ %d Bytes allocated for script file text.\n", TEXT_STRING_BUFFER_LEN);
  317. fflush(stdout);
  318. // ------------------------------------
  319. if ( EUROsymbol == 1 )
  320. {
  321. fp2=fopen( "euro_sym.h", "wb" );
  322. if(fp2==NULL)
  323. {
  324. EUROsymbol = 0;
  325. printf ("þ Error trying to create symbol table.\n");
  326. fflush(stdout);
  327. }
  328. }
  329. process_script_file(&EuroSCRIPTfile[0]); // Reads script file and compiles relevent data for game.
  330. if ( EUROsymbol == 1 )
  331. {
  332. fclose(fp2);
  333. printf ("þ Symbol table created.\n");
  334. fflush(stdout);
  335. DeAllocateMemory(TextStringMemHandle); // DeAllocates memory used previously for text strings.
  336. exit(-1);
  337. }
  338. // ------------------------------------
  339. if ( EUROgameType == EURO_wireplay )
  340. {
  341. printf ("þ Wireplay Teams: %s V",
  342. GetTEAMname( EUROteamA, 11 ) );
  343. fflush(stdout);
  344. printf (" %s\n",
  345. GetTEAMname( EUROteamB, 11 ) );
  346. fflush(stdout);
  347. }
  348. AllocateDisplayBuffers(); // Allocates two 640x480 display buffers.
  349. TexturePageMemHandle = // Set up memory handle.
  350. AllocateTexturePageMemory( 8, // Specify number of texture pages to allocate.
  351. &FrontendTextureDEFN ); // Allocate memory for frontend texture pages.
  352. FrontendTextureDEFN.page_start = (BYTE *)TexturePages; // Specify memory address used for texture pages.
  353. LoadTexturePage( BIN_PAGE1, // Load texture page 1 into texture memory.
  354. &EuroDATfile[0],
  355. 0, &FrontendTextureDEFN );
  356. LoadPalette( BIN_TSELPAL, &EuroDATfile[0], 0 ); // creates special filters for team select section.
  357. CreateFilter( &FilterBuffer[256], 40, 54, 60, .7, .7, .7);
  358. CreateFilter( &FilterBuffer[512], 40, 54, 60, .6, .6, .6);
  359. CreateFilter( &FilterBuffer[768], 40, 54, 60, .5, .5, .5);
  360. CreateFilter( &FilterBuffer[1024], 40, 54, 60, .4, .4, .4);
  361. CreateFilter( &FilterBuffer[1280], 40, 54, 60, .3, .3, .3);
  362. CreateFilter( &FilterBuffer[1536], 40, 54, 60, .2, .2, .2);
  363. CreateFilter( &FilterBuffer[1792], 40, 54, 60, .1, .1, .1);
  364. //********************************************************************************************************************************
  365. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  366. //º º
  367. //º Checks command line for verbose options. º
  368. //º º
  369. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  370. if(ReadConfigFile())
  371. bomb_message|= CONFIG_ERROR;
  372. match_info.menu_res = HI;
  373. batch_info.GDVres = HI;
  374. newgame = 0;
  375. redefine_flag = 255;
  376. CarryControl = NULL;
  377. x1ok = NULL;
  378. y1ok = NULL;
  379. x2ok = NULL;
  380. y2ok = NULL;
  381. bitaccept = NULL;
  382. match_info.tga_enable = NULL;
  383. batch_info.cheat_mode = OFF;
  384. match_info.menu_res = HI;
  385. force_res = NULL;
  386. match_info.language = Language;
  387. no_cd = FALSE;
  388. // batch_info.floppy = FLOPPY;
  389. keyboard = 0;
  390. batch_info.rolling_demo = ROLLING_DEMO;
  391. if (batch_info.rolling_demo!=Off)
  392. no_cd = TRUE;
  393. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  394. //º º
  395. //º Checks for PC memory and machine speed then sets up game and intro variables. º
  396. //º º
  397. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  398. setup.detail.sky = ON;
  399. setup.detail.stadia = HI;
  400. setup.detail.lines = ON;
  401. setup.vidi_type = HI;
  402. setup.detail.players = HI;
  403. setup.detail.pitch = MED;
  404. setup.start_res = LO;
  405. setup.screen_size = NULL;
  406. setup.stadium = 1;
  407. PC_speed = timing();
  408. setup.M8 = 1; //DisplayFree();
  409. if (PC_speed>31)
  410. PC_speed = 31;
  411. setup.detail.sky = detail_defaults[PC_speed].sky;
  412. setup.detail.stadia = detail_defaults[PC_speed].stadia;
  413. setup.detail.pitch = detail_defaults[PC_speed].pitch;
  414. setup.detail.players = detail_defaults[PC_speed].players;
  415. setup.detail.lines = detail_defaults[PC_speed].lines;
  416. setup.detail.shadows = detail_defaults[PC_speed].shadows;
  417. setup.vidi_type = NULL;
  418. setup.start_res = NULL;
  419. match_info.camera = NULL;
  420. setup.screen_size = screen_defaults[PC_speed];
  421. music_fade_flag = NULL;
  422. match_info.music = NULL;
  423. match_info.crowd = NULL;
  424. match_info.commentary = NULL;
  425. match_info.master = NULL;
  426. match_info.pitch = NULL;
  427. match_info.referee = 16+16;
  428. match_info.CompetitionType = FRIENDLY;
  429. match_info.CompetitionType_toggle = FRIENDLY;
  430. match_info.NoOfPlayers = NULL;
  431. match_info.NoOfPlayers_toggle = NULL;
  432. if (batch_info.rolling_demo==Off)
  433. {
  434. match_info.GameType = SIMULATION;
  435. match_info.GameType_toggle = SIMULATION;
  436. }
  437. else
  438. {
  439. match_info.GameType = ARCADE;
  440. match_info.GameType_toggle = ARCADE;
  441. }
  442. batch_info.Port_toggle = NULL;
  443. match_info.control_methods[0] = 0;
  444. match_info.control_methods[1] = 1;
  445. match_info.control_methods[2] = 2;
  446. match_info.control_methods[3] = 3;
  447. match_info.time = 0;
  448. match_info.time_toggle = match_info.time;
  449. net_half = match_info.time;
  450. match_info.offside = 0;
  451. match_info.offside_toggle = 0;
  452. match_info.substitutes = 1;
  453. match_info.substitutes_toggle = 1;
  454. match_info.bookings = 1;
  455. match_info.bookings_toggle = 1;
  456. match_info.wind = 0;
  457. match_info.wind_toggle = 0;
  458. match_info.freekicks = 1;
  459. match_info.freekicks_toggle = 1;
  460. batch_info.match_number = -1;
  461. batch_info.round_up_page = 0;
  462. batch_info.cup_match_number = -1;
  463. batch_info.number_of_cup_teams = 32;
  464. batch_info.keys_used[UP_RED] = 0x1e; // A
  465. batch_info.keys_used[DN_RED] = 0x2c; // Z
  466. batch_info.keys_used[LF_RED] = 0x33; // <
  467. batch_info.keys_used[RT_RED] = 0x34; // >
  468. batch_info.keys_used[F1_RED] = 0x10; // Q
  469. batch_info.keys_used[F2_RED] = 0x35; // /
  470. batch_info.keys_used[UP_RED+6] = -0x48; // Arrow Up
  471. batch_info.keys_used[DN_RED+6] = -0x50; // Arrow Dn
  472. batch_info.keys_used[LF_RED+6] = -0x4b; // Arrow Lf
  473. batch_info.keys_used[RT_RED+6] = -0x4d; // Arrow Rt
  474. batch_info.keys_used[F1_RED+6] = 0x52; // 0(num)
  475. batch_info.keys_used[F2_RED+6] = 0x53; // .(num)
  476. cal0 = NULL;
  477. cal1 = NULL;
  478. net_game_no = 0;
  479. cd_in = TRUE;
  480. suspend_audio = 0;
  481. reset_league_teams();
  482. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  483. //º º
  484. //º Load DATA.DAT file offset table. º
  485. //º º
  486. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  487. //
  488. // // The following lines check to see if DATA.DAT and DATA.OFF files are on C:
  489. audio_version=TRUE;
  490. InitialiseTimer(); // Initialise timers for sound drivers (see ANDY or LAURENT)..
  491. if (go_audio())
  492. {
  493. UnInitialiseTimer();
  494. bomb_message|= SOUND_ERROR;
  495. }
  496. // Timer stuff
  497. ftick = 0;
  498. tick = 0;
  499. count = 0;
  500. game_speed = REAL_SPEED;
  501. readptr=writeptr= 0;
  502. AddTimer(TIMER_SPEED,nethandler,NetworkHandle);
  503. AddTimer( 63, EUROinterupt, EuroHandle );
  504. claim_key_int();
  505. //----------------------------------------------------------------------------------------------
  506. Set_palette_to_black();
  507. RESET_MEMORY = YES;
  508. OverlayFlag = NULL;
  509. if (newgame==0)
  510. while ( new_menu!=QUIT && new_menu!=NO_MOUSE )
  511. {
  512. return_doskey = FALSE;
  513. if ( RESET_MEMORY==YES )
  514. {
  515. Set_palette_to_black();
  516. // old actua Initialise_environment();
  517. // old actua Allocate_memory();
  518. // OLD ACTUA mbuff.buff_start = (BYTE *)psudo_buffer-4-60;
  519. // old actua sbuff.buff_start = (BYTE *)psudo_buffer-4-60;
  520. //********************************************************************************************************************************
  521. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  522. //º º
  523. //º Euro '96 addition. º
  524. //º º
  525. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  526. // InitialiseSquadPositions();
  527. FrontendBackgroundDEFN.pseudo_start = (BYTE *)EuroBackgroundBuffer;
  528. FrontendPseudoDEFN.pseudo_start = (BYTE *)EuroPseudoBuffer;
  529. Set_640x480_VideoMode();
  530. Set_palette_to_black();
  531. //********************************************************************************************************************************
  532. suspend_audio = 0;
  533. memset( palette_buffer, 0, 768 );
  534. memset( work_buffer, 0, 768 );
  535. RESET_MEMORY = NO;
  536. }
  537. batch_info.PointsForWin = 3;
  538. last_ticks = NULL;
  539. AutoSTARTgame = NULL;
  540. suspend_audio = 0;
  541. RetestNet = FALSE;
  542. //********************************************************************************************************************************
  543. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  544. //º º
  545. //º Euro '96 addition. º
  546. //º º
  547. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  548. //
  549. EUROoveride = 0;
  550. if ( EUROgameType == EURO_wireplay )
  551. {
  552. StartingEURO_96( EUROgameType );
  553. Euro96initialise(); // Initialise game data.
  554. EUROuserSelection = 0;
  555. Menu = PLAYER_SETUP;
  556. EURO_Did_I_ChooseTeams = Yes; // you made team choice.
  557. Team_A = EUROteamA; // Send your choice of teams.
  558. Team_B = EUROteamB; // Send your choice of teams.
  559. SendTeamInfo();
  560. TickPause();
  561. TickPause();
  562. TickPause();
  563. EURO_NetSelectionMade = No; // player selection has not yet been made.
  564. }
  565. //********************************************************************************************************************************
  566. while ( new_menu!=QUIT )
  567. // while ( ChangeMenu!=EXIT_FRONTEND && LogicState!=BLANK_SCREEN ) // new loop.
  568. {
  569. ClearDumpList();
  570. hold_loop = NULL;
  571. while (current_menu==new_menu)
  572. {
  573. do
  574. {
  575. } while (count<TIMER_SPEED/30);
  576. count = 0;
  577. //*********************** NEW EURO '96 FRONTEND LOOP *************************************************************************
  578. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  579. //º º
  580. //º Euro '96 addition. º
  581. //º º
  582. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  583. unsigned short r = GetRnd2();
  584. if ( LogicState == BLANK_SCREEN && ChangeMenu == -2 )
  585. {
  586. OVERRIDEpal1 = 15;
  587. OVERRIDEpal2 = 29;
  588. ResetAnimations();
  589. ResetBoundingBoxes();
  590. SetupExtraTexturePages( Menu );
  591. DisplayBackground( Menu );
  592. OverlayStaticBackgroundImages( Menu );
  593. memcpy( EuroPseudoBuffer, EuroBackgroundBuffer, 307200 );
  594. InitialiseMenuPage( Menu );
  595. svgacpy( (unsigned char *) EuroPseudoBuffer, 0, 0, 640, 480, 640);
  596. EuroTextEditState = 0;
  597. ChangeMenu = -1;
  598. LogicState = PALETTE_FADEUP;
  599. Finish = 0;
  600. }
  601. GetConsoleInput();
  602. ControlAnimations();
  603. Bounding_box = GetBoundingBox( SelectorXcoord, SelectorYcoord );
  604. DoMainScreen( Menu );
  605. DoSquadSelection( Menu, Bounding_box, SelectorXcoord, SelectorYcoord );
  606. DoTeamSelection( Menu, Bounding_box );
  607. DoUserSetup( Menu, Bounding_box );
  608. DoModemSetup( Menu, Bounding_box );
  609. DoNextMatchSelection( Menu, Bounding_box );
  610. EuroReDraw( Menu, Bounding_box );
  611. GroupFixturesPage( Menu, Bounding_box );
  612. DoPlayerStats( Menu, Bounding_box, SelectorXcoord, SelectorYcoord );
  613. DoTeamStats( Menu, Bounding_box, SelectorXcoord, SelectorYcoord );
  614. DoFinalRoundFixtures( Menu, Bounding_box );
  615. if ( EuroTextEditState == 0 )
  616. {
  617. StorePSEUDObuffer( &FrontendPseudoDEFN, &FrontendTextureDEFN, MOUSE_STOREbuff, SelectorXcoord, SelectorYcoord );
  618. DrawIMAGE( &FrontendPseudoDEFN, &FrontendTextureDEFN, MOUSEimages+NoButton,
  619. SelectorXcoord, SelectorYcoord, NO_BOX, spritecopy );
  620. AddToDumpList( SelectorXcoord, SelectorYcoord, Image_Widths[MOUSEimages+NoButton], Image_Heights[MOUSEimages+NoButton] );
  621. }
  622. CopyDumpListToScreen();
  623. if ( EuroTextEditState == 0 )
  624. {
  625. DrawIMAGE( &FrontendPseudoDEFN, &FrontendTextureDEFN, MOUSE_STOREbuff,
  626. SelectorXcoord, SelectorYcoord, NO_BOX, straightcopy );
  627. AddToDumpList( SelectorXcoord, SelectorYcoord, Image_Widths[MOUSEimages+NoButton], Image_Heights[MOUSEimages+NoButton] );
  628. }
  629. ReplaceSquadBuffers( Menu );
  630. // DoStadiumFlythru( Menu );
  631. if ( ChangeMenu != -1 && ChangeMenu < 63 )
  632. {
  633. {
  634. LogicState = PALETTE_FADEDOWN;
  635. ChangeMenu|= 64;
  636. }
  637. }
  638. if ( ChangeMenu >= 64 && LogicState == BLANK_SCREEN )
  639. {
  640. if (EUROgameType==EURO_network_game && (ChangeMenu & 63)==TEAM_SELECT &&
  641. HaveNETteamsBeenChosen() == Yes )
  642. Menu = PLAYER_SETUP;
  643. else
  644. Menu = ChangeMenu & 63;
  645. ChangeMenu = -2;
  646. if ( RunMatch == Yes )
  647. PlayMatch( argc, argv );
  648. }
  649. //*** TEMPORY EXIT TO DOS ********************************************************************************************************
  650. if ( LogicState == RUN_FRONTEND )
  651. {
  652. if (keys[2])
  653. TeamOveride = 1;
  654. if (keys[0x3b])
  655. {
  656. ChangeMenu = EXIT_FRONTEND;
  657. LogicState = PALETTE_FADEDOWN;
  658. }
  659. }
  660. if ( ChangeMenu == EXIT_FRONTEND && LogicState == BLANK_SCREEN )
  661. {
  662. new_menu = QUIT;
  663. }
  664. //********************************************************************************************************************************
  665. hold_loop = NULL;
  666. }
  667. current_menu = new_menu;
  668. rerun_menu = NULL;
  669. }
  670. }
  671. MAJOR_ERROR:;
  672. if (new_menu==QUIT)
  673. {
  674. UnInitEUROnet();
  675. // old actua DeinitialiseNET(Competition_limit); // net game can be played.....
  676. release_key_int();
  677. RemoveTimer(EuroHandle);
  678. RemoveTimer(NetworkHandle);
  679. if (audio_version)
  680. {
  681. UnInitialiseDIGI(); // Uninitialise SOS
  682. if ( batch_info.floppy==YES )
  683. UnInitialiseMIDI();
  684. }
  685. UnInitialiseTimer();
  686. UnInitEUROnet();
  687. // old actua DeinitialiseNET(Competition_limit); // net game can be played.....
  688. union REGS r;
  689. r.x.eax = 0x0003;
  690. int386(0x10, &r, &r);
  691. }
  692. //********************************************************************************************************************************
  693. //ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
  694. //º º
  695. //º Euro '96 addition. º
  696. //º º
  697. //ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
  698. if ( EUROverbose != 0 )
  699. {
  700. printf("\n DEALLOCATING MEMORY BEFORE EXITING TO DOS.\n\n");
  701. fflush(stdout);
  702. }
  703. DeAllocateTexturePages();
  704. DeAllocateDisplayBuffers();
  705. DeAllocateMemory(TextStringMemHandle); // DeAllocates memory used previously for text strings.
  706. //********************************************************************************************************************************
  707. // if ((bomb_message & MOUSE_ERROR)!=0)
  708. // printf ( GetText(MOUSE_ERROR_TEXT) );
  709. // if ((bomb_message & SOUND_ERROR)!=0)
  710. // printf ( GetText(SOUND_ERROR_TEXT) );
  711. // if ((bomb_message & CONFIG_ERROR)!=0)
  712. // printf ( GetText(CONFG_ERROR_TEXT) );
  713. // if ((bomb_message & FILE_ERROR)!=0)
  714. // printf ( GetText(DFILE_ERROR_TEXT) );
  715. // if ((bomb_message & FILE_MISSING)!=0)
  716. // printf ( GetText(MFILE_ERROR_TEXT) );
  717. // if ((bomb_message & MATCH_ERROR)!=0)
  718. // printf ( GetText(INI3d_ERROR_TEXT) );
  719. // if ((bomb_message & MEMORY_PROBLEM)!=0)
  720. // printf ( GetText(MEMOY_ERROR_TEXT) );
  721. // if ((bomb_message & WHEEL_ERROR)!=0)
  722. // printf ( GetText(WHEEL_ERROR_TEXT) );
  723. }
  724. /******************************************************************************
  725. *****************************************************************************/
  726. int go_audio()
  727. {
  728. // Initialise Audio Config...
  729. if ( batch_info.floppy==YES )
  730. {
  731. if(InitialiseMIDI())
  732. return(EXIT_FAILURE);
  733. }
  734. if(InitialiseDIGI(22050,setup.verbose?IDF_VERBOSE:0)) // Initialise Digital Sound Drivers
  735. {
  736. if ( batch_info.floppy==YES )
  737. UnInitialiseMIDI();
  738. return(EXIT_FAILURE);
  739. }
  740. return(FALSE);
  741. }
  742. /******************************************************************************
  743. ******************************************************************************/
  744. //
  745. // Software Piracy Protection Pumpkin Gobbler for ACTUA SOCCER
  746. //
  747. int NumCDdrives;
  748. int FirstCDdrive;
  749. int file=0;
  750. //*************************************************************************************************
  751. //
  752. // Checks for the Actua Soccer CD
  753. //
  754. //*************************************************************************************************
  755. int CDPresent()
  756. {
  757. if ( batch_info.floppy==NO )
  758. {
  759. int i=0;
  760. int CDfound=0;
  761. for(i=0;i<NumCDdrives;i++)
  762. if(!CDfound)
  763. CDfound=CheckCD(FirstCDdrive+i);
  764. return(CDfound);
  765. }
  766. else
  767. return(1); // using floppy version.
  768. }
  769. //*************************************************************************************************
  770. //
  771. // Checks to see if there is a CD Drive connected.
  772. //
  773. // returns TRUE if CD Connected and fills in First CD Drive and NumCDdrives
  774. // FALSE if nothing there
  775. //
  776. //*************************************************************************************************
  777. int GetFirstCDDrive()
  778. {
  779. int drive;
  780. union REGS regs;
  781. regs.w.ax=0x1423;
  782. regs.w.ax+=0xdd; // 0x1500
  783. regs.w.bx=0;
  784. int386(0x2f,&regs,&regs);
  785. if(regs.w.bx)
  786. {
  787. drive = (char)regs.w.cx;
  788. FirstCDdrive=drive;
  789. NumCDdrives=regs.w.bx;
  790. return(0);
  791. }
  792. else
  793. return(1);
  794. }
  795. //*************************************************************************************************
  796. //
  797. // Check for a single file on a drive
  798. //
  799. //*************************************************************************************************
  800. int CheckCD(int CD)
  801. {
  802. char filename[16];
  803. FILE *fp;
  804. filename[0]=CD+'A'; //check the last one we new about
  805. file^=1;
  806. if (match_info.language==English || match_info.language==French || match_info.language==Norwegian)
  807. strcpy(filename+1,file?":\\ACTREND.DAT":":\\DATA.DAT");
  808. if (match_info.language==German)
  809. strcpy(filename+1,file?":\\ACTREND.DAT":":\\RANDATA.DAT");
  810. if (match_info.language==American || match_info.language==Canadian)
  811. strcpy(filename+1,file?":\\ACTREND.DAT":":\\VRDATA.DAT");
  812. if(fp=fopen(filename,"rb"))
  813. {
  814. fread(&filename[0],1,16,fp);
  815. fclose(fp);
  816. return(1);
  817. }
  818. else
  819. return(0);
  820. }
  821. //*************************************************************************************************
  822. //
  823. // Critical Error Handle for Disk Errors
  824. //
  825. //*************************************************************************************************
  826. int __far criticalhandler(unsigned deverror,unsigned errcode, unsigned __far * devhdr)
  827. {
  828. return(_HARDERR_FAIL);
  829. }
  830. int InsertKey(int SourceKEY)
  831. {
  832. if (SourceKEY>127)
  833. {
  834. SourceKEY-= 128;
  835. SourceKEY= -SourceKEY;
  836. }
  837. return (SourceKEY);
  838. }
  839. //void SearchForVIDEOmode()
  840. //{
  841. // char testgdv[128];
  842. // strcpy (testgdv,SourcePath);
  843. // strcat (testgdv,"\\VIDEO\\swhole_s.gdv");
  844. // GDVavailable = DoesFILEexist(testgdv);
  845. // if (match_info.language==German)
  846. // GDVavailable = 1;
  847. // strcpy (testgdv,SourcePath);
  848. // if (match_info.language==English || match_info.language==French || match_info.language==Norwegian)
  849. // strcat (testgdv,"\\VIDEO\\sfull_s.gdv");
  850. // if (match_info.language==German)
  851. // strcat (testgdv,"\\VIDEO\\dssintro.gdv");
  852. // if (match_info.language==American || match_info.language==Canadian)
  853. // strcat (testgdv,"\\VIDEO\\sfull_s.gdv");
  854. //
  855. // StartGDVavailable = 1; //DoesFILEexist(testgdv);
  856. //
  857. // if (StartGDVavailable==0 || batch_info.GDVres==LO)
  858. // {
  859. // strcpy (testgdv,DestinationPath);
  860. //
  861. // if (match_info.language==English || match_info.language==French || match_info.language==Norwegian)
  862. // strcat (testgdv,"\\VIDEO\\vfull_s.gdv");
  863. // if (match_info.language==German)
  864. // strcat (testgdv,"\\VIDEO\\dvsintro.gdv");
  865. // if (match_info.language==American || match_info.language==Canadian)
  866. // strcat (testgdv,"\\VIDEO\\vfull_s.gdv");
  867. //
  868. // StartGDVavailable = DoesFILEexist(testgdv);
  869. //
  870. //
  871. // if (StartGDVavailable==0 && batch_info.floppy==NO)
  872. // bomb_message|= FILE_MISSING;
  873. // }
  874. //
  875. // if ( setup.verbose!=NULL && GDVavailable==NULL)
  876. // printf ("THE MAKING OF ACTUA MOVIE IS MISSING FROM SOURCE PATH...\n");
  877. // if ( setup.verbose!=NULL && StartGDVavailable==NULL)
  878. // printf ("THE ACTUA INTRO GDV IS MISSING FROM SOURCE PATH...\n");
  879. //
  880. //
  881. //
  882. //
  883. //
  884. //
  885. // DisplayWidth = 640;
  886. //
  887. // // checks for GDV mode, only if GDV is on CD.
  888. //
  889. // if (GDVavailable!=NULL)
  890. // {
  891. // testVESA = 1;
  892. // VIDEOstatus = VESAmode( &GDVvidmode[0] );
  893. // }
  894. //
  895. //// if (VIDEOstatus==-1 || GDVavailable==NULL)
  896. //// batch_info.GDVres=LO;
  897. //
  898. // // setup the video mode, mode 101 (640x480).
  899. //
  900. // testVESA = 1;
  901. // VIDEOstatus = VESAmode( &MENUvidmode[0] );
  902. //
  903. // if (VIDEOstatus == -1)
  904. // match_info.menu_res=LO;
  905. //}
  906. //void InitialiseCodeWheel()
  907. //{
  908. // CursorXposn = 0;
  909. // WheelOuter = (Random_RS()&15);
  910. // WheelInner = (Random_RS()&15);
  911. // WindowNumber = (Random_RS()&31);
  912. // wheelgoes++;
  913. //
  914. // char legal_manual = FALSE;
  915. //
  916. // while ( legal_manual==FALSE )
  917. // {
  918. // german_man = (Random_RS()&63);
  919. // if ( german_man<50 )
  920. // legal_manual = TRUE;
  921. // }
  922. //}