Hi all,
I've been trying to compile GASS also, and found that all data that was
supposed to be loaded into IWRAM isn't. What's weirder is that the data isn't
even at the ROM load address.
A simple test has shown me that Jeff's lnkscrpt will load data into IWRAM
correctly if there are C constants being loaded also, but incorrectly if the
only external data is loaded through an asm file. Not a big deal I guess, but it
might be something to fix in the next revision... :)
Ben
here's the test:
asm.s:
.section .iwram
.global AsmExternInIWRAM
AsmExternInIWRAM:
.word 0xDEADC0DE
c.c:
// const unsigned int CInIWRAM __attribute__ ((section (".iwram")))=
0xDEADC0DE;
// when this is commented Mappy prints 0.
// Uncommented Mappy prints 0xDEADC0DE
test.c:
extern unsigned int AsmExternInIWRAM;
extern const unsigned int CInIWRAM;
extern int __printf(char *, ...);
int AgbMain()
{
__printf("%x", AsmExternInIWRAM);
while (1);
return 0;
}
debug.c:
void dprint(const char *sz)
{
asm volatile
(" \
mov r2, %0 \n\
mov r0, %1 \n\
mov r1, #0 \n\
and r0, r0, r0 \n\
"
: : "r" (sz), "r" (0xC0DED00D) : "r0", "r1", "r2"
);
}
int __printf(char *fmt, ...)
{
char s[256];
va_list marker;
va_start(marker, fmt);
int r = vsprintf(s, fmt, marker);
va_end(marker);
dprint(s);
return r;
}
[Non-text portions of this message have been removed]