-
Notifications
You must be signed in to change notification settings - Fork 1
/
euro_gdv.cpp
212 lines (171 loc) · 6.08 KB
/
euro_gdv.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
/**********************************************************************
*
* GDV.CPP
*
*
* Summary: Play a GDV file
*
* Author: Kevin Dudley / Tony Crowther / Graeme Ing
*
* Project: Normality Inc PC
*
* Dated: 1527995 Wednesday 27-9-1995 15:59.
*
**********************************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <float.h>
#include <time.h>
#include <math.h>
#include <string.h>
#include "config.h"
//#include "sos.h"
#include "timer.h"
#include "digi.h"
#include "midi.h"
#include "playdam.h" // Structure Definitions for Digital Video
#include "playcall.h" // Call Defininitions for Digital Video
#include "mallocx.h"
#include "control.h"
#include "eurodefs.h"
#include "euro_fxd.h"
#include "euro.equ"
#include "euro_sym.h"
#include "euro_def.h"
#include "euro_var.h"
#include "euro_grf.h"
#include "euro_dsk.h"
#include "euro_fix.h"
#include "euro_sel.h"
#include "euro_inf.h"
#include "euro_cnt.h"
#include "euro_usr.h"
#include "euro_net.h"
#include "defines.h"
#include "data.equ"
#include "3deng.h"
#include "menu.h"
#include "video.h"
#include "vesa.h"
#include "unmangle.h"
#include "memory.h"
#include "gamedata.h"
#define GDV_MEM 512*1024
#define GDV_ABORT 0x01
#define GDV_LOOP 0x08
#define DEFAULT_FADEIN 0
#define DEFAULT_FADEOUT 0
#define DEFAULT_DELAYEXIT 25
extern "C" volatile int count;
extern int VESAmode(int *);
extern int gdv_gran;
extern "C" volatile char keys[256];
extern char return_doskey;
extern BYTE palette_buffer[];
extern BYTE work_buffer[768];
extern ModeInfoBlock *vmode_inf;
char out;
BYTE presents[] = {
0x3F, 0x33, 0x00, 0x3F, 0x33, 0x0C, 0x3F, 0x33, 0x19, 0x3F, 0x3F, 0x26,
};
//---------------------------------------------------
long int GDVCallbackRoutine(long int mode, void *header, void *data, short int frame)
//---------------------------------------------------
//********************************************************************************************************************************
// Callback generated by GDV player.
// Test for abort GDV.
//********************************************************************************************************************************
{
// Get_mouse_data(); // reads mouse data and erases last displayed mouse cursor.
//
// StorePSEUDObuffer( &FrontendPseudoDEFN, &FrontendTextureDEFN,
// MOUSE_STOREbuff, MouseXposn, MouseYposn );
// DrawIMAGE( &FrontendPseudoDEFN, &FrontendTextureDEFN, MOUSEimages+NoButton,
// MouseXposn, MouseYposn, NO_BOX, spritecopy );
// AddToDumpList( MouseXposn, MouseYposn, Image_Widths[MOUSEimages+NoButton], Image_Heights[MOUSEimages+NoButton]);
// CopyDumpListToScreen();
// DrawIMAGE( &FrontendPseudoDEFN, &FrontendTextureDEFN, MOUSE_STOREbuff,
// MouseXposn, MouseYposn, NO_BOX, straightcopy );
// AddToDumpList( MouseXposn, MouseYposn, Image_Widths[MOUSEimages+NoButton], Image_Heights[MOUSEimages+NoButton]);
//
if (mode == CBM_LookForAbort && (keys[1])) {
ChangeMenu = MAIN;
return (CBX_Abort);
} else
return (CBX_Normal);
}
//********************************************************************************************************************************
void PlayGDV() {
#ifdef IMPLEMENT_ME
char file[128];
unsigned char *mem;
unsigned long int Error;
_PlayAnimBlock PlayBlock = {0};
mem = (unsigned char *) malloc(GDV_MEM); // allocate mem for player
if (mem == 0)
return;
memset(mem, 0, GDV_MEM);
strcpy(file, EuroGDVfile);
PlayBlock.FileName = &file[0];
PlayBlock.Flags = 0;
PlayBlock.Screen = 0x110;
PlayBlock.ScreenXSize = 640;
PlayBlock.ScreenYSize = 480;
PlayBlock.ScreenGran = 0;
if (SoundCard == 0)
PlayBlock.Flags |= PAF_NoAudio;
PlayBlock.CallBack = &GDVCallbackRoutine;
PlayBlock.DrvPath = (char *) "DIGI\\";
PlayBlock.MemBlock = mem;
PlayBlock.MemBlockSize = GDV_MEM;
if (SoundCard == 0)
PlayBlock.Flags |= PAF_NoAudio;
#ifdef IMPLEMENT_ME
else
PlayBlock.DIGIHandle_SOS=DIGIDriverHandle;
PlayBlock.DriveCap_SOS=&DIGICapabilities;
#endif
PlayBlock.SNDID = SoundCard;
PlayBlock.SNDPort = SoundPort;
PlayBlock.SNDIRQ = SoundIRQ;
PlayBlock.SNDDMA = SoundDMA;
PlayBlock.SNDPara = 0;
if (!(Error = (unsigned long) InitAnim(&PlayBlock))) {
Error = (unsigned long) StartAnim(&PlayBlock);
CloseAnim(&PlayBlock);
}
free(mem);
#endif
}
//********************************************************************************************************************************
// PlaySample routines to link with Tony's ROTH sample stuff!
//********************************************************************************************************************************
#ifdef IMPLEMENT_ME
extern WORD PlaySample (_SOS_START_SAMPLE *mysample, void (*callback)(WORD,WORD,WORD))
{
#ifdef IMPLEMENT_ME
mysample->lpCallback=(void cdecl (far*)(WORD,WORD,WORD))callback;
return (sosDIGIStartSample( DIGIDriverHandle, mysample));
#else
return 0;
#endif
} /* PlaySample */
extern WORD StopPlaySample (WORD handle)
{
return (sosDIGIStopSample( DIGIDriverHandle, handle));
}
extern WORD ChangeSampleVol (WORD handle,int vol)
{
return (sosDIGISetSampleVolume( DIGIDriverHandle, handle,vol));
}
extern WORD ChangeSamplePan (WORD handle,int pan)
{
return (sosDIGISetPanLocation( DIGIDriverHandle, handle,pan));
}
#endif
//********************************************************************************************************************************
void DoStadiumFlythru(char MENU) {
if (MENU == VENUE_FLYTHRU && LogicState == RUN_FRONTEND)
PlayGDV();
}
//********************************************************************************************************************************