Subversion Repositories Kolibri OS

Rev

Rev 333 | Blame | Last modification | View Log | Download | RSS feed

  1. // Emacs style mode select   -*- C++ -*-
  2. //-----------------------------------------------------------------------------
  3. //
  4. // $Id:$
  5. //
  6. // Copyright (C) 1993-1996 by id Software, Inc.
  7. //
  8. // This source is available for distribution and/or modification
  9. // only under the terms of the DOOM Source Code License as
  10. // published by id Software. All rights reserved.
  11. //
  12. // The source is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
  15. // for more details.
  16. //
  17. // $Log:$
  18. //
  19. // DESCRIPTION:
  20. //
  21. //-----------------------------------------------------------------------------
  22.  
  23. static const char
  24. rcsid[] = "$Id: m_bbox.c,v 1.1 1997/02/03 22:45:10 b1 Exp $";
  25.  
  26. #include <stdlib.h>
  27. #include <stdarg.h>
  28. #include <ctype.h>
  29.  
  30. #include "doomdef.h"
  31. #include "m_misc.h"
  32. #include "i_video.h"
  33. #include "i_sound.h"
  34.  
  35. #include "d_net.h"
  36. #include "g_game.h"
  37.  
  38.  
  39. #include "i_system.h"
  40.  
  41. #include "kolibri.h"
  42.  
  43. int     mb_used = 8;
  44.  
  45. void
  46. I_Tactile
  47. ( int   on,
  48.   int   off,
  49.   int   total )
  50. {
  51.   // UNUSED.
  52.   on = off = total = 0;
  53. }
  54.  
  55. ticcmd_t        emptycmd;
  56. ticcmd_t*       I_BaseTiccmd(void)
  57. {
  58.     return &emptycmd;
  59. }
  60.  
  61.  
  62. int  I_GetHeapSize (void)
  63. {
  64.  return mb_used*1024*1024;
  65. }
  66.  
  67. byte* I_ZoneBase (int*  size)
  68. {
  69.  *size = mb_used*1024*1024;
  70.  return (byte *) UserAlloc(*size);
  71. }
  72.  
  73.  
  74. //
  75. // I_GetTime
  76. // returns time in 1/35 second tics
  77. //
  78.  
  79. int  I_GetTime (void)
  80. {
  81.  unsigned int tm;
  82.  _asm
  83.  {  push ebx
  84.     mov eax, 26
  85.     mov ebx, 9
  86.     int 0x40
  87.     mov dword ptr [tm], eax
  88.     pop ebx
  89.  };
  90.  
  91.  return (tm*TICRATE)/100;
  92. }
  93.  
  94.  
  95.  
  96. //
  97. // I_Init
  98. //
  99. void I_Init (void)
  100. {
  101.   I_InitGraphics();
  102.   I_InitSound();
  103. }
  104.  
  105. //
  106. // I_Quit
  107. //
  108. void I_Quit (void)
  109. {
  110. //    __libclog_printf("Calling I_Quit from %x\n",__builtin_return_address(0));
  111.     D_QuitNetGame ();
  112.  //   I_ShutdownSound();
  113.  //   I_ShutdownMusic();
  114.     M_SaveDefaults ();
  115.     I_ShutdownGraphics();
  116.     exit(0);
  117. }
  118.  
  119. void I_WaitVBL(int count)
  120. {
  121.  //__menuet__delay100((count*10)/7);
  122. }
  123.  
  124. void I_BeginRead(void)
  125. {
  126. }
  127.  
  128. void I_EndRead(void)
  129. {
  130. }
  131.  
  132. /***********
  133. byte*   I_AllocLow(int length)
  134. {
  135.     byte*       mem;
  136.        
  137.     mem = (byte *)malloc (length);
  138.     memset (mem,0,length);
  139.     return mem;
  140. }
  141. ************/
  142.  
  143. //
  144. // I_Error
  145. //
  146. extern boolean demorecording;
  147.  
  148. void I_Error (char *error, ...)
  149. {
  150.     va_list     argptr;
  151.  
  152.     // Message first.
  153.     va_start (argptr,error);
  154.     printf ("Error:  ");
  155.     printf (error,argptr);
  156.     printf ("\n\r");
  157.     va_end (argptr);
  158.  
  159.     // Shutdown. Here might be other errors.
  160.     if (demorecording)
  161.         G_CheckDemoStatus();
  162.  
  163.     D_QuitNetGame ();
  164.     I_ShutdownGraphics();
  165. //    getch();
  166.     exit(-1);
  167. }
  168.