2 Copyright (C) 1996-1997 Id Software, Inc.
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 // this file is shared by quake and qcc
26 typedef unsigned int func_t;
29 typedef enum etype_e {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t;
34 #define OFS_PARM0 4 // leave 3 ofs for each parm to hold vectors
42 #define RESERVED_OFS 28
126 //these following ones are Hexen 2 constants.
183 //mostly they are various different ways of adding two vars with conversions.
236 OP_POINTER_ADD, //32 bit pointers
275 //-------------------------------------
276 //string manipulation.
277 OP_ADD_SF, //(char*)c = (char*)a + (float)b
278 OP_SUB_S, //(float)c = (char*)a - (char*)b
279 OP_STOREP_C,//(float)c = *(char*)b = (float)a
280 OP_LOADP_C, //(float)c = *(char*) //170
281 //-------------------------------------
303 //erm... FTEQCC doesn't make use of these... These are for DP.
307 OP_GSTOREP_FLD, // integers
309 OP_GSTOREP_FNC, // pointers
320 //back to ones that we do use.
322 OP_PUSH, //push 4octets onto the local-stack (which is ALWAYS poped on function return). Returns a pointer.
323 OP_POP, //pop those ones that were pushed (don't over do it). Needs assembler.
328 //extensions for fixing stuff
336 typedef struct statement_s
343 typedef struct ddef_s
345 unsigned short type; // if DEF_SAVEGLOBGAL bit is set
346 // the variable needs to be saved in savegames
351 #define DEF_SAVEGLOBAL (1<<15)
355 typedef struct dfunction_s
357 int first_statement; // negative numbers are builtins
359 int locals; // total ints of parms + locals
361 int profile; // runtime
364 int s_file; // source file defined in
367 unsigned char parm_size[MAX_PARMS];
371 typedef struct mfunction_s
373 int first_statement; // negative numbers are builtins
375 int locals; // total ints of parms + locals
377 // these are doubles so that they can count up to 54bits or so rather than 32bit
378 double profile; // runtime
379 double builtinsprofile; // cost of builtin functions called by this function
380 double callcount; // times the functions has been called since the last profile call
381 double totaltime; // total execution time of this function DIRECTLY FROM THE ENGINE
382 double profile_total; // runtime
383 double builtinsprofile_total; // cost of builtin functions called by this function
387 int s_file; // source file defined in
390 unsigned char parm_size[MAX_PARMS];
395 #define PROG_VERSION 6
396 #define PROG_EXTENDED 7
397 typedef struct dprograms_s
400 int crc; // check of header file
403 int numstatements; // statement 0 is an error
412 int numfunctions; // function 0 is an empty
415 int numstrings; // first string is a null string