Remove some unused code, add some stubs to vfpu jit, some cleanup

This commit is contained in:
Henrik Rydgard 2013-04-27 19:35:42 +02:00
parent 660d5700e7
commit 6f4ad05582
9 changed files with 203 additions and 143 deletions

View File

@ -730,4 +730,44 @@ namespace MIPSComp
DISABLE;
}
void Jit::Comp_VMinMax(u32 op) {
DISABLE;
}
void Jit::Comp_VHdp(u32 op) {
DISABLE;
}
void Jit::Comp_VCrs(u32 op) {
DISABLE;
}
void Jit::Comp_VDet(u32 op) {
DISABLE;
}
void Jit::Comp_Vi2x(u32 op) {
DISABLE;
}
void Jit::Comp_Vx2i(u32 op) {
DISABLE;
}
void Jit::Comp_Vf2i(u32 op) {
DISABLE;
}
void Jit::Comp_Vi2f(u32 op) {
DISABLE;
}
void Jit::Comp_Vcst(u32 op) {
DISABLE;
}
void Jit::Comp_Vhoriz(u32 op) {
DISABLE;
}
}

View File

@ -197,6 +197,16 @@ public:
void Comp_Vmmul(u32 op);
void Comp_Vmscl(u32 op);
void Comp_Vtfm(u32 op);
void Comp_VHdp(u32 op);
void Comp_VCrs(u32 op);
void Comp_VDet(u32 op);
void Comp_VMinMax(u32 op);
void Comp_Vi2x(u32 op);
void Comp_Vx2i(u32 op);
void Comp_Vf2i(u32 op);
void Comp_Vi2f(u32 op);
void Comp_Vcst(u32 op);
void Comp_Vhoriz(u32 op);
JitBlockCache *GetBlockCache() { return &blocks; }

View File

@ -28,18 +28,16 @@
#include <windows.h>
#endif
#include "../../Core.h"
#include "../../MemMap.h"
#include "../../CoreTiming.h"
#include "Core/Core.h"
#include "Core/MemMap.h"
#include "Core/CoreTiming.h"
#include "../MIPS.h"
#include "../MIPSTables.h"
#include "../MIPSAnalyst.h"
#include "Core/MIPS/MIPS.h"
#include "Core/MIPS/MIPSTables.h"
#include "Core/MIPS/MIPSAnalyst.h"
#include "JitBlockCache.h"
#include "JitCommon.h"
#include "Core/MIPS/JitCommon/JitBlockCache.h"
#include "Core/MIPS/JitCommon/JitCommon.h"
#if defined(ARM)
#include "Common/ArmEmitter.h"
@ -71,8 +69,7 @@ op_agent_t agent;
#define INVALID_EXIT 0xFFFFFFFF
JitBlockCache::JitBlockCache(MIPSState *mips_, CodeBlock *codeBlock) :
mips(mips_), codeBlock_(codeBlock), blocks(0), num_blocks(0),
MAX_NUM_BLOCKS(0) {
mips(mips_), codeBlock_(codeBlock), blocks(0), num_blocks(0) {
}
JitBlockCache::~JitBlockCache() {
@ -92,8 +89,6 @@ bool JitBlockCache::IsFull() const
void JitBlockCache::Init()
{
MAX_NUM_BLOCKS = 65536*2;
#if defined USE_OPROFILE && USE_OPROFILE
agent = op_open_agent();
#endif
@ -120,25 +115,12 @@ void JitBlockCache::Shutdown()
void JitBlockCache::Clear()
{
for (int i = 0; i < num_blocks; i++)
{
DestroyBlock(i, false);
}
links_to.clear();
block_map.clear();
num_blocks = 0;
}
/*void JitBlockCache::DestroyBlocksWithFlag(BlockFlag death_flag)
{
for (int i = 0; i < num_blocks; i++)
{
if (blocks[i].flags & death_flag)
{
DestroyBlock(i, false);
}
}
}*/
void JitBlockCache::Reset()
{
Shutdown();
@ -150,18 +132,6 @@ JitBlock *JitBlockCache::GetBlock(int no)
return &blocks[no];
}
bool JitBlockCache::RangeIntersect(int s1, int e1, int s2, int e2) const
{
// check if any endpoint is inside the other range
if ((s1 >= s2 && s1 <= e2) ||
(e1 >= s2 && e1 <= e2) ||
(s2 >= s1 && s2 <= e1) ||
(e2 >= s1 && e2 <= e1))
return true;
else
return false;
}
int JitBlockCache::AllocateBlock(u32 em_address)
{
JitBlock &b = blocks[num_blocks];
@ -278,18 +248,14 @@ u32 JitBlockCache::GetOriginalFirstOp(int block_num)
void JitBlockCache::LinkBlockExits(int i)
{
JitBlock &b = blocks[i];
if (b.invalid)
{
if (b.invalid) {
// This block is dead. Don't relink it.
return;
}
for (int e = 0; e < 2; e++)
{
if (b.exitAddress[e] != INVALID_EXIT && !b.linkStatus[e])
{
for (int e = 0; e < 2; e++) {
if (b.exitAddress[e] != INVALID_EXIT && !b.linkStatus[e]) {
int destinationBlock = GetBlockNumberFromStartAddress(b.exitAddress[e]);
if (destinationBlock != -1)
{
if (destinationBlock != -1) {
#if defined(ARM)
ARMXEmitter emit(b.exitPtrs[e]);
emit.B(blocks[destinationBlock].checkedEntry);
@ -342,14 +308,12 @@ void JitBlockCache::UnlinkBlock(int i)
void JitBlockCache::DestroyBlock(int block_num, bool invalidate)
{
if (block_num < 0 || block_num >= num_blocks)
{
if (block_num < 0 || block_num >= num_blocks) {
ERROR_LOG(JIT, "DestroyBlock: Invalid block number %d", block_num);
return;
}
JitBlock &b = blocks[block_num];
if (b.invalid)
{
if (b.invalid) {
if (invalidate)
ERROR_LOG(JIT, "Invalidating invalid block %d", block_num);
return;
@ -393,13 +357,10 @@ void JitBlockCache::InvalidateICache(u32 address, const u32 length)
// destroy JIT blocks
// !! this works correctly under assumption that any two overlapping blocks end at the same address
std::map<pair<u32,u32>, u32>::iterator it1 = block_map.lower_bound(std::make_pair(pAddr, 0)), it2 = it1;
while (it2 != block_map.end() && it2->first.second < pAddr + length)
{
while (it2 != block_map.end() && it2->first.second < pAddr + length) {
DestroyBlock(it2->second, true);
it2++;
}
if (it1 != it2)
{
block_map.erase(it1, it2);
}
}

View File

@ -40,13 +40,13 @@ typedef Gen::XCodeBlock CodeBlock;
#error "Unsupported arch!"
#endif
// Define this in order to get VTune profile support for the Jit generated code.
// Add the VTune include/lib directories to the project directories to get this to build.
// #define USE_VTUNE
struct JitBlock
{
struct JitBlock {
bool ContainsAddress(u32 em_address);
const u8 *checkedEntry;
const u8 *normalEntry;
@ -55,23 +55,12 @@ struct JitBlock
u32 originalAddress;
u32 originalFirstOpcode; //to be able to restore
u32 codeSize;
u32 originalSize;
int runCount; // for profiling.
int blockNum;
int flags;
u16 codeSize;
u16 originalSize;
u16 blockNum;
bool invalid;
bool linkStatus[2];
bool ContainsAddress(u32 em_address);
#ifdef _WIN32
// we don't really need to save start and stop
// TODO (mb2): ticStart and ticStop -> "local var" mean "in block" ... low priority ;)
u64 ticStart; // for profiling - time.
u64 ticStop; // for profiling - time.
u64 ticCounter; // for profiling - time.
#endif
#ifdef USE_VTUNE
char blockName[32];
@ -116,7 +105,6 @@ public:
void DestroyBlock(int block_num, bool invalidate);
private:
bool RangeIntersect(int s1, int e1, int s2, int e2) const;
void LinkBlockExits(int i);
void LinkBlock(int i);
void UnlinkBlock(int i);
@ -131,6 +119,8 @@ private:
std::multimap<u32, int> links_to;
std::map<std::pair<u32,u32>, u32> block_map; // (end_addr, start_addr) -> number
int MAX_NUM_BLOCKS;
enum {
MAX_NUM_BLOCKS = 65536*2
};
};

View File

@ -492,9 +492,9 @@ const MIPSInstruction tableVFPU1[8] =
INSTR("vdot",&Jit::Comp_VDot, Dis_VectorDot, Int_VDot, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vscl",&Jit::Comp_VScl, Dis_VScl, Int_VScl, IS_VFPU|OUT_EAT_PREFIX),
{-2},
INSTR("vhdp",&Jit::Comp_Generic, Dis_Generic, Int_VHdp, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vcrs",&Jit::Comp_Generic, Dis_Vcrs, Int_Vcrs, IS_VFPU),
INSTR("vdet",&Jit::Comp_Generic, Dis_Generic, Int_Vdet, IS_VFPU),
INSTR("vhdp",&Jit::Comp_VHdp, Dis_Generic, Int_VHdp, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vcrs",&Jit::Comp_VCrs, Dis_Vcrs, Int_Vcrs, IS_VFPU),
INSTR("vdet",&Jit::Comp_VDet, Dis_Generic, Int_Vdet, IS_VFPU),
{-2},
};
@ -502,8 +502,8 @@ const MIPSInstruction tableVFPU3[8] = //011011 xxx
{
INSTR("vcmp",&Jit::Comp_Generic, Dis_Vcmp, Int_Vcmp, IS_VFPU|OUT_EAT_PREFIX),
{-2},
INSTR("vmin",&Jit::Comp_Generic, Dis_VectorSet3, Int_Vminmax, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vmax",&Jit::Comp_Generic, Dis_VectorSet3, Int_Vminmax, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vmin",&Jit::Comp_VMinMax, Dis_VectorSet3, Int_Vminmax, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vmax",&Jit::Comp_VMinMax, Dis_VectorSet3, Int_Vminmax, IS_VFPU|OUT_EAT_PREFIX),
{-2},
INSTR("vscmp",&Jit::Comp_Generic, Dis_VectorSet3, Int_Vscmp, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vsge",&Jit::Comp_Generic, Dis_VectorSet3, Int_Vsge, IS_VFPU|OUT_EAT_PREFIX),
@ -516,7 +516,7 @@ const MIPSInstruction tableVFPU4Jump[32] = //110100 xxxxx
{VFPU4},
{VFPU7},
{VFPU9},
INSTR("vcst", &Jit::Comp_Generic, Dis_Vcst, Int_Vcst, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vcst", &Jit::Comp_Vcst, Dis_Vcst, Int_Vcst, IS_VFPU|OUT_EAT_PREFIX),
{-2},{-2},{-2},{-2},
//8
@ -524,12 +524,12 @@ const MIPSInstruction tableVFPU4Jump[32] = //110100 xxxxx
{-2},{-2},{-2},{-2},
//16
INSTR("vf2in", &Jit::Comp_Generic, Dis_Vf2i, Int_Vf2i, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vf2iz", &Jit::Comp_Generic, Dis_Vf2i, Int_Vf2i, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vf2iu", &Jit::Comp_Generic, Dis_Vf2i, Int_Vf2i, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vf2id", &Jit::Comp_Generic, Dis_Vf2i, Int_Vf2i, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vf2in", &Jit::Comp_Vf2i, Dis_Vf2i, Int_Vf2i, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vf2iz", &Jit::Comp_Vf2i, Dis_Vf2i, Int_Vf2i, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vf2iu", &Jit::Comp_Vf2i, Dis_Vf2i, Int_Vf2i, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vf2id", &Jit::Comp_Vf2i, Dis_Vf2i, Int_Vf2i, IS_VFPU|OUT_EAT_PREFIX),
//20
INSTR("vi2f", &Jit::Comp_Generic, Dis_Vf2i, Int_Vi2f, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vi2f", &Jit::Comp_Vi2f, Dis_Vf2i, Int_Vi2f, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vcmov", &Jit::Comp_Generic, Dis_Vcmov,Int_Vcmov,IS_VFPU|OUT_EAT_PREFIX),
{-2},
{-2},
@ -567,15 +567,15 @@ const MIPSInstruction tableVFPU7[32] =
{-2},
INSTR("vlgb", &Jit::Comp_Generic, Dis_Generic, Int_Vlgb, IS_VFPU),
//24
INSTR("vuc2i", &Jit::Comp_Generic, Dis_Vs2i, Int_Vx2i, IS_VFPU), // Seen in BraveStory, initialization 110100 00001110000 000 0001 0000 0000
INSTR("vc2i", &Jit::Comp_Generic, Dis_Vs2i, Int_Vx2i, IS_VFPU),
INSTR("vus2i", &Jit::Comp_Generic, Dis_Vs2i, Int_Vx2i, IS_VFPU),
INSTR("vs2i", &Jit::Comp_Generic, Dis_Vs2i, Int_Vx2i, IS_VFPU),
INSTR("vuc2i", &Jit::Comp_Vx2i, Dis_Vs2i, Int_Vx2i, IS_VFPU), // Seen in BraveStory, initialization 110100 00001110000 000 0001 0000 0000
INSTR("vc2i", &Jit::Comp_Vx2i, Dis_Vs2i, Int_Vx2i, IS_VFPU),
INSTR("vus2i", &Jit::Comp_Vx2i, Dis_Vs2i, Int_Vx2i, IS_VFPU),
INSTR("vs2i", &Jit::Comp_Vx2i, Dis_Vs2i, Int_Vx2i, IS_VFPU),
INSTR("vi2uc", &Jit::Comp_Generic, Dis_Vi2x, Int_Vi2x, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vi2c", &Jit::Comp_Generic, Dis_Vi2x, Int_Vi2x, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vi2us", &Jit::Comp_Generic, Dis_Vi2x, Int_Vi2x, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vi2s", &Jit::Comp_Generic, Dis_Vi2x, Int_Vi2x, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vi2uc", &Jit::Comp_Vi2x, Dis_Vi2x, Int_Vi2x, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vi2c", &Jit::Comp_Vi2x, Dis_Vi2x, Int_Vi2x, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vi2us", &Jit::Comp_Vi2x, Dis_Vi2x, Int_Vi2x, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vi2s", &Jit::Comp_Vi2x, Dis_Vi2x, Int_Vi2x, IS_VFPU|OUT_EAT_PREFIX),
};
// 110100 00000 10100 0000000000000000
@ -692,8 +692,8 @@ const MIPSInstruction tableVFPU9[32] = //110100 00010 xxxxx
//4
INSTR("vocp", &Jit::Comp_Generic, Dis_Vbfy, Int_Vocp, IS_VFPU|OUT_EAT_PREFIX), // one's complement
INSTR("vsocp", &Jit::Comp_Generic, Dis_Vbfy, Int_Vsocp, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vfad", &Jit::Comp_Generic, Dis_Vfad, Int_Vfad, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vavg", &Jit::Comp_Generic, Dis_Vfad, Int_Vavg, IS_VFPU),
INSTR("vfad", &Jit::Comp_Vhoriz, Dis_Vfad, Int_Vfad, IS_VFPU|OUT_EAT_PREFIX),
INSTR("vavg", &Jit::Comp_Vhoriz, Dis_Vfad, Int_Vavg, IS_VFPU),
//8
INSTR("vsrt3", &Jit::Comp_Generic, Dis_Vbfy, Int_Vsrt3, IS_VFPU),
INSTR("vsrt4", &Jit::Comp_Generic, Dis_Vbfy, Int_Vsrt4, IS_VFPU),

View File

@ -934,4 +934,44 @@ void Jit::Comp_Vtfm(u32 op) {
fpr.ReleaseSpillLocks();
}
void Jit::Comp_VMinMax(u32 op) {
DISABLE;
}
void Jit::Comp_VHdp(u32 op) {
DISABLE;
}
void Jit::Comp_VCrs(u32 op) {
DISABLE;
}
void Jit::Comp_VDet(u32 op) {
DISABLE;
}
void Jit::Comp_Vi2x(u32 op) {
DISABLE;
}
void Jit::Comp_Vx2i(u32 op) {
DISABLE;
}
void Jit::Comp_Vf2i(u32 op) {
DISABLE;
}
void Jit::Comp_Vi2f(u32 op) {
DISABLE;
}
void Jit::Comp_Vcst(u32 op) {
DISABLE;
}
void Jit::Comp_Vhoriz(u32 op) {
DISABLE;
}
}

View File

@ -207,6 +207,16 @@ public:
void Comp_Vmmul(u32 op);
void Comp_Vmscl(u32 op);
void Comp_Vtfm(u32 op);
void Comp_VHdp(u32 op);
void Comp_VCrs(u32 op);
void Comp_VDet(u32 op);
void Comp_VMinMax(u32 op);
void Comp_Vi2x(u32 op);
void Comp_Vx2i(u32 op);
void Comp_Vf2i(u32 op);
void Comp_Vi2f(u32 op);
void Comp_Vcst(u32 op);
void Comp_Vhoriz(u32 op);
void Comp_DoNothing(u32 op);

View File

@ -39,31 +39,33 @@ extern u32 curTextureWidth;
extern u32 curTextureHeight;
static const u8 flushOnChangedBeforeCommandList[] = {
GE_CMD_REGION1,GE_CMD_REGION2,
GE_CMD_VERTEXTYPE,
GE_CMD_BLENDMODE,
GE_CMD_BLENDFIXEDA,
GE_CMD_BLENDFIXEDB,
GE_CMD_TEXOFFSETU,
GE_CMD_TEXOFFSETV,
GE_CMD_TEXSCALEU,
GE_CMD_TEXSCALEV,
GE_CMD_CULLFACEENABLE,
GE_CMD_CULL,
GE_CMD_TEXTUREMAPENABLE,
GE_CMD_LIGHTINGENABLE,
GE_CMD_LIGHTENABLE0,GE_CMD_LIGHTENABLE1,GE_CMD_LIGHTENABLE2,GE_CMD_LIGHTENABLE3,
GE_CMD_CULLFACEENABLE,
GE_CMD_TEXTUREMAPENABLE,
GE_CMD_FOGENABLE,
GE_CMD_DITHERENABLE,
GE_CMD_ALPHABLENDENABLE,
GE_CMD_ALPHATESTENABLE,
GE_CMD_ALPHATEST,
GE_CMD_ZTESTENABLE,
GE_CMD_STENCILTESTENABLE,
GE_CMD_COLORTESTENABLE,
GE_CMD_COLORTEST,
GE_CMD_COLORTESTMASK,
GE_CMD_COLORREF,
GE_CMD_MINZ,GE_CMD_MAXZ,
GE_CMD_FOG1,
GE_CMD_FOG2,
GE_CMD_FOGCOLOR,
GE_CMD_MORPHWEIGHT0,GE_CMD_MORPHWEIGHT1,GE_CMD_MORPHWEIGHT2,GE_CMD_MORPHWEIGHT3,
GE_CMD_MORPHWEIGHT4,GE_CMD_MORPHWEIGHT5,GE_CMD_MORPHWEIGHT6,GE_CMD_MORPHWEIGHT7,
GE_CMD_PATCHDIVISION,
GE_CMD_PATCHPRIMITIVE,
GE_CMD_PATCHFACING,
GE_CMD_VIEWPORTX1,GE_CMD_VIEWPORTY1,
GE_CMD_VIEWPORTX2,GE_CMD_VIEWPORTY2,
GE_CMD_VIEWPORTZ1,GE_CMD_VIEWPORTZ2,
GE_CMD_TEXSCALEU,
GE_CMD_TEXSCALEV,
GE_CMD_TEXOFFSETU,
GE_CMD_TEXOFFSETV,
GE_CMD_OFFSETX,
GE_CMD_OFFSETY,
GE_CMD_SHADEMODE,
GE_CMD_REVERSENORMAL,
GE_CMD_MATERIALUPDATE,
@ -95,47 +97,52 @@ static const u8 flushOnChangedBeforeCommandList[] = {
GE_CMD_LAC1,GE_CMD_LDC1,GE_CMD_LSC1,
GE_CMD_LAC2,GE_CMD_LDC2,GE_CMD_LSC2,
GE_CMD_LAC3,GE_CMD_LDC3,GE_CMD_LSC3,
GE_CMD_VIEWPORTX1,GE_CMD_VIEWPORTY1,
GE_CMD_VIEWPORTX2,GE_CMD_VIEWPORTY2,
GE_CMD_VIEWPORTZ1,GE_CMD_VIEWPORTZ2,
GE_CMD_LIGHTENABLE0,GE_CMD_LIGHTENABLE1,GE_CMD_LIGHTENABLE2,GE_CMD_LIGHTENABLE3,
GE_CMD_PATCHDIVISION,
GE_CMD_CLEARMODE,
GE_CMD_CULL,
GE_CMD_FRAMEBUFPTR,
GE_CMD_FRAMEBUFWIDTH,
GE_CMD_TEXADDR0,GE_CMD_TEXADDR1,GE_CMD_TEXADDR2,GE_CMD_TEXADDR3,
GE_CMD_TEXADDR4,GE_CMD_TEXADDR5,GE_CMD_TEXADDR6,GE_CMD_TEXADDR7,
GE_CMD_TEXBUFWIDTH0,GE_CMD_TEXBUFWIDTH1,GE_CMD_TEXBUFWIDTH2,GE_CMD_TEXBUFWIDTH3,
GE_CMD_TEXBUFWIDTH4,GE_CMD_TEXBUFWIDTH5,GE_CMD_TEXBUFWIDTH6,GE_CMD_TEXBUFWIDTH7,
GE_CMD_CLUTADDR,
GE_CMD_CLUTADDRUPPER,
GE_CMD_TEXSIZE0,GE_CMD_TEXSIZE1,GE_CMD_TEXSIZE2,GE_CMD_TEXSIZE3,
GE_CMD_TEXSIZE4,GE_CMD_TEXSIZE5,GE_CMD_TEXSIZE6,GE_CMD_TEXSIZE7,
GE_CMD_TEXMAPMODE,
GE_CMD_TEXSHADELS,
GE_CMD_TEXFUNC,
GE_CMD_TEXFILTER,
GE_CMD_TEXENVCOLOR,
GE_CMD_TEXMODE,
GE_CMD_TEXFORMAT,
GE_CMD_LOADCLUT,
GE_CMD_CLUTFORMAT,
GE_CMD_TEXFILTER,
GE_CMD_TEXWRAP,
GE_CMD_TEXLEVEL,
GE_CMD_TEXFUNC,
GE_CMD_TEXENVCOLOR,
//GE_CMD_TEXFLUSH,
GE_CMD_FOG1,
GE_CMD_FOG2,
GE_CMD_FOGCOLOR,
// GE_CMD_TEXLODSLOPE,
GE_CMD_FRAMEBUFPIXFORMAT,
GE_CMD_CLEARMODE,
GE_CMD_SCISSOR1,
GE_CMD_SCISSOR2,
GE_CMD_ZTESTENABLE,
GE_CMD_ZWRITEDISABLE,
GE_CMD_STENCILTESTENABLE,
GE_CMD_MINZ,
GE_CMD_MAXZ,
GE_CMD_COLORTEST,
GE_CMD_COLORTESTMASK,
GE_CMD_COLORREF,
GE_CMD_ALPHATEST,
GE_CMD_STENCILOP,
GE_CMD_STENCILTEST,
GE_CMD_ZTEST,
GE_CMD_BLENDMODE,
GE_CMD_BLENDFIXEDA,
GE_CMD_BLENDFIXEDB,
GE_CMD_ZWRITEDISABLE,
GE_CMD_MASKRGB,
GE_CMD_MASKALPHA,
GE_CMD_TEXBUFWIDTH0,
GE_CMD_CLUTADDR,
GE_CMD_CLUTADDRUPPER,
GE_CMD_LOADCLUT,
GE_CMD_CLUTFORMAT,
GE_CMD_TEXADDR0,GE_CMD_TEXADDR1,GE_CMD_TEXADDR2,GE_CMD_TEXADDR3,
GE_CMD_TEXADDR4,GE_CMD_TEXADDR5,GE_CMD_TEXADDR6,GE_CMD_TEXADDR7,
GE_CMD_TEXSIZE0,GE_CMD_TEXSIZE1,GE_CMD_TEXSIZE2,GE_CMD_TEXSIZE3,
GE_CMD_TEXSIZE4,GE_CMD_TEXSIZE5,GE_CMD_TEXSIZE6,GE_CMD_TEXSIZE7,
GE_CMD_OFFSETX,
GE_CMD_OFFSETY,
GE_CMD_MORPHWEIGHT0,GE_CMD_MORPHWEIGHT1,GE_CMD_MORPHWEIGHT2,GE_CMD_MORPHWEIGHT3,
GE_CMD_MORPHWEIGHT4,GE_CMD_MORPHWEIGHT5,GE_CMD_MORPHWEIGHT6,GE_CMD_MORPHWEIGHT7,
GE_CMD_REGION1,GE_CMD_REGION2,
GE_CMD_FRAMEBUFPTR,
GE_CMD_FRAMEBUFWIDTH,
GE_CMD_FRAMEBUFPIXFORMAT,
GE_CMD_ZBUFPTR,
GE_CMD_ZBUFWIDTH,
};

View File

@ -49,6 +49,7 @@ public:
bool DecodeTexture(u8 *output, GPUgstate state);
private:
// Wow this is starting to grow big. Soon need to start looking at resizing it.
struct TexCacheEntry {
// After marking STATUS_UNRELIABLE, if it stays the same this many frames we'll trust it again.
const static int FRAMES_REGAIN_TRUST = 1000;
@ -69,8 +70,8 @@ private:
int numFrames;
u32 framesUntilNextFullHash;
u8 format;
u16 dim;
u8 clutformat;
u16 dim;
u32 clutaddr;
u32 cluthash;
u32 texture; //GLuint
@ -80,6 +81,7 @@ private:
float lodBias;
// Cache the current filter settings so we can avoid setting it again.
// (OpenGL madness where filter settings are attached to each texture).
u8 magFilt;
u8 minFilt;
bool sClamp;