Merge branch 'master' of github.com:r0ket/r0ket

This commit is contained in:
iggy 2011-08-05 00:49:39 +02:00
commit 24965deaed
8 changed files with 41 additions and 6 deletions

View File

@ -54,7 +54,7 @@ uint8_t getInputWaitTimeout(int timeout) {
uint8_t key;
if(timeout==0)
return getInputWait();
int end=_timectr+timeout*(1000/SYSTICKSPEED);
int end=_timectr+timeout/SYSTICKSPEED;
while ((key=getInputRaw())==BTN_NONE){
if(_timectr>end)
break;

View File

@ -46,7 +46,7 @@ void handleMenu(const struct MENU *the_menu) {
}
lcdRefresh();
switch (getInputWaitTimeout((menuflags&MENU_TIMEOUT)?15:0)) {
switch (getInputWaitTimeout((menuflags&MENU_TIMEOUT)?15000:0)) {
case BTN_UP:
menuselection--;
if (menuselection < current_offset) {

View File

@ -2,3 +2,6 @@
*.bin
usetable.h
loadable.ld
*.nik
*.c0d
*.int

View File

@ -84,3 +84,5 @@ readFile
writeFile
input
saveConfig
lcdShowAnim
lcdLoadImage

View File

@ -5,6 +5,8 @@ SRCS = $(wildcard *.c)
OBJS = $(foreach mod,$(SRCS),$(subst .c,.o,$(mod)))
ELFS = $(foreach mod,$(SRCS),$(subst .c,.elf,$(mod)))
BINS = $(foreach mod,$(SRCS),$(subst .c,.bin,$(mod)))
CODS = $(foreach mod,$(SRCS),$(subst .c,.c0d,$(mod)))
NIKS = $(foreach mod,$(wildcard nick_*.c),$(subst .c,.nik,$(subst nick_,,$(mod))))
##########################################################################
# GNU GCC compiler flags
@ -22,7 +24,10 @@ LDSRCFILE=ram.ld
LDFILE=loadable.ld
CFLAGS+=-mlong-calls -fno-toplevel-reorder
all: $(OBJS) $(ELFS) $(BINS)
CRYPT=cp
CRYPTFLAGS=-p
all: $(OBJS) $(ELFS) $(BINS) $(CODS) $(NIKS) 1boot.int
$(LDFILE):
-@echo "MEMORY" > $(LDFILE)
@ -41,6 +46,15 @@ $(LDFILE):
%.bin: %.elf
$(OBJCOPY) $(OCFLAGS) -O binary $< $@
%.c0d: %.bin
$(CRYPT) $(CRYPTFLAGS) $< $@
%.nik: .PHONY
@a=$@;a=nick_$${a%.nik}.c0d;echo mv $$a $@;mv $$a $@
1boot.int: 1boot.c0d .PHONY
mv $< $@
clean:
rm -f *.o *.elf *.bin usetable.h

View File

@ -127,7 +127,7 @@ static bool screen_intro() {
DoString (0, 9, highnick);
lcdDisplay();
step = !step;
key=getInputWaitTimeout(1);
key=getInputWaitTimeout(1000);
}
return !(key==BTN_LEFT);
}
@ -142,7 +142,7 @@ static bool screen_gameover() {
if (highscore_set(game.score, GLOBAL(nickname)))
DoString (0,9,"HIGHSCORE!");
lcdDisplay();
key=getInputWaitTimeout(5);
key=getInputWaitTimeout(5000);
}
return !(key==BTN_LEFT);
}

View File

@ -0,0 +1,12 @@
#include <sysinit.h>
#include "basic/basic.h"
#include "lcd/lcd.h"
#include "filesystem/ff.h"
#include "usetable.h"
void ram(void) {
char fname[FILENAMELEN];
lcdShowAnim("nick.lcd",1000);
};

View File

@ -34,7 +34,11 @@ uint8_t lcdShowAnim(char *fname, uint32_t framems) {
continue;
};
lcdDisplay();
state=delayms_queue_plus(framems,0);
if(framems<100){
state=delayms_queue_plus(framems,0);
}else{
getInputWaitTimeout(framems);
};
}
if(state)