2009-02-11 07:05:44 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2007-2009 Gabest
|
|
|
|
* http://www.gabest.org
|
|
|
|
*
|
|
|
|
* 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, 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 GNU Make; see the file COPYING. If not, write to
|
|
|
|
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
* http://www.gnu.org/copyleft/gpl.html
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "GSLocalMemory.h"
|
|
|
|
#include "GSVector.h"
|
|
|
|
|
|
|
|
union GSScanlineSelector
|
|
|
|
{
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
DWORD fpsm:2; // 0
|
|
|
|
DWORD zpsm:2; // 2
|
|
|
|
DWORD ztst:2; // 4 (0: off, 1: write, 2: test (ge), 3: test (g))
|
|
|
|
DWORD atst:3; // 6
|
|
|
|
DWORD afail:2; // 9
|
|
|
|
DWORD iip:1; // 11
|
|
|
|
DWORD tfx:3; // 12
|
|
|
|
DWORD tcc:1; // 15
|
|
|
|
DWORD fst:1; // 16
|
|
|
|
DWORD ltf:1; // 17
|
|
|
|
DWORD tlu:1; // 18
|
|
|
|
DWORD fge:1; // 19
|
|
|
|
DWORD date:1; // 20
|
2009-03-09 01:42:56 +00:00
|
|
|
DWORD abe:1; // 21
|
|
|
|
DWORD aba:2; // 22
|
|
|
|
DWORD abb:2; // 24
|
|
|
|
DWORD abc:2; // 26
|
|
|
|
DWORD abd:2; // 28
|
|
|
|
DWORD pabe:1; // 30
|
|
|
|
DWORD aa1:1; // 31
|
2009-02-11 07:05:44 +00:00
|
|
|
|
|
|
|
DWORD fwrite:1; // 32
|
|
|
|
DWORD ftest:1; // 33
|
2009-03-09 01:42:56 +00:00
|
|
|
DWORD rfb:1; // 34
|
|
|
|
DWORD zwrite:1; // 35
|
|
|
|
DWORD ztest:1; // 36
|
|
|
|
DWORD zoverflow:1; // 37 (z max >= 0x80000000)
|
|
|
|
DWORD wms:2; // 38
|
|
|
|
DWORD wmt:2; // 40
|
|
|
|
DWORD datm:1; // 42
|
|
|
|
DWORD colclamp:1; // 43
|
|
|
|
DWORD fba:1; // 44
|
|
|
|
DWORD dthe:1; // 45
|
|
|
|
DWORD sprite:1; // 46
|
|
|
|
DWORD edge:1; // 47
|
2009-02-11 07:05:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
2009-03-09 01:42:56 +00:00
|
|
|
DWORD _pad1:22;
|
|
|
|
DWORD ababcd:8;
|
|
|
|
DWORD _pad2:2;
|
2009-02-11 07:05:44 +00:00
|
|
|
DWORD fb:2;
|
2009-03-09 01:42:56 +00:00
|
|
|
DWORD _pad3:1;
|
2009-02-11 07:05:44 +00:00
|
|
|
DWORD zb:2;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
DWORD lo;
|
|
|
|
DWORD hi;
|
|
|
|
};
|
|
|
|
|
|
|
|
UINT64 key;
|
|
|
|
|
|
|
|
operator DWORD() {return lo;}
|
|
|
|
operator UINT64() {return key;}
|
|
|
|
|
|
|
|
bool IsSolidRect()
|
|
|
|
{
|
|
|
|
return sprite
|
|
|
|
&& iip == 0
|
|
|
|
&& tfx == TFX_NONE
|
2009-03-09 01:42:56 +00:00
|
|
|
&& abe == 0
|
2009-02-11 07:05:44 +00:00
|
|
|
&& ztst <= 1
|
|
|
|
&& atst <= 1
|
|
|
|
&& date == 0
|
|
|
|
&& fge == 0;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
__declspec(align(16)) struct GSScanlineParam
|
|
|
|
{
|
|
|
|
GSScanlineSelector sel;
|
|
|
|
|
|
|
|
void* vm;
|
|
|
|
const void* tex;
|
|
|
|
const DWORD* clut;
|
|
|
|
DWORD tw;
|
|
|
|
|
|
|
|
GSLocalMemory::Offset* fbo;
|
|
|
|
GSLocalMemory::Offset* zbo;
|
|
|
|
GSLocalMemory::Offset4* fzbo;
|
|
|
|
|
|
|
|
DWORD fm, zm;
|
|
|
|
};
|
|
|
|
|
|
|
|
__declspec(align(16)) struct GSScanlineEnvironment
|
|
|
|
{
|
|
|
|
void* vm;
|
|
|
|
const void* tex;
|
|
|
|
const DWORD* clut;
|
|
|
|
DWORD tw;
|
|
|
|
|
|
|
|
GSVector4i* fbr;
|
|
|
|
GSVector4i* zbr;
|
|
|
|
int** fbc;
|
|
|
|
int** zbc;
|
|
|
|
GSVector2i* fzbr;
|
|
|
|
GSVector2i* fzbc;
|
|
|
|
|
|
|
|
GSVector4i* dimx;
|
|
|
|
|
|
|
|
GSVector4i fm, zm;
|
2009-02-11 21:42:10 +00:00
|
|
|
struct {GSVector4i min, max, mask, invmask;} t; // [u] x 4 [v] x 4
|
2009-02-11 07:05:44 +00:00
|
|
|
GSVector4i aref;
|
2009-02-13 09:28:51 +00:00
|
|
|
GSVector4i afix;
|
2009-02-11 07:05:44 +00:00
|
|
|
GSVector4i frb, fga;
|
|
|
|
|
|
|
|
struct {GSVector4 z, s, t, q; GSVector4i rb, ga, f, si, ti, _pad[7];} d[4];
|
|
|
|
struct {GSVector4 z, stq; GSVector4i c, f, st;} d4;
|
|
|
|
struct {GSVector4i rb, ga;} c;
|
|
|
|
struct {GSVector4i z, f;} p;
|
2009-03-09 01:42:56 +00:00
|
|
|
struct {GSVector4i z, f, s, t, q, rb, ga, zs, zd, uf, vf, cov;} temp;
|
2009-02-11 07:05:44 +00:00
|
|
|
};
|