EURO_GDV.CPP 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /**********************************************************************
  2. *
  3. * GDV.CPP
  4. *
  5. *
  6. * Summary: Play a GDV file
  7. *
  8. * Author: Kevin Dudley / Tony Crowther / Graeme Ing
  9. *
  10. * Project: Normality Inc PC
  11. *
  12. * Dated: 1527995 Wednesday 27-9-1995 15:59.
  13. *
  14. **********************************************************************/
  15. #include <iostream.h>
  16. #include <stdlib.h>
  17. #include <stdio.h>
  18. #include <graph.h>
  19. #include <i86.h>
  20. #include <dos.h>
  21. #include <conio.h>
  22. #include <float.h>
  23. #include <time.h>
  24. #include <math.h>
  25. #include <string.h>
  26. #include "defines.h"
  27. #include "data.equ"
  28. #include "3deng.h"
  29. #include "menu.h"
  30. #include "video.h"
  31. #include "vesa.h"
  32. #include "unmangle.h"
  33. #include "memory.h"
  34. #include "gamedata.h"
  35. #include "config.h"
  36. #include "sos.h"
  37. #include "timer.h"
  38. #include "digi.h"
  39. #include "midi.h"
  40. #include "playdam.h" // Structure Definitions for Digital Video
  41. #include "playcall.h" // Call Defininitions for Digital Video
  42. #include "animlink.h"
  43. #include "calldef.h"
  44. #include "memstruc.h"
  45. #include "rothlink.h"
  46. #include "mallocx.h"
  47. #include "control.h"
  48. #include "eurodefs.h"
  49. #include "euro_fxd.h"
  50. #include "euro.equ"
  51. #include "euro_sym.h"
  52. #include "euro_def.h"
  53. #include "euro_var.h"
  54. #include "euro_grf.h"
  55. #include "euro_dsk.h"
  56. #include "euro_fix.h"
  57. #include "euro_sel.h"
  58. #include "euro_inf.h"
  59. #include "euro_cnt.h"
  60. #include "euro_usr.h"
  61. #include "euro_net.h"
  62. #define GDV_MEM 512*1024
  63. #define GDV_ABORT 0x01
  64. #define GDV_LOOP 0x08
  65. #define DEFAULT_FADEIN 0
  66. #define DEFAULT_FADEOUT 0
  67. #define DEFAULT_DELAYEXIT 25
  68. extern "C" volatile int count;
  69. extern int testVESA;
  70. extern int VESAmode(int *);
  71. extern int gdv_gran;
  72. extern "C" volatile char keys[256];
  73. extern char return_doskey;
  74. extern BYTE palette_buffer[];
  75. extern BYTE work_buffer[768];
  76. extern ModeInfoBlock *vmode_inf;
  77. char out;
  78. BYTE presents[]={
  79. 0x3F,0x33,0x00,0x3F,0x33,0x0C,0x3F,0x33,0x19,0x3F,0x3F,0x26,
  80. };
  81. //---------------------------------------------------
  82. long int GDVCallbackRoutine(long int mode,void *header,void *data,short int frame)
  83. //---------------------------------------------------
  84. //********************************************************************************************************************************
  85. // Callback generated by GDV player.
  86. // Test for abort GDV.
  87. //********************************************************************************************************************************
  88. {
  89. // Get_mouse_data(); // reads mouse data and erases last displayed mouse cursor.
  90. //
  91. // StorePSEUDObuffer( &FrontendPseudoDEFN, &FrontendTextureDEFN,
  92. // MOUSE_STOREbuff, MouseXposn, MouseYposn );
  93. // DrawIMAGE( &FrontendPseudoDEFN, &FrontendTextureDEFN, MOUSEimages+NoButton,
  94. // MouseXposn, MouseYposn, NO_BOX, spritecopy );
  95. // AddToDumpList( MouseXposn, MouseYposn, Image_Widths[MOUSEimages+NoButton], Image_Heights[MOUSEimages+NoButton]);
  96. // CopyDumpListToScreen();
  97. // DrawIMAGE( &FrontendPseudoDEFN, &FrontendTextureDEFN, MOUSE_STOREbuff,
  98. // MouseXposn, MouseYposn, NO_BOX, straightcopy );
  99. // AddToDumpList( MouseXposn, MouseYposn, Image_Widths[MOUSEimages+NoButton], Image_Heights[MOUSEimages+NoButton]);
  100. //
  101. if (mode == CBM_LookForAbort && (keys[1]) )
  102. {
  103. ChangeMenu = MAIN;
  104. return(CBX_Abort);
  105. }
  106. else
  107. return(CBX_Normal);
  108. }
  109. //********************************************************************************************************************************
  110. void PlayGDV()
  111. {
  112. char file[128];
  113. unsigned char *mem;
  114. unsigned long int Error;
  115. _PlayAnimBlock PlayBlock = { 0 };
  116. mem=(unsigned char *)mallocx(GDV_MEM); // allocate mem for player
  117. if (mem == 0)
  118. return;
  119. memset( mem, 0, GDV_MEM );
  120. strcpy (file, EuroGDVfile);
  121. PlayBlock.FileName = &file[0];
  122. PlayBlock.Flags = NULL;
  123. PlayBlock.Screen = 0x110;
  124. PlayBlock.ScreenXSize = 640;
  125. PlayBlock.ScreenYSize = 480;
  126. PlayBlock.ScreenGran = 0;
  127. if (SoundCard==0)
  128. PlayBlock.Flags|= PAF_NoAudio;
  129. PlayBlock.CallBack = &GDVCallbackRoutine;
  130. PlayBlock.DrvPath="DIGI\\";
  131. PlayBlock.MemBlock=mem;
  132. PlayBlock.MemBlockSize=GDV_MEM;
  133. if (SoundCard==0)
  134. PlayBlock.Flags|= PAF_NoAudio;
  135. else
  136. PlayBlock.DIGIHandle_SOS=DIGIDriverHandle;
  137. PlayBlock.DriveCap_SOS=&DIGICapabilities;
  138. PlayBlock.SNDID=SoundCard;
  139. PlayBlock.SNDPort=SoundPort;
  140. PlayBlock.SNDIRQ=SoundIRQ;
  141. PlayBlock.SNDDMA=SoundDMA;
  142. PlayBlock.SNDPara=0;
  143. if(!(Error=InitAnim(&PlayBlock)))
  144. {
  145. Error=StartAnim(&PlayBlock);
  146. CloseAnim(&PlayBlock);
  147. }
  148. freex(mem);
  149. }
  150. //********************************************************************************************************************************
  151. // PlaySample routines to link with Tony's ROTH sample stuff!
  152. //********************************************************************************************************************************
  153. extern WORD PlaySample (_SOS_START_SAMPLE *mysample, void (far cdecl*callback)(WORD,WORD,WORD))
  154. {
  155. mysample->lpCallback=(void cdecl (far*)(WORD,WORD,WORD))callback;
  156. return (sosDIGIStartSample( DIGIDriverHandle, mysample));
  157. } /* PlaySample */
  158. extern WORD StopPlaySample (WORD handle)
  159. {
  160. return (sosDIGIStopSample( DIGIDriverHandle, handle));
  161. }
  162. extern WORD ChangeSampleVol (WORD handle,int vol)
  163. {
  164. return (sosDIGISetSampleVolume( DIGIDriverHandle, handle,vol));
  165. }
  166. extern WORD ChangeSamplePan (WORD handle,int pan)
  167. {
  168. return (sosDIGISetPanLocation( DIGIDriverHandle, handle,pan));
  169. }
  170. //********************************************************************************************************************************
  171. void DoStadiumFlythru( char MENU )
  172. {
  173. if ( MENU == VENUE_FLYTHRU && LogicState == RUN_FRONTEND)
  174. PlayGDV();
  175. }
  176. //********************************************************************************************************************************