td-d wrote:
Try logging 0XFFF89B02 and FFF89891 for gear. One byte, raw value.
Thank you td-d, your contributions in FT86Club (I started off there) have helped me tremendously.
I found the 2nd set in your list but I missed the first one as Ghidra assumed the data type to a character. Figured out since the models with K00G still used the 4.1 final gear ratio, hence the values in the thresholds table in A01G should be the same as the one in K00G.
However in the first set (from 0x00104548) Ghidra does not show any cross referencing; does that imply that those values aren't used? I had changed the data types and re-analysed it in case Ghidra picks up something new but yet there are no new xrefs.
In the function referenced for the second group of values (0x00104578), it reads off a RAM value 0xFFF88FFC to determine if the first set or the second set is used... will dig further to understand it.
Code:
uint ?GearDetermination(void)
{
char cVar2;
uint uVar1;
undefined4 uVar3;
undefined4 uVar4;
float fVar5;
float fVar6;
uVar4 = DAT_fff88f7c;
fVar6 = DAT_fff89750;
cVar2 = FUN_00056ad0();
if (DAT_fff88ffc == '\x01') {
DAT_fff8997c = 33.86;
DAT_fff89978 = 26.81;
DAT_fff89974 = 21.65;
DAT_fff89970 = 16.25;
DAT_fff8996c = 10.77;
}
else {
DAT_fff8997c = 32.07;
DAT_fff89978 = 25.4;
DAT_fff89974 = 20.51;
DAT_fff89970 = 15.4;
DAT_fff8996c = 10.2;
}
fVar5 = 1.0;
if (DAT_fff896f4 == '\0') {
uVar1 = (uint)DAT_fff88e96;
if (uVar1 == 0) {
DAT_fff89962 = 6;
DAT_fff89963 = 0;
return 0;
}
if (uVar1 == 0xd) {
DAT_fff89962 = 6;
DAT_fff89963 = 0;
return 0;
}
if (uVar1 == 0xe) {
DAT_fff89962 = 1;
DAT_fff89963 = 1;
return 1;
}
if (uVar1 < 7) {
if (uVar1 == 6) {
DAT_fff89962 = 5;
DAT_fff89963 = 6;
return 6;
}
DAT_fff89962 = DAT_fff88e96;
DAT_fff89963 = DAT_fff88e96;
return (int)(char)DAT_fff88e96;
}
return uVar1;
}
if (0.1953125 <= fVar6) {
uVar3 = FUN_00010b30(fVar6,0x447a0000);
uVar4 = FUN_00010b30(uVar4,uVar3);
DAT_fff89958 = (float)FUN_00010b30(uVar4,fVar5);
DAT_fff8995c = (float)FUN_000112b0(DAT_fff89958,DAT_fff8995c,0x3e99999a);
if (DAT_fff8996c < DAT_fff89958) {
if (DAT_fff89970 < DAT_fff89958) {
if (DAT_fff89974 < DAT_fff89958) {
if (DAT_fff89978 < DAT_fff89958) {
if (DAT_fff8997c < DAT_fff89958) {
DAT_fff89960 = '\x06';
}
else {
DAT_fff89960 = '\x05';
}
}
else {
DAT_fff89960 = '\x04';
}
}
else {
DAT_fff89960 = '\x03';
}
}
else {
DAT_fff89960 = '\x02';
}
}
else {
DAT_fff89960 = '\x01';
}
if (DAT_fff8995c <= DAT_fff8996c) {
DAT_fff89961 = 1;
goto LAB_00050236;
}
if (DAT_fff8995c <= DAT_fff89970) {
DAT_fff89961 = 2;
goto LAB_00050236;
}
if (DAT_fff8995c <= DAT_fff89974) {
DAT_fff89961 = 3;
goto LAB_00050236;
}
if (DAT_fff8995c <= DAT_fff89978) {
DAT_fff89961 = 4;
goto LAB_00050236;
}
if (DAT_fff8995c <= DAT_fff8997c) {
DAT_fff89961 = 5;
goto LAB_00050236;
}
}
else {
DAT_fff8995c = DAT_fff89958;
DAT_fff89960 = '\x06';
}
DAT_fff89961 = 6;
LAB_00050236:
if ((DAT_fff896ed != '\x01') && (cVar2 != '\x04')) {
if (DAT_fff89960 == '\x06') {
DAT_fff89962 = 5;
DAT_fff89963 = 6;
return 6;
}
DAT_fff89962 = DAT_fff89960;
DAT_fff89963 = DAT_fff89960;
return (int)DAT_fff89960;
}
DAT_fff89963 = 0;
DAT_fff89962 = 6;
return 0;
}