142 lines
2.9 KiB
C
142 lines
2.9 KiB
C
/*
|
|
Copyright (C) 1996-2001 Id Software, Inc.
|
|
Copyright (C) 2002-2009 John Fitzgibbons and others
|
|
Copyright (C) 2010-2014 QuakeSpasm developers
|
|
Copyright (C) 2019 Alison G. Watson
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
modify it under the terms of the GNU General Public License
|
|
as published by the Free Software Foundation; either version 2
|
|
of the License, or (at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program; if not, write to the Free Software
|
|
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
#if defined(pr_ops__xmac)
|
|
|
|
pr_ops__xmac(DONE)
|
|
pr_ops__xmac(MUL_F)
|
|
pr_ops__xmac(MUL_V)
|
|
pr_ops__xmac(MUL_FV)
|
|
pr_ops__xmac(MUL_VF)
|
|
pr_ops__xmac(DIV_F)
|
|
pr_ops__xmac(ADD_F)
|
|
pr_ops__xmac(ADD_V)
|
|
pr_ops__xmac(SUB_F)
|
|
pr_ops__xmac(SUB_V)
|
|
|
|
pr_ops__xmac(EQ_F)
|
|
pr_ops__xmac(EQ_V)
|
|
pr_ops__xmac(EQ_S)
|
|
pr_ops__xmac(EQ_E)
|
|
pr_ops__xmac(EQ_FNC)
|
|
|
|
pr_ops__xmac(NE_F)
|
|
pr_ops__xmac(NE_V)
|
|
pr_ops__xmac(NE_S)
|
|
pr_ops__xmac(NE_E)
|
|
pr_ops__xmac(NE_FNC)
|
|
|
|
pr_ops__xmac(LE)
|
|
pr_ops__xmac(GE)
|
|
pr_ops__xmac(LT)
|
|
pr_ops__xmac(GT)
|
|
|
|
pr_ops__xmac(LOAD_F)
|
|
pr_ops__xmac(LOAD_V)
|
|
pr_ops__xmac(LOAD_S)
|
|
pr_ops__xmac(LOAD_ENT)
|
|
pr_ops__xmac(LOAD_FLD)
|
|
pr_ops__xmac(LOAD_FNC)
|
|
|
|
pr_ops__xmac(ADDRESS)
|
|
|
|
pr_ops__xmac(STORE_F)
|
|
pr_ops__xmac(STORE_V)
|
|
pr_ops__xmac(STORE_S)
|
|
pr_ops__xmac(STORE_ENT)
|
|
pr_ops__xmac(STORE_FLD)
|
|
pr_ops__xmac(STORE_FNC)
|
|
|
|
pr_ops__xmac(STOREP_F)
|
|
pr_ops__xmac(STOREP_V)
|
|
pr_ops__xmac(STOREP_S)
|
|
pr_ops__xmac(STOREP_ENT)
|
|
pr_ops__xmac(STOREP_FLD)
|
|
pr_ops__xmac(STOREP_FNC)
|
|
|
|
pr_ops__xmac(RETURN)
|
|
pr_ops__xmac(NOT_F)
|
|
pr_ops__xmac(NOT_V)
|
|
pr_ops__xmac(NOT_S)
|
|
pr_ops__xmac(NOT_ENT)
|
|
pr_ops__xmac(NOT_FNC)
|
|
pr_ops__xmac(IF)
|
|
pr_ops__xmac(IFNOT)
|
|
pr_ops__xmac(CALL0)
|
|
pr_ops__xmac(CALL1)
|
|
pr_ops__xmac(CALL2)
|
|
pr_ops__xmac(CALL3)
|
|
pr_ops__xmac(CALL4)
|
|
pr_ops__xmac(CALL5)
|
|
pr_ops__xmac(CALL6)
|
|
pr_ops__xmac(CALL7)
|
|
pr_ops__xmac(CALL8)
|
|
pr_ops__xmac(STATE)
|
|
pr_ops__xmac(GOTO)
|
|
pr_ops__xmac(AND)
|
|
pr_ops__xmac(OR)
|
|
|
|
pr_ops__xmac(BITAND)
|
|
pr_ops__xmac(BITOR)
|
|
|
|
#undef pr_ops__xmac
|
|
|
|
#elif !defined(spingle__pr_ops_h)
|
|
#define spingle__pr_ops_h
|
|
|
|
enum
|
|
{
|
|
#define pr_ops__xmac(x) OP_##x,
|
|
#include "pr_ops.h"
|
|
OP_MAX,
|
|
};
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t op;
|
|
int16_t a, b, c;
|
|
} dstatement_t;
|
|
|
|
typedef struct
|
|
{
|
|
int32_t first_statement; // negative numbers are builtins
|
|
int32_t parm_start;
|
|
int32_t locals; // total ints of parms + locals
|
|
|
|
int32_t profile; // runtime
|
|
|
|
int32_t s_name;
|
|
int32_t s_file; // source file defined in
|
|
|
|
int32_t numparms;
|
|
byte parm_size[8];
|
|
} dfunction_t;
|
|
|
|
extern dfunction_t *pr_functions;
|
|
extern dstatement_t *pr_statements;
|
|
|
|
void PR_ExecuteProgram(func_t fnum);
|
|
void PR_LoadProgs(void);
|
|
|
|
#endif
|