Commit 65d7dc44 authored by Steven Fuller's avatar Steven Fuller

Got wl_menu.c done

parent 9520fb90
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <values.h> #include <values.h>
#include <sys/types.h> #include <sys/types.h>
#include <glob.h>
#include "misc.h" #include "misc.h"
......
...@@ -1550,8 +1550,8 @@ void CopyProtection(void) ...@@ -1550,8 +1550,8 @@ void CopyProtection(void)
US_LineInput(PrintX,PrintY,inputbuffer,nil,true,20,100); US_LineInput(PrintX,PrintY,inputbuffer,nil,true,20,100);
match = 0; match = 0;
for (i=0;i<_fstrlen(bossstrs[whichboss]);i++) for (i=0;i<strlen(bossstrs[whichboss]);i++)
if (!_fstrnicmp(inputbuffer,bossstrs[whichboss]+i,strlen(inputbuffer)) && if (!strnicmp(inputbuffer,bossstrs[whichboss]+i,strlen(inputbuffer)) &&
strlen(inputbuffer)>3) strlen(inputbuffer)>3)
match = 1; match = 1;
...@@ -1569,9 +1569,9 @@ void CopyProtection(void) ...@@ -1569,9 +1569,9 @@ void CopyProtection(void)
PrintY += 25; PrintY += 25;
US_CPrint(STR_MAN1); US_CPrint(STR_MAN1);
US_CPrint(STR_MAN2); US_CPrint(STR_MAN2);
_fstrcpy(message,STR_MAN3" \""); strcpy(message,STR_MAN3" \"");
_fstrcat(message,WordStr[whichword]); strcat(message,WordStr[whichword]);
_fstrcat(message,"\" "STR_MAN4); strcat(message,"\" "STR_MAN4);
US_CPrint(message); US_CPrint(message);
VW_UpdateScreen(); VW_UpdateScreen();
VW_FadeIn(); VW_FadeIn();
...@@ -1584,7 +1584,7 @@ void CopyProtection(void) ...@@ -1584,7 +1584,7 @@ void CopyProtection(void)
US_LineInput(PrintX,PrintY,inputbuffer,nil,true,6,100); US_LineInput(PrintX,PrintY,inputbuffer,nil,true,6,100);
strlwr(inputbuffer); strlwr(inputbuffer);
match = 1-(_fstrcmp(inputbuffer,WordCorrect[whichword])!=0); match = 1-(strcmp(inputbuffer,WordCorrect[whichword])!=0);
match += BackDoor(inputbuffer); match += BackDoor(inputbuffer);
break; break;
...@@ -1611,8 +1611,8 @@ void CopyProtection(void) ...@@ -1611,8 +1611,8 @@ void CopyProtection(void)
strlwr(inputbuffer); strlwr(inputbuffer);
match = 0; match = 0;
for (i=0;i<_fstrlen(MemberCorrect[whichmem]);i++) for (i=0;i<strlen(MemberCorrect[whichmem]);i++)
if (!_fstrnicmp(inputbuffer,MemberCorrect[whichmem]+i,strlen(inputbuffer)) && if (!strnicmp(inputbuffer,MemberCorrect[whichmem]+i,strlen(inputbuffer)) &&
strlen(inputbuffer)>2) strlen(inputbuffer)>2)
match = 1; match = 1;
match += BackDoor(inputbuffer); match += BackDoor(inputbuffer);
...@@ -1641,7 +1641,7 @@ void CopyProtection(void) ...@@ -1641,7 +1641,7 @@ void CopyProtection(void)
US_LineInput(PrintX,PrintY,inputbuffer,nil,true,6,100); US_LineInput(PrintX,PrintY,inputbuffer,nil,true,6,100);
strlwr(inputbuffer); strlwr(inputbuffer);
match = 1-(_fstrcmp(inputbuffer,MiscCorrect[whichone])!=0); match = 1-(strcmp(inputbuffer,MiscCorrect[whichone])!=0);
match += BackDoor(inputbuffer); match += BackDoor(inputbuffer);
break; break;
} }
...@@ -1693,10 +1693,7 @@ void CopyProtection(void) ...@@ -1693,10 +1693,7 @@ void CopyProtection(void)
ClearMemory(); ClearMemory();
ShutdownId(); ShutdownId();
_fstrcpy(message,DosMessages[US_RndT()%9]); strcpy(message,DosMessages[US_RndT()%9]);
_AX = 3;
geninterrupt(0x10);
printf("%s\n",message); printf("%s\n",message);
exit(1); exit(1);
......
...@@ -511,12 +511,10 @@ void US_ControlPanel(byte scancode) ...@@ -511,12 +511,10 @@ void US_ControlPanel(byte scancode)
// //
if (startgame || loadedgame) if (startgame || loadedgame)
{ {
#pragma warn -sus
MainMenu[viewscores].routine = NULL; MainMenu[viewscores].routine = NULL;
#ifndef JAPAN #ifndef JAPAN
_fstrcpy(MainMenu[viewscores].string,STR_EG); strcpy(MainMenu[viewscores].string,STR_EG);
#endif #endif
#pragma warn +sus
} }
// RETURN/START GAME EXECUTION // RETURN/START GAME EXECUTION
...@@ -558,9 +556,9 @@ void DrawMainMenu(void) ...@@ -558,9 +556,9 @@ void DrawMainMenu(void)
#ifndef JAPAN #ifndef JAPAN
#ifdef SPANISH #ifdef SPANISH
_fstrcpy(&MainMenu[backtodemo].string,STR_GAME); strcpy(&MainMenu[backtodemo].string,STR_GAME);
#else #else
_fstrcpy(&MainMenu[backtodemo].string[8],STR_GAME); strcpy(&MainMenu[backtodemo].string[8],STR_GAME);
#endif #endif
#else #else
...@@ -577,9 +575,9 @@ void DrawMainMenu(void) ...@@ -577,9 +575,9 @@ void DrawMainMenu(void)
{ {
#ifndef JAPAN #ifndef JAPAN
#ifdef SPANISH #ifdef SPANISH
_fstrcpy(&MainMenu[backtodemo].string,STR_BD); strcpy(&MainMenu[backtodemo].string,STR_BD);
#else #else
_fstrcpy(&MainMenu[backtodemo].string[8],STR_DEMO); strcpy(&MainMenu[backtodemo].string[8],STR_DEMO);
#endif #endif
#else #else
CA_CacheGrChunk(C_MRETDEMOPIC); CA_CacheGrChunk(C_MRETDEMOPIC);
...@@ -852,13 +850,11 @@ int CP_EndGame(void) ...@@ -852,13 +850,11 @@ int CP_EndGame(void)
pickquick = gamestate.lives = 0; pickquick = gamestate.lives = 0;
playstate = ex_died; playstate = ex_died;
#pragma warn -sus
MainMenu[savegame].active = 0; MainMenu[savegame].active = 0;
MainMenu[viewscores].routine=CP_ViewScores; MainMenu[viewscores].routine=CP_ViewScores;
#ifndef JAPAN #ifndef JAPAN
_fstrcpy(MainMenu[viewscores].string,STR_VS); strcpy(MainMenu[viewscores].string,STR_VS);
#endif #endif
#pragma warn +sus
return 1; return 1;
} }
...@@ -1646,9 +1642,7 @@ int CalibrateJoystick(void) ...@@ -1646,9 +1642,7 @@ int CalibrateJoystick(void)
#define CALW 158 #define CALW 158
#define CALH 140 #define CALH 140
unsigned xmin,ymin,xmax,ymax,jb; word xmin,ymin,xmax,ymax,jb;
#ifdef JAPAN #ifdef JAPAN
VWB_DrawPic(CALX,CALY,C_JOY0PIC); VWB_DrawPic(CALX,CALY,C_JOY0PIC);
...@@ -1683,7 +1677,7 @@ int CalibrateJoystick(void) ...@@ -1683,7 +1677,7 @@ int CalibrateJoystick(void)
} while(!(jb&1)); } while(!(jb&1));
SD_PlaySound(SHOOTSND); SD_PlaySound(SHOOTSND);
IN_GetJoyAbs(joystickport,&xmin,&ymin); IN_GetJoyAbs(joystickport, &xmin, &ymin);
#ifdef JAPAN #ifdef JAPAN
...@@ -2931,6 +2925,7 @@ void DrawOutline(int x,int y,int w,int h,int color1,int color2) ...@@ -2931,6 +2925,7 @@ void DrawOutline(int x,int y,int w,int h,int color1,int color2)
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void SetupControlPanel(void) void SetupControlPanel(void)
{ {
#if 0 /* DOS VERSION */
struct ffblk f; struct ffblk f;
char name[13]; char name[13];
int which,i; int which,i;
...@@ -2975,6 +2970,45 @@ void SetupControlPanel(void) ...@@ -2975,6 +2970,45 @@ void SetupControlPanel(void)
strcpy(&SaveGameNames[which][0],temp); strcpy(&SaveGameNames[which][0],temp);
} }
} while(!findnext(&f)); } while(!findnext(&f));
#else
glob_t globbuf;
char name[13];
int which, i, x;
CA_CacheGrChunk(STARTFONT+1);
#ifndef SPEAR
CacheLump(CONTROLS_LUMP_START, CONTROLS_LUMP_END);
#else
CacheLump(BACKDROP_LUMP_START, BACKDROP_LUMP_END);
#endif
SETFONTCOLOR(TEXTCOLOR, BKGDCOLOR);
fontnumber = 1;
WindowH = 200;
if (!ingame)
CA_LoadAllSounds();
else
MainMenu[savegame].active = 1;
if (glob(SaveName, 0, NULL, &globbuf))
return;
for (x = 0; x < globbuf.gl_pathc; x++) {
which = globbuf.gl_pathv[x][7] - '0';
if (which < 10) {
int handle;
char temp[32];
SaveGamesAvail[which] = 1;
handle = open(globbuf.gl_pathv[x], O_RDONLY);
read(handle, temp, 32);
close(handle);
strcpy(SaveGameNames[which], temp);
}
}
globfree(&globbuf);
#endif
} }
...@@ -3546,7 +3580,7 @@ void Message(char *string) ...@@ -3546,7 +3580,7 @@ void Message(char *string)
fontnumber=1; fontnumber=1;
font=grsegs[STARTFONT+fontnumber]; font=grsegs[STARTFONT+fontnumber];
h=font->height; h=font->height;
for (i=0;i<_fstrlen(string);i++) for (i=0;i<strlen(string);i++)
if (string[i]=='\n') if (string[i]=='\n')
{ {
if (w>mw) if (w>mw)
...@@ -3690,6 +3724,7 @@ void ShootSnd(void) ...@@ -3690,6 +3724,7 @@ void ShootSnd(void)
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
void CheckForEpisodes(void) void CheckForEpisodes(void)
{ {
#if 0 /* DOS VERSION */
struct ffblk f; struct ffblk f;
// //
...@@ -3783,4 +3818,88 @@ void CheckForEpisodes(void) ...@@ -3783,4 +3818,88 @@ void CheckForEpisodes(void)
strcat(SaveName,extension); strcat(SaveName,extension);
strcat(PageFileName,extension); strcat(PageFileName,extension);
#else
glob_t globbuf;
//
// JAPANESE VERSION
//
#ifdef JAPAN
#ifdef JAPDEMO
if (glob("*.wj1", 0, NULL, &globbuf) == 0) {
strcpy(extension, "wj1");
#else /* JAPDEMO */
if (glob("*.wj6", 0, NULL, &globbuf) == 0) {
strcpy(extension, "wj6");
#endif /* JAPDEMO */
strcat(configname,extension);
strcat(SaveName,extension);
strcat(PageFileName,extension);
EpisodeSelect[1] =
EpisodeSelect[2] =
EpisodeSelect[3] =
EpisodeSelect[4] =
EpisodeSelect[5] = 1;
}
else
Quit("NO JAPANESE WOLFENSTEIN 3-D DATA FILES to be found!");
#else /* JAPAN */
//
// ENGLISH
//
#ifndef UPLOAD
#ifndef SPEAR
if (glob("*.wl6", 0, NULL, &globbuf) == 0) {
strcpy(extension,"wl6");
NewEmenu[2].active =
NewEmenu[4].active =
NewEmenu[6].active =
NewEmenu[8].active =
NewEmenu[10].active =
EpisodeSelect[1] =
EpisodeSelect[2] =
EpisodeSelect[3] =
EpisodeSelect[4] =
EpisodeSelect[5] = 1;
} else if (glob("*.wl3", 0, NULL, &globbuf) == 0) {
strcpy(extension,"wl3");
NewEmenu[2].active =
NewEmenu[4].active =
EpisodeSelect[1] =
EpisodeSelect[2] = 1;
}
else
#endif /* SPEAR */
#endif /* UPLOAD */
#ifdef SPEAR
#ifndef SPEARDEMO
if (glob("*.sod", 0, NULL, &globbuf) == 0) {
strcpy(extension, "sod");
} else
Quit("NO SPEAR OF DESTINY DATA FILES TO BE FOUND!");
#else /* SPEARDEMO */
if (glob("*.sdm", 0, NULL, &globbuf) == 0) {
strcpy(extension, "sdm");
}
else
Quit("NO SPEAR OF DESTINY DEMO DATA FILES TO BE FOUND!");
#endif /* SPEARDEMO */
#else /* SPEAR */
if (glob("*.wl1", 0, NULL, &globbuf) == 0) {
strcpy(extension,"wl1");
}
else
Quit("NO WOLFENSTEIN 3-D DATA FILES to be found!");
#endif /* SPEAR */
#endif /* JAPAN */
strcat(configname,extension);
strcat(SaveName,extension);
strcat(PageFileName,extension);
#endif
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment