tixiv
16 years ago
11 changed files with 427 additions and 547 deletions
@ -0,0 +1,124 @@ |
|||
|
|||
#include <setjmp.h> |
|||
|
|||
#include "config.h" |
|||
#include "scrolltext/scrolltext.h" |
|||
#include "animations/programm.h" |
|||
#include "animations/matrix.h" |
|||
#include "animations/gameoflife.h" |
|||
#include "borg_hw/borg_hw.h" |
|||
#include "can/borg_can.h" |
|||
#include "random/prng.h" |
|||
#include "random/persistentCounter.h" |
|||
#include "mcuf/mcuf.h" |
|||
#include "menu/menu.h" |
|||
#include "pixel.h" |
|||
#include "joystick.h" |
|||
|
|||
|
|||
volatile unsigned char oldMode, oldOldmode, mode; |
|||
|
|||
jmp_buf newmode_jmpbuf; |
|||
|
|||
void display_loop(){ |
|||
// mcuf_serial_mode();
|
|||
|
|||
mode = setjmp(newmode_jmpbuf); |
|||
oldOldmode = oldMode; |
|||
waitForFire = 1; |
|||
for(;;){ |
|||
oldMode = mode; |
|||
switch(mode++) { |
|||
|
|||
#ifdef ANIMATION_SCROLLTEXT |
|||
case 1: |
|||
scrolltext(scrolltext_text); |
|||
{ char a[14]; |
|||
sprintf(a,"</# counter == %lu ", percnt_get()); |
|||
scrolltext(a); |
|||
} |
|||
break; |
|||
#endif |
|||
|
|||
#ifdef ANIMATION_SPIRALE |
|||
case 2: |
|||
spirale(5); |
|||
break; |
|||
#endif |
|||
|
|||
#ifdef ANIMATION_JOERN1 |
|||
case 3: |
|||
joern1(); |
|||
break; |
|||
#endif |
|||
|
|||
#ifdef ANIMATION_SNAKE |
|||
case 4: |
|||
snake(); |
|||
break; |
|||
#endif |
|||
|
|||
#ifdef ANIMATION_SCHACHBRETT |
|||
case 5: |
|||
schachbrett(20); |
|||
break; |
|||
#endif |
|||
|
|||
#ifdef ANIMATION_FEUER |
|||
case 6: |
|||
feuer(); |
|||
break; |
|||
#endif |
|||
|
|||
#ifdef ANIMATION_MATRIX |
|||
case 7: |
|||
matrix(); |
|||
break; |
|||
#endif |
|||
|
|||
#ifdef ANIMATION_RANDOM_BRIGHT |
|||
case 8: |
|||
random_bright(200); |
|||
break; |
|||
#endif |
|||
|
|||
#ifdef ANIMATION_GAMEOFLIFE |
|||
case 9: |
|||
gameoflife(); |
|||
break; |
|||
#endif |
|||
|
|||
case 29: |
|||
mode = 1; |
|||
break; |
|||
|
|||
#ifdef ANIMATION_TESTS |
|||
case 31: |
|||
test_level1(); |
|||
break; |
|||
case 32: |
|||
test_level2(); |
|||
break; |
|||
case 33: |
|||
test_level3(); |
|||
break; |
|||
case 35: |
|||
test1(); |
|||
while(1); |
|||
break; |
|||
#endif |
|||
|
|||
#ifdef ANIMATION_OFF |
|||
case 0xFF: |
|||
off(); |
|||
break; |
|||
#endif |
|||
|
|||
#ifdef MENU_SUPPORT |
|||
case 43: |
|||
menu(); |
|||
mode = oldOldmode; |
|||
#endif |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,4 @@ |
|||
|
|||
void display_loop(); |
|||
|
|||
extern jmp_buf newmode_jmpbuf; |
@ -1,111 +1,9 @@ |
|||
PRG = borgSim |
|||
OPTIMIZE = -O0 |
|||
LIBS = -lglut -lpthread -lGL -lGLU |
|||
CC = gcc |
|||
LD = ld |
|||
TARGET = libanimations.a |
|||
TOPDIR = .. |
|||
|
|||
override CFLAGS = -g -Wall -pedantic -std=c99 $(OPTIMIZE) |
|||
$(DEFS) |
|||
override LDFLAGS = -Wl,-Map,$(PRG).map |
|||
include $(TOPDIR)/defaults.mk |
|||
|
|||
OBJ = breakpoint.o font_arial8.o font_small6.o font_uni53.o invader_draw.o \
|
|||
invader_init.o invader_proc.o invaders2.o joystick.o main.o menu.o pixel.o \
|
|||
programm.o scrolltext3.o snake.o trackball.o util.o tetris/input.o \
|
|||
tetris/logic.o tetris/piece.o tetris/playfield.o tetris/view.o prng.o \
|
|||
memxor_c.o noekeon.o stonefly.o |
|||
SRC_SIM = main.c trackball.c |
|||
|
|||
all: $(PRG) |
|||
|
|||
$(PRG): $(OBJ) |
|||
$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) $(OBJ) -o $@ |
|||
|
|||
clean: |
|||
rm -rf $(OBJ) $(PRG) $(PRG).map |
|||
|
|||
breakpoint.o: breakpoint.c pixel.h util.h config.h |
|||
$(CC) $(CFLAGS) -c -o breakpoint.o breakpoint.c |
|||
|
|||
font_arial8.o: font_arial8.c font.h |
|||
$(CC) $(CFLAGS) -c -o font_arial8.o font_arial8.c |
|||
|
|||
font_small6.o: font_small6.c font.h |
|||
$(CC) $(CFLAGS) -c -o font_small6.o font_small6.c |
|||
|
|||
font_uni53.o: font_uni53.c font.h |
|||
$(CC) $(CFLAGS) -c -o font_uni53.o font_uni53.c |
|||
|
|||
invader_draw.o: invader_draw.c invaders2.h pixel.h util.h config.h \ |
|||
scrolltext.h joystick.h |
|||
$(CC) $(CFLAGS) -c -o invader_draw.o invader_draw.c |
|||
|
|||
invader_init.o: invader_init.c invaders2.h pixel.h util.h config.h \ |
|||
scrolltext.h joystick.h |
|||
$(CC) $(CFLAGS) -c -o invader_init.o invader_init.c |
|||
|
|||
invader_proc.o: invader_proc.c invaders2.h pixel.h util.h config.h \ |
|||
scrolltext.h joystick.h |
|||
$(CC) $(CFLAGS) -c -o invader_proc.o invader_proc.c |
|||
|
|||
invaders2.o: invaders2.c util.h invaders2.h pixel.h config.h scrolltext.h \ |
|||
joystick.h |
|||
$(CC) $(CFLAGS) -c -o invaders2.o invaders2.c |
|||
|
|||
joystick.o: joystick.c joystick.h |
|||
$(CC) $(CFLAGS) -c -o joystick.o joystick.c |
|||
|
|||
main.o: main.c config.h pixel.h util.h programm.h menu.h tetris/logic.h \ |
|||
tetris/piece.h trackball.h snake.h scrolltext.h |
|||
$(CC) $(CFLAGS) -c -o main.o main.c |
|||
|
|||
menu.o: menu.c menu.h config.h util.h pixel.h joystick.h snake.h \ |
|||
tetris/logic.h tetris/piece.h invaders2.h scrolltext.h |
|||
$(CC) $(CFLAGS) -c -o menu.o menu.c |
|||
|
|||
pixel.o: pixel.c pixel.h util.h config.h |
|||
$(CC) $(CFLAGS) -c -o pixel.o pixel.c |
|||
|
|||
programm.o: programm.c pixel.h util.h config.h programm.h joystick.h |
|||
$(CC) $(CFLAGS) -c -o programm.o programm.c |
|||
|
|||
scrolltext3.o: scrolltext3.c config.h scrolltext.h pixel.h util.h \ |
|||
font_arial8.h font.h font_small6.h font_uni53.h |
|||
$(CC) $(CFLAGS) -c -o scrolltext3.o scrolltext3.c |
|||
|
|||
snake.o: snake.c pixel.h util.h config.h joystick.h |
|||
$(CC) $(CFLAGS) -c -o snake.o snake.c |
|||
|
|||
trackball.o: trackball.c trackball.h |
|||
$(CC) $(CFLAGS) -c -o trackball.o trackball.c |
|||
|
|||
util.o: util.c joystick.h |
|||
$(CC) $(CFLAGS) -c -o util.o util.c |
|||
|
|||
noekeon.o: noekeon.c noekeon.h memxor.h |
|||
$(CC) $(CFLAGS) -c -o $@ $< |
|||
|
|||
memxor_c.o: memxor_c.c memxor.h |
|||
$(CC) $(CFLAGS) -c -o $@ $< |
|||
|
|||
prng.o: prng.c prng.h noekeon.h memxor.h |
|||
$(CC) $(CFLAGS) -c -o $@ $< |
|||
|
|||
tetris/input.o: tetris/input.c joystick.h util.h tetris/input.h |
|||
$(CC) $(CFLAGS) -c -o tetris/input.o tetris/input.c |
|||
|
|||
logic.o: tetris/logic.c tetris/logic.h tetris/piece.h tetris/playfield.h \ |
|||
tetris/view.h tetris/input.h prng.h ../borg-base/prng.h |
|||
$(CC) $(CFLAGS) -c -o tetris/logic.o tetris/logic.c |
|||
|
|||
tetris/piece.o: tetris/piece.c tetris/piece.h |
|||
$(CC) $(CFLAGS) -c -o tetris/piece.o tetris/piece.c |
|||
|
|||
tetris/playfield.o: tetris/playfield.c tetris/playfield.h tetris/piece.h |
|||
$(CC) $(CFLAGS) -c -o tetris/playfield.o tetris/playfield.c |
|||
|
|||
tetris/view.o: tetris/view.c config.h pixel.h util.h scrolltext.h \ |
|||
tetris/logic.h tetris/piece.h tetris/playfield.h tetris/view.h |
|||
$(CC) $(CFLAGS) -c -o tetris/view.o tetris/view.c |
|||
|
|||
stonefly.o: stonefly.h stonefly.c pixel.h util.h config.h prng.h \ |
|||
../borg-base/prng.h tetris/piece.h |
|||
$(CC) $(CFLAGS) -c -o stonefly.o stonefly.c |
|||
include $(TOPDIR)/rules.mk |
|||
|
@ -1,8 +1,6 @@ |
|||
#ifndef UTIL_H |
|||
#define UTIL_H |
|||
|
|||
#include <avr/io.h> |
|||
|
|||
void wait(int ms); |
|||
|
|||
#endif |
|||
|
Loading…
Reference in new issue