NOOPr wrote:
It's possible to force a function to be inlined in cc65? I know that's possible with a #define, but I need a multi-line macro. I unsuccessfully tried to define a macro in assembler and then call it on the C code direct or via define.
CC65 doesn't have much effective optimization, and it doesn't implement inline functions. Even if it could inline them the advantage is gone because it isn't really capable of optimizing through them either.
As stated above, you can make a multi-line define with a \ to continue the line. That's not just for inline assembly, you can put C code in there too. I think the suggestion for inline assembly was just assuming you were trying to optimize more (which generally requires doing it "by hand" in assembly).
I used this to manually unroll some loops in my
Giant Steps project, which was a big optimization by itself, despite not using any inline assembly. (See coltrane.c, look for RING_BUFFER_SWAP.)