forked from mtuomi/SecondReality
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSTART.C
executable file
·105 lines (92 loc) · 1.67 KB
/
START.C
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
/* UNREAL 2 - Init / Deinit part
*/
#include <stdio.h>
#include <dos.h>
#include <string.h>
#include <malloc.h>
#include "..\dis\dis.h"
// doshandle.h
#include <sys\types.h>
#include <sys\stat.h>
#include <fcntl.h>
#include <io.h>
// variables in menu.c
extern int m_detail;
extern int m_soundcard;
extern int m_soundquality;
extern int m_looping;
extern int m_exit;
#include "vgasave.c"
char far *tvram=(char far *)0xb8000000L;
main(int argc,char *argv[])
{
FILE *f1,*f2;
long *lp;
int *ip;
char *cp;
int a;
unsigned len;
dis_partstart();
cp=halloc(16384,4);
hfree(cp);
cp=halloc(16384,4);
f1=fopen("fcinfo10.txt","rb");
fseek(f1,0L,SEEK_END);
len=ftell(f1);
fseek(f1,0L,SEEK_SET);
fread(cp,1,len,f1);
fclose(f1);
f2=fopen("fcinfo10.txt","wb");
if(f2)
{
fwrite(cp,1,len,f1);
fclose(f2);
}
f1=fopen("readme.1st","rb");
fseek(f1,0L,SEEK_END);
len=ftell(f1);
fseek(f1,0L,SEEK_SET);
fread(cp,1,len,f1);
fclose(f1);
f2=fopen("readme.1st","wb");
if(f2)
{
fwrite(cp,1,len,f1);
fclose(f2);
}
hfree(cp);
ip=(int *)lp=dis_msgarea(3);
if(*lp==0)
{ // START OF DEMO
/* ask stuff */
/*
printf( "\n"
"ùSùEùCùOùNùDù ùRùEùAùLùIùTùYù Copyright (C) 1993 The Future Crew\n"
"\n");
*/
/*
printf("Arguments: ");
for(a=0;a<argc;a++) printf("%i[%s] ",a,argv[a]);
printf("\n");
*/
if(getenv("windir"))
{
*ip=-3;
return;
}
if(!memicmp(argv[1],"/gravis",7))
{
m_looping=2;
m_soundcard=3;
}
else menu();
if(m_exit)
{
*ip=-1;
return;
}
ip[1]=m_soundcard;
ip[2]=m_soundquality;
ip[3]=m_looping;
}
}