home *** CD-ROM | disk | FTP | other *** search
/ Total Meltdown / dukenukemtotalmeltdown.img / util / dukenet / commit.c next >
C/C++ Source or Header  |  1996-02-14  |  2KB  |  122 lines

  1. // commit.c
  2.  
  3. #include <conio.h>
  4. #include <stdio.h>
  5. #include <stdlib.h>
  6. #include <dos.h>
  7. #include <string.h>
  8. #include <process.h>
  9. #include <stdarg.h>
  10. #include <bios.h>
  11. #include <time.h>
  12.  
  13. #include "gamecom.h"
  14. #include "commit.h"
  15. #include "network.h"
  16.  
  17. #define VERSION "1.0"
  18.  
  19. //
  20. // COMMIT Apogee Software Ltd. (c) 1995
  21. //        written by Mark Dochtermann
  22. //
  23.  
  24. config_t config;
  25.  
  26. /*
  27. =================
  28. =
  29. = Shutdown
  30. =
  31. =================
  32. */
  33.  
  34. void Shutdown ( void )
  35.    {
  36.    // Put in Shutdown code for a specific comm type
  37.    ShutdownNetwork ();
  38.     ShutdownGAMECOM ();
  39.    }
  40.  
  41. /*
  42. =================
  43. =
  44. = Startup
  45. =
  46. =================
  47. */
  48.  
  49. boolean Startup ( void )
  50.     {
  51.    boolean proceed=false;
  52.  
  53.    clrscr();
  54.     printf(
  55.           "--------------------------------\n"
  56.           "COMMIT Compliant Device Driver Version %s \n",VERSION);
  57.     printf("--------------------------------\n");
  58.  
  59. //
  60. // default game parameters
  61. //
  62.    config.vector = -1;
  63.    config.socketnumber = DEFAULTSOCKETNUMBER;
  64.    config.comportnum = 2;
  65.    config.baudrate = 9600;
  66.    config.uartaddress = -1;
  67.    config.irqnumber = -1;
  68.    config.showstats = 0;
  69.    config.gametype = NETWORK_GAME;
  70.    config.numplayers = 2;
  71.    config.launchname = "DUKE3D.EXE";
  72.    config.pause = true;
  73.  
  74.  
  75. //
  76. // copy over configuration parameters
  77. // into gamecom structure.
  78. //
  79.  
  80.     gamecom.intnum     = config.vector;
  81.     gamecom.numplayers = config.numplayers;
  82.     gamecom.gametype   = config.gametype;
  83.  
  84. //
  85. // print out game type and num players
  86. // setup program for specific game type
  87. //
  88.  
  89.     printf ("o  %d Player Game\n", gamecom.numplayers);
  90.  
  91. // **********************************
  92. // Put Comm startup code here
  93.    proceed=StartupNetwork ();
  94. // *********************************
  95.  
  96.     return proceed;
  97.     }
  98.  
  99.  
  100. /*
  101. =============
  102. =
  103. = main
  104. =
  105. =============
  106. */
  107.  
  108. void main (void)
  109.     {
  110.  
  111.    if (Startup () == true)
  112.         {
  113.         LaunchGAME ( (boolean)config.pause );
  114.         }
  115.  
  116.     Shutdown ();
  117.  
  118.     exit(0);
  119.     }
  120.  
  121.  
  122.