| _rom_call_addr_hack | Function (Macro Constructor)

default.h

#define _rom_call_addr_hack(index,addr,minams) (_rom_call_addr_hack_concat (0x##index, _ROM_CALL_##index, (addr), (minams), 0x##index))

Returns a void pointer for a TIOS ROM call, using an address hack if needed.

_rom_call_addr_hack works exactly like _rom_call_addr, except that it takes an additional parameter addr specifying an alternative way to get the address of the ROM call. If the TIOS jump table contains the ROM call specified by index, the address from the jump table is used. Otherwise _rom_call_addr_hack computes the address specified by addr (which can be any pointer type), and returns it.
minams specifies the AMS version which first exports the ROM call identified by index. If the value of `MIN_AMS` is greater or equal to the value of minams, the ROM call is used unconditionally. When using this macro directly, you need to make sure that this value is correct; otherwise you will get crashes only if a specific value for `MIN_AMS` has been chosen and an unsupported AMS version is used.

See also: _rom_call_addr, _rom_call_hack, Manually Obtaining the Address of a ROM Function