0 Members and 2 Guests are viewing this topic.
Quote from: lkj on February 22, 2012, 05:54:06 pmthe "directory for the tns file" means the name and directory were the compiled .tns will be. For example this line could be Code: [Select]DISTDIR = Example.tnsIn the OBJS line you have to write the names of the .c files you want to compile, but with .o instead of .c at the end of each name.So I could putDISTDIR = C:/ndless/test1/testprogram.tns?
the "directory for the tns file" means the name and directory were the compiled .tns will be. For example this line could be Code: [Select]DISTDIR = Example.tnsIn the OBJS line you have to write the names of the .c files you want to compile, but with .o instead of .c at the end of each name.
DISTDIR = Example.tns
//seed=randnum(seed); //my goal is to give yvel a random value -128 to 128 seed = randMinMax(-128, 128);
GCC = nspire-gccLD = nspire-ldGCCFLAGS = -Os -nostdlib -I"c:/nRGBlib/sdk/include/"LDFLAGS = -L "c:/nRGBlib/sdk/lib/"OBJCOPY := "$(shell (which arm-elf-objcopy arm-none-eabi-objcopy arm-linux-gnueabi-objcopy | head -1) 2>/dev/null)"ifeq (${OBJCOPY},"") OBJCOPY := arm-none-eabi-objcopyendifOBJS = pong.oDISTDIR = .vpath %.tns $(DISTDIR)all: Pong.tns%.o: %.c $(GCC) $(GCCFLAGS) -c $<%.o: %.S $(GCC) $(GCCFLAGS) -c $<Pong.tns: $(OBJS) $(LD) $(LDFLAGS) $^ -o $(@:.tns=.elf) -lRGB @mkdir -p $(DISTDIR) $(OBJCOPY) -O binary $(@:.tns=.elf) $(DISTDIR)/$@clean: rm -f *.o *.elf rm -f $(DISTDIR)/Pong.tns
I'd just need to doyvel=randMinMax(-128, 128)do do what i need
while (players == 0) { //seed++; rand(); if (isKeyPressed(KEY_NSPIRE_CTRL)) /* ... */ //seed=randnum(seed); //my goal is to give yvel a random value -128 to 128 //yvel=seed%257-128; yvel=randMinMax(-128, 128);
The objects flash a lot with this tho