Discussion about software development for the old-school Gameboys, ranging from the "Gray brick" to Gameboy Color
(Launched in 2008)
You are not logged in.
Pages: 1
Yo doods.
I've been trying to compile this borrowed code in GBDK with no success.
Note the Sar inline definition
#define Sar(a,b) (((a)<0) ? -((-a)>>(b)) : ((a)>>(b)))
Later on when I use it with say, a long integer and an unsigned 8bit integer, it throws a warning for the variable types used (regardless of what variable type they are, having tried many combinations) and an error in the Sar function, specifically in the -((-a)>>(b)) part. "Invalid Operand for Shift Operator".
So I wrote the inline definition out as a full function, same error. I changed the offending line of code to return (a)>>(b);, and the compiler has a hissy fit/internal error in "gen.c" line 349 : code generation internal error.
What on earth have I dont wrong?
Offline
Pages: 1