macros.h - aalesv/2boost GitHub Wiki

Contains all symbols and macros definitions used in 2Boost code except for generic_lut_t which is defined in types.h.

Symbols

ALWAYS_INLINE

Function attribute, which requires that the function will always be inlined.

GNUC_MIN_ACTUAL_VERSION

Old GCC has bugs and thus needs some workarounds. This is major version of GCC that don't need such workarounds.

LUT_COLUMN_COUNT

Count of Lookup Table columns. Equals to NUMBER_OF_REGULAR_TABLES + 1 + number of extra tables (because the column count starts from 0).

LUT_OVERTAKE_MAP_COLUMN_NUMBER

The Overtake map column number. It's last column. It's the extra table.

NUMBER_OF_REGULAR_TABLES

Number of auto-generated tables for each hack section. Does not take into account extra tables (currently it is Overtake table). Defaults to 2 on non Si-Drive cars (map 1 and map 2) and 3 on Si-Drive cars (Intelligent map, Sport map and Sport Sharp map). Depends on P_SI_DRVIE_STATE symbol which is defined in CALID.h.

ROM_CODE

Defines ROM code section. All functions that belong to the regular code should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_CONFIG

Defines ROM configuration constants section. All global constants that belong to the mod config and are tuner-editable (Map Switch Source, Engine Displacement etc.) should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_DATA

Defines ROM global variables section. All global variables that belong to the regular code should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_DATA_CONST

Defines ROM constants section. All global constants that belong to the regular code should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_ENTRY_POINT_CALC_2D

Defines ROM entry point section. All functions that intercept ROM calculate 2D tables routines should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_ENTRY_POINT_CALC_3D

Defines ROM entry point section. All functions that intercept ROM calculate 3D tables routines should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_ENTRY_POINT_SPEED_DENSITY

Defines ROM entry point section. All functions that intercept ROM air flow calculation routines should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_LUT

Defines ROM Lookup Table data section. All lookup tables should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_METADATA

Defines ROM metadata section. All constants that belong to the metadata (version string definition etc.) should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_TABLE_DATA

Defines ROM table data section. All tables (table X, Y axis and data arrays) should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_TABLE_PTR

Defines ROM table pointers section. All table pointer structures should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_TESTS_CODE

Defines ROM tests code section. All functions that belong to the tests code should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

ROM_TESTS_DATA

Defines ROM tests global variables section. All tests variables that belong to the tests code should use this section definition. The symbol is defined via LD_SECTION macro. Section name must correspond to name specified in linker script 2boost.txt.

UINT_0x04000000

uint8 alias. Used in CREATE_TABLE_3D_UINT macro.

UINT_0x4000000

uint8 alias. Used in CREATE_TABLE_3D_UINT macro.

UINT_0x08000000

uint16 alias. Used in CREATE_TABLE_3D_UINT macro.

UINT_0x8000000

uint16 alias. Used in CREATE_TABLE_3D_UINT macro.

UINT_0x0400

uint8 alias. Used in CREATE_TABLE_2D_UINT macro.

UINT_0x400

uint8 alias. Used in CREATE_TABLE_2D_UINT macro.

UINT_0x0800

uint16 alias. Used in CREATE_TABLE_2D_UINT macro.

UINT_0x800

uint16 alias. Used in CREATE_TABLE_2D_UINT macro.

uint8

Alias to unsigned char

uint16

Alias to unsigned short

Macros

COUNT_OF(x)

Array size macro.

CREATE_LUT_ENTRY(NUM, TYPE, ORIG, REPL, EXTRA)

Macro that creates Lookup table entry.

Argument Description
NUM Number of tables. Must be equal to NUMBER_OF_REGULAR_TABLES.
TYPE Type of table. Possible values are described in type defs table_2d_uint_t and table_3d_uint_t, field data_type
ORIG Address of original ROM's table
REPL Name of 2Boost tables created by CREATE_TABLE_2D_UINT or CREATE_TABLE_3D_UINT macros. Will expand to REPL1, REPL2 and so on depending of NUM argument
EXTRA Name of extra (currently it is Overtake) table

CREATE_LUT_ENTRY_EXTRA_ONLY(NUM, TYPE, ORIG, EXTRA)

Macro that creates Lookup table entry. It works similar to CREATE_LUT_ENTRY, but ORIG address is used instead addresses of all REPL tables.

CREATE_TABLE_2D_UINT(NUM, NAME, X_COUNT, DATA_TYPE, MULTIPLIER, OFFSET)

Macro that creates NUM table pointer structures (with tables) of type table_2d_uint_t named NAME1, NAME2 and so on. NUM can be 1, 2 or 3. Possible values for DATA_TYPE are described in type def table_2d_uint_t, field data_type.

CREATE_TABLE_2D_UINT_1(NAME, X_COUNT, DATA_TYPE, MULTIPLIER, OFFSET)

Internal macro, do not use it. Macro that creates table pointer structure (with tables) of type table_2d_uint_t named NAME.

CREATE_TABLE_3D_UINT(NUM, NAME, X_COUNT, Y_COUNT, DATA_TYPE, MULTIPLIER, OFFSET)

Macro that creates NUM table pointer structures (with tables) of type table_3d_uint_t named NAME1, NAME2 and so on. NUM can be 1, 2 or 3. Possible values for DATA_TYPEare described in type def table_3d_uint_t, field data_type.

CREATE_TABLE_3D_UINT_1(NAME, X_COUNT, Y_COUNT, DATA_TYPE, MULTIPLIER, OFFSET)

Internal macro, do not use it. Macro that creates table pointer structure (with tables) of type table_3d_uint_t named NAME.

LD_SECTION(SECTION, ALIGN)

Function attribute that defines linker section named SECTION aligned at ALIGN.

OPTIMIZE(LEVEL)

Function attribute that defines optimization level.