diff --git a/GBI.cpp b/GBI.cpp index 866c7669..e732f501 100644 --- a/GBI.cpp +++ b/GBI.cpp @@ -182,6 +182,7 @@ void GBIInfo::_makeCurrent(MicrocodeInfo * _pCurrent) glDisable(GL_CLIP_DISTANCE0); } } + m_pCurrent = _pCurrent; } inline @@ -206,6 +207,7 @@ void GBIInfo::loadMicrocode(u32 uc_start, u32 uc_dstart, u16 uc_dsize) current.dataAddress = uc_dstart; current.dataSize = uc_dsize; current.NoN = false; + current.textureGen = true; current.type = NONE; // See if we can identify it by CRC @@ -214,6 +216,7 @@ void GBIInfo::loadMicrocode(u32 uc_start, u32 uc_dstart, u16 uc_dsize) for (u32 i = 0; i < numSpecialMicrocodes; ++i) { if (uc_crc == specialMicrocodes[i].crc) { current.type = specialMicrocodes[i].type; + current.NoN = specialMicrocodes[i].NoN; _makeCurrent(¤t); return; } @@ -247,6 +250,8 @@ void GBIInfo::loadMicrocode(u32 uc_start, u32 uc_dstart, u16 uc_dsize) type = F3DEX; else if (uc_str[31] == '2') type = F3DEX2; + if (strncmp(&uc_str[14], "F3DF", 4) == 0) + current.textureGen = false; } else if (strncmp( &uc_str[14], "L3D", 3 ) == 0) { u32 t = 22; diff --git a/GBI.h b/GBI.h index 2c90b1ed..bba398be 100644 --- a/GBI.h +++ b/GBI.h @@ -678,6 +678,7 @@ struct MicrocodeInfo u32 type; u32 crc; bool NoN; + bool textureGen; }; struct GBIInfo @@ -691,7 +692,8 @@ struct GBIInfo void loadMicrocode(u32 uc_start, u32 uc_dstart, u16 uc_dsize); u32 getMicrocodeType() const {return m_pCurrent != NULL ? m_pCurrent->type : NONE;} bool isHWLSupported() const; - bool isNoN() const { return m_pCurrent != NULL ? m_pCurrent->NoN != 0 : false; } + bool isNoN() const { return m_pCurrent != NULL ? m_pCurrent->NoN : false; } + bool isTextureGen() const { return m_pCurrent != NULL ? m_pCurrent->textureGen: true; } private: void _makeCurrent(MicrocodeInfo * _pCurrent); diff --git a/gSP.cpp b/gSP.cpp index 0f18327b..86edb19f 100644 --- a/gSP.cpp +++ b/gSP.cpp @@ -342,7 +342,7 @@ void gSPProcessVertex4(u32 v) else gSPLightVertex4(v); - if (gSP.geometryMode & G_TEXTURE_GEN) { + if (GBI.isTextureGen() && gSP.geometryMode & G_TEXTURE_GEN) { for(int i = 0; i < 4; ++i) { SPVertex & vtx = render.getVertex(v+i); f32 fLightDir[3] = {vtx.nx, vtx.ny, vtx.nz}; @@ -570,7 +570,7 @@ void gSPProcessVertex(u32 v) else gSPLightVertex(vtx); - if (gSP.geometryMode & G_TEXTURE_GEN) { + if (GBI.isTextureGen() && gSP.geometryMode & G_TEXTURE_GEN) { f32 fLightDir[3] = {vtx.nx, vtx.ny, vtx.nz}; f32 x, y; if (gSP.lookatEnable) {