Permalink
Browse files

Adding the release of the DOOM IPX driver.

  • Loading branch information...
1 parent 4eb368a commit 73424b6129f1c3ca9fc22aedcfe1f5330db137a9 @tbradshaw tbradshaw committed Jan 31, 2012
Showing with 1,003 additions and 0 deletions.
  1. +73 −0 ipx/DOOMNET.C
  2. +58 −0 ipx/DOOMNET.H
  3. +294 −0 ipx/IPXNET.C
  4. +117 −0 ipx/IPXNET.H
  5. +420 −0 ipx/IPXSETUP.C
  6. +19 −0 ipx/IPXSTR.H
  7. +21 −0 ipx/IPX_FRCH.H
  8. +1 −0 ipx/README
View
@@ -0,0 +1,73 @@
+//#define DOOM2
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <process.h>
+#include <conio.h>
+#include <dos.h>
+
+#include "doomnet.h"
+//#include "ipxstr.h"
+#include "ipx_frch.h" // FRENCH VERSION
+
+doomcom_t doomcom;
+int vectorishooked;
+void interrupt (*olddoomvect) (void);
+
+
+
+/*
+=============
+=
+= LaunchDOOM
+=
+These fields in doomcom should be filled in before calling:
+
+ short numnodes; // console is allways node 0
+ short ticdup; // 1 = no duplication, 2-5 = dup for
+slow nets
+ short extratics; // 1 = send a backup tic in every
+packet
+
+ short consoleplayer; // 0-3 = player number
+ short numplayers; // 1-4
+ short angleoffset; // 1 = left, 0 = center, -1 = right
+ short drone; // 1 = drone
+=============
+*/
+
+void LaunchDOOM (void)
+{
+ char *newargs[99];
+ char adrstring[10];
+ long flatadr;
+
+// prepare for DOOM
+ doomcom.id = DOOMCOM_ID;
+
+// hook the interrupt vector
+ olddoomvect = getvect (doomcom.intnum);
+ setvect (doomcom.intnum,(void interrupt (*)(void))MK_FP(_CS,
+(int)NetISR));
+ vectorishooked = 1;
+
+// build the argument list for DOOM, adding a -net &doomcom
+ memcpy (newargs, _argv, (_argc+1)*2);
+ newargs[_argc] = "-net";
+ flatadr = (long)_DS*16 + (unsigned)&doomcom;
+ sprintf (adrstring,"%lu",flatadr);
+ newargs[_argc+1] = adrstring;
+ newargs[_argc+2] = NULL;
+
+ if (!access("doom2.exe",0))
+ spawnv (P_WAIT, "doom2", newargs);
+ else
+ spawnv (P_WAIT, "doom", newargs);
+
+ #ifdef DOOM2
+ printf (STR_RETURNED"\n");
+ #else
+ printf ("Returned from DOOM\n");
+ #endif
+}
View
@@ -0,0 +1,58 @@
+// doomnet.h
+
+#define PEL_WRITE_ADR 0x3c8
+#define PEL_DATA 0x3c9
+
+#define I_ColorBlack(r,g,b) {outp(PEL_WRITE_ADR,0);outp(PEL_DATA,r);outp(PEL_DATA,g);outp(PEL_DATA,b);};
+
+
+
+#define MAXNETNODES 8 // max computers in a game
+#define MAXPLAYERS 4 // 4 players max + drones
+
+
+#define CMD_SEND 1
+#define CMD_GET 2
+
+#define DOOMCOM_ID 0x12345678l
+
+typedef struct
+{
+ long id;
+ short intnum; // DOOM executes an int to send commands
+
+// communication between DOOM and the driver
+ short command; // CMD_SEND or CMD_GET
+ short remotenode; // dest for send, set by get (-1 = no packet)
+ short datalength; // bytes in doomdata to be sent / bytes read
+
+// info common to all nodes
+ short numnodes; // console is allways node 0
+ short ticdup; // 1 = no duplication, 2-5 = dup for slow nets
+ short extratics; // 1 = send a backup tic in every packet
+ short deathmatch; // 1 = deathmatch
+ short savegame; // -1 = new game, 0-5 = load savegame
+ short episode; // 1-3
+ short map; // 1-9
+ short skill; // 1-5
+
+// info specific to this node
+ short consoleplayer; // 0-3 = player number
+ short numplayers; // 1-4
+ short angleoffset; // 1 = left, 0 = center, -1 = right
+ short drone; // 1 = drone
+
+// packet data to be sent
+ char data[512];
+} doomcom_t;
+
+
+
+extern doomcom_t doomcom;
+extern void interrupt (*olddoomvect) (void);
+extern int vectorishooked;
+
+int CheckParm (char *check);
+void LaunchDOOM (void);
+void interrupt NetISR (void);
+
Oops, something went wrong.

0 comments on commit 73424b6

Please sign in to comment.