//...
Color appleCol; // Red for CX and Black for Classic
appleCol.R = 255; // |
appleCol.G = 0; // |-> Red
appleCol.B = 0; // |
appleCol.BW = 0; // Black
drawSthColor(x, y, appleCol);
//...
DISTDIR = Example.tns
the "directory for the tns file" means the name and directory were the compiled .tns will be. For example this line could beSo I could putCode: [Select]DISTDIR = Example.tns
In 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.
GCC = nspire-gcc
LD = nspire-ld
GCCFLAGS = -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-objcopy
endif
OBJS = main.o bar.o -> hello.o
DISTDIR = .
vpath %.tns $(DISTDIR)
all: hello.tns
%.o: %.c
$(GCC) $(GCCFLAGS) -c $<
%.o: %.S
$(GCC) $(GCCFLAGS) -c $<
hello.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)/hello.tns
EDIT: I changed it to just OBJS = hello.o and it made the tns
So, does "character drawing" mean sprite support or text?
Sprite support would be really nice. At arbitrary sizes, ideally.
Also, have you considered image importing?
Is there a pixel test command? That would be highly useful.
In nRGBlib, how do you make sprites? Or has that not been implemented yet?
Also, as ive posted multiple times :P, rand() doesnt work because RGBlib has a rand function that conflicts with yagarto's one, so how do I get it to work? The snake game uses rand() and it works fine.... I can't really spot any differences between snake's code and mine that could have made snake's work, other than that it included nMATHS, but that didn't change anything for me when I included it
Edit: Ouch, triple post D:
the "directory for the tns file" means the name and directory were the compiled .tns will be. For example this line could beSo I could putCode: [Select]DISTDIR = Example.tns
In 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 = C:/ndless/test1/testprogram.tns
?
//seed=randnum(seed); //my goal is to give yvel a random value -128 to 128
seed = randMinMax(-128, 128);
and it works pretty fine.GCC = nspire-gcc
LD = nspire-ld
GCCFLAGS = -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-objcopy
endif
OBJS = pong.o
DISTDIR = .
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 doI'm not sure to have understood, but if I have well understood, you're right :
yvel=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);
And I've checked yvel values and they are goods.The objects flash a lot with this tho
Yay!
What was that double-buffering thing?
// Create the sub-image
ImageSubrect tile;
setImage(&tile, &img);
tile.w = CELL_SIZE;
tile.h = CELL_SIZE;
tile.x = 0;
tile.y = 0;
tile.offset_x = CELL_SIZE * 3;
tile.offset_y = CELL_SIZE * 2;
drawImagesubrect(&tile, buffer);