summaryrefslogtreecommitdiff
path: root/libpcsxcore/pgxp_gte.h
blob: c97c5b29798f8a29aa72ab2b90cd999a46e74118 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/***************************************************************************
*   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_gte.h
*	PGXP - Parallel/Precision Geometry Xform Pipeline
*
*	Created on: 12 Mar 2016
*      Author: iCatButler
***************************************************************************/

#ifndef _PGXP_GTE_H_
#define _PGXP_GTE_H_

#include "psxcommon.h"

void	PGXP_Init();	// initialise memory
char*	PGXP_GetMem();	// return pointer to precision memory

// -- GTE functions
// Transforms
void	PGXP_pushSXYZ2f(float _x, float _y, float _z);
void	PGXP_pushSXYZ2s(s64 _x, s64 _y, s64 _z);
int		PGXP_NLCIP_valid();
float	PGXP_NCLIP();

// Data transfer tracking
void	PGXP_MFC2(u32 gpr, u32 gtr, u32 value);		// copy GTE reg to GPR reg (MFC2)
void	PGXP_MTC2(u32 gpr, u32 gtr, u32 value);		// copy GPR reg to GTR reg (MTC2)
void	PGXP_LWC2(u32 addr, u32 gtr, u32 value);	// copy memory to GTE reg
void	PGXP_SWC2(u32 addr, u32 gtr, u32 value);	// copy GTE reg to memory

// -- CPU functions
// Data transfer tracking
void	PGPR_L32(u32 addr, u32 code, u32 value);	// load 32bit word
void	PGPR_S32(u32 addr, u32 code, u32 value);	// store 32bit word

// Memory Read/Write hooks
u32		PGXP_psxMemRead32Trace(u32 mem, u32 code);
void	PGXP_psxMemWrite32Trace(u32 mem, u32 value, u32 code);

#endif /* _PGXP_GTE_H_ */