tokumaru wrote:
Can we have the definition of
starts_with?
I believe that the reason you can't use the macros directly in the IF statement is because ca65 doesn't know when the last parameter of a c-style macro ends. In that case, delimiting the last parameter with {} should work. Something like this:
Code:
.if macro0 parameter0, {parameter1} || macro1 parameter2, {parameter3}
;(...)
.endif
Cool, worked perfectly! Thanks sir! ca65's macros and directives are so gnarly...but I love them

For curiosity's sake, starts_with and ends_with are here:
Code:
.define starts_with(string, prefix) .xmatch(.sprintf(.sprintf("%%.%ds", .strlen(prefix)), string), prefix)
.define ends_with(string, suffix) .xmatch(.sprintf(.sprintf("%%.%ds%%s", (.strlen(suffix) < .strlen(string)) * (.strlen(string) - .strlen(suffix))), string, suffix), string)
These resulted from a
conversation with thefox.