Subversion Repositories Kolibri OS

Rev

Rev 342 | 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. // I_Init
  96. //
  97. void I_Init (void)
  98. {
  99.   I_InitGraphics();
  100.   I_InitSound();
  101. }
  102.  
  103. //
  104. // I_Quit
  105. //
  106. void I_Quit (void)
  107. {
  108. //    __libclog_printf("Calling I_Quit from %x\n",__builtin_return_address(0));
  109.     D_QuitNetGame ();
  110.     I_ShutdownSound();
  111.  //   I_ShutdownMusic();
  112.     M_SaveDefaults ();
  113. //    I_ShutdownGraphics();
  114.     exit(0);
  115. }
  116.  
  117. void I_WaitVBL(int count)
  118. {
  119.  //__menuet__delay100((count*10)/7);
  120. }
  121.  
  122. void I_BeginRead(void)
  123. {
  124. }
  125.  
  126. void I_EndRead(void)
  127. {
  128. }
  129.  
  130. /***********
  131. byte*   I_AllocLow(int length)
  132. {
  133.     byte*       mem;
  134.        
  135.     mem = (byte *)malloc (length);
  136.     memset (mem,0,length);
  137.     return mem;
  138. }
  139. ************/
  140.  
  141. //
  142. // I_Error
  143. //
  144. extern boolean demorecording;
  145. extern volatile int sound_state;
  146.  
  147. void I_Error (char *error, ...)
  148. {
  149.     va_list     argptr;
  150.  
  151.     // Message first.
  152.     va_start (argptr,error);
  153.     printf ("Error:  ");
  154.     printf (error,argptr);
  155.     printf ("\n\r");
  156.     va_end (argptr);
  157.  
  158.     // Shutdown. Here might be other errors.
  159.     if (demorecording)
  160.         G_CheckDemoStatus();
  161.  
  162.     D_QuitNetGame ();
  163.     I_ShutdownGraphics();
  164.     sound_state=0;
  165. //    getch();
  166.     exit(-1);
  167. }
  168.