Skip to content

Commit 73424b6

Browse files
author
Travis Bradshaw
committed
Adding the release of the DOOM IPX driver.
1 parent 4eb368a commit 73424b6

File tree

8 files changed

+1003
-0
lines changed

8 files changed

+1003
-0
lines changed

ipx/DOOMNET.C

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
//#define DOOM2
2+
3+
#include <stdio.h>
4+
#include <stdlib.h>
5+
#include <string.h>
6+
#include <process.h>
7+
#include <conio.h>
8+
#include <dos.h>
9+
10+
#include "doomnet.h"
11+
//#include "ipxstr.h"
12+
#include "ipx_frch.h" // FRENCH VERSION
13+
14+
doomcom_t doomcom;
15+
int vectorishooked;
16+
void interrupt (*olddoomvect) (void);
17+
18+
19+
20+
/*
21+
=============
22+
=
23+
= LaunchDOOM
24+
=
25+
These fields in doomcom should be filled in before calling:
26+
27+
short numnodes; // console is allways node 0
28+
short ticdup; // 1 = no duplication, 2-5 = dup for
29+
slow nets
30+
short extratics; // 1 = send a backup tic in every
31+
packet
32+
33+
short consoleplayer; // 0-3 = player number
34+
short numplayers; // 1-4
35+
short angleoffset; // 1 = left, 0 = center, -1 = right
36+
short drone; // 1 = drone
37+
=============
38+
*/
39+
40+
void LaunchDOOM (void)
41+
{
42+
char *newargs[99];
43+
char adrstring[10];
44+
long flatadr;
45+
46+
// prepare for DOOM
47+
doomcom.id = DOOMCOM_ID;
48+
49+
// hook the interrupt vector
50+
olddoomvect = getvect (doomcom.intnum);
51+
setvect (doomcom.intnum,(void interrupt (*)(void))MK_FP(_CS,
52+
(int)NetISR));
53+
vectorishooked = 1;
54+
55+
// build the argument list for DOOM, adding a -net &doomcom
56+
memcpy (newargs, _argv, (_argc+1)*2);
57+
newargs[_argc] = "-net";
58+
flatadr = (long)_DS*16 + (unsigned)&doomcom;
59+
sprintf (adrstring,"%lu",flatadr);
60+
newargs[_argc+1] = adrstring;
61+
newargs[_argc+2] = NULL;
62+
63+
if (!access("doom2.exe",0))
64+
spawnv (P_WAIT, "doom2", newargs);
65+
else
66+
spawnv (P_WAIT, "doom", newargs);
67+
68+
#ifdef DOOM2
69+
printf (STR_RETURNED"\n");
70+
#else
71+
printf ("Returned from DOOM\n");
72+
#endif
73+
}

ipx/DOOMNET.H

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// doomnet.h
2+
3+
#define PEL_WRITE_ADR 0x3c8
4+
#define PEL_DATA 0x3c9
5+
6+
#define I_ColorBlack(r,g,b) {outp(PEL_WRITE_ADR,0);outp(PEL_DATA,r);outp(PEL_DATA,g);outp(PEL_DATA,b);};
7+
8+
9+
10+
#define MAXNETNODES 8 // max computers in a game
11+
#define MAXPLAYERS 4 // 4 players max + drones
12+
13+
14+
#define CMD_SEND 1
15+
#define CMD_GET 2
16+
17+
#define DOOMCOM_ID 0x12345678l
18+
19+
typedef struct
20+
{
21+
long id;
22+
short intnum; // DOOM executes an int to send commands
23+
24+
// communication between DOOM and the driver
25+
short command; // CMD_SEND or CMD_GET
26+
short remotenode; // dest for send, set by get (-1 = no packet)
27+
short datalength; // bytes in doomdata to be sent / bytes read
28+
29+
// info common to all nodes
30+
short numnodes; // console is allways node 0
31+
short ticdup; // 1 = no duplication, 2-5 = dup for slow nets
32+
short extratics; // 1 = send a backup tic in every packet
33+
short deathmatch; // 1 = deathmatch
34+
short savegame; // -1 = new game, 0-5 = load savegame
35+
short episode; // 1-3
36+
short map; // 1-9
37+
short skill; // 1-5
38+
39+
// info specific to this node
40+
short consoleplayer; // 0-3 = player number
41+
short numplayers; // 1-4
42+
short angleoffset; // 1 = left, 0 = center, -1 = right
43+
short drone; // 1 = drone
44+
45+
// packet data to be sent
46+
char data[512];
47+
} doomcom_t;
48+
49+
50+
51+
extern doomcom_t doomcom;
52+
extern void interrupt (*olddoomvect) (void);
53+
extern int vectorishooked;
54+
55+
int CheckParm (char *check);
56+
void LaunchDOOM (void);
57+
void interrupt NetISR (void);
58+

0 commit comments

Comments
 (0)