-
Notifications
You must be signed in to change notification settings - Fork 0
/
D_MAIN.C
1155 lines (997 loc) · 21.2 KB
/
D_MAIN.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
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
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// D_main.c
#ifdef __WATCOMC__
#include <dos.h>
#include <graph.h>
#include <sys\types.h>
#include <direct.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <time.h> // FS: For Stat Copy
#include "DoomDef.h"
#include "P_local.h"
#include "soundst.h"
#include "deh_main.h" // FS: For HHE
#include "i_system.h"
boolean shareware = false; // true if only episode 1 present
boolean ExtendedWAD = false; // true if episodes 4 and 5 present
boolean nomonsters; // checkparm of -nomonsters
boolean respawnparm; // checkparm of -respawn
boolean debugmode; // checkparm of -debug
boolean ravpic; // checkparm of -ravpic
boolean cdrom; // true if cd-rom mode active
boolean singletics; // debug flag to cancel adaptiveness
boolean noartiskip; // whether shift-enter skips an artifact
skill_t startskill;
int startepisode;
int startmap;
boolean autostart;
extern boolean automapactive;
extern int headBob; // FS: Head bob toggle
extern int usePalFlash; // FS
extern int faststart; // FS: Always faststart if you want
extern int novert; // FS: No vertical mouse movement
boolean advancedemo;
FILE *debugfile;
void D_CheckNetGame(void);
void D_ProcessEvents(void);
void G_BuildTiccmd(ticcmd_t *cmd);
void D_DoAdvanceDemo(void);
void D_PageDrawer (void);
void D_AdvanceDemo (void);
void F_Drawer(void);
boolean F_Responder(event_t *ev);
extern int savestringsize; // FS: now a parameter
extern int savegamesize; // FS: now a parameter
int saveconvertslot; // FS: Convert Save
boolean convertsave = false; // FS: Convert Save
//---------------------------------------------------------------------------
//
// FUNC FixedDiv
//
//---------------------------------------------------------------------------
fixed_t FixedDiv(fixed_t a, fixed_t b)
{
if ((abs(a) >> 14) >= abs(b))
{
return((a ^ b) < 0 ? MININT : MAXINT);
}
return(FixedDiv2(a, b));
}
/*
===============================================================================
EVENT HANDLING
Events are asyncronous inputs generally generated by the game user.
Events can be discarded if no responder claims them
===============================================================================
*/
event_t events[MAXEVENTS];
int eventhead;
int eventtail;
//---------------------------------------------------------------------------
//
// PROC D_PostEvent
//
// Called by the I/O functions when input is detected.
//
//---------------------------------------------------------------------------
void D_PostEvent(event_t *ev)
{
events[eventhead] = *ev;
eventhead = (++eventhead) & (MAXEVENTS - 1);
}
//---------------------------------------------------------------------------
//
// PROC D_ProcessEvents
//
// Send all the events of the given timestamp down the responder chain.
//
//---------------------------------------------------------------------------
void D_ProcessEvents(void)
{
event_t *ev;
for (; eventtail != eventhead; eventtail = (++eventtail) & (MAXEVENTS - 1))
{
ev = &events[eventtail];
if (F_Responder(ev))
{
continue;
}
if (MN_Responder(ev))
{
continue;
}
G_Responder(ev);
}
}
//---------------------------------------------------------------------------
//
// PROC DrawMessage
//
//---------------------------------------------------------------------------
void DrawMessage(void)
{
player_t *player;
player = &players[consoleplayer];
if (player->messageTics <= 0 || !player->message)
{ // No message
return;
}
MN_DrTextA(player->message, 160 - MN_TextAWidth(player->message) / 2, 1);
}
//---------------------------------------------------------------------------
//
// PROC D_Display
//
// Draw current display, possibly wiping it from the previous.
//
//---------------------------------------------------------------------------
void R_ExecuteSetViewSize(void);
extern boolean finalestage;
void D_Display(void)
{
extern boolean MenuActive;
extern boolean askforquit;
// Change the view size if needed
if (setsizeneeded)
{
R_ExecuteSetViewSize();
}
//
// do buffered drawing
//
switch (gamestate)
{
case GS_LEVEL:
if (!gametic)
break;
if (automapactive)
AM_Drawer ();
else
R_RenderPlayerView (&players[displayplayer]);
CT_Drawer();
UpdateState |= I_FULLVIEW;
SB_Drawer();
break;
case GS_INTERMISSION:
IN_Drawer ();
break;
case GS_FINALE:
F_Drawer ();
break;
case GS_DEMOSCREEN:
D_PageDrawer ();
break;
}
if (paused && !MenuActive && !askforquit)
{
if (!netgame)
{
V_DrawPatch(160, viewwindowy + 5, W_CacheLumpName("PAUSED",
PU_CACHE));
}
else
{
V_DrawPatch(160, 70, W_CacheLumpName("PAUSED",
PU_CACHE));
}
}
// Handle player messages
DrawMessage();
// Menu drawing
MN_Drawer();
// Send out any new accumulation
NetUpdate();
// Flush buffered stuff to screen
I_Update();
}
//---------------------------------------------------------------------------
//
// PROC D_DoomLoop
//
//---------------------------------------------------------------------------
void D_DoomLoop(void)
{
if (M_CheckParm("-debugfile"))
{
char filename[20];
sprintf(filename, "debug%i.txt", consoleplayer);
debugfile = fopen(filename, "w");
}
I_InitGraphics();
while (1)
{
// Frame syncronous IO operations
I_StartFrame();
// Process one or more tics
if (singletics)
{
I_StartTic();
D_ProcessEvents();
G_BuildTiccmd(&netcmds[consoleplayer][maketic % BACKUPTICS]);
if (advancedemo)
D_DoAdvanceDemo ();
G_Ticker();
gametic++;
maketic++;
}
else
{
// Will run at least one tic
TryRunTics();
}
// Move positional sounds
S_UpdateSounds(players[consoleplayer].mo);
D_Display();
}
}
/*
===============================================================================
DEMO LOOP
===============================================================================
*/
int demosequence;
int pagetic;
char *pagename;
/*
================
=
= D_PageTicker
=
= Handles timing for warped projection
=
================
*/
void D_PageTicker (void)
{
if (--pagetic < 0)
D_AdvanceDemo ();
}
/*
================
=
= D_PageDrawer
=
================
*/
extern boolean MenuActive;
void D_PageDrawer(void)
{
V_DrawRawScreen(W_CacheLumpName(pagename, PU_CACHE));
if (demosequence == 1)
{
V_DrawPatch(4, 160, W_CacheLumpName("ADVISOR", PU_CACHE));
}
UpdateState |= I_FULLSCRN;
}
/*
=================
=
= D_AdvanceDemo
=
= Called after each demo or intro demosequence finishes
=================
*/
void D_AdvanceDemo (void)
{
advancedemo = true;
}
void D_DoAdvanceDemo (void)
{
players[consoleplayer].playerstate = PST_LIVE; // don't reborn
advancedemo = false;
usergame = false; // can't save / end game here
paused = false;
gameaction = ga_nothing;
demosequence = (demosequence + 1) % 7;
switch (demosequence)
{
case 0:
pagetic = 210;
gamestate = GS_DEMOSCREEN;
pagename = "TITLE";
I_ShutdownVRGoggles(false);
S_StartSong(mus_titl, false);
break;
case 1:
pagetic = 140;
gamestate = GS_DEMOSCREEN;
pagename = "TITLE";
I_ShutdownVRGoggles(false);
break;
case 2:
BorderNeedRefresh = true;
UpdateState |= I_FULLSCRN;
G_DeferedPlayDemo ("demo1");
break;
case 3:
pagetic = 200;
gamestate = GS_DEMOSCREEN;
pagename = "CREDIT";
I_ShutdownVRGoggles(false);
break;
case 4:
BorderNeedRefresh = true;
UpdateState |= I_FULLSCRN;
G_DeferedPlayDemo ("demo2");
break;
case 5:
pagetic = 200;
gamestate = GS_DEMOSCREEN;
if (shareware)
{
pagename = "ORDER";
}
else
{
pagename = "CREDIT";
}
I_ShutdownVRGoggles(false);
break;
case 6:
BorderNeedRefresh = true;
UpdateState |= I_FULLSCRN;
G_DeferedPlayDemo ("demo3");
break;
}
}
/*
=================
=
= D_StartTitle
=
=================
*/
void D_StartTitle (void)
{
gameaction = ga_nothing;
demosequence = -1;
D_AdvanceDemo ();
}
/*
==============
=
= D_CheckRecordFrom
=
= -recordfrom <savegame num> <demoname>
==============
*/
void D_CheckRecordFrom (void)
{
int p;
char file[256];
p = M_CheckParm ("-recordfrom");
if (!p || p > myargc - 2)
return;
if (cdrom)
{
sprintf(file, SAVEGAMENAMECD"%c.hsg", myargv[p + 1][0]);
}
else
{
sprintf(file, SAVEGAMENAME"%c.hsg", myargv[p + 1][0]);
}
G_LoadGame (file);
G_DoLoadGame (); // load the gameskill etc info from savegame
G_RecordDemo (gameskill, 1, gameepisode, gamemap, myargv[p + 2]);
D_DoomLoop (); // never returns
}
/*
===============
=
= D_AddFile
=
===============
*/
#define MAXWADFILES 20
// MAPDIR should be defined as the directory that holds development maps
// for the -wart # # command
#ifdef __NeXT__
#define MAPDIR "/Novell/Heretic/data/"
#define SHAREWAREWADNAME "/Novell/Heretic/source/heretic1.wad"
char *wadfiles[MAXWADFILES] =
{
"/Novell/Heretic/source/heretic.wad",
"/Novell/Heretic/data/texture1.lmp",
"/Novell/Heretic/data/texture2.lmp",
"/Novell/Heretic/data/pnames.lmp"
};
#else
#define MAPDIR "\\data\\"
#define SHAREWAREWADNAME "heretic1.wad"
char *wadfiles[MAXWADFILES] =
{
"heretic.wad",
"texture1.lmp",
"texture2.lmp",
"pnames.lmp"
};
#endif
char *basedefault = "heretic.cfg";
char exrnwads[80];
char exrnwads2[80];
void wadprintf(void)
{
if (debugmode || M_CheckParm ("-faststart") || faststart) // FS: Fast Start
{
return;
}
#ifdef __WATCOMC__
_settextposition(23, 2);
_setbkcolor(1);
_settextcolor(0);
_outtext(exrnwads);
_settextposition(24, 2);
_outtext(exrnwads2);
#endif
}
void D_AddFile(char *file, int flag)
{
int numwadfiles;
char *new;
// char text[256];
for (numwadfiles = 0; wadfiles[numwadfiles]; numwadfiles++);
new = malloc(strlen(file) + 1);
strcpy(new, file);
if (strlen(exrnwads) + strlen(file) < 78 && flag) // FS
{
if (strlen(exrnwads))
{
strcat(exrnwads, ", ");
}
else
{
strcpy(exrnwads, "External Wadfiles: ");
}
strcat(exrnwads, file);
}
else if (strlen(exrnwads2) + strlen(file) < 79 && flag) // FS
{
if (strlen(exrnwads2))
{
strcat(exrnwads2, ", ");
}
else
{
strcpy(exrnwads2, " ");
strcat(exrnwads, ",");
}
strcat(exrnwads2, file);
}
wadfiles[numwadfiles] = new;
}
//==========================================================
//
// Startup Thermo code
//
//==========================================================
#define MSG_Y 9
//#define THERM_X 15
//#define THERM_Y 16
//#define THERMCOLOR 3
#define THERM_X 14
#define THERM_Y 14
int thermMax;
int thermCurrent;
char *startup; // * to text screen
char smsg[80]; // status bar line
//
// Heretic startup screen shit
//
byte *hscreen;
void hgotoxy(int x, int y)
{
hscreen = (byte *)(0xb8000 + y * 160 + x * 2);
}
void hput(unsigned char c, unsigned char a)
{
*hscreen++ = c;
*hscreen++ = a;
}
void hprintf(char *string, unsigned char a)
{
#ifdef __WATCOMC__
int i;
if (M_CheckParm ("-faststart") || faststart) // FS: Fast Start
return;
if (debugmode)
{
puts(string);
return;
}
for (i = 0; i < strlen(string); i++)
{
hput(string[i], a);
}
#endif
}
void drawstatus(void)
{
if (debugmode || M_CheckParm ("-faststart") || faststart) // FS: Fast Start
{
return;
}
#ifdef __WATCOMC__
_settextposition(25, 2);
_setbkcolor(1);
_settextcolor(15);
_outtext(smsg);
_settextposition(25, 1);
#endif
}
void status(char *string)
{
strcat(smsg, string);
drawstatus();
}
void DrawThermo(void)
{
#ifdef __WATCOMC__
unsigned char *screen;
int progress;
int i;
if (debugmode || M_CheckParm ("-faststart") || faststart) // FS: Fast Start
{
return;
}
#if 0
progress = (98 * thermCurrent) / thermMax;
screen = (char *)0xb8000 + (THERM_Y * 160 + THERM_X * 2);
for (i = 0; i < progress / 2; i++)
{
switch (i)
{
case 4:
case 9:
case 14:
case 19:
case 29:
case 34:
case 39:
case 44:
*screen++ = 0xb3;
*screen++ = (THERMCOLOR << 4) + 15;
break;
case 24:
*screen++ = 0xba;
*screen++ = (THERMCOLOR << 4) + 15;
break;
default:
*screen++ = 0xdb;
*screen++ = 0x40 + THERMCOLOR;
break;
}
}
if (progress & 1)
{
*screen++ = 0xdd;
*screen++ = 0x40 + THERMCOLOR;
}
#else
progress = (50 * thermCurrent) / thermMax + 2;
// screen = (char *)0xb8000 + (THERM_Y*160 + THERM_X*2);
hgotoxy(THERM_X, THERM_Y);
for (i = 0; i < progress; i++)
{
// *screen++ = 0xdb;
// *screen++ = 0x2a;
hput(0xdb, 0x2a);
}
#endif
#endif
}
#ifdef __WATCOMC__
void blitStartup(void)
{
byte *textScreen;
if (debugmode || M_CheckParm("-faststart") || faststart) // FS: Fast Start
{
return;
}
// Blit main screen
textScreen = (byte *)0xb8000;
memcpy(textScreen, startup, 4000);
// Print version string
_setbkcolor(4); // Red
_settextcolor(14); // Yellow
_settextposition(3, 47);
_outtext(VERSION_TEXT);
// Hide cursor
_settextcursor(0x2000);
}
#endif
char tmsg[300];
void tprintf(char *msg, int initflag)
{
if (debugmode || M_CheckParm ("-faststart") || faststart) // FS: Fast Start
{
printf("%s", msg);
return;
}
#if 0
#ifdef __WATCOMC__
char temp[80];
int start;
int add;
int i;
#endif
#ifdef __WATCOMC__
if (initflag)
tmsg[0] = 0;
strcat(tmsg, msg);
blitStartup();
DrawThermo();
_setbkcolor(4);
_settextcolor(15);
for (add = start = i = 0; i <= strlen(tmsg); i++)
if ((tmsg[i] == '\n') || (!tmsg[i]))
{
memset(temp, 0, 80);
strncpy(temp, tmsg + start, i - start);
_settextposition(MSG_Y + add, 40 - strlen(temp) / 2);
_outtext(temp);
start = i + 1;
add++;
}
_settextposition(25, 1);
drawstatus();
#else
printf(msg);
#endif
#endif
}
#ifdef __WATCOMC__
void CleanExit(void)
{
union REGS regs;
I_ShutdownKeyboard();
regs.x.eax = 0x3;
int386(0x10, ®s, ®s);
printf("Exited from HERETIC.\n");
exit(1);
}
#endif
void CheckAbortStartup(void)
{
#ifdef __WATCOMC__
extern int lastpress;
if (lastpress == 1)
{ // Abort if escape pressed
CleanExit();
}
#endif
}
void IncThermo(void)
{
thermCurrent++;
DrawThermo();
CheckAbortStartup();
}
void InitThermo(int max)
{
thermMax = max;
thermCurrent = 0;
}
//---------------------------------------------------------------------------
//
// PROC D_DoomMain
//
//---------------------------------------------------------------------------
void D_DoomMain(void)
{
int p;
int e;
int m;
char file[256];
FILE *fp;
boolean devMap;
//char *screen;
M_FindResponseFile();
setbuf(stdout, NULL);
nomonsters = M_CheckParm("-nomonsters");
respawnparm = M_CheckParm("-respawn");
ravpic = M_CheckParm("-ravpic");
noartiskip = M_CheckParm("-noartiskip");
debugmode = M_CheckParm("-debug");
if (M_CheckParm("-oldsave")) // FS: Load old saves
{
savestringsize = 24;
savegamesize = 0x30000;
}
startskill = sk_medium;
startepisode = 1;
startmap = 1;
autostart = false;
// FS: Define a custom main WAD
p = M_CheckParm("-mainwad");
if (p)
{
wadfiles[0] = myargv[p + 1];
}
// wadfiles[0] is a char * to the main wad
fp = fopen(wadfiles[0], "rb");
if (fp)
{
fclose(fp);
}
else
{ // Change to look for shareware wad
wadfiles[0] = SHAREWAREWADNAME;
}
// Check for -CDROM
cdrom = false;
#ifdef __WATCOMC__
if (M_CheckParm("-cdrom"))
{
cdrom = true;
mkdir("c:\\heretic.cd");
}
#endif
// -FILE [filename] [filename] ...
// Add files to the wad list.
p = M_CheckParm("-file");
if (p)
{ // the parms after p are wadfile/lump names, until end of parms
// or another - preceded parm
while (++p != myargc && myargv[p][0] != '-')
{
D_AddFile(myargv[p], 1);
}
}
// -DEVMAP <episode> <map>
// Adds a map wad from the development directory to the wad list,
// and sets the start episode and the start map.
devMap = false;
p = M_CheckParm("-devmap");
if (p && p < myargc - 2)
{
e = myargv[p + 1][0];
m = myargv[p + 2][0];
sprintf(file, MAPDIR"E%cM%c.wad", e, m);
D_AddFile(file, 1);
printf("DEVMAP: Episode %c, Map %c.\n", e, m);
startepisode = e - '0';
startmap = m - '0';
autostart = true;
devMap = true;
}
p = M_CheckParm("-playdemo");
if (!p)
{
p = M_CheckParm("-timedemo");
}
if (p && p < myargc - 1)
{
sprintf(file, "%s.lmp", myargv[p + 1]);
D_AddFile(file, 1);
printf("Playing demo %s.lmp.\n", myargv[p + 1]);
}
//
// get skill / episode / map from parms
//
if (M_CheckParm("-deathmatch"))
{
deathmatch = true;
}
p = M_CheckParm("-skill");
if (p && p < myargc - 1)
{
startskill = myargv[p + 1][0] - '1';
if (startskill < sk_baby || startskill > sk_nightmare) // FS: Make sure it's valid. Was fucking up my Kali gamin'!
I_Error("Invalid Skill parameter! Valid options are 1 through 5.");
autostart = true;
}
p = M_CheckParm("-episode");
if (p && p < myargc - 1)
{
startepisode = myargv[p + 1][0] - '0';
startmap = 1;
autostart = true;
}
p = M_CheckParm("-warp");
if (p && p < myargc - 2)
{
startepisode = myargv[p + 1][0] - '0';
startmap = myargv[p + 2][0] - '0';
autostart = true;
}
//
// init subsystems
//
printf("V_Init: allocate screens.\n");
V_Init();
// Load defaults before initing other systems
printf("M_LoadDefaults: Load system defaults.\n");
M_LoadDefaults();
M_LoadExtendedDefaults(); // FS: For EXTEND.CFG
printf("Z_Init: Init zone memory allocation daemon.\n");
Z_Init();
printf("W_Init: Init WADfiles.\n");
W_InitMultipleFiles(wadfiles);
if (W_CheckNumForName("E2M1") == -1)
{ // Can't find episode 2 maps, must be the shareware WAD
shareware = true;
}
else if (W_CheckNumForName("EXTENDED") != -1)
{ // Found extended lump, must be the extended WAD
ExtendedWAD = true;
}
#ifdef __WATCOMC__
I_StartupKeyboard();
I_StartupJoystick();
#endif
startup = W_CacheLumpName("LOADING", PU_CACHE);
#ifdef __WATCOMC__
blitStartup();
#endif
//
// Build status bar line!
//
smsg[0] = 0;
if (deathmatch)
status("DeathMatch...");
if (nomonsters)
status("No Monsters...");
if (respawnparm)
status("Respawning...");
if (autostart)
{
char temp[64];
sprintf(temp, "Warp to Episode %d, Map %d, Skill %d ", startepisode, startmap, startskill + 1);
status(temp);
}
wadprintf(); // print the added wadfiles
tprintf("MN_Init: Init menu system.\n", 1);
MN_Init();
CT_Init();
tprintf("R_Init: Init Heretic refresh daemon - ", 1);
hgotoxy(17, 7);
hprintf("Loading graphics", 0x3f);
R_Init();
tprintf("\nP_Init: Init Playloop state.\n", 1);
hgotoxy(17, 8);
hprintf("Init game engine.", 0x3f);
P_Init();
IncThermo();
tprintf("I_Init: Setting up machine state.\n", 1);
I_Init();
IncThermo();
tprintf("D_CheckNetGame: Checking network game status.\n", 1);
if (hasGUS)
{
hgotoxy(17, 10); // FS
}
else
{