Merge branch 'master' of github.com:r0ket/r0ket
This commit is contained in:
commit
24965deaed
|
@ -54,7 +54,7 @@ uint8_t getInputWaitTimeout(int timeout) {
|
||||||
uint8_t key;
|
uint8_t key;
|
||||||
if(timeout==0)
|
if(timeout==0)
|
||||||
return getInputWait();
|
return getInputWait();
|
||||||
int end=_timectr+timeout*(1000/SYSTICKSPEED);
|
int end=_timectr+timeout/SYSTICKSPEED;
|
||||||
while ((key=getInputRaw())==BTN_NONE){
|
while ((key=getInputRaw())==BTN_NONE){
|
||||||
if(_timectr>end)
|
if(_timectr>end)
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -46,7 +46,7 @@ void handleMenu(const struct MENU *the_menu) {
|
||||||
}
|
}
|
||||||
lcdRefresh();
|
lcdRefresh();
|
||||||
|
|
||||||
switch (getInputWaitTimeout((menuflags&MENU_TIMEOUT)?15:0)) {
|
switch (getInputWaitTimeout((menuflags&MENU_TIMEOUT)?15000:0)) {
|
||||||
case BTN_UP:
|
case BTN_UP:
|
||||||
menuselection--;
|
menuselection--;
|
||||||
if (menuselection < current_offset) {
|
if (menuselection < current_offset) {
|
||||||
|
|
|
@ -2,3 +2,6 @@
|
||||||
*.bin
|
*.bin
|
||||||
usetable.h
|
usetable.h
|
||||||
loadable.ld
|
loadable.ld
|
||||||
|
*.nik
|
||||||
|
*.c0d
|
||||||
|
*.int
|
||||||
|
|
|
@ -84,3 +84,5 @@ readFile
|
||||||
writeFile
|
writeFile
|
||||||
input
|
input
|
||||||
saveConfig
|
saveConfig
|
||||||
|
lcdShowAnim
|
||||||
|
lcdLoadImage
|
||||||
|
|
|
@ -5,6 +5,8 @@ SRCS = $(wildcard *.c)
|
||||||
OBJS = $(foreach mod,$(SRCS),$(subst .c,.o,$(mod)))
|
OBJS = $(foreach mod,$(SRCS),$(subst .c,.o,$(mod)))
|
||||||
ELFS = $(foreach mod,$(SRCS),$(subst .c,.elf,$(mod)))
|
ELFS = $(foreach mod,$(SRCS),$(subst .c,.elf,$(mod)))
|
||||||
BINS = $(foreach mod,$(SRCS),$(subst .c,.bin,$(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
|
# GNU GCC compiler flags
|
||||||
|
@ -22,7 +24,10 @@ LDSRCFILE=ram.ld
|
||||||
LDFILE=loadable.ld
|
LDFILE=loadable.ld
|
||||||
CFLAGS+=-mlong-calls -fno-toplevel-reorder
|
CFLAGS+=-mlong-calls -fno-toplevel-reorder
|
||||||
|
|
||||||
all: $(OBJS) $(ELFS) $(BINS)
|
CRYPT=cp
|
||||||
|
CRYPTFLAGS=-p
|
||||||
|
|
||||||
|
all: $(OBJS) $(ELFS) $(BINS) $(CODS) $(NIKS) 1boot.int
|
||||||
|
|
||||||
$(LDFILE):
|
$(LDFILE):
|
||||||
-@echo "MEMORY" > $(LDFILE)
|
-@echo "MEMORY" > $(LDFILE)
|
||||||
|
@ -41,6 +46,15 @@ $(LDFILE):
|
||||||
%.bin: %.elf
|
%.bin: %.elf
|
||||||
$(OBJCOPY) $(OCFLAGS) -O binary $< $@
|
$(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:
|
clean:
|
||||||
rm -f *.o *.elf *.bin usetable.h
|
rm -f *.o *.elf *.bin usetable.h
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ static bool screen_intro() {
|
||||||
DoString (0, 9, highnick);
|
DoString (0, 9, highnick);
|
||||||
lcdDisplay();
|
lcdDisplay();
|
||||||
step = !step;
|
step = !step;
|
||||||
key=getInputWaitTimeout(1);
|
key=getInputWaitTimeout(1000);
|
||||||
}
|
}
|
||||||
return !(key==BTN_LEFT);
|
return !(key==BTN_LEFT);
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ static bool screen_gameover() {
|
||||||
if (highscore_set(game.score, GLOBAL(nickname)))
|
if (highscore_set(game.score, GLOBAL(nickname)))
|
||||||
DoString (0,9,"HIGHSCORE!");
|
DoString (0,9,"HIGHSCORE!");
|
||||||
lcdDisplay();
|
lcdDisplay();
|
||||||
key=getInputWaitTimeout(5);
|
key=getInputWaitTimeout(5000);
|
||||||
}
|
}
|
||||||
return !(key==BTN_LEFT);
|
return !(key==BTN_LEFT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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);
|
||||||
|
};
|
|
@ -34,7 +34,11 @@ uint8_t lcdShowAnim(char *fname, uint32_t framems) {
|
||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
lcdDisplay();
|
lcdDisplay();
|
||||||
state=delayms_queue_plus(framems,0);
|
if(framems<100){
|
||||||
|
state=delayms_queue_plus(framems,0);
|
||||||
|
}else{
|
||||||
|
getInputWaitTimeout(framems);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
if(state)
|
if(state)
|
||||||
|
|
Loading…
Reference in New Issue