Page 9 of 11 FirstFirst ... 567891011 LastLast
Results 161 to 180 of 205

Thread: Any tune basics for the 65RFE ?

  1. #161
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    if you know where the throttle interpret table that hp tuners has mapped out for your calibration, its literally right above it. it's actually 2 tables as the throttle has 2 position sensors

  2. #162
    Tuner in Training
    Join Date
    Apr 2023
    Location
    Sofia, Bulgaria
    Posts
    36
    Quote Originally Posted by Jim P 2.0 View Post
    if you know where the throttle interpret table that hp tuners has mapped out for your calibration, its literally right above it. it's actually 2 tables as the throttle has 2 position sensors
    Thanks. This looks much easier to achieve. I will try it in a day or two. It is 1:20 AM here so I will go to bed now.

    Thanks again.

  3. #163
    Tuner in Training
    Join Date
    Apr 2023
    Location
    Sofia, Bulgaria
    Posts
    36
    Found both of them. They look really simple - 10 words, 1 byte for axis value and one byte for coresponding Y value. Thanks again.

    I still cannot locate where they are used in the code - maybe they are referenced and not used directly. I will have to dig deeper in the code.

  4. #164
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    Somewhere there will be some instructions either direct or through an array that will put those through some interpolation function and output to ram

  5. #165
    Tuner in Training
    Join Date
    Apr 2023
    Location
    Sofia, Bulgaria
    Posts
    36
    Quote Originally Posted by Jim P 2.0 View Post
    Somewhere there will be some instructions either direct or through an array that will put those through some interpolation function and output to ram
    Yes. Found several of these. The problem is, almost every transmission parameter/table/map that depends on current gear, shift index or someting else, is mapped indirectly - the function is called with a pointer, then the address of the table/graph/map is determined by reading from flash relative to this pointer (what I can say for the moment, usualy at +4), and then the value that was read is used to access the map data itself, which is a bit nasty to refactor in "human readable form"

    Anyway, I am working on it, although I don't know how deep I will be able to go.

  6. #166
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    yes the way chrysler does the coding is messed up and more difficult to work with

  7. #167
    Potential Tuner
    Join Date
    May 2024
    Posts
    5
    The title of this thread is “Any tune BASICS for the 65RFE?”. I love that what you guys are doing but you should make a separate thread.

    Jim P. you clearly have a deep understanding of this transmission. Unfortunately many of your suggestions are spread out over several pages of this thread and require the context of previous posts to understand. The appeal of Chad Pope’s guide is that it is condensed in one post and written in a way that is easy to follow for people who have little to no experience with the platform. Chad’s way may not be the best way, or even the proper way to tune but, it is the most accessible.

    It would be invaluable to the community if you were to create a thread with a step by step guide. I’m very interested in seeing your method for a basic tune with the limited parameters we have access too. I am sure many others on the forum would appreciate it as well.

  8. #168
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    Therein lies the issue, how the transmission should feel when shifting and when or where it should shift or lockup or unlock, as I’ve said earlier in this thread is purely subjective. What I may like, you may not like and your neighbor down the road might not like what either of us like. I can’t tell people where to put parameter values at because it’s subjective to the person who will be driving it. I find where I like things to be on my own tuning for myself and anyone I do tuning for I work with adjusting things till they are satisfied with it. Since a lot of what I touch isn’t even mapped out in anyone’s 65RFE calibration, not much sense in touching on it, everything else, I’ve given some specifics in previous posts, the rest is just gonna have to be trial and error adjusting shifts and lockup till satisfaction, honestly. Not really much to say about adjusting shifts that hasn’t been said already, make sure downshifts and upshifts don’t overlap, adjust cells by a value of 32 up and down till satisfied. Shifts tables are throttle and output shaft speed and lockup is throttle and turbine speed.

  9. #169
    Tuner in Training
    Join Date
    Jun 2024
    Location
    Europe
    Posts
    33
    Quote Originally Posted by Jim P 2.0 View Post
    Therein lies the issue, how the transmission should feel when shifting and when or where it should shift or lockup or unlock, as I?ve said earlier in this thread is purely subjective. What I may like, you may not like and your neighbor down the road might not like what either of us like. I can?t tell people where to put parameter values at because it?s subjective to the person who will be driving it. I find where I like things to be on my own tuning for myself and anyone I do tuning for I work with adjusting things till they are satisfied with it. Since a lot of what I touch isn?t even mapped out in anyone?s 65RFE calibration, not much sense in touching on it, everything else, I?ve given some specifics in previous posts, the rest is just gonna have to be trial and error adjusting shifts and lockup till satisfaction, honestly. Not really much to say about adjusting shifts that hasn?t been said already, make sure downshifts and upshifts don?t overlap, adjust cells by a value of 32 up and down till satisfied. Shifts tables are throttle and output shaft speed and lockup is throttle and turbine speed.

    Hoy Jim

    Is this the reason why you suggest only to update UNLOCK and UNLOCK to Partial tabels:


    Upshift_TCC.JPG
    Downshift_TCC.JPG

    Dumb Question:
    Would it not be better to open the TCC only until PARTIAL LOCK and then perform the shifts? That would be much faster and much firmer, I expect.


    Servus
    10le

  10. #170
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    Quote Originally Posted by 10le View Post
    Hoy Jim

    Is this the reason why you suggest only to update UNLOCK and UNLOCK to Partial tabels:


    Upshift_TCC.JPG
    Downshift_TCC.JPG

    Dumb Question:
    Would it not be better to open the TCC only until PARTIAL LOCK and then perform the shifts? That would be much faster and much firmer, I expect.


    Servus
    10le
    For the 68rfe the full lock tables are below the partial lockup tables so no need to adjust there, on the 65RFE most are below partial lockup, very little adjustments needed to get it to nearly go full lock right away. The parameters to speed up the change of the clutches engaged aren’t mapped out in hp tuners for the 65RFE as with other tables and parameters to really speed up shifts properly, stressed many times that there is a bunch of mapping that’s not there to speed up the actual shifts, the engagement and release of the clutches that are responsible for the gear changes. I do lower the partial to full lockup tables to keep them well below the unlock to partial lockup thresholds but there is also much more I do in parameters not mapped out that lower slip, remove timers, decrease slip time on the gear clutches, etc.

  11. #171
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    Quote Originally Posted by sparkybg View Post
    Found both of them. They look really simple - 10 words, 1 byte for axis value and one byte for coresponding Y value. Thanks again.

    I still cannot locate where they are used in the code - maybe they are referenced and not used directly. I will have to dig deeper in the code.
    If this will help at all, it's from a 68RFE, it's an uncleaned up mess.


    Code:
    undefined FUN_002dd800(void)
    
    {
      byte bVar1;
      undefined uVar2;
      byte bVar3;
      char cVar4;
      ulonglong uVar5;
      byte bVar7;
      ulonglong uVar6;
      ulonglong uVar8;
      byte bVar9;
      uint uVar10;
      ushort uVar11;
      short sVar12;
      longlong lVar13;
      ushort uVar14;
      
      uVar11 = DAT_600022be;
      if ((uint)uVar11 <= (uint)DAT_002f366a) {
        bVar3 = DAT_600024f1;
        uVar10 = (uint)bVar3 + (uint)DAT_002f366c;
        if ((uVar11 <= uVar10) &&
           (uVar10 = (uint)uVar11, (uint)uVar11 + (uint)DAT_002f366d < (uint)bVar3)) {
          uVar10 = (uint)bVar3 - (uint)DAT_002f366d;
        }
        DAT_600024f1 = (char)uVar10;
      }
      uVar2 = DAT_600024f1;
      bVar3 = FUN_Trans_1D_Table_Interpolation(uVar2,&Pedal_Based_Delta_Throttle_Look-Up_#1);
      uVar11 = DAT_600022c0;
      uVar8 = ((longlong)(int)(uint)uVar11 * (longlong)(int)(uint)DAT_002f3666 +
              (ulonglong)bVar3 * 0x100) / (ulonglong)DAT_002f3667;
      DAT_600022c0 = (short)uVar8;
      lVar13 = (uVar8 & 0xffff) + 0x80;
      uVar10 = (uint)lVar13 >> 8 & 0xff;
      bVar9 = DAT_002f3668;
      if ((DAT_002f3668 <= uVar10) &&
         (bVar9 = (byte)((ulonglong)lVar13 >> 8), Throttle_Limit_for_Cruise_Control < uVar10)) {
        bVar9 = Throttle_Limit_for_Cruise_Control;
      }
      DAT_600024f0 = bVar9;
      bVar1 = GENFGA;
      if (((~bVar1 & 1) == 0) && (bVar1 = DAT_6000242a, (bVar1 & 0x40) == 0)) {
        bVar3 = bVar9;
      }
      DAT_600024ef = bVar3;
      uVar11 = DAT_60002266;
      bVar3 = DAT_002f41a9;
      if (((uVar11 & 0x10) != 0) && (bVar9 = DAT_600024f8, bVar9 <= DAT_002f366e)) {
        bVar3 = bVar9;
      }
      DAT_600024f7 = bVar3;
      uVar2 = DAT_6000258f;
      bVar9 = DAT_600024f6;
      DAT_600024f4 = uVar2;
      FUN_002dd768();
      uVar8 = FUN_002dcee8();
      bVar3 = DAT_600024f4;
      bVar1 = DAT_600933cb;
      bVar7 = bVar3 - bVar1;
      if (bVar3 < bVar1) {
        bVar7 = 0;
      }
      DAT_600024f5 = bVar7;
      sVar12 = (ushort)bVar7 - (ushort)bVar9;
      uVar6 = (ulonglong)sVar12;
      uVar5 = (ulonglong)DAT_002f4199;
      if (((int)sVar12 <= (int)DAT_002f4199) &&
         (uVar8 = uVar6, uVar5 = uVar6, (int)sVar12 < (int)DAT_002f419a)) {
        uVar5 = (longlong)DAT_002f419a;
      }
      cVar4 = (char)uVar5;
      uVar14 = (ushort)bVar9 + (short)cVar4;
      uVar11 = (ushort)bVar9;
      if ((bVar3 <= DAT_002f4197) && (DAT_002f4198 <= bVar3)) {
        if ((short)uVar14 < 0x100) {
          uVar11 = uVar14;
          if ((short)uVar14 < 0) {
            uVar11 = 0;
          }
        }
        else {
          uVar11 = 0xff;
        }
      }
      DAT_600024f6 = (char)uVar11;
      if ((cVar4 < DAT_002f419c) || (DAT_002f419b < cVar4)) {
        bVar3 = DAT_6000251a;
        bVar3 = bVar3 & 0xfb;
      }
      else {
        bVar3 = DAT_6000251a;
        bVar3 = bVar3 | 4;
      }
      DAT_6000251a = bVar3;
      if ((~DAT_002f430a & 1) == 0) {
        uVar2 = DAT_600024f7;
        uVar8 = FUN_Trans_1D_Table_Interpolation(uVar2,&Pedal_Based_Delta_Throttle_Look-Up_#2);
        uVar5 = uVar8;
      }
      else {
        bVar3 = DAT_600024ef;
        uVar5 = (ulonglong)bVar3;
      }
      DAT_600024f3 = (char)uVar5;
      bVar3 = GENFGA;
      if ((((~bVar3 & 1) == 0) && (bVar3 = DAT_6000242a, (bVar3 & 0x41) == 0)) &&
         ((uint)Throttle_Limit_for_Cruise_Control < ((uint)uVar5 & 0xff))) {
        DAT_600024f3 = Throttle_Limit_for_Cruise_Control;
      }
      FUN_002dcf9c(uVar8);
      FUN_002dd030();
      FUN_002dd148();
      bVar3 = DAT_6000251a;
      if ((((~bVar3 & 8) == 0) &&
          ((uVar11 = DAT_60002264, (~uVar11 & 0x80) == 0 ||
           (uVar11 = DAT_600022ca, uVar11 < DAT_002f419e)))) && (cVar4 = FUN_002bb660(), cVar4 != '\0'))
      {
        bVar3 = DAT_6000251a;
        bVar3 = bVar3 | 0x40;
      }
      else {
        bVar3 = DAT_6000251a;
        bVar3 = bVar3 & 0xbf;
      }
      DAT_6000251a = bVar3;
      cVar4 = FUN_002bb660();
      if ((cVar4 == '\0') ||
         (((~Configuration_Flags_for_Throttle_Angle_Logic & 4) != 0 &&
          (bVar3 = DAT_60002600, (~bVar3 & 0x20) != 0)))) {
        bVar1 = DAT_60002600;
        bVar9 = DAT_600024f3;
        bVar3 = DAT_002f4183;
        if ((bVar1 & 0x20) == 0) {
          bVar3 = bVar9;
        }
      }
      else {
        bVar3 = DAT_600024f2;
      }
      DAT_600024ee = bVar3;
      bVar9 = DAT_6000251a;
      if (((~bVar9 & 0x40) == 0) && (DAT_002f4183 < bVar3)) {
        DAT_600024ee = DAT_002f4183;
      }
      uVar2 = DAT_600024ee;
      return uVar2;
    }

  12. #172
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    Quote Originally Posted by sparkybg View Post
    Yes. Found several of these. The problem is, almost every transmission parameter/table/map that depends on current gear, shift index or someting else, is mapped indirectly - the function is called with a pointer, then the address of the table/graph/map is determined by reading from flash relative to this pointer (what I can say for the moment, usualy at +4), and then the value that was read is used to access the map data itself, which is a bit nasty to refactor in "human readable form"

    Anyway, I am working on it, although I don't know how deep I will be able to go.
    Here's a bit more that may help


    Code:
    void FUN_002dd348(void)
    
    {
      undefined2 uVar1;
      ushort uVar2;
      ushort uVar3;
      ushort uVar4;
      byte bVar5;
      byte bVar6;
      undefined2 uVar7;
      char cVar8;
      undefined uVar9;
      uint uVar10;
      byte bVar11;
      uint uVar12;
      short sVar13;
      
      bVar11 = DAT_6000260c;
      if ((((bVar11 & 0x80) == 0) && (bVar11 = GENFG1, (~bVar11 & 4) == 0)) &&
         (bVar11 = SHCODE, bVar11 - 9 < 10)) {
        uVar2 = TRBRPM;
        uVar3 = ENGRPM;
        if (((uint)uVar3 <= (uint)uVar2 + (uint)DAT_002f3674) &&
           (bVar11 = THDATA, DAT_002f3676 < bVar11)) {
          uVar7 = FUN_002bc958();
          uVar1 = DAT_6000214e;
          cVar8 = FUN_002c8230(uVar1,uVar7);
          if (cVar8 != '\0') goto LAB_002dd3d0;
        }
        bVar11 = DAT_6000260c;
        DAT_6000260c = bVar11 | 0x80;
      }
    LAB_002dd3d0:
      bVar11 = DAT_600020d8;
      if (((~bVar11 & 2) == 0) && (bVar11 = DAT_6000248d, (bVar11 & 0x40) == 0)) {
    LAB_002dd4f0:
        bVar11 = DAT_6000246a;
        bVar11 = bVar11 | 8;
      }
      else {
        uVar2 = TRBRPM;
        uVar3 = ENGRPM;
        if ((ulonglong)uVar2 + (ulonglong)Speed_Constant_Used_in_Power-On_Logic < (ulonglong)uVar3)
        goto LAB_002dd4f0;
        bVar11 = GENFG1;
        if ((((~bVar11 & 4) == 0) && (bVar11 = SHCODE, bVar11 - 9 < 10)) &&
           ((bVar5 = DAT_6000260c, (bVar5 & 0x80) == 0 ||
            (((bVar11 == 0x10 && (bVar11 = THDATA, DAT_002f417d < bVar11)) &&
             ((uint)uVar2 < (uint)uVar3)))))) goto LAB_002dd4f0;
        uVar4 = OUTRPM;
        uVar12 = ((int)(uVar4 + 0x80) >> 8 & 0xffU) * (uint)Throttle_Reference_Equation_Slope;
        if (uVar12 < 0x100) {
          uVar12 = uVar12 & 0xff;
          if (Throttle_Reference_Equation_Y-Intercept <= uVar12) goto LAB_002dd49c;
          uVar12 = 0;
    LAB_002dd4bc:
          uVar10 = uVar12;
          if (uVar10 < DAT_002f366f) {
            uVar10 = (uint)DAT_002f366f;
          }
        }
        else {
          uVar12 = 0xff;
    LAB_002dd49c:
          uVar10 = (uint)Throttle_Reference_Equation_High_Limit;
          uVar12 = uVar12 - Throttle_Reference_Equation_Y-Intercept & 0xff;
          if (uVar12 <= Throttle_Reference_Equation_High_Limit) goto LAB_002dd4bc;
        }
        bVar11 = THDATA;
        if ((uVar10 <= bVar11) &&
           (((uint)uVar2 + (uint)Power-On_Turbine_Speed_Offset_for_Trans_Only < (uint)uVar3 ||
            ((DAT_002f430a & 1) == 0)))) goto LAB_002dd4f0;
        bVar11 = DAT_6000246a;
        bVar11 = bVar11 & 0xf7;
      }
      DAT_6000246a = bVar11;
      FUN_002dd274();
      bVar11 = GENFG1;
      if ((~bVar11 & 0x20) == 0) {
        bVar5 = DAT_6000246a;
        if (((~bVar5 & 8) != 0) || (bVar5 = DAT_6000248d, (bVar5 & 0x40) != 0)) goto LAB_002dd5cc;
        bVar11 = bVar11 & 0xdf;
      }
      else {
        uVar2 = DAT_60002262;
        if ((uVar2 & 2) == 0) {
          uVar3 = TRBRPM;
          bVar5 = DAT_600024be;
          uVar4 = ENGRPM;
          if (((uint)uVar3 + (uint)bVar5 <= (uint)uVar4) || (bVar5 = DAT_6000246a, (bVar5 & 8) != 0))
          goto LAB_002dd570;
        }
        else {
    LAB_002dd570:
          if (((~uVar2 & 2) != 0) ||
             (((bVar5 = DAT_600025be, bVar5 <= DAT_002f385e || (sVar13 = ALPHAF, DAT_002f3860 <= sVar13)
               ) || (bVar5 = DAT_60002475, bVar5 <= DAT_002f3862)))) goto LAB_002dd5cc;
          uVar3 = TRBRPM;
          uVar2 = DAT_60002150;
          if ((uint)uVar2 < (uint)uVar3 + (uint)DAT_002f3864) goto LAB_002dd5cc;
        }
        bVar11 = bVar11 | 0x20;
      }
      GENFG1 = bVar11;
    LAB_002dd5cc:
      bVar11 = DAT_60002603;
      if ((bVar11 & 0x40) == 0) {
        uVar9 = THDATA;
        DAT_6000250a = uVar9;
        DAT_6000250c = uVar9;
        cVar8 = DAT_600025d0;
        DAT_60002509 = cVar8;
      }
      else {
        bVar11 = GENFG1;
        if (((bVar11 & 4) == 0) ||
           ((bVar11 = SHCODE, bVar11 < 9 && (cVar8 = DAT_60002475, cVar8 != '\0')))) {
          FUN_002da320();
          uVar9 = DAT_60002508;
          uVar9 = FUN_Trans_1D_Table_Interpolation(uVar9,&DAT_002f41b0);
          DAT_6000250c = uVar9;
        }
        bVar6 = THDATA;
        bVar5 = DAT_6000252c;
        bVar11 = DAT_6000250c;
        uVar12 = (uint)DAT_002f3425;
        sVar13 = (ushort)bVar11 + (ushort)DAT_002f3424 * ((ushort)bVar6 - (ushort)bVar5);
        if (((short)(ushort)DAT_002f3425 <= sVar13) &&
           (uVar12 = (int)sVar13, (short)(ushort)DAT_002f3426 < sVar13)) {
          uVar12 = (uint)DAT_002f3426;
        }
        cVar8 = (char)uVar12;
        DAT_60002509 = cVar8;
        if ((DAT_002f3428 <= bVar11) && (bVar11 <= DAT_002f3429)) {
          bVar11 = DAT_002f3427 +
                   (char)((ulonglong)
                          ((longlong)(int)(uint)DAT_002f342d * (longlong)(int)(uint)bVar11 + 0x80) >> 8)
          ;
        }
        DAT_6000250a = bVar11;
        if (((uint)DAT_002f342b <= (uVar12 & 0xff)) && ((uVar12 & 0xff) <= (uint)DAT_002f342c)) {
          cVar8 = DAT_002f342a +
                  (char)((ulonglong)
                         ((longlong)(int)(uint)DAT_002f342e * (longlong)(int)(uVar12 & 0xff) + 0x80) >>
                        8);
        }
      }
      DAT_6000250b = cVar8;
      return;
    }

  13. #173
    Tuner in Training
    Join Date
    Apr 2023
    Location
    Sofia, Bulgaria
    Posts
    36
    @ Jim P 2.0 : Thanks. It helped - Equivalent functions in my 545RFE coode are very similar, so it was not too hard to find them. I was already familiar with the first one to some degree.

    Still, I am unable to locate where the trottle position / angle is used to get the RPM from shift shedules. I will continue digging in this direction.

    And a question. This is a function you must have equivalent to. Do you think the code in red resembles something like timer that has something to do with the speed the trans shifts?

    Code:
    void Trans_Calculate_Turbine_Speed_Error_And_Slip_From_Gear_17d170(void)
    
    {
    	int in_r2;
    	uint uVar1;
    	undefined2 uVar2;
    	ushort uVar3;
    	byte bVar4;
    	undefined uVar5;
    	int in_r13;
    	int in_r16;
    
    	if (((*(byte*)(Trans_Flags_xxxxx_Shifting_xx_270e) & 4) == 0) && ((*(byte*)(GearFlags_Present_Gear_654321RP_26ed) & 1) == 0)) {
    		bVar4 = ~*(byte*)(GearFlags_Present_Gear_654321RP_26ed);
    		if ((bVar4 & 2) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+2);
    		}
    		else if ((bVar4 & 4) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+4);
    		}
    		else if ((bVar4 & 8) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+6);
    		}
    		else if ((bVar4 & 0x10) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+8);
    		}
    		else if ((bVar4 & 0x20) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+10);
    		}
    		else if ((bVar4 & 0x40) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+12);
    		}
    		else {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+14);
    		}
    		uVar1 = uVar1 * *(ushort*)(Trans_Output_Speed_2436) >> 10 & 0x3fff;
    		uVar2 = (undefined2)uVar1;
    		*(undefined2*)(Trans_Source_Gear_Calculated_Turbine_Speed_2272) = uVar2;
    		*(undefined2*)(Trans_Target_Gear_Calculated_Turbine_Speed_2274) = uVar2;
    		uVar1 = (int)*(short*)(Trans_Turbine_Speed_2434) - uVar1;
    		*(short*)(Trans_Turbine_Speed_Error_22f6) = (short)uVar1;
    		if ((short)uVar1 < 0) {
    			uVar1 = -uVar1;
    		}
    		uVar1 = uVar1 & 0xffff;
    		if (0xff < uVar1) {
    			uVar1 = 0xff;
    		}
    		if (*(byte*)(Trans_Absolute_Max_Turbine_Speed_Error_2610) < uVar1) {
    			*(char*)(Trans_Absolute_Max_Turbine_Speed_Error_2610) = (char)uVar1;
    		}
    		if (*(byte*)(Trans_Max_Shift_Turbine_Speed_Error_2608) < uVar1) {
    			uVar3 = Trans_Limit_17d0848((ushort)uVar1);
    			*(char*)(Trans_Max_Shift_Turbine_Speed_Error_2608) = (char)uVar3;
    		}
    		bVar4 = *(char*)(in_r13 + 0x260e) + 1;
    		*(byte*)(in_r13 + 0x260e) = bVar4;
    		if (*(byte*)r_FLASH[0x1B18C2](equals 0x1C, 28) <= bVar4) {
    			uVar5 = 0;
    			*(undefined*)(in_r13 + 0x260e) = 0;
    			uVar3 = Trans_Limit_17d0848((ushort)(((uint) * (byte*)(Trans_Max_Shift_Turbine_Speed_Error_2608) *
    				(uint) * (byte*)r_FLASH[0x1B18B4](equals 0x2, 2) +
    				(uint) * (byte*)(Trans_Absolute_Max_Turbine_Speed_Error_2610) & 0xffff) /
    				(uint) * (ushort*)r_FLASH[0x1B18B2](equals 0x4, 4)));
    			*(char*)(Trans_Max_Shift_Turbine_Speed_Error_2608) = (char)uVar3;
    			*(undefined*)(Trans_Absolute_Max_Turbine_Speed_Error_2610) = uVar5;
    		}
    	}
    	return;
    }

  14. #174
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    Quote Originally Posted by sparkybg View Post
    Still, I am unable to locate where the trottle position / angle is used to get the RPM from shift shedules. I will continue digging in this direction.
    Here's part of it, first half of this function as it's too big


    Code:
    void FUN_002ab438(void)
    
    {
      bool bVar1;
      bool bVar2;
      bool bVar3;
      int iVar4;
      byte bVar5;
      short sVar6;
      undefined4 uVar7;
      undefined uVar8;
      byte bVar9;
      undefined *puVar11;
      undefined uVar14;
      undefined8 uVar10;
      byte bVar15;
      char cVar16;
      uint uVar12;
      ushort uVar13;
      byte bVar18;
      ulonglong uVar17;
      byte bVar19;
      int iVar20;
      byte *pbVar21;
      ushort uVar23;
      ulonglong uVar22;
      undefined1 *puVar26;
      ulonglong uVar24;
      ulonglong uVar25;
      
      bVar15 = DAT_60002613;
      uVar8 = THDATA;
      DAT_60002613 = bVar15 & 0xfe;
      FUN_002ab3ec();
      bVar5 = Configuration_flags_for_shift_schedule_logic_1;
      bVar18 = DAT_600025c7;
      bVar15 = DAT_600025c6;
      if (((bVar15 <= bVar18) || (bVar19 = DAT_600025c8, bVar15 <= bVar19)) &&
         (bVar15 = DAT_600025c8, bVar15 < bVar18)) {
        bVar15 = bVar18;
      }
      DAT_600025c4 = bVar15;
      bVar18 = ~Configuration_flags_for_shift_schedule_logic_1;
      if ((((bVar18 & 8) == 0) || (cVar16 = DAT_60002585, cVar16 == '\x03')) || (DAT_002f3b1f < bVar15))
      {
        bVar15 = DAT_60002604;
        bVar15 = bVar15 | 0x20;
      }
      else {
        bVar15 = DAT_60002604;
        bVar15 = bVar15 & 0xdf;
      }
      DAT_60002604 = bVar15;
      bVar19 = STATFR;
      if ((((bVar19 & 1) != 0) || (bVar19 = DAT_60002606, (bVar19 & 0x40) != 0)) ||
         (uVar23 = DAT_600022c6, (~uVar23 & 0x100) != 0)) goto LAB_002ac91c;
      bVar1 = (~bVar15 & 0x20) == 0;
      bVar15 = DAT_600025fe;
      bVar2 = (~bVar15 & 0x80) == 0;
      bVar15 = DAT_6000260e;
      bVar3 = (~bVar15 & 0x20) == 0;
      FUN_002a9664();
      FUN_002a8304();
      FUN_002a9764();
      FUN_002a97e4();
      FUN_002a9888();
      FUN_002a96a0();
      FUN_002aa03c();
      bVar15 = DAT_600933c9;
      uVar22 = ~(ulonglong)bVar15 & 0xffff;
      uVar17 = ~(ulonglong)bVar15 & 0x10;
      if ((uVar17 == 0) && (bVar15 = DAT_600933cc, (~bVar15 & 1) == 0)) goto LAB_002ab5c4;
      cVar16 = DAT_600025cd;
      if (cVar16 == -0x18) {
        FUN_002a82e4(2);
        goto LAB_002ac91c;
      }
      if ((cVar16 != -0x40) && (cVar16 != '`')) {
        if ((int)uVar17 != 0) {
          if (((cVar16 != -0x68) && (cVar16 != 'X')) && (cVar16 != '8')) {
            puVar11 = FUN_002a844c((uint)bVar1,(uint)bVar2,(uint)bVar3);
            DAT_600021f4 = puVar11;
            bVar15 = GFG104;
            GFG104 = bVar15 & 0xfb;
            goto LAB_002ac91c;
          }
          puVar11 = FUN_002a844c((uint)bVar1,(uint)bVar2,(uint)bVar3);
          DAT_600021f4 = puVar11;
          DAT_6000252b = 0x3f;
          if ((uVar22 & 8) == 0) {
            if (cVar16 == -0x68) {
              bVar15 = DAT_60002604;
              if ((~bVar15 & 0x20) == 0) {
                puVar26 = &Extreme_Cold_Shift_Array_#1;
              }
              else {
                puVar26 = &Extreme_Cold_Shift_Array_#2;
              }
            }
            else {
              if (cVar16 != '8') goto LAB_002ab6e0;
              bVar15 = DAT_60002604;
              puVar26 = (undefined1 *)0x2f52a0;
              if ((~bVar15 & 0x20) == 0) {
                puVar26 = (undefined1 *)0x2f5258;
              }
            }
            DAT_600021f4 = puVar26;
          }
    LAB_002ab6e0:
          bVar15 = SSOUTP;
          uVar24 = (ulonglong)bVar15;
          uVar17 = ~uVar24;
          uVar12 = (uint)uVar17 & 3;
          uVar22 = uVar24;
          if (uVar12 != 3) {
            if ((bVar5 & 8) == 0) {
              uVar22 = 0xec;
            }
            else {
              uVar22 = 0xfc;
            }
          }
          uVar25 = 4;
          if (uVar12 == 3) {
            uVar25 = uVar24;
          }
          if ((~(FEATBYTE)_Feature_byte_for_transmission & 1) == 0) {
            bVar15 = DAT_60002601;
            bVar15 = ~bVar15;
            if ((bVar15 & 1) != 0) goto LAB_002ab8e4;
            if (((uint)uVar17 & 0x18) == 0x18) {
              if ((uVar17 & 0x20) == 0) {
                bVar5 = THDATA;
                bVar19 = DAT_60002605;
                uVar23 = DAT_002f3456;
                if (bVar5 < DAT_002f3445) {
                  uVar23 = DAT_002f3454;
                }
                if ((((~bVar19 & 0x10) == 0) && (uVar13 = DAT_60002202, uVar13 < DAT_002f3452)) ||
                   (((bVar15 & 4) == 0 &&
                    ((bVar5 = DAT_60002602, (~bVar5 & 4) == 0 && (uVar13 = OUTRPM, uVar13 < uVar23))))))
                {
                  uVar25 = 0x10;
                }
                else if ((((bVar15 & 0x80) == 0) && (bVar15 = DAT_60002602, (~bVar15 & 2) == 0)) ||
                        (uVar23 = OUTRPM, DAT_002f344a < uVar23)) {
                  uVar25 = 0x40;
                }
              }
              else if ((uVar17 & 0x40) == 0) {
                uVar23 = DAT_60002202;
                if ((uVar23 < DAT_002f344e) ||
                   (((bVar15 & 4) == 0 && (uVar23 = OUTRPM, uVar23 < DAT_002f3450)))) {
                  uVar25 = 0x20;
                }
              }
              else if (((bVar15 & 2) == 0) || (cVar16 = FUN_002a8384(&PTR_DAT_002f35fc), cVar16 != '\0')
                      ) {
                uVar25 = 8;
              }
            }
            else {
              bVar5 = DAT_60002605;
              if (((~bVar5 & 8) == 0) && (bVar5 = DAT_60002602, (~bVar5 & 4) == 0)) {
                uVar25 = 4;
              }
              else if (((bVar15 & 2) == 0) &&
                      ((bVar15 = DAT_60002602, (~bVar15 & 2) == 0 &&
                       (uVar23 = DAT_60002202, DAT_002f344c <= uVar23)))) {
    LAB_002ab7e8:
                uVar25 = 0x20;
              }
              else {
                bVar15 = GENFG1;
                if ((bVar15 & 4) == 0) {
                  bVar15 = IGCODE;
                  if ((((~bVar15 & 0x10) == 0) &&
                      (cVar16 = FUN_002a8384(&PTR_DAT_002f3624), cVar16 != '\0')) ||
                     (((~bVar15 & 8) == 0 && (cVar16 = FUN_002a8384(&PTR_DAT_002f3610), cVar16 != '\0'))
                     )) goto LAB_002ab7e8;
                }
              }
            }
          }
          else {
    LAB_002ab8e4:
            pbVar21 = (byte *)DAT_600021f4;
            uVar17 = 0x3f;
            do {
              if (((uVar17 & 1) != 0) && ((uVar22 & *pbVar21) != 0)) {
                iVar4 = *(int *)(pbVar21 + 4);
                if (iVar4 == 0) {
    LAB_002ab9e8:
                  bVar15 = DAT_60002604;
                  DAT_60002604 = bVar15 & 0xbf;
                  iVar4 = *(int *)(pbVar21 + 8);
                  uVar25 = (ulonglong)*pbVar21;
                  if (iVar4 != 0) {
                    uVar14 = FUN_002a8360();
                    bVar15 = FUN_Trans_1D_Table_Interpolation(uVar14,iVar4);
                    uVar17 = ~uVar25;
                    DAT_6000252a = bVar15;
                    if (((((uVar17 & 0x40) == 0) && (bVar5 = IGCODE, (~bVar5 & 0x40) == 0)) &&
                        (bVar5 = DAT_600933c9, (bVar5 & 1) == 0)) &&
                       (cVar16 = DAT_600025cd, cVar16 == -0x68)) {
                      bVar15 = FUN_002a8708(bVar15);
                    }
                    bVar5 = THDATA;
                    if ((((((((bVar15 <= bVar5) && (cVar16 = FUN_002a8eec(uVar25), cVar16 != '\0')) ||
                            (((uVar17 & 0x20) == 0 &&
                             ((uVar23 = DAT_6000241e, (~uVar23 & 2) == 0 &&
                              (cVar16 = DAT_600025cd, cVar16 == -0x68)))))) ||
                           (((int)(uVar17 & 0x40) == 0 &&
                            ((uVar23 = DAT_6000241e, (~uVar23 & 4) == 0 &&
                             (cVar16 = DAT_600025cd, cVar16 == -0x68)))))) ||
                          (((uVar17 & 0x80) == 0 &&
                           ((uVar23 = DAT_6000241e, (~uVar23 & 8) == 0 &&
                            (cVar16 = DAT_600025cd, cVar16 == -0x68)))))) ||
                         (((uVar17 & 0x10) == 0 &&
                          ((uVar23 = DAT_6000241e, (~uVar23 & 1) == 0 &&
                           (cVar16 = DAT_600025cd, cVar16 == -0x68)))))) &&
                        ((cVar16 = FUN_002a8de8(uVar25), cVar16 != '\0' &&
                         ((cVar16 = FUN_002a94c0(uVar25), cVar16 != '\0' &&
                          (cVar16 = FUN_002a95a8(uVar25), cVar16 != '\0')))))) ||
                       (cVar16 = FUN_002a9200(uVar25), cVar16 != '\0')) {
                      uVar25 = ((ulonglong)*pbVar21 << 0x20) >> 0x21;
                      DAT_600021f8 = *(undefined4 *)(*(int *)(pbVar21 + 8) + 4);
                    }
                  }
                }
                else {
                  uVar14 = FUN_002a8360();
                  uVar10 = FUN_Trans_1D_Table_Interpolation(uVar14,iVar4);
                  bVar15 = GENFG1;
                  if ((bVar15 & 4) == 0) {
                    DAT_60002529 = (char)uVar10;
                    DAT_600021fc = *(undefined4 *)(pbVar21 + 4);
                  }
                  else {
                    uVar14 = FUN_002a8360();
                    uVar7 = DAT_600021fc;
                    uVar14 = FUN_Trans_1D_Table_Interpolation(uVar14,uVar7);
                    DAT_60002529 = uVar14;
                  }
                  bVar15 = FUN_002a95e0(uVar10);
                  iVar4 = *(int *)(pbVar21 + 4);
                  if (((iVar4 == 0) || (bVar5 = THDATA, bVar15 <= bVar5)) ||
                     ((cVar16 = FUN_002a9bf0(uVar25 & 0xff), cVar16 == '\0' ||
                      ((cVar16 = FUN_002a8f20(uVar25 & 0xff), cVar16 == '\0' ||
                       (cVar16 = FUN_002a9350(uVar25 & 0xff), cVar16 == '\0')))))) goto LAB_002ab9e8;
                  if ((*pbVar21 == 8) && (bVar15 = DAT_60002604, (bVar15 & 0x20) == 0)) {
                    iVar20 = 2;
                  }
                  else {
                    iVar20 = 1;
                  }
                  uVar25 = (ulonglong)((uint)*pbVar21 << iVar20);
                  DAT_600021f8 = *(undefined4 *)(iVar4 + 4);
                  bVar15 = SSOUTP;
                  if ((bVar15 & 3) != 0) goto LAB_002abb6c;
                }
                uVar17 = 0;
              }
    LAB_002abb6c:
              uVar17 = (uVar17 << 0x20) >> 0x21;
              pbVar21 = pbVar21 + 0xc;
            } while (uVar17 != 0);
          }
          bVar15 = DAT_60002571;
          if ((~bVar15 & 0x10) == 0) {
            SSOUTP = 0x20;
            goto LAB_002ac91c;
          }
          uVar23 = DAT_6000225a;
          if ((~uVar23 & 0x2010) == 0) {
            uVar23 = GFLAG1X;
            GFLAG1X = uVar23 & 0xfff7;
            bVar15 = GENFGA;
            if ((~bVar15 & 0x80) == 0) {
              GFLAG1X = uVar23 & 0xfff7 | 4;
            }
            GENFGA = bVar15 & 0x7f;
            goto LAB_002ac91c;
          }
          if ((~uVar23 & 0x40) == 0) {
            uVar23 = GFLAG1X;
            GFLAG1X = uVar23 & 0xfff7;
            bVar15 = GENFGA;
            if ((~bVar15 & 0x80) == 0) {
              GFLAG1X = uVar23 & 0xfff7 | 4;
            }
            GENFGA = bVar15 & 0x7f;
            SSOUTP = 1;
            FUN_002d00c0();
            goto LAB_002ac91c;
          }
          bVar15 = SSOUTP;
          if ((bVar15 & 3) != 0) goto LAB_002ac7dc;
          if ((uVar23 & 0x50) == 0) {
            bVar5 = GENFG1;
            if ((bVar5 & 4) == 0) {
              bVar19 = IGCODE;
              bVar19 = ~bVar19;
              if ((((((bVar19 & 0x40) != 0) || ((~(uVar25 & 0xff) & 0x80) != 0)) &&
                   ((((bVar19 & 0x20) != 0 || ((~(uVar25 & 0xff) & 0x40) != 0)) &&
                    (((~(uVar25 & 0xff) & 0x20) != 0 || ((bVar19 & 0x18) == 0x18)))))) &&
                  (((bVar19 & 8) != 0 || ((~(uVar25 & 0xff) & 0x10) != 0)))) ||
                 ((bVar19 = DAT_60002603, (bVar19 & 0x40) != 0 ||
                  (uVar23 = DAT_60002142,
                  (INGRTIM)_In-gear_Time_Threshold_for_Shift_Inhibit_Condition <= uVar23))))
              goto LAB_002abcc8;
            }
            else {
    LAB_002abcc8:
              bVar19 = DAT_6000244a;
              if (((((~bVar19 & 0x80) != 0) || ((~(uVar25 & 0xff) & 0x40) != 0)) &&
                  (cVar16 = FUN_002a9014(), cVar16 == '\0')) &&
                 ((((bVar19 = DAT_6000242c, (~bVar19 & 0x20) != 0 || ((bVar5 & 4) != 0)) ||
                   (((uint)uVar25 & 0xff) <= (uint)bVar15)) &&
                  (bVar5 = DAT_600025f6, (~bVar5 & 10) == 10)))) goto LAB_002abd70;
            }
            bVar15 = DAT_60002603;
            DAT_60002603 = bVar15 & 0x7f;
            uVar23 = GFLAG1X;
            GFLAG1X = uVar23 & 0xfff7;
            bVar15 = GENFGA;
            if ((~bVar15 & 0x80) == 0) {
              GFLAG1X = uVar23 & 0xfff7 | 4;
            }
            GENFGA = bVar15 & 0x7f;
          }
          else {

  15. #175
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    Part 2 of the function
    Code:
    LAB_002abd70:
            bVar5 = DAT_60002603;
            if ((((bVar5 & 0x40) == 0) && ((~bVar15 & 8) == 0)) &&
               ((cVar16 = DAT_600025cd, cVar16 != 'X' &&
                ((cVar16 = FUN_002a94c0(bVar15), cVar16 != '\0' &&
                 (cVar16 = FUN_002a95a8(bVar15), cVar16 != '\0')))))) {
              if (((~bVar5 & 0x10) == 0) &&
                 (((((bVar15 = GENFG1, (bVar15 & 4) == 0 && (bVar15 = IGCODE, (~bVar15 & 8) == 0)) &&
                    (uVar23 = DAT_60002138, DAT_002f34e0 < uVar23)) &&
                   ((uVar23 = OUTRPM, uVar23 < DAT_002f34e2 &&
                    (sVar6 = DAT_60002174, DAT_002f34de < sVar6)))) &&
                  (uVar23 = DAT_6000220e, (T_tm)_Max_turbine_torque < uVar23)))) {
                bVar15 = DAT_60002613;
                DAT_60002613 = bVar15 | 1;
              }
              else {
                uVar23 = DAT_6000241e;
                if (((~uVar23 & 0x10) != 0) ||
                   ((bVar15 = GENFGA, (bVar15 & 1) != 0 &&
                    (((~bVar15 & 1) != 0 || (bVar15 = DAT_6000242a, (~bVar15 & 0x40) != 0))))))
                goto LAB_002abe68;
              }
              uVar25 = 4;
            }
    LAB_002abe68:
            uVar12 = (uint)~(uVar25 & 0xff) & 0xc0;
            if ((uVar12 != 0xc0) &&
               ((((bVar15 = DAT_60002600, (~bVar15 & 0x20) == 0 && ((bVar5 & 0x40) == 0)) &&
                 (bVar15 = DAT_60002488, (bVar15 & 0x80) == 0)) ||
                ((uVar12 != 0xc0 && (bVar15 = DAT_60002607, (~bVar15 & 0x40) == 0)))))) {
              uVar23 = GFLAG1X;
              GFLAG1X = uVar23 & 0xfff7;
              bVar15 = GENFGA;
              if ((~bVar15 & 0x80) == 0) {
                GFLAG1X = uVar23 & 0xfff7 | 4;
              }
              GENFGA = bVar15 & 0x7f;
              DAT_60002603 = bVar5 & 0x7f;
              uVar22 = 0x20;
              goto LAB_002ac7c8;
            }
            if ((~(uVar25 & 0xff) & 4) == 0) {
              bVar15 = DAT_6000244f;
              if ((~bVar15 & 0x20) == 0) {
                uVar25 = 8;
              }
              else {
                bVar15 = DAT_60002608;
                bVar19 = ~bVar15;
                if ((bVar19 & 0x20) == 0) {
                  if ((((bVar15 & 1) == 0) && (bVar9 = IGCODE, (~bVar9 & 0x28) != 0x28)) ||
                     ((((bVar19 & 1) == 0 && (bVar9 = IGCODE, (~bVar9 & 0x2c) != 0x2c)) &&
                      (((cVar16 = DAT_600025cd, cVar16 == 'X' ||
                        (cVar16 = DAT_60002585, cVar16 == '\x01')) &&
                       (uVar23 = OUTRPM, DAT_002f1e22 < uVar23)))))) {
                    uVar25 = 8;
                  }
                  else {
                    if ((((bVar15 & 1) != 0) ||
                        ((bVar15 = IGCODE, (~bVar15 & 0x10) != 0 && (cVar16 = SHCODE, cVar16 != '\r'))))
                       && ((((bVar19 & 1) != 0 ||
                            ((bVar15 = IGCODE, (~bVar15 & 0x10) != 0 ||
                             ((cVar16 = DAT_600025cd, cVar16 != 'X' &&
                              (cVar16 = DAT_60002585, cVar16 != '\x01')))))) ||
                           (uVar23 = OUTRPM, uVar23 <= DAT_002f1e22)))) goto LAB_002ac020;
                    uVar25 = 0x10;
                  }
                }
                else {
    LAB_002ac020:
                  cVar16 = SHCODE;
                  if (((cVar16 != '\x12') || (uVar23 = OUTRPM, uVar23 < DAT_002f398c)) ||
                     ((bVar15 = GENFG1, (~bVar15 & 4) != 0 &&
                      (uVar23 = DAT_60002138, PTR_DAT_002f3992._2_2_ <= uVar23)))) goto LAB_002ac064;
                  uVar25 = 0x10;
                }
              }
            }
            else {
    LAB_002ac064:
              if ((bVar5 & 0x40) == 0) {
                bVar15 = GENFG1;
                if (((((((~bVar15 & 4) == 0) && (bVar15 = SHCODE, bVar15 < 9)) &&
                      (bVar5 = DAT_6000244f, (bVar5 & 0x80) == 0)) &&
                     ((bVar5 = DAT_600020d8, (~bVar5 & 9) != 9 && (bVar5 = IGCODE, (bVar5 & 3) == 0))))
                    && (((((bVar15 == 6 && (cVar16 = DAT_600025cd, cVar16 == -0x68)) ||
                          ((bVar15 == 5 && (cVar16 = DAT_600025cd, cVar16 == -0x68)))) ||
                         ((bVar15 == 3 && (cVar16 = DAT_600025cd, cVar16 == -0x68)))) ||
                        ((((bVar15 == 4 && (cVar16 = DAT_600025cd, cVar16 == -0x68)) ||
                          ((bVar15 == 0 && (cVar16 = DAT_600025cd, cVar16 != 'X')))) ||
                         ((bVar15 == 2 && (cVar16 = DAT_600025cd, cVar16 == -0x68)))))))) &&
                   (bVar15 = DAT_6000242d, bVar15 < Upshift_Cancel_Turbine_Speed_Threshold)) {
                  uVar12 = FUN_002bc958();
                  uVar13 = TRBRPM;
                  uVar23 = DAT_6000214e;
                  if (((uint)uVar13 + (uVar12 & 0xffff) < (uint)uVar23) ||
                     (cVar16 = DAT_60002529, cVar16 == '\0')) goto LAB_002ac1c8;
                  bVar15 = THRSS;
                  bVar5 = THDATA;
                  if (((uint)bVar5 <=
                       (uint)(THIJV1)_Throttle_Constant_for_Upshift_Cancel_Term + (uint)bVar15) ||
                     ((bVar15 = DAT_60002475, bVar15 <= DAT_002f34ce &&
                      (sVar6 = DAT_60002280,
                      (USCACC)_Upshift_Cancel_Output_Speed_Acceleration_Threshold <= sVar6))))
                  goto LAB_002ac1c8;
                  uVar23 = GFLAG1X;
                  if ((uVar23 & 0x20) == 0) {
                    GFLAG1X = uVar23 | 2;
                  }
                  uVar23 = GFLAG1X;
                  uVar23 = uVar23 | 0x20;
                }
                else {
    LAB_002ac1c8:
                  uVar23 = GFLAG1X;
                  uVar23 = uVar23 & 0xffdf;
                }
                GFLAG1X = uVar23;
                if ((~uVar23 & 0x20) == 0) {
                  bVar15 = SSOUTP;
                  cVar16 = FUN_002a94c0(bVar15);
                  if (cVar16 != '\0') {
                    bVar15 = IGCODE;
                    uVar22 = (ulonglong)bVar15;
                    if (((bVar15 & 4) == 0) ||
                       ((bVar15 = DAT_60002584, (bVar15 & 0x80) == 0 &&
                        (cVar16 = DAT_600025cd, cVar16 != 'X')))) goto LAB_002ac7c8;
                  }
                }
                bVar15 = SSOUTP;
                bVar15 = ~bVar15;
                if (((bVar15 & 0x80) == 0) && (cVar16 = DAT_600025cd, cVar16 == -0x68)) {
                  bVar5 = DAT_6000242c;
                  if ((~bVar5 & 8) == 0) {
                    uVar13 = FUN_002a9b3c(0x10);
                    uVar23 = OUTRPM;
                    if (uVar13 <= uVar23) goto LAB_002ac264;
                  }
                  else {
    LAB_002ac264:
                    bVar5 = DAT_600025fc;
                    if (((((~bVar5 & 1) != 0) && (bVar5 = DAT_60002576, (~bVar5 & 4) != 0)) &&
                        (bVar5 = DAT_600025fd, (~bVar5 & 0x40) != 0)) &&
                       (((uVar23 = OUTRPM, uVar23 <= (N_o_MAX4P)_Output_maximum_for_4P_gear &&
                         (bVar5 = DAT_6000251a, (~bVar5 & 0x40) != 0)) &&
                        (bVar5 = DAT_60002572, (~bVar5 & 2) != 0)))) {
                      uVar13 = DAT_600023d2;
                      uVar23 = DAT_60002202;
                      if (uVar13 <= uVar23) goto LAB_002ac2ec;
                    }
                  }
                  cVar16 = FUN_002a94c0(0x80);
                  if (cVar16 != '\0') {
                    uVar22 = 0x40;
                    goto LAB_002ac7c8;
                  }
                }
    LAB_002ac2ec:
                if (((bVar15 & 0x40) != 0) || (cVar16 = DAT_600025cd, cVar16 != -0x68))
                goto LAB_002ac3c0;
                bVar5 = DAT_600025fd;
                if (((~bVar5 & 0x20) == 0) ||
                   (((bVar5 = DAT_60002602, (~bVar5 & 0x40) == 0 ||
                     (bVar5 = DAT_60002576, (~bVar5 & 4) == 0)) ||
                    (bVar5 = DAT_60002572, (~bVar5 & 4) == 0)))) {
    LAB_002ac3a8:
                  cVar16 = FUN_002a94c0(0x40);
                  if (cVar16 != '\0') {
                    uVar22 = 0x20;
                    goto LAB_002ac7c8;
                  }
                }
                else {
                  uVar13 = DAT_600023d4;
                  uVar23 = DAT_60002202;
                  if ((uVar23 < uVar13) ||
                     ((bVar5 = DAT_60002488, (~bVar5 & 1) == 0 &&
                      (uVar23 = OUTRPM, uVar23 < DAT_002f35f6)))) goto LAB_002ac3a8;
                  bVar5 = DAT_6000242c;
                  if (((~bVar5 & 8) == 0) && (bVar5 = THDATA, DAT_002f367b <= bVar5)) {
                    uVar13 = FUN_002a9b3c(0xf);
                    uVar23 = OUTRPM;
                    if (uVar23 < uVar13) goto LAB_002ac3a8;
                  }
                }
    LAB_002ac3c0:
                if (((bVar15 & 0x20) != 0) || (cVar16 = DAT_600025cd, cVar16 != -0x68))
                goto LAB_002ac454;
                bVar5 = DAT_60002604;
                if (((~bVar5 & 1) == 0) || (bVar5 = DAT_60002572, (~bVar5 & 8) == 0)) {
    LAB_002ac43c:
                  cVar16 = FUN_002a94c0(0x20);
                  if (cVar16 != '\0') {
                    uVar22 = 0x10;
                    goto LAB_002ac7c8;
                  }
                }
                else {
                  uVar13 = DAT_600023d6;
                  uVar23 = DAT_60002202;
                  if (uVar23 < uVar13) goto LAB_002ac43c;
                  bVar5 = DAT_6000242c;
                  if (((~bVar5 & 8) == 0) && (bVar5 = THDATA, DAT_002f367d <= bVar5)) {
                    uVar13 = FUN_002a9b3c(10);
                    uVar23 = OUTRPM;
                    if (uVar23 < uVar13) goto LAB_002ac43c;
                  }
                }

  16. #176
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    and part 3
    Code:
    LAB_002ac454:
                if (((bVar15 & 0x10) == 0) && (cVar16 = DAT_600025cd, cVar16 == -0x68)) {
                  bVar5 = DAT_6000242c;
                  if ((~bVar5 & 8) == 0) {
                    uVar13 = FUN_002a9b3c(0xe);
                    uVar23 = OUTRPM;
                    if (uVar13 <= uVar23) goto LAB_002ac490;
                  }
                  else {
    LAB_002ac490:
                    uVar13 = DAT_600023d8;
                    uVar23 = DAT_60002202;
                    if (uVar13 <= uVar23) goto LAB_002ac4b8;
                  }
                  cVar16 = FUN_002a94c0(0x10);
                  if (cVar16 != '\0') {
                    uVar22 = 8;
                    goto LAB_002ac7c8;
                  }
                }
    LAB_002ac4b8:
                uVar22 = uVar25;
                if (((bVar15 & 4) == 0) && ((cVar16 = DAT_600025cd, cVar16 == -0x68 || (cVar16 == '8')))
                   ) {
                  cVar16 = FUN_002a8384(&PTR_DAT_002f35fc);
                  if (((((cVar16 != '\0') && (bVar15 = GENFG1, (bVar15 & 4) == 0)) &&
                       ((bVar15 = IGCODE, (~bVar15 & 4) == 0 &&
                        ((uVar23 = OUTRPM, DAT_002f34d4 < uVar23 &&
                         (uVar23 = DAT_6000241e, (uVar23 & 0x800) == 0)))))) ||
                      ((bVar15 = DAT_60002487, (bVar15 & 0x80) == 0 &&
                       (cVar16 = FUN_002a93dc(4), cVar16 != '\0')))) &&
                     ((cVar16 = FUN_002a8f20(4), cVar16 != '\0' &&
                      (bVar15 = DAT_60002571, (bVar15 & 8) == 0)))) {
                    uVar22 = (ulonglong)DAT_002f3608;
                  }
                }
                else if (((bVar15 & 8) == 0) && (cVar16 = DAT_600025cd, cVar16 == -0x68)) {
                  bVar5 = DAT_60002604;
                  if ((bVar5 & 0x20) == 0) {
                    bVar15 = GENFG1;
                    if (((((bVar15 & 4) == 0) && (bVar15 = IGCODE, (~bVar15 & 8) == 0)) &&
                        (cVar16 = FUN_002a8384(&PTR_DAT_002f3610), cVar16 != '\0')) &&
                       (cVar16 = FUN_002a8f20(8), cVar16 != '\0')) {
                      uVar22 = (ulonglong)DAT_002f361c;
                    }
                  }
                  else {
                    if ((~bVar5 & 0x20) != 0) goto LAB_002ac640;
                    bVar15 = GENFG1;
                    if (((((((bVar15 & 4) == 0) && (bVar15 = IGCODE, (~bVar15 & 8) == 0)) &&
                          (cVar16 = FUN_002a8384(&PTR_DAT_002f3638), cVar16 != '\0')) ||
                         (cVar16 = FUN_002a93dc(8), cVar16 != '\0')) &&
                        ((cVar16 = FUN_002a8f20(8), cVar16 != '\0' &&
                         (bVar15 = DAT_6000248c, (bVar15 & 2) == 0)))) &&
                       (uVar23 = DAT_6000241e, (uVar23 & 0x20) == 0)) {
                      uVar22 = (ulonglong)DAT_002f3644;
                    }
                  }
                }
                else {
    LAB_002ac640:
                  if (((bVar15 & 0x10) == 0) && (cVar16 = DAT_600025cd, cVar16 == -0x68)) {
                    bVar15 = GENFG1;
                    if ((((((bVar15 & 4) == 0) && (bVar15 = IGCODE, (~bVar15 & 0x10) == 0)) &&
                         (cVar16 = FUN_002a8384(&PTR_DAT_002f3624), cVar16 != '\0')) ||
                        (cVar16 = FUN_002a93dc(0x10), cVar16 != '\0')) &&
                       (((cVar16 = FUN_002a8f20(0x10), cVar16 != '\0' &&
                         (cVar16 = FUN_002a9350(0x10), cVar16 != '\0')) &&
                        ((bVar15 = DAT_6000248c, (bVar15 & 2) == 0 &&
                         (uVar23 = DAT_6000241e, (uVar23 & 0x40) == 0)))))) {
                      uVar22 = (ulonglong)DAT_002f3630;
                    }
                  }
                  else if (((bVar15 & 0x20) == 0) && (cVar16 = DAT_600025cd, cVar16 == -0x68)) {
                    bVar15 = GENFG1;
                    if ((((((bVar15 & 4) == 0) && (bVar15 = IGCODE, (~bVar15 & 0x20) == 0)) &&
                         (cVar16 = FUN_002a8384(&PTR_DAT_002f364c), cVar16 != '\0')) ||
                        (cVar16 = FUN_002a93dc(0x20), cVar16 != '\0')) &&
                       ((((cVar16 = FUN_002a8f20(0x20), cVar16 != '\0' &&
                          (cVar16 = FUN_002a9350(0x20), cVar16 != '\0')) &&
                         (bVar15 = DAT_6000248c, (bVar15 & 2) == 0)) &&
                        (uVar23 = DAT_6000241e, (uVar23 & 0x80) == 0)))) {
                      uVar22 = (ulonglong)DAT_002f3658;
                    }
                  }
                  else if ((((((bVar15 & 0x40) == 0) && (cVar16 = DAT_600025cd, cVar16 == -0x68)) &&
                            ((bVar18 & 2) == 0)) &&
                           (((cVar16 = FUN_002a93dc(0x40), cVar16 != '\0' &&
                             (cVar16 = FUN_002a8f20(0x40), cVar16 != '\0')) &&
                            (cVar16 = FUN_002a9350(0x40), cVar16 != '\0')))) &&
                          ((bVar15 = DAT_6000248c, (bVar15 & 2) == 0 &&
                           (uVar23 = DAT_6000241e, (uVar23 & 0x100) == 0)))) {
                    uVar22 = 0x80;
                  }
                }
    LAB_002ac7c8:
                cVar16 = FUN_002aa804(uVar22 & 0xff);
                uVar25 = uVar22;
                if (cVar16 != '\0') {
                  uVar25 = 0x40;
                }
              }
            }
    LAB_002ac7dc:
            uVar22 = uVar25 & 0xff;
            FUN_002a88ec(uVar22);
            FUN_002a8bf8(uVar22);
            FUN_002a8d0c(uVar22);
            bVar15 = GENFGA;
            if ((((bVar15 & 0x80) == 0) && (bVar15 = DAT_60002603, (bVar15 & 0x80) == 0)) &&
               (uVar23 = GFLAG1X, (uVar23 & 8) == 0)) {
              bVar15 = GENFG1;
              uVar12 = (uint)uVar25;
              if ((bVar15 & 4) == 0) {
                bVar15 = SSOUTP;
                if (((((((~bVar15 & 0x7c) != 0x7c) && ((uint)bVar15 < (uVar12 & 0xff))) ||
                      (((~bVar15 & 0xf8) != 0xf8 &&
                       (((uVar12 & 0xff) < (uint)bVar15 &&
                        (bVar15 = DAT_6000248d, (~bVar15 & 0x40) == 0)))))) &&
                     (uVar23 = SSLPTMR, uVar23 == DAT_002f34c6)) &&
                    (((bVar15 = GFG104, (bVar15 & 6) == 0 && (bVar18 = DAT_6000248b, (bVar18 & 8) == 0))
                     && (bVar18 = DAT_6000260d, (bVar18 & 4) == 0)))) &&
                   ((cVar16 = DAT_600025cd, cVar16 == -0x68 || (cVar16 == '8')))) {
                  GFG104 = bVar15 | 4;
                  FUN_002aab28();
                  goto LAB_002ac91c;
                }
              }
              FUN_002aaa60(uVar25 & 0xff);
              bVar15 = GFG104;
              if ((bVar15 & 4) == 0) {
                bVar15 = GENFG1;
                if (((bVar15 & 4) == 0) && (bVar15 = SSOUTP, (uint)bVar15 < (uVar12 & 0xff))) {
                  bVar15 = DAT_60002529;
                  THRSS = bVar15;
                }
                SSOUTP = (byte)uVar25;
              }
              goto LAB_002ac91c;
            }
          }
          FUN_002aaa60(uVar25 & 0xff);
          goto LAB_002ac91c;
        }
        bVar15 = IGCODE;
        if ((~bVar15 & 2) != 0) {
          puVar11 = FUN_002a844c((uint)bVar1,(uint)bVar2,(uint)bVar3);
          DAT_600021f4 = puVar11;
          uVar23 = OUTRPM;
          if ((uVar23 < (BX1SNO1)_Extreme_cold_1st_gear_output_speed_constant_#1) ||
             ((uVar23 < (BX1SNO2)_Extreme_cold_1st_gear_output_speed_constant_#2 && ((~bVar15 & 5) != 5)
              ))) {
            FUN_002a82e4(4);
          }
          else {
            FUN_002a82e4(0x20);
          }
          goto LAB_002ac91c;
        }
      }
    LAB_002ab5c4:
      FUN_002a82e4(1);
    LAB_002ac91c:
      FUN_002a8dc0();
      THDATA = uVar8;
      return;
    }

  17. #177
    Tuner in Training
    Join Date
    Apr 2023
    Location
    Sofia, Bulgaria
    Posts
    36
    Quote Originally Posted by Jim P 2.0 View Post
    Here's part of it, first half of this function as it's too big
    Thank you VERY much, again. Found the equivalent of this one also. I will investigate.

  18. #178
    Tuner in Training
    Join Date
    Apr 2023
    Location
    Sofia, Bulgaria
    Posts
    36
    I managed to refactor it with all the renamed varibles in your code. Now it is much clearer to read and analyze. Thank you again, Jim P.

    What software/hardware are you using for monitoring memory variables and is it available for buying form non-professionals? I think I will need this if I want to continue digging deeper.

  19. #179
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    virtually everything i deal with is the cummins so i use their stuff

  20. #180
    Advanced Tuner
    Join Date
    Sep 2023
    Posts
    438
    Quote Originally Posted by sparkybg View Post

    And a question. This is a function you must have equivalent to. Do you think the code in red resembles something like timer that has something to do with the speed the trans shifts?

    Code:
    void Trans_Calculate_Turbine_Speed_Error_And_Slip_From_Gear_17d170(void)
    
    {
    	int in_r2;
    	uint uVar1;
    	undefined2 uVar2;
    	ushort uVar3;
    	byte bVar4;
    	undefined uVar5;
    	int in_r13;
    	int in_r16;
    
    	if (((*(byte*)(Trans_Flags_xxxxx_Shifting_xx_270e) & 4) == 0) && ((*(byte*)(GearFlags_Present_Gear_654321RP_26ed) & 1) == 0)) {
    		bVar4 = ~*(byte*)(GearFlags_Present_Gear_654321RP_26ed);
    		if ((bVar4 & 2) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+2);
    		}
    		else if ((bVar4 & 4) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+4);
    		}
    		else if ((bVar4 & 8) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+6);
    		}
    		else if ((bVar4 & 0x10) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+8);
    		}
    		else if ((bVar4 & 0x20) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+10);
    		}
    		else if ((bVar4 & 0x40) == 0) {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+12);
    		}
    		else {
    			uVar1 = (uint) * (ushort*)(r_REP_P_Trans_Gear_Ratios_0x1E023C+14);
    		}
    		uVar1 = uVar1 * *(ushort*)(Trans_Output_Speed_2436) >> 10 & 0x3fff;
    		uVar2 = (undefined2)uVar1;
    		*(undefined2*)(Trans_Source_Gear_Calculated_Turbine_Speed_2272) = uVar2;
    		*(undefined2*)(Trans_Target_Gear_Calculated_Turbine_Speed_2274) = uVar2;
    		uVar1 = (int)*(short*)(Trans_Turbine_Speed_2434) - uVar1;
    		*(short*)(Trans_Turbine_Speed_Error_22f6) = (short)uVar1;
    		if ((short)uVar1 < 0) {
    			uVar1 = -uVar1;
    		}
    		uVar1 = uVar1 & 0xffff;
    		if (0xff < uVar1) {
    			uVar1 = 0xff;
    		}
    		if (*(byte*)(Trans_Absolute_Max_Turbine_Speed_Error_2610) < uVar1) {
    			*(char*)(Trans_Absolute_Max_Turbine_Speed_Error_2610) = (char)uVar1;
    		}
    		if (*(byte*)(Trans_Max_Shift_Turbine_Speed_Error_2608) < uVar1) {
    			uVar3 = Trans_Limit_17d0848((ushort)uVar1);
    			*(char*)(Trans_Max_Shift_Turbine_Speed_Error_2608) = (char)uVar3;
    		}
    		bVar4 = *(char*)(in_r13 + 0x260e) + 1;
    		*(byte*)(in_r13 + 0x260e) = bVar4;
    		if (*(byte*)r_FLASH[0x1B18C2](equals 0x1C, 28) <= bVar4) {
    			uVar5 = 0;
    			*(undefined*)(in_r13 + 0x260e) = 0;
    			uVar3 = Trans_Limit_17d0848((ushort)(((uint) * (byte*)(Trans_Max_Shift_Turbine_Speed_Error_2608) *
    				(uint) * (byte*)r_FLASH[0x1B18B4](equals 0x2, 2) +
    				(uint) * (byte*)(Trans_Absolute_Max_Turbine_Speed_Error_2610) & 0xffff) /
    				(uint) * (ushort*)r_FLASH[0x1B18B2](equals 0x4, 4)));
    			*(char*)(Trans_Max_Shift_Turbine_Speed_Error_2608) = (char)uVar3;
    			*(undefined*)(Trans_Absolute_Max_Turbine_Speed_Error_2610) = uVar5;
    		}
    	}
    	return;
    }
    This just looks like diagnostic code to me. Many things affect how fast the transmission will shift, there are delay timers, there are slip time values for the clutches (this is a big one because its telling the code how long to allow the slip based on various factors when the clutches change hands for the gear changes), there are speed offsets and all sorts of stuff that goes into it.

    Here is a piece showing some delays
    Code:
    void FUN_002a88ec(uint param_1)
    
    {
      ushort uVar1;
      short sVar2;
      byte bVar3;
      ushort uVar4;
      byte bVar5;
      byte bVar6;
      byte bVar7;
      
      bVar7 = GENFGA;
      if ((~bVar7 & 0x80) != 0) {
        bVar3 = DAT_60002603;
        if (((~bVar3 & 0x80) != 0) && (uVar1 = GFLAG1X, (~uVar1 & 8) != 0)) {
          bVar3 = GENFG1;
          if (((((bVar3 & 4) != 0) ||
               (((bVar6 = IGCODE, (~bVar6 & 8) != 0 ||
                 ((~Configuration_flags_for_shift_schedule_logic_1 & 0x10) != 0)) ||
                ((~param_1 & 0x30) == 0x30)))) &&
              (((((bVar3 & 4) != 0 || (bVar6 = IGCODE, (~bVar6 & 0x10) != 0)) ||
                ((~Configuration_flags_for_shift_schedule_logic_1 & 0x20) != 0)) ||
               ((~param_1 & 0x20) != 0)))) &&
             ((((bVar3 & 4) != 0 || (bVar6 = IGCODE, (~bVar6 & 0x20) != 0)) ||
              (((~Configuration_flags_for_shift_schedule_logic_1 & 0x40) != 0 ||
               ((~param_1 & 0x40) != 0)))))) {
            if ((bVar3 & 4) != 0) {
              return;
            }
            bVar3 = IGCODE;
            if ((~bVar3 & 0x40) != 0) {
              return;
            }
            if ((~Configuration_flags_for_shift_schedule_logic_2 & 2) != 0) {
              return;
            }
            if ((~param_1 & 0x80) != 0) {
              return;
            }
          }
          uVar4 = DAT_6000240c;
          uVar1 = DCTIME;
          if (uVar1 <= uVar4) {
            return;
          }
          uVar1 = DAT_60002190;
          uVar4 = DAT_600021ee;
          if ((uint)Shift_Delay_TC_Slip_Threshold + (uint)uVar1 <= (uint)uVar4) {
            return;
          }
          bVar3 = DAT_60002601;
          if (((bVar3 & 1) != 0) && ((~bVar3 & 0x80) != 0)) {
            return;
          }
        }
        uVar1 = GFLAG1X;
        if ((~uVar1 & 2) == 0) {
          GENFGA = bVar7 | 0x80;
          GFLAG1X = uVar1 & 0xfffd;
          DAT_6000251c = 0;
          DAT_600025b3 = 0;
          return;
        }
        return;
      }
      bVar3 = DAT_6000251c;
      if (bVar3 <= DAT_002f3992) {
        bVar3 = DAT_600020d8;
        if ((~bVar3 & 9) != 9) {
          bVar6 = GENFG1;
          if ((((((((bVar6 & 4) == 0) && (bVar5 = IGCODE, (~bVar5 & 4) == 0)) && ((~param_1 & 8) == 0))
                || ((((bVar6 & 4) == 0 && (bVar5 = IGCODE, (~bVar5 & 8) == 0)) &&
                    ((~param_1 & 0x10) == 0)))) ||
               ((((bVar6 & 4) == 0 && (bVar5 = IGCODE, (~bVar5 & 8) == 0)) && ((~param_1 & 0x20) == 0)))
               ) || (((((bVar6 & 4) == 0 && (bVar5 = IGCODE, (~bVar5 & 0x10) == 0)) &&
                      ((~param_1 & 0x20) == 0)) ||
                     ((((bVar6 & 4) == 0 && (bVar5 = IGCODE, (~bVar5 & 0x20) == 0)) &&
                      ((~param_1 & 0x40) == 0)))))) ||
             ((((bVar6 & 4) == 0 && (bVar6 = IGCODE, (~bVar6 & 0x40) == 0)) && ((~param_1 & 0x80) == 0))
             )) goto LAB_002a8a78;
        }
        bVar6 = DAT_60002601;
        if ((~bVar6 & 5) != 0) {
          if ((~bVar3 & 2) == 0) {
            uVar4 = TRBRPM;
            uVar1 = DAT_600021ee;
            if ((((uint)uVar4 + (int)Shift_Delay_Unlock_Slip_Value < (uint)uVar1) &&
                (bVar3 = DAT_600020d5, (bVar3 & 0x40) == 0)) ||
               ((sVar2 = DAT_6000207a, sVar2 <= _DAT_002f1c5a &&
                (bVar3 = DAT_600020d5, (~bVar3 & 0x40) == 0)))) goto LAB_002a8a78;
          }
          bVar3 = DAT_600025b3;
          if (bVar3 <= Exhaust_Brake_Delay_Timer_Limit) {
            return;
          }
        }
      }
    LAB_002a8a78:
      GENFGA = bVar7 & 0x7f;
      uVar1 = GFLAG1X;
      GFLAG1X = uVar1 | 4;
      return;
    }