mirror of
https://github.com/iCatButler/pcsxr.git
synced 2024-06-02 03:07:43 -04:00
69f33a4782
- Sign extend values read using LH - Add conversion functions to represent Signed/Unsigned 16-bit ranges - Add overflow and truncation functions for 16-bit ranges - Sign extend imm value in ADD(U) - Add component overflow and truncation to ADD/SUB functions - Construct new value in logic operators where result using inputs is undefined - Return a valid W component from logic operators (if either input has one) - Compare against high value (y), then low value (x) in less than operators - Use doubles and implement overflow for Multiply operations to try to increase accuracy - Use unsigned values in both MUL and DIV operations to make output as accurate as possible - Implement several variants of shift operators. Trying both arithmetically correct and more analytical approaches with varying success. Debug updates - Added ability to force all values to be equal to low precision values before operating on them - Added feature to test output of operations against a tolerance and print only those which fail GPU updates - Colour vertices with valid XY coordinates but no W as cyan to make them easier to spot - Remove cyan colouring for stale vertices (wasn't useful) - Added ability to skip debug rendering when needed (like seeing the output of offscreen rendering applied to a sprite). - Added new mode which shows primitive type
49 lines
2.2 KiB
C
49 lines
2.2 KiB
C
/***************************************************************************
|
|
* 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_mem.h
|
|
* PGXP - Parallel/Precision Geometry Xform Pipeline
|
|
*
|
|
* Created on: 07 Jun 2016
|
|
* Author: iCatButler
|
|
***************************************************************************/
|
|
|
|
#ifndef _PGXP_MEM_H_
|
|
#define _PGXP_MEM_H_
|
|
|
|
#include "psxcommon.h"
|
|
|
|
void PGXP_Init(); // initialise memory
|
|
char* PGXP_GetMem(); // return pointer to precision memory
|
|
u32 PGXP_ConvertAddress(u32 addr);
|
|
|
|
struct PGXP_value_Tag;
|
|
typedef struct PGXP_value_Tag PGXP_value;
|
|
|
|
PGXP_value* GetPtr(u32 addr);
|
|
PGXP_value* ReadMem(u32 addr);
|
|
|
|
void ValidateAndCopyMem(PGXP_value* dest, u32 addr, u32 value);
|
|
void ValidateAndCopyMem16(PGXP_value* dest, u32 addr, u32 value, int sign);
|
|
|
|
void WriteMem(PGXP_value* value, u32 addr);
|
|
void WriteMem16(PGXP_value* src, u32 addr);
|
|
|
|
#endif//_PGXP_MEM_H_
|