Rev 300 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
298 | serge | 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 |
||
27 | #include |
||
28 | #include |
||
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" |
||
333 | serge | 40 | |
300 | serge | 41 | #include "kolibri.h" |
298 | serge | 42 | |
333 | serge | 43 | int mb_used = 8; |
298 | serge | 44 | |
45 | void |
||
46 | I_Tactile |
||
333 | serge | 47 | ( int on, |
48 | int off, |
||
49 | int total ) |
||
298 | serge | 50 | { |
51 | // UNUSED. |
||
52 | on = off = total = 0; |
||
53 | } |
||
54 | |||
333 | serge | 55 | ticcmd_t emptycmd; |
56 | ticcmd_t* I_BaseTiccmd(void) |
||
298 | serge | 57 | { |
58 | return &emptycmd; |
||
59 | } |
||
60 | |||
61 | |||
62 | int I_GetHeapSize (void) |
||
63 | { |
||
64 | return mb_used*1024*1024; |
||
65 | } |
||
66 | |||
333 | serge | 67 | byte* I_ZoneBase (int* size) |
298 | serge | 68 | { |
69 | *size = mb_used*1024*1024; |
||
300 | serge | 70 | return (byte *) UserAlloc(*size); |
298 | serge | 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; |
||
333 | serge | 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 | }; |
||
298 | serge | 90 | |
91 | return (tm*TICRATE)/100; |
||
92 | } |
||
93 | |||
94 | |||
95 | |||
96 | // |
||
97 | // I_Init |
||
98 | // |
||
99 | void I_Init (void) |
||
100 | { |
||
101 | I_InitGraphics(); |
||
333 | serge | 102 | // I_InitSound(); |
298 | serge | 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 | |||
333 | serge | 132 | /*********** |
133 | byte* I_AllocLow(int length) |
||
298 | serge | 134 | { |
333 | serge | 135 | byte* mem; |
298 | serge | 136 | |
137 | mem = (byte *)malloc (length); |
||
138 | memset (mem,0,length); |
||
139 | return mem; |
||
140 | } |
||
333 | serge | 141 | ************/ |
298 | serge | 142 | |
143 | // |
||
144 | // I_Error |
||
145 | // |
||
146 | extern boolean demorecording; |
||
147 | |||
148 | void I_Error (char *error, ...) |
||
149 | { |
||
333 | serge | 150 | va_list argptr; |
298 | serge | 151 | |
152 | // Message first. |
||
153 | va_start (argptr,error); |
||
333 | serge | 154 | printf ("Error: "); |
155 | printf (error,argptr); |
||
156 | printf ("\n\r"); |
||
298 | serge | 157 | va_end (argptr); |
158 | |||
159 | // Shutdown. Here might be other errors. |
||
160 | if (demorecording) |
||
333 | serge | 161 | G_CheckDemoStatus(); |
298 | serge | 162 | |
163 | D_QuitNetGame (); |
||
164 | I_ShutdownGraphics(); |
||
300 | serge | 165 | // getch(); |
298 | serge | 166 | exit(-1); |
167 | } |