/***************************************************************************
*   Copyright (C) 2016 by iCatButler                                      *
*                                                                         *
*   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.,                                       *
*   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.           *
***************************************************************************/

/**************************************************************************
*	pgxp_debug.h
*	PGXP - Parallel/Precision Geometry Xform Pipeline
*
*	Created on: 07 Jun 2016
*      Author: iCatButler
***************************************************************************/

#ifndef _PGXP_DEBUG_H_
#define _PGXP_DEBUG_H_

#include "pgxp_types.h"

//#define PGXP_CPU_DEBUG
//#define PGXP_OUTPUT_ALL
//#define PGXP_FORCE_INPUT_VALUES
//#define PGXP_TEST_OUTPUT_VALUES

#define PGXP_DEBUG_TOLERANCE 2.f


// Debug wrappers
void	PGXP_psxTraceOp(u32 eOp, u32 code);
void	PGXP_psxTraceOp1(u32 eOp, u32 code, u32 op1);
void	PGXP_psxTraceOp2(u32 eOp, u32 code, u32 op1, u32 op2);
void	PGXP_psxTraceOp3(u32 eOp, u32 code, u32 op1, u32 op2, u32 op3);
void	PGXP_psxTraceOp4(u32 eOp, u32 code, u32 op1, u32 op2, u32 op3, u32 op4);

extern unsigned int pgxp_debug;


// Op flags
enum PGXP_DBG_Enum
{
	DBG_E_SPECIAL,
	DBG_E_REGIMM,
	DBG_E_J,
	DBG_E_JAL,
	DBG_E_BEQ,
	DBG_E_BNE,
	DBG_E_BLEZ,
	DBG_E_BGTZ,
	DBG_E_ADDI,
	DBG_E_ADDIU,
	DBG_E_SLTI,
	DBG_E_SLTIU,
	DBG_E_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