Merge git://github.com/r0ket/r0ket
This commit is contained in:
commit
7f373d8a88
|
@ -5,6 +5,7 @@
|
|||
#include "lcd/lcd.h"
|
||||
#include "lcd/fonts/smallfonts.h"
|
||||
#include "lcd/print.h"
|
||||
#include "lcd/image.h"
|
||||
#include "filesystem/ff.h"
|
||||
#include "usb/usbmsc.h"
|
||||
#include "basic/random.h"
|
||||
|
@ -14,8 +15,13 @@
|
|||
|
||||
void main_default(void) {
|
||||
systickInit(SYSTICKSPEED);
|
||||
|
||||
switch(getInputRaw()){
|
||||
|
||||
//show bootscreen
|
||||
lcdClear();
|
||||
lcdLoadImage("r0ket.lcd");
|
||||
lcdRefresh();
|
||||
|
||||
switch(getInputRaw()){
|
||||
case BTN_ENTER:
|
||||
ISPandReset();
|
||||
break;
|
||||
|
|
|
@ -18,7 +18,8 @@ void init_nick();
|
|||
void fancyNickname();
|
||||
|
||||
void main_final(void) {
|
||||
if(GLOBAL(privacy)>2){ //firstboot
|
||||
init_nick();
|
||||
if(GLOBAL(privacy)>2){ //firstboot
|
||||
if(execute_file("1boot.int",0,0)){
|
||||
lcdPrintln("Badge SETUP");
|
||||
lcdPrintln("error.");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -2,3 +2,6 @@
|
|||
*.bin
|
||||
usetable.h
|
||||
loadable.ld
|
||||
*.nik
|
||||
*.c0d
|
||||
*.int
|
||||
|
|
|
@ -84,3 +84,5 @@ readFile
|
|||
writeFile
|
||||
input
|
||||
saveConfig
|
||||
lcdShowAnim
|
||||
lcdLoadImage
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
lcdDisplay();
|
||||
state=delayms_queue_plus(framems,0);
|
||||
if(framems<100){
|
||||
state=delayms_queue_plus(framems,0);
|
||||
}else{
|
||||
getInputWaitTimeout(framems);
|
||||
};
|
||||
}
|
||||
|
||||
if(state)
|
||||
|
|
Loading…
Reference in New Issue