1 
2 extern "C"
3 {
4 	#include "3dc.h"
5 	#include "inline.h"
6 	//#include "smacker.h"
7 	#include "avp_menus.h"
8     #include "avp_intro.h"
9 	extern int NormalFrameTime;
10 	extern unsigned char GotAnyKey;
11 	extern int DebouncedGotAnyKey;
12 	extern SCREENDESCRIPTORBLOCK ScreenDescriptorBlock;
13 	extern AVPMENUGFX AvPMenuGfxStorage[];
14 extern void DirectReadKeyboard(void);
15 
16 
17 static int IntroHasAlreadyBeenPlayed = 1;
18 
19 
20 void Show_CopyrightInfo(void);
21 void Show_Presents(void);
22 void Show_ARebellionGame(void);
23 void Show_AvPLogo(void);
24 extern void ShowSplashScreens(void);
25 extern void Show_WinnerScreen(void);
26 extern void PlayBinkedFMV(char *filenamePtr);
27 extern void DrawMainMenusBackdrop(void);
28 extern void FadedScreen(int alpha);
29 
StartMenuMusic(void)30 void StartMenuMusic(void)
31 {
32 }
33 
PlayMenuMusic(void)34 void PlayMenuMusic(void)
35 {
36 }
37 
EndMenuMusic(void)38 void EndMenuMusic(void)
39 {
40 }
41 
WeWantAnIntro(void)42 void WeWantAnIntro(void)
43 {
44 	IntroHasAlreadyBeenPlayed = 0;
45 }
46 
47 
PlayIntroSequence(void)48 extern void PlayIntroSequence(void)
49 {
50 	if (IntroHasAlreadyBeenPlayed)
51 	{
52 		StartMenuMusic();
53 		return;
54 	}
55 	IntroHasAlreadyBeenPlayed=1;
56 
57 	ResetFrameCounter();
58 	Show_CopyrightInfo();
59 
60 	/* play the Fox Interactive FMV */
61 	ClearScreenToBlack();
62 	FlipBuffers();
63 	ClearScreenToBlack();
64 
65 	//PlayBinkedFMV("FMVs/logos.bik");
66 	//PlayFMV("FMVs/rebellion.smk");
67 
68 	StartMenuMusic();
69 	ResetFrameCounter();
70 
71 	Show_Presents();
72 	#if ALLOW_SKIP_INTRO
73 	if (!GotAnyKey) Show_ARebellionGame();
74 	if (!GotAnyKey) Show_AvPLogo();
75 	#else
76 	Show_ARebellionGame();
77 	Show_AvPLogo();
78 	#endif
79 
80 }
ShowSplashScreens(void)81 extern void ShowSplashScreens(void)
82 {
83 	LoadAllSplashScreenGfx();
84 	int i;
85 	enum AVPMENUGFX_ID graphic[] =
86 	{
87 		AVPMENUGFX_SPLASH_SCREEN1,AVPMENUGFX_SPLASH_SCREEN2,AVPMENUGFX_SPLASH_SCREEN3,
88 		AVPMENUGFX_SPLASH_SCREEN4,AVPMENUGFX_SPLASH_SCREEN5,
89 	};
90 	for (i=0; i<5; i++)
91 	{
92 		int timeRemaining = 5*ONE_FIXED;
93 		do
94 		{
95 			int a = timeRemaining*2;
96 			if (a>ONE_FIXED) a=ONE_FIXED;
97 
98 			if (i!=4)
99 			{
100 			  	DrawAvPMenuGfx_CrossFade(graphic[i],graphic[i+1], a);
101 				timeRemaining-=NormalFrameTime;
102 			}
103 			else
104 			{
105 				if (a==ONE_FIXED)
106 				{
107 				  	DrawAvPMenuGfx(graphic[i], 0, 0, ONE_FIXED+1,AVPMENUFORMAT_LEFTJUSTIFIED);
108 				}
109 				else
110 				{
111 				  	DrawAvPMenuGfx_Faded(graphic[i], 0, 0, a,AVPMENUFORMAT_LEFTJUSTIFIED);
112 				}
113 				timeRemaining-=NormalFrameTime/2;
114 			}
115 			CheckForWindowsMessages();
116 			FlipBuffers();
117 
118 		  	DirectReadKeyboard();
119 			FrameCounterHandler();
120 		}
121 		while(timeRemaining>=0 && !DebouncedGotAnyKey);
122 	}
123 	ClearScreenToBlack();
124 	FlipBuffers();
125 	ClearScreenToBlack();
126 	FlipBuffers();
127 
128 }
Show_WinnerScreen(void)129 extern void Show_WinnerScreen(void)
130 {
131 	LoadAvPMenuGfx(AVPMENUGFX_WINNER_SCREEN);
132 
133 	int timeRemaining = 10*ONE_FIXED;
134 	do
135 	{
136 		int a = timeRemaining*2;
137 		if (a>ONE_FIXED)
138 		{
139 		  	DrawAvPMenuGfx(AVPMENUGFX_WINNER_SCREEN, 0, 0, ONE_FIXED+1,AVPMENUFORMAT_LEFTJUSTIFIED);
140 		}
141 		else
142 		{
143 		  	DrawAvPMenuGfx_Faded(AVPMENUGFX_WINNER_SCREEN, 0, 0, a,AVPMENUFORMAT_LEFTJUSTIFIED);
144 		}
145 
146 		CheckForWindowsMessages();
147 		FlipBuffers();
148 
149 	  	DirectReadKeyboard();
150 		FrameCounterHandler();
151 		timeRemaining-=NormalFrameTime;
152 	}
153 	while(timeRemaining>=0 && !DebouncedGotAnyKey);
154 	ClearScreenToBlack();
155 	FlipBuffers();
156 	ClearScreenToBlack();
157 	FlipBuffers();
158 
159 }
160 
Show_CopyrightInfo(void)161 void Show_CopyrightInfo(void)
162 {
163 	int timeRemaining = ONE_FIXED/2;
164 	do
165 	{
166 		CheckForWindowsMessages();
167 		{
168 			DrawAvPMenuGfx_Faded(AVPMENUGFX_COPYRIGHT_SCREEN, 0, 0, ONE_FIXED-timeRemaining*2,AVPMENUFORMAT_LEFTJUSTIFIED);
169 			FlipBuffers();
170 		}
171 		FrameCounterHandler();
172 		timeRemaining-=NormalFrameTime;
173 	}
174 	while(timeRemaining>0);
175 
176 	timeRemaining = ONE_FIXED*2;
177 	do
178 	{
179 		CheckForWindowsMessages();
180 		{
181 			DrawAvPMenuGfx_Faded(AVPMENUGFX_COPYRIGHT_SCREEN, 0, 0, ONE_FIXED,AVPMENUFORMAT_LEFTJUSTIFIED);
182 			FlipBuffers();
183 		}
184 		FrameCounterHandler();
185 		timeRemaining-=NormalFrameTime;
186 	}
187 	while(timeRemaining>0);
188 
189 	timeRemaining = ONE_FIXED/2;
190 	do
191 	{
192 		CheckForWindowsMessages();
193 		{
194 			DrawAvPMenuGfx_Faded(AVPMENUGFX_COPYRIGHT_SCREEN, 0, 0, timeRemaining*2,AVPMENUFORMAT_LEFTJUSTIFIED);
195 			FlipBuffers();
196 		}
197 		FrameCounterHandler();
198 		timeRemaining-=NormalFrameTime;
199 	}
200 	while(timeRemaining>0);
201 }
202 
Show_Presents(void)203 void Show_Presents(void)
204 {
205 	int timeRemaining = 8*ONE_FIXED-ONE_FIXED/2;
206 	do
207 	{
208 		CheckForWindowsMessages();
209 		{
210 			char *textPtr = GetTextString(TEXTSTRING_FOXINTERACTIVE);
211 			int y = (480-AvPMenuGfxStorage[AVPMENUGFX_PRESENTS].Height)/2;
212 			PlayMenuMusic();
213 			DrawMainMenusBackdrop();
214 
215 			if (timeRemaining > 6*ONE_FIXED)
216 			{
217 			  //	DrawGraphicWithFadingLevel(&Starfield_Backdrop,timeRemaining-7*ONE_FIXED);
218 //				DrawAvPMenuGfx_Faded(AVPMENUGFX_BACKDROP, 0, 0, 15*ONE_FIXED-timeRemaining*2,AVPMENUFORMAT_LEFTJUSTIFIED);
219 				FadedScreen((15*ONE_FIXED-timeRemaining*2)/3);
220 			}
221 			else if (timeRemaining > 5*ONE_FIXED)
222 			{
223 				RenderMenuText(textPtr,MENU_CENTREX,y,6*ONE_FIXED-timeRemaining,AVPMENUFORMAT_CENTREJUSTIFIED);
224 			}
225 			else if (timeRemaining > 4*ONE_FIXED)
226 			{
227 				RenderMenuText(textPtr,MENU_CENTREX,y,ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED);
228 			}
229 			else if (timeRemaining > 3*ONE_FIXED)
230 			{
231 				RenderMenuText(textPtr,MENU_CENTREX,y,timeRemaining-3*ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED);
232 			}
233 
234 			FlipBuffers();
235 		}
236 		#if ALLOW_SKIP_INTRO
237 		DirectReadKeyboard();
238 		#endif
239 		FrameCounterHandler();
240 		timeRemaining-=NormalFrameTime;
241 	}
242 	#if ALLOW_SKIP_INTRO
243 	while((timeRemaining>0) && !GotAnyKey);
244 	#else
245 	while(timeRemaining>0);// && !GotAnyKey);
246 	#endif
247 }
248 
Show_ARebellionGame(void)249 void Show_ARebellionGame(void)
250 {
251 	int timeRemaining = 7*ONE_FIXED;
252 	do
253 	{
254 		CheckForWindowsMessages();
255 		{
256 			char *textPtr = GetTextString(TEXTSTRING_PRESENTS);
257 			int y = (480-AvPMenuGfxStorage[AVPMENUGFX_AREBELLIONGAME].Height)/2;
258 			DrawMainMenusBackdrop();
259 //			DrawAvPMenuGfx(AVPMENUGFX_BACKDROP, 0, 0, ONE_FIXED+1,AVPMENUFORMAT_LEFTJUSTIFIED);
260 			PlayMenuMusic();
261 
262 			if (timeRemaining > 13*ONE_FIXED/2)
263 			{
264 //				DrawAvPMenuGfx(AVPMENUGFX_AREBELLIONGAME, MENU_CENTREX, y, 14*ONE_FIXED-timeRemaining*2,AVPMENUFORMAT_CENTREJUSTIFIED);
265 				RenderMenuText(textPtr,MENU_CENTREX,y,14*ONE_FIXED-timeRemaining*2,AVPMENUFORMAT_CENTREJUSTIFIED);
266 //				DrawGraphicWithAlphaChannel(&RebellionLogo,timeRemaining*2-13*ONE_FIXED);
267  			}
268 			else if (timeRemaining > 5*ONE_FIXED)
269 			{
270 //				DrawAvPMenuGfx(AVPMENUGFX_AREBELLIONGAME, MENU_CENTREX, y, ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED);
271 				RenderMenuText(textPtr,MENU_CENTREX,y,ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED);
272 //				DrawGraphicWithAlphaChannel(&RebellionLogo,0);
273 			}
274 			else if (timeRemaining > 3*ONE_FIXED)
275 			{
276 //				DrawAvPMenuGfx(AVPMENUGFX_AREBELLIONGAME, MENU_CENTREX, y, (timeRemaining-3*ONE_FIXED)/2,AVPMENUFORMAT_CENTREJUSTIFIED);
277 				RenderMenuText(textPtr,MENU_CENTREX,y,(timeRemaining-3*ONE_FIXED)/2,AVPMENUFORMAT_CENTREJUSTIFIED);
278 //				DrawGraphicWithAlphaChannel(&RebellionLogo, ONE_FIXED - (timeRemaining-3*ONE_FIXED)/2);
279 			}
280 
281 			FlipBuffers();
282 		}
283 		DirectReadKeyboard();
284 		FrameCounterHandler();
285 		timeRemaining-=NormalFrameTime;
286 	}
287 	#if ALLOW_SKIP_INTRO
288 	while((timeRemaining>0) && !GotAnyKey);
289 	#else
290 	while(timeRemaining>0);// && !GotAnyKey);
291 	#endif
292 }
Show_AvPLogo(void)293 void Show_AvPLogo(void)
294 {
295 	int timeRemaining = 5*ONE_FIXED;
296 	do
297 	{
298 		CheckForWindowsMessages();
299 		{
300 			int y = (480-AvPMenuGfxStorage[AVPMENUGFX_ALIENSVPREDATOR].Height)/2;
301 			DrawMainMenusBackdrop();
302 //			DrawAvPMenuGfx(AVPMENUGFX_BACKDROP, 0, 0, ONE_FIXED+1,AVPMENUFORMAT_LEFTJUSTIFIED);
303 			PlayMenuMusic();
304 
305 			if (timeRemaining > 9*ONE_FIXED/2)
306 			{
307 				DrawAvPMenuGfx(AVPMENUGFX_ALIENSVPREDATOR, MENU_CENTREX, y, -timeRemaining*2+10*ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED);
308  			}
309 			else if (timeRemaining > 4*ONE_FIXED)
310 			{
311 				DrawAvPMenuGfx(AVPMENUGFX_ALIENSVPREDATOR, MENU_CENTREX, y, ONE_FIXED,AVPMENUFORMAT_CENTREJUSTIFIED);
312 			}
313 			else
314 			{
315 				DrawAvPMenuGfx(AVPMENUGFX_ALIENSVPREDATOR, MENU_CENTREX, y, timeRemaining/4,AVPMENUFORMAT_CENTREJUSTIFIED);
316 				timeRemaining-=NormalFrameTime/4;
317 			}
318 
319 			FlipBuffers();
320 		}
321 		DirectReadKeyboard();
322 		FrameCounterHandler();
323 		timeRemaining-=NormalFrameTime;
324 	}
325 	#if ALLOW_SKIP_INTRO
326 	while((timeRemaining>0) && !GotAnyKey);
327 	#else
328 	while(timeRemaining>0);// && !GotAnyKey);
329 	#endif
330 }
331 
332 };
333 
334