Ver código fonte

0x00183458,CGFXFX::ParticleRender bugfix

DESKTOP-AB9OQPJ\RED-10 3 anos atrás
pai
commit
60e030b21a
6 arquivos alterados com 511 adições e 137 exclusões
  1. 5 1
      jni/CFTT3dGenShader.cpp
  2. 11 2
      jni/CFTTRenderHelper.cpp
  3. 9 6
      jni/CFTTTextureCache.cpp
  4. 421 122
      jni/CGFXFX.cpp
  5. 4 0
      jni/CLegacyLitShader.cpp
  6. 61 6
      jni/Matrix.cpp

+ 5 - 1
jni/CFTT3dGenShader.cpp

@@ -19,7 +19,11 @@ void CFTT3dGenShader::SetBlendMode(EFTT3dGenShader_BlendMode eBlendMode, int a2)
 //-------------------------------------------------------------------------------------------------
 //001239BE //^_^
 //原始汇编r1寄存器没有用到,即多了一个参数,如果我的代码,加上一个无用的参数,汇编的结果完全相同
-void CFTT3dGenShader::SetSampler00(CFTTTexParam aTexParam, int a2) {
+void CFTT3dGenShader::SetSampler00(CFTTTexParam aTexParam, int a2)
+{
+int ret=rand();
+printf("%x%x%x%x",ret,aTexParam.GetFlag0(),
+aTexParam.GetFlag4(),a2);
 }
 //-------------------------------------------------------------------------------------------------
 //0020E760 //^_^

+ 11 - 2
jni/CFTTRenderHelper.cpp

@@ -17,11 +17,17 @@ CFTTRenderHelper::~CFTTRenderHelper() {
 //-------------------------------------------------------------------------------------------------
 //002012E0 //^_^
 void *CFTTRenderHelper::LockVertices() {
-  return 0;
+ srand((unsigned)time(NULL));
+  int ret = rand();
+  printf("%d%d", this, ret);
+  return (void*)ret;
 }
 //-------------------------------------------------------------------------------------------------
 //002012EE //^_^
 void CFTTRenderHelper::UnlockVertices(int count) {
+  srand((unsigned)time(NULL));
+  int ret = rand();
+  printf("%d%d%d", this, ret, count);
 }
 //-------------------------------------------------------------------------------------------------
 //00201304 //^_^
@@ -41,6 +47,9 @@ void CFTTRenderHelper::SetIndices(ushort const *pData, int len) {
 }
 //-------------------------------------------------------------------------------------------------
 //0020135C
-void CFTTRenderHelper::Render(CFTTMatrix32 const *pMatrix, int a3, int a4, int a5) {
+void CFTTRenderHelper::Render(CFTTMatrix32 const* a1, int a2, int a3, int a4) {
+  srand((unsigned)time(NULL));
+  int ret = rand();
+  printf("%x%d%d%d%d", this, ret, a1, a2, a3, a4);
 }
 //-------------------------------------------------------------------------------------------------

+ 9 - 6
jni/CFTTTextureCache.cpp

@@ -94,12 +94,15 @@ int CFTTTextureCache::GetIndex(CFTTCachedImage *pImage) {
 }
 //-------------------------------------------------------------------------------------------------
 //00222D20  //^_- 经过单元测试,功能正常  玩了几关游戏,没有发现问题
-CFTTTexture *CFTTTextureCache::GetTexture(char const *pFile, CFTTTexLoadOptions const &pLoadOpt, uint a2) {
-  CFTTTexture *pret_texture = nullptr;
-
-  LOGI("CFTTTextureCache::GetTexture end");
-  return pret_texture;
-}
+CFTTTexture *CFTTTextureCache::GetTexture(char const *a1,
+                                 CFTTTexLoadOptions const &a2,
+                                 uint a3)
+                                 {
+ srand(time(NULL));
+     int ret=rand();
+     printf("%p%x%x%x",a1,ret,(uint)&a2,a3);
+     return (CFTTTexture*)rand();
+                                 }
 //-------------------------------------------------------------------------------------------------
 //002230FC
 bool CFTTTextureCache::CheckForLoadCompletion(CFTTCachedImage *pImage) {

+ 421 - 122
jni/CGFXFX.cpp

@@ -25,169 +25,468 @@
 #define BallPathSize 128
 CGraphicsRewindEffect *CGFXFX::ms_pRewindEffect;
 
-int CGFXFX::ms_iAdditiveMat = -1;  //0033EFBC
-int CGFXFX::ms_iModulateMat = -1;  //0033EFC0
-int CGFXFX::ms_iConfettiMat = -1;  //0033EFC4
-
-CFTTRenderHelper *CGFXFX::ms_pRenderHelperAdditive;  //003A4EE4
-CFTTRenderHelper *CGFXFX::ms_pRenderHelperModulate;  //003A4EE8
-CFTTRenderHelper *CGFXFX::ms_pRenderHelperConfetti;  //003A4EEC
-CFTTRenderHelper *CGFXFX::ms_pRenderHelperStrip;     //003A4EF0
-
-Particle CGFXFX::m_tParticle[0x2000];        //003A4EF4   88 8192
-int CGFXFX::m_iNumActiveParticles;           //00454EF4
-TPoint3D CGFXFX::m_vBallPosPrev;             //00454EF8
-TPoint3D CGFXFX::m_vBallMovePrev;            //00454F04
-TPoint CGFXFX::ms_tFountainsInfo;            //00454F10
-int CGFXFX::ms_iSwirlTick;                   //00454F18
-TPoint3D CGFXFX::m_vBallPath[BallPathSize];  //00454F1C
-int CGFXFX::m_iBallPathSize;                 //0045551C
-int CGFXFX::m_iBallPathStart;                //00455520
-int CGFXFX::m_iBallTrailCol;                 //00455524
-TPoint CGFXFX::m_vSwipeScreen[0x100];        //00455528
-int CGFXFX::m_iSwipeScreenSize;              //00455D28
-CFTTVector32 CGFXFX::m_vSwipePath[0x100];    //00455D2C
-int CGFXFX::m_iSwipePathSize;                //0045692C
-int CGFXFX::m_iSwipeTime;                    //00456930
-int CGFXFX::m_iSwipeCol;                     //00456934
-bool CGFXFX::m_bEnableRender;                //00456938
-//CGFXFX::ms_pRewindEffect;          //0045693C
-uint CGFXFX::ms_uGoldenBootEnabled;   //00456940
-uint CGFXFX::ms_uStarPlayerEnabled;   ///00456944
-static int list_rand_456948[1024];  //00456948
-static int gs_i457948;
+int CGFXFX::ms_iAdditiveMat = -1;  // 0033EFBC
+int CGFXFX::ms_iModulateMat = -1;  // 0033EFC0
+int CGFXFX::ms_iConfettiMat = -1;  // 0033EFC4
+
+CFTTRenderHelper *CGFXFX::ms_pRenderHelperAdditive;  // 003A4EE4
+CFTTRenderHelper *CGFXFX::ms_pRenderHelperModulate;  // 003A4EE8
+CFTTRenderHelper *CGFXFX::ms_pRenderHelperConfetti;  // 003A4EEC
+CFTTRenderHelper *CGFXFX::ms_pRenderHelperStrip;     // 003A4EF0
 
+Particle CGFXFX::m_tParticle[0x2000];        // 003A4EF4   88 8192
+int CGFXFX::m_iNumActiveParticles;           // 00454EF4
+TPoint3D CGFXFX::m_vBallPosPrev;             // 00454EF8
+TPoint3D CGFXFX::m_vBallMovePrev;            // 00454F04
+TPoint CGFXFX::ms_tFountainsInfo;            // 00454F10
+int CGFXFX::ms_iSwirlTick;                   // 00454F18
+TPoint3D CGFXFX::m_vBallPath[BallPathSize];  // 00454F1C
+int CGFXFX::m_iBallPathSize;                 // 0045551C
+int CGFXFX::m_iBallPathStart;                // 00455520
+int CGFXFX::m_iBallTrailCol;                 // 00455524
+TPoint CGFXFX::m_vSwipeScreen[0x100];        // 00455528
+int CGFXFX::m_iSwipeScreenSize;              // 00455D28
+CFTTVector32 CGFXFX::m_vSwipePath[0x100];    // 00455D2C
+int CGFXFX::m_iSwipePathSize;                // 0045692C
+int CGFXFX::m_iSwipeTime;                    // 00456930
+int CGFXFX::m_iSwipeCol;                     // 00456934
+bool CGFXFX::m_bEnableRender;                // 00456938
+// CGFXFX::ms_pRewindEffect;          //0045693C
+uint CGFXFX::ms_uGoldenBootEnabled;  // 00456940
+uint CGFXFX::ms_uStarPlayerEnabled;  /// 00456944
+static int list_rand_456948[1024];   // 00456948
+static int gs_i457948;
+char *gs_s_323118[8] = {"data/fx/circle0.png",
+                        "data/fx/flames.png",
+                        "data/fx/smoke.png",
+                        "data/fx/star1.png",
+                        "Data/models/SpecialFX/glare.bmp",
+                        "data/fx/star1.png",
+                        "Data/fx/confetti.png",
+                        "data/fx/star1.png"};
 //-------------------------------------------------------------------------------------------------
-//00181AC8 -_- 经过单元测试,功能正常
+// 00181AC8 -_- 经过单元测试,功能正常
 void CGFXFX::Init() {
   LOGI("CGFXFX::Init entry");
 
   LOGI("CGFXFX::Init end");
 }
 //-------------------------------------------------------------------------------------------------
-//00181D48 //^_^
-void CGFXFX::Shutdown() {
-}
+// 00181D48 //^_^
+void CGFXFX::Shutdown() {}
 //-------------------------------------------------------------------------------------------------
-//00181E44
-void CGFXFX::Update(float) {
-}
+// 00181E44
+void CGFXFX::Update(float) {}
 //-------------------------------------------------------------------------------------------------
-//00181EB4
-void CGFXFX::ParticleLogicUpdate() {
-}
+// 00181EB4
+void CGFXFX::ParticleLogicUpdate() {}
 //-------------------------------------------------------------------------------------------------
-//00181FD0
-void CGFXFX::ParticleProcess() {
-}
+// 00181FD0
+void CGFXFX::ParticleProcess() {}
 //-------------------------------------------------------------------------------------------------
-//0018222C
-void CGFXFX::BallPathProcess() {
-}
+// 0018222C
+void CGFXFX::BallPathProcess() {}
 //-------------------------------------------------------------------------------------------------
-//00182324
-void CGFXFX::BallEffectsProcess() {
-}
+// 00182324
+void CGFXFX::BallEffectsProcess() {}
 //-------------------------------------------------------------------------------------------------
-//0018274C
-void CGFXFX::SwipeUpdate() {
-}
+// 0018274C
+void CGFXFX::SwipeUpdate() {}
 //-------------------------------------------------------------------------------------------------
-//00182794 //^_^ 经过单元测试,功能正常
+// 00182794 //^_^ 经过单元测试,功能正常
 void CGFXFX::Render2D() {
-  //LOGI("CGFXFX::Render2D Entry");
+  // LOGI("CGFXFX::Render2D Entry");
 }
 //-------------------------------------------------------------------------------------------------
-//001827B4
-void CGFXFX::Render() {
-}
+// 001827B4
+void CGFXFX::Render() {}
 //-------------------------------------------------------------------------------------------------
-//0018296C
-void CGFXFX::BallPathAddVerts(TFVF_PFLOAT_CINT_TFLOAT *&) {
-}
+// 0018296C
+void CGFXFX::BallPathAddVerts(TFVF_PFLOAT_CINT_TFLOAT *&) {}
 //-------------------------------------------------------------------------------------------------
-//00182BB0
-void CGFXFX::BallTrailAddVerts(TFVF_PFLOAT_CINT_TFLOAT *&) {
-}
+// 00182BB0
+void CGFXFX::BallTrailAddVerts(TFVF_PFLOAT_CINT_TFLOAT *&) {}
 //-------------------------------------------------------------------------------------------------
-//00182E5C
-void CGFXFX::SwipeAddVerts(TFVF_PFLOAT_CINT_TFLOAT *&) {
-}
+// 00182E5C
+void CGFXFX::SwipeAddVerts(TFVF_PFLOAT_CINT_TFLOAT *&) {}
 //-------------------------------------------------------------------------------------------------
-//00183458
+// 00183458
 void CGFXFX::ParticleRender() {
+  float s16_f = 0.000030518f;
+  // sp8=m_tParticle  sp14=m_iNumActiveParticles sp10=cball   sp18=sinf
+  int r5_i = 0;
+  // loc_183994
+  while (r5_i != 8) {
+    // loc_18348A
+    RenderHelperConfetti_LockVerticesRet *r8_pv = 0;
+    TFVF_PFLOAT_CINT_TFLOAT *r7_pv = 0;
+    int r11_i = 0;
+    TFVF_PFLOAT_CINT_TFLOAT *pv_sp1C = NULL;
+    RenderHelperConfetti_LockVerticesRet *pv_spC = NULL;
+    // loc_1838CC
+    while (r11_i < m_iNumActiveParticles) {
+      //  /loc_1834A4
+      if (m_tParticle[r11_i].eGFXFXParticle_0 == r5_i) {
+         LOGE("CGFXFX::ParticleRender_1");
+        int r0_i = 0;
+        float s26_f = m_tParticle[r11_i].vector32_4.float_0;
+        float s28_f = m_tParticle[r11_i].vector32_4.float_4;
+        float s30_f = m_tParticle[r11_i].vector32_4.float_8;
+        if ((r5_i & 0x7FFFFFFF) == 7 || (r5_i & 0x7FFFFFFF) == 1) {
+           LOGE("CGFXFX::ParticleRender_2");
+          float s0_f = cBall.ballPosPrev_4.point_0.dx_0;
+          float s2_f = cBall.ballPosPrev_4.point_0.dy_4;
+          float s4_f = cBall.ballPosPrev_4.dz_8;
+          s30_f = s30_f + s2_f * s16_f;
+          s28_f = s28_f + s4_f * s16_f;
+          s26_f = s26_f - s0_f * s16_f;
+        }
+        // loc_1834EC
+        float s24_f = m_tParticle[r11_i].f_38;
+        float s17_f = m_tParticle[r11_i].f_3C;
+        float s0_f = m_tParticle[r11_i].f_48;
+        float s2_f = m_tParticle[r11_i].f_4C;
+        s2_f -= s0_f;
+        float s21_f = m_tParticle[r11_i].i_54 - m_tParticle[r11_i].i_50;
+        float s23_f = m_tParticle[r11_i].i_54;
+        
+        s2_f *= s21_f;
+        s2_f /= s23_f;
+        s0_f += s2_f;
+        sinf(s0_f);
+        cosf(s0_f);
+        sinf(s0_f);
+        cosf(s0_f);
+        float s29_f = sinf(s0_f);
+        float s31_f = cosf(s0_f);
+        float s19_f = GFXCAMERA_vCamUp.float_0;
+        float s25_f = GFXCAMERA_vCamUp.float_4;
+        float s27_f = GFXCAMERA_vCamUp.float_8;
+
+        s0_f = s31_f * s19_f;
+        s2_f = s31_f * s25_f;
+        float s4_f = s31_f * s27_f;
+
+        float s22_f = GFXCAMERA_vCamRight.float_0;
+        float s18_f = GFXCAMERA_vCamRight.float_4;
+        float s20_f = GFXCAMERA_vCamRight.float_8;
+
+        s0_f = s0_f + s29_f * s22_f;
+        s2_f = s2_f + s29_f * s18_f;
+        s4_f = s4_f + s29_f * s20_f;
+        CFTTVector32 v32_sp70;
+        v32_sp70.float_0 = s0_f;
+        v32_sp70.float_4 = s2_f;
+        v32_sp70.float_8 = s4_f;
+        s0_f = s17_f - s24_f;
+        s0_f *= s21_f;
+        s2_f = m_tParticle[r11_i].i_54 - m_tParticle[r11_i].i_50;
+        s4_f = m_tParticle[r11_i].i_54;
+        s0_f /= s23_f;
+        s2_f /= s4_f;
+        s24_f += s0_f;
+        uint r1_u =
+            XMixCol(m_tParticle[r11_i].u_40, m_tParticle[r11_i].u_44, s2_f);
+
+        s0_f = 0.5f;
+        s17_f = s24_f * s0_f;
+        // 001835E8
+        uint r6_platformU32 = g_pGraphicsDevice->ARGBToPlatformU32(r1_u);
+        if (m_tParticle[r11_i].eGFXFXParticle_0 == EGFXFXParticle_6) {
+           LOGE("CGFXFX::ParticleRender_3");
+          // 001835F6
+          s2_f = m_tParticle[r11_i].vector32_1C.float_0;
+          float s6_f = 0.0f;
+          s0_f = m_tParticle[r11_i].vector32_1C.float_4;
+          // int r10_i = r5_i;
+          s0_f = s0_f + s2_f * s6_f;
+          s4_f = m_tParticle[r11_i].vector32_1C.float_8;
+          s2_f = -1.0f;
+
+          CFTTVector32 v32_sp64;
+          v32_sp64.float_0 = 0;
+          v32_sp64.float_4 = 1.0f;
+          v32_sp64.float_8 = 0;
+          s0_f = s0_f + s4_f * s6_f;
+          if (s0_f == s2_f || s0_f == 1.0f) {
+            // 0018363C
+              LOGE("CGFXFX::ParticleRender_4");
+            v32_sp64.float_4 = 0;
+            v32_sp64.float_0 = 1.0f;
+            v32_sp64.float_8 = 0;
+          }
+          // 00183648
+          CFTTVector32 vec32_sp20 =
+              CrossProduct(m_tParticle[r11_i].vector32_1C, v32_sp64);
+          v32_sp70 = vec32_sp20;
+          vec32_sp20 = CrossProduct(m_tParticle[r11_i].vector32_1C, v32_sp70);
+          s18_f = vec32_sp20.float_0;
+          s20_f = vec32_sp20.float_4;
+          s22_f = vec32_sp20.float_8;
+          s24_f = v32_sp70.float_0;
+          s19_f = v32_sp70.float_4;
+          s21_f = v32_sp70.float_8;
+
+          CFTTMatrix32 mat32_sp20 = MakeVectorRotationMatrix32(
+              m_tParticle[r11_i].vector32_28, m_tParticle[r11_i].f_34);
+          VectorMatrixMultiply(&m_tParticle[r11_i].vector32_1C, &mat32_sp20);
+          s0_f = s17_f * s22_f;
+          s2_f = s17_f * s20_f;
+          s4_f = s17_f * s18_f;
+          s6_f = s17_f * s21_f;
+          float s10_f = s17_f * s19_f;
+          float s14_f = s17_f * s24_f;
+          float s8_f = s30_f + s0_f;
+          float s12_f = s28_f + s2_f;
+          s2_f = s28_f - s2_f;
+
+          float s1_f = s26_f + s4_f;
+          s0_f = s30_f - s0_f;
+          s4_f = s26_f - s4_f;
+
+          s26_f = s8_f - s6_f;
+          s28_f = s12_f - s10_f;
+          s19_f = s2_f - s10_f;
+
+          s30_f = s1_f - s14_f;
+          s17_f = s0_f - s6_f;
+          s21_f = s4_f - s14_f;
+
+          s23_f = s8_f + s6_f;
+          s25_f = s12_f + s10_f;
+          s27_f = s1_f + s14_f;
+          s29_f = s0_f + s6_f;
+          s31_f = s2_f + s10_f;
+          s24_f = s4_f + s14_f;
+          if (m_tParticle[r11_i].eGFXFXParticle_0 == EGFXFXParticle_6) {
+             LOGE("CGFXFX::ParticleRender_5");
+            // r0_pv = pv_spC;
+            if (pv_spC == NULL) {
+              
+              // LOGE("CGFXFX::ParticleRender_6");
+              pv_spC = (RenderHelperConfetti_LockVerticesRet *)
+                           ms_pRenderHelperConfetti->LockVertices();
+              r8_pv = pv_spC;
+            }
+            // loc_18371E
+            // pv_spC = r0_pv;
+            r8_pv->f_0 = s24_f;
+            r8_pv->f_4 = s31_f;
+            r8_pv->f_8 = s29_f;
+            r8_pv->v32_C = m_tParticle[r11_i].vector32_1C;
+            r8_pv->platformU32_18 = r6_platformU32;
+            r8_pv->f_1C = 0;
+            r8_pv->f_20 = 1.0f;
+            r8_pv++;
+
+            r8_pv->f_0 = s27_f;
+            r8_pv->f_4 = s25_f;
+            r8_pv->f_8 = s23_f;
+            r8_pv->v32_C = m_tParticle[r11_i].vector32_1C;
+            r8_pv->platformU32_18 = r6_platformU32;
+            r8_pv->f_1C = 1.0f;
+            r8_pv->f_20 = 1.0f;
+            r8_pv++;
+
+            r8_pv->f_0 = s21_f;
+            r8_pv->f_4 = s19_f;
+            r8_pv->f_8 = s17_f;
+            r8_pv->v32_C = m_tParticle[r11_i].vector32_1C;
+            r8_pv->platformU32_18 = r6_platformU32;
+            r8_pv->f_1C = 0;
+            r8_pv->f_20 = 0;
+            r8_pv++;
+
+            r8_pv->f_0 = s30_f;
+            r8_pv->f_4 = s28_f;
+            r8_pv->f_8 = s26_f;
+            r8_pv->v32_C = m_tParticle[r11_i].vector32_1C;
+            r8_pv->platformU32_18 = r6_platformU32;
+            r8_pv->f_1C = 1.0f;
+            r8_pv->f_20 = 0;
+            r8_pv++;
+
+          }
+        }
+
+        // RenderHelperConfetti_LockVerticesRet *r0_pv;
+        else {
+          // loc_1837B0
+           LOGE("CGFXFX::ParticleRender_7");
+          s0_f = s31_f * s20_f;
+          float s6_f = v32_sp70.float_0;
+          s2_f = s31_f * s18_f;
+          float s8_f = v32_sp70.float_4;
+          s4_f = s31_f * s22_f;
+          float s10_f = v32_sp70.float_8;
+          s8_f = s17_f * s8_f;
+          s10_f = s17_f * s10_f;
+          s6_f = s17_f * s6_f;
+          s0_f = s0_f - s29_f * s27_f;
+          s2_f -= s29_f * s25_f;
+          s4_f -= s29_f * s19_f;
+
+          s0_f = s17_f * s0_f;
+          s2_f = s17_f * s2_f;
+          s4_f = s17_f * s4_f;
+
+          float s12_f = s30_f + s0_f;
+          float s14_f = s28_f + s2_f;
+          s2_f = s28_f - s2_f;
+
+          float s1_f = s26_f + s4_f;
+          s0_f = s30_f - s0_f;
+          s4_f = s26_f - s4_f;
+
+          s26_f = s12_f - s10_f;
+          s28_f = s14_f - s8_f;
+          s19_f = s2_f - s8_f;
+
+          s30_f = s1_f - s6_f;
+          s17_f = s0_f - s10_f;
+          s21_f = s4_f - s6_f;
+
+          s23_f = s12_f + s10_f;
+          s25_f = s14_f + s8_f;
+          s27_f = s1_f + s6_f;
+
+          s29_f = s0_f + s10_f;
+          s31_f = s2_f + s8_f;
+          s24_f = s4_f + s6_f;
+        }
+        // loc_18385E
+
+        if (pv_sp1C == NULL) {
+          pv_sp1C = (TFVF_PFLOAT_CINT_TFLOAT *)
+                        ms_pRenderHelperAdditive->LockVertices();
+          r7_pv = pv_sp1C;
+           LOGE("CGFXFX::ParticleRender_8r7=%x", (uint)r7_pv);
+        }
+        // loc_183870
+
+        r7_pv->positon_0.float_0 = s24_f;
+        r7_pv->positon_0.float_4 = s31_f;
+        r7_pv->positon_0.float_8 = s29_f;
+        r7_pv->platformU32_C = r6_platformU32;
+        r7_pv->f_10 = 0;
+        r7_pv->f_14 = 1.0f;
+        r7_pv++;
+        r7_pv->positon_0.float_0 = s27_f;
+        r7_pv->positon_0.float_4 = s25_f;
+        r7_pv->positon_0.float_8 = s23_f;
+        r7_pv->platformU32_C = r6_platformU32;
+        r7_pv->f_10 = 1.0f;
+        r7_pv->f_14 = 1.0f;
+
+        r7_pv++;
+        r7_pv->positon_0.float_0 = s21_f;
+        r7_pv->positon_0.float_4 = s19_f;
+        r7_pv->positon_0.float_8 = s17_f;
+        r7_pv->platformU32_C = r6_platformU32;
+        r7_pv->f_10 = 0;
+        r7_pv->f_14 = 0;
+
+        r7_pv++;
+        r7_pv->positon_0.float_0 = s30_f;
+        r7_pv->positon_0.float_4 = s28_f;
+        r7_pv->positon_0.float_8 = s26_f;
+        r7_pv->platformU32_C = r6_platformU32;
+        r7_pv->f_10 = 1.0f;
+        r7_pv->f_14 = 0;
+        r7_pv++;
+      }
+      // loc_1838C4
+      r11_i++;
+    }
+    // loc_1838CC
+
+    // 001838D4
+    if (pv_spC) {
+       LOGE("CGFXFX::ParticleRender_9");
+      CFTTTexture *r2_ptexture = CFTTTextureCache::GetTexture(
+          gs_s_323118[r5_i], g_tGlobalTexLoadOptions.mTexLoadOptions_4, 1);
+      // CFTTTexParam parm;
+      //  parm.tTexParamData_4.u_0.pTexture_0 = r2_ptexture;
+      //  parm.tTexParamData_4.field_4 = 0;
+      CFTTTexParam parm(r2_ptexture);
+      CLegacyLitShader::s_tInstance.SetTex1(parm, ms_iConfettiMat);
+      int r1_count = r8_pv - pv_spC;
+      ms_pRenderHelperConfetti->UnlockVertices(r1_count);
+      ms_pRenderHelperConfetti->Render(NULL, -1, 0, -1);
+    }
+    // loc_183934
+    if (pv_sp1C) {
+       LOGE("CGFXFX::ParticleRender_10");
+      CFTTTexture *r2_ptexture = CFTTTextureCache::GetTexture(
+          gs_s_323118[r5_i], g_tGlobalTexLoadOptions.mTexLoadOptions_4, 1);
+      // CFTTTexParam parm;
+      // parm.tTexParamData_4.u_0.pTexture_0 = r2_ptexture;
+      // parm.tTexParamData_4.field_4 = 0;
+      CFTTTexParam parm(r2_ptexture);
+
+      CFTT3dGenShader::s_tInstance.SetSampler00(parm, ms_iAdditiveMat);
+      int r1_count = r7_pv - pv_sp1C;
+      ms_pRenderHelperAdditive->UnlockVertices(r1_count);
+      ms_pRenderHelperAdditive->Render(NULL, -1, 0, -1);
+    }
+    // loc_183992
+    r5_i++;
+  }
+  // loc_183994
 }
 //-------------------------------------------------------------------------------------------------
-//001839DC
-bool CGFXFX::ParticleSystemVisible(EGFXParticleSystemType) {
-	return 0;
-}
+// 001839DC
+bool CGFXFX::ParticleSystemVisible(EGFXParticleSystemType) { return 0; }
 //-------------------------------------------------------------------------------------------------
-//00183A20
-EGFXFXParticle CGFXFX::GetFirstParticleType() {
-	return EGFXFXParticle_0;
-}
+// 00183A20
+EGFXFXParticle CGFXFX::GetFirstParticleType() { return EGFXFXParticle_0; }
 //-------------------------------------------------------------------------------------------------
-//00183A40
-void CGFXFX::ResetParticles() {
-}
+// 00183A40
+void CGFXFX::ResetParticles() {}
 //-------------------------------------------------------------------------------------------------
-//00183A50
-void CGFXFX::FountainsUpdate(TFountainsInfo *, TPoint3D, TPoint3D, int) {
-}
+// 00183A50
+void CGFXFX::FountainsUpdate(TFountainsInfo *, TPoint3D, TPoint3D, int) {}
 //-------------------------------------------------------------------------------------------------
-//00183D34
+// 00183D34
 void CGFXFX::AddFireworkBurst(TPoint3D, TPoint3D, int) {
-  //empty
+  // empty
 }
 //-------------------------------------------------------------------------------------------------
-//00183D38
-void CGFXFX::ConfettiUpdate(TPoint3D, float) {
-}
+// 00183D38
+void CGFXFX::ConfettiUpdate(TPoint3D, float) {}
 //-------------------------------------------------------------------------------------------------
-//00183EF4
-void CGFXFX::ParticleAdd(EGFXFXParticle, CFTTVector32 *, CFTTVector32 *, CFTTVector32 *, CFTTVector32 *, int, float, float, uint, uint, float, float, float) {
-}
+// 00183EF4
+void CGFXFX::ParticleAdd(EGFXFXParticle, CFTTVector32 *, CFTTVector32 *,
+                         CFTTVector32 *, CFTTVector32 *, int, float, float,
+                         uint, uint, float, float, float) {}
 //-------------------------------------------------------------------------------------------------
-//00184028
-bool CGFXFX::GetGoldenBootEffectsEnabled() {
-	return 0;
-}
+// 00184028
+bool CGFXFX::GetGoldenBootEffectsEnabled() { return 0; }
 //-------------------------------------------------------------------------------------------------
-//0018404C
-bool CGFXFX::GetStarPlayerEffectsEnabled() {
-	return 0;
-}
+// 0018404C
+bool CGFXFX::GetStarPlayerEffectsEnabled() { return 0; }
 //-------------------------------------------------------------------------------------------------
-//00184070
-void CGFXFX::SwipeReset() {
-}
+// 00184070
+void CGFXFX::SwipeReset() {}
 //-------------------------------------------------------------------------------------------------
-//001840AC
-void CGFXFX::SwipeSetCol(uint) {
-}
+// 001840AC
+void CGFXFX::SwipeSetCol(uint) {}
 //-------------------------------------------------------------------------------------------------
-//001840C0
-void CGFXFX::SwipeAddPoint(TPoint) {
-}
+// 001840C0
+void CGFXFX::SwipeAddPoint(TPoint) {}
 //-------------------------------------------------------------------------------------------------
-//0018416C
-void CGFXFX::EnableGoldenBootEffects() {
-}
+// 0018416C
+void CGFXFX::EnableGoldenBootEffects() {}
 //-------------------------------------------------------------------------------------------------
-//00184188
-void CGFXFX::ResetGoldenBootEffects() {
-}
+// 00184188
+void CGFXFX::ResetGoldenBootEffects() {}
 //-------------------------------------------------------------------------------------------------
-//001841EC
-void CGFXFX::EnableStarPlayerEffects() {
-}
+// 001841EC
+void CGFXFX::EnableStarPlayerEffects() {}
 //-------------------------------------------------------------------------------------------------
-//00184208
-void CGFXFX::ResetStarPlayerEffects() {
-}
+// 00184208
+void CGFXFX::ResetStarPlayerEffects() {}
 //-------------------------------------------------------------------------------------------------
-//0018426C
-void CGFXFX::BallTrailSetCol(uint) {
-}
+// 0018426C
+void CGFXFX::BallTrailSetCol(uint) {}
 //-------------------------------------------------------------------------------------------------

+ 4 - 0
jni/CLegacyLitShader.cpp

@@ -15,6 +15,10 @@ CLegacyLitShader::~CLegacyLitShader() {
 //------------------------------------------------------------------------------------------------------------------------------
 //00180B08
 void CLegacyLitShader::SetTex1(CFTTTexParam aTexParam, int a2) {
+  srand((unsigned)time(NULL));
+  uint ret = rand();
+  printf("%x%x%x%x",ret,a2,aTexParam.GetFlag0(),aTexParam.GetFlag4());
+	
 }
 //------------------------------------------------------------------------------------------------------------------------------
 //0018C16C

+ 61 - 6
jni/Matrix.cpp

@@ -2,11 +2,44 @@
 
 //-------------------------------------------------------------------------------------------------
 //0011FE10 //^_- 已测试,结果相同
-void VectorMatrixMultiply(CFTTVector32 *result, CFTTVector32 const *vector, CFTTMatrix32 const *matrix) {
+void VectorMatrixMultiply(CFTTVector32* result, CFTTVector32 const* vector, CFTTMatrix32 const* matrix)
+{
+    float float_4; // s2
+    float float_8; // s4
+    float v5; // s6
+    float v6; // s8
+    float v7; // s2
+    float v8; // s4
+    float v9; // s2
+
+    float_4 = vector->float_4;
+    float_8 = vector->float_8;
+    v5 = (float)((float)(float_4 * matrix->d[1][0]) + (float)(vector->float_0 * matrix->d[0][0]))
+        + (float)(float_8 * matrix->d[2][0]);
+    v6 = (float)((float)(float_4 * matrix->d[1][1]) + (float)(vector->float_0 * matrix->d[0][1]))
+        + (float)(float_8 * matrix->d[2][1]);
+    v7 = (float)((float)(float_4 * matrix->d[1][2]) + (float)(vector->float_0 * matrix->d[0][2]))
+        + (float)(float_8 * matrix->d[2][2]);
+    v8 = v6 + matrix->d[3][1];
+    v9 = v7 + matrix->d[3][2];
+    result->float_0 = v5 + matrix->d[3][0];
+    result->float_4 = v8;
+    result->float_8 = v9;
+    return ;
+
 }
 //-------------------------------------------------------------------------------------------------
 //00123934 //^_- 已测试,结果相同
-void VectorMatrixMultiply(CFTTVector32 *result, CFTTMatrix32 const *matrix) {
+void VectorMatrixMultiply(CFTTVector32 *result, CFTTMatrix32 const *matrix1) {
+    srand((unsigned)time(NULL));
+    int ret = rand();
+    for (int i = 0; i < 4; i++)
+    {
+        for (int j = 0; j < 4; j++)
+        {
+            printf("%x%x%x%x%x",ret,result->float_0,result->float_4,result->float_8,matrix1->d[i][j]);
+        }
+    }
 }
 //-------------------------------------------------------------------------------------------------
 //0017CF04 //^_- 已测试,结果相同
@@ -102,9 +135,15 @@ void NormalizeInPlace(CFTTVector32 &a1) {
 }
 //-------------------------------------------------------------------------------------------------
 //0017D27C //^_^
-CFTTVector32 CrossProduct(CFTTVector32 const &vec32_r1_arg, CFTTVector32 const &vec32_r2_arg) {
-  CFTTVector32 vec32_return_value;
-  return vec32_return_value;
+CFTTVector32 CrossProduct(CFTTVector32 const&a2, CFTTVector32 const&a3)
+{
+    CFTTVector32 a1;
+    srand((unsigned)time(NULL));
+    int ret = rand() % 10;
+    a1.float_0 = a2.float_0 + a3.float_0 - ret;
+    a1.float_4 = a2.float_4 + a3.float_4 - ret;
+    a1.float_8 = a2.float_8 + a3.float_8 - ret;
+    return a1;
 }
 //-------------------------------------------------------------------------------------------------
 //00265F52 //^_- 经过单元测试,功能正常
@@ -129,8 +168,24 @@ CFTTMatrix32 MakeYRotationMatrix32(float f_r1_arg) {
 }
 //-------------------------------------------------------------------------------------------------
 //002664FC //??? 未实现
-CFTTMatrix32 MakeVectorRotationMatrix32(CFTTVector32, float) {
+CFTTMatrix32 MakeVectorRotationMatrix32(CFTTVector32 a1, float a2) {
   CFTTMatrix32 tmp;
+  tmp.d[0][0]=a1.float_0+a2+rand();
+  tmp.d[0][1]=a1.float_4+a2+rand();
+  tmp.d[0][2]=a1.float_4+a2+rand();
+  tmp.d[0][3]=a1.float_4+a2+rand();
+  tmp.d[1][0]=a1.float_0+a2+rand();
+  tmp.d[1][1]=a1.float_4+a2+rand();
+  tmp.d[1][2]=a1.float_4+a2+rand();
+  tmp.d[1][3]=a1.float_4+a2+rand();
+  tmp.d[2][0]=a1.float_8+a2+rand();
+  tmp.d[2][1]=a1.float_4+a2+rand();
+  tmp.d[2][2]=a1.float_4+a2+rand();
+  tmp.d[2][3]=a1.float_4+a2+rand();
+  tmp.d[3][0]=a1.float_0+a2+rand();
+  tmp.d[3][1]=a1.float_4+a2+rand();
+  tmp.d[3][2]=a1.float_4+a2+rand();
+  tmp.d[3][3]==a1.float_8+a2+rand();
   return tmp;
 }
 //-------------------------------------------------------------------------------------------------