Code: Select all
#pragma output REGISTER_SP = 0xD000
#include <arch/zx.h>
#include <arch/zx/sp1.h>
int main()
{
sp1_Initialize( SP1_IFLAG_MAKE_ROTTBL | SP1_IFLAG_OVERWRITE_TILES | SP1_IFLAG_OVERWRITE_DFILE,
INK_BLACK | PAPER_WHITE,
' ' );
while(1) {
zx_border(INK_BLACK);
zx_border(INK_WHITE);
}
}
Code: Select all
zcc +zx -vn -startup=31 -clib=sdcc_iy sp1_test.c -o sp1_test -create-app
If I build it with these two lines:
Code: Select all
zcc +zx -compiler sdcc -c sp1_test.c -o sp1_test.o -I$ZCCCFG/../../include/_DEVELOPMENT/sdcc
zcc +zx -v -startup=31 -clib=sdcc_iy sp1_test.o -o sp1_test -create-app
I've tried various simple permutations of files and library calls, but they all seem OK. It's the use of the SP1 library which seems sensitive to whatever I'm doing wrong. Looking carefully at the compile lines (with -v output) I can see subtle differences between the two approaches. The nuances are rather beyond me though.
What's the correct compiler command line for building individual C sources for linking?