Possible to create a table to change individual bits?

For questions relating to the configuration and use of tunerpro
User avatar
Phoenix
Posts: 132
Joined: Fri Aug 21, 2020 7:02 pm
cars: 1983 Chevy C10
1993 Ford Mustang LX 5.0
2004 Pontiac GTO
2005 Pontiac GTO
Location: Anna, TX

Possible to create a table to change individual bits?

Post by Phoenix »

Hello,

I'm wondering if there is a way to set up a table in TunerPro so that it can change individual bits from 0 to 1 and 1 to 0 in an individual byte? I'm trying to define a parameter in the P59 GM OS that deals with engine protection and a cylinder group. In the byte each cylinder is represented by 1 bit so for example:

HEX value is 55, the Binary value is 01010101. The cylinders are defined as:
Cylinder H = 0, False
Cylinder G = 1, True
Cylinder F = 0, False
Etc.

I know I can set up a Flag and change the individual bit that way, but is there a way to group them them together and have 1 table instead of 8 flags?
Highlander
Posts: 82
Joined: Sun May 11, 2014 8:36 am
cars: Z06

Re: Possible to create a table to change individual bits?

Post by Highlander »

You can create a new table whose each row is linked to a different cal.

Like this:

https://prnt.sc/MsnFoYSXjHQx

https://prnt.sc/ov9pDfnGFFOv

https://prnt.sc/z-KTrwnJqKqg
User avatar
Phoenix
Posts: 132
Joined: Fri Aug 21, 2020 7:02 pm
cars: 1983 Chevy C10
1993 Ford Mustang LX 5.0
2004 Pontiac GTO
2005 Pontiac GTO
Location: Anna, TX

Re: Possible to create a table to change individual bits?

Post by Phoenix »

Highlander wrote:You can create a new table whose each row is linked to a different cal.

Like this:

https://prnt.sc/MsnFoYSXjHQx

https://prnt.sc/ov9pDfnGFFOv

https://prnt.sc/z-KTrwnJqKqg
So basically I would have to create all the flags, then scroll through the 2800+ parameters of the XDF (I cannot find a way to search in the Linked Item XDF Browser) link it, then repeat 31 more times?
sparepartsblazer
Posts: 89
Joined: Mon Dec 04, 2023 1:18 am
Location: Missouri

Re: Possible to create a table to change individual bits?

Post by sparepartsblazer »

I know Universal Patcher can do it. I just ran into this issue the other day
sparepartsblazer
Posts: 89
Joined: Mon Dec 04, 2023 1:18 am
Location: Missouri

Re: Possible to create a table to change individual bits?

Post by sparepartsblazer »

This is from the help section of Tunerpro. I could not figure it out


Flags, also called "bit masks," are single bits within a byte that the code uses as switches to determine whether or not to use a particular sensor or feature (or even another line of code). Consider the following bit mask from the hack example above:

LC014: FCB $90 ; %1001 0000 Air Fuel Opt Word, W/VATS
;
; Bit 0 = MANUAL XMISSION
; 1 = SINGLE FIRE MODE
; 2 = ANALOG MAF METER IN USE, (HLM)
; 3 =
; 4 = VATS ENABLE
; 5 = REQ CLSED LP FOR CAN PURGE
; 6 = USE TCC FOR SHFT LAMP CNT'L
; 7 = USE FILTER FOR AIR FLOW

From the previous examples, we know that this item is located at offset $14 and is a single byte in size. The value in the bin that is disassembled at this offset is $90. You'll notice in the comment for the line that $90 in binary (%)is 10010000. Each 1 and 0 represent a bit, where 1 is a "set" bit and 0 is a "clear" bit. Bits are usually identified in "zero-based" fashion, which means the first bit is Bit 0. Bit zero in the binary string 10010000 is the bit furthest right (0). From the comments, we can see that bit 0 is "Manual Transmission" (as vague as that is).

Adding this item to the ECU file, we'd enter 14 (hex) as the start address, "Air Fuel Opt Word" as a map name (from the comment in the hack), we'd check "bitmask" since we know its a bitmask. We're not doing math on this item, so the offset, factor, and operation don't matter. X Unit and Y Unit don't matter, and X Axis Label doesn't matter.

To specify a label for each bit, we use Y Axis Label. Bit 0 is Row 8, Bit 7 is Row 1 (which, I know, is a little counter-intuitive). Keep in mind that each label can only be 5 characters in length (per the ECU file format specification).