| _rom_call_hack | Function (Macro Constructor)

default.h

#define _rom_call_hack(type,args,index,addr,minams) (_rom_call_hack_attr_concat (type, args, , 0x##index, _ROM_CALL_##index, (addr), (minams), 0x##index))

Constructs a function definition with an address hack for a TIOS ROM call.

_rom_call_hack works exactly like _rom_call, 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_hack computes the address specified by addr (which can be any pointer type), and uses it as the address of the ROM call.
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, _rom_call_hack_attr, _rom_call_addr_hack, Manually Obtaining the Address of a ROM Function