From 49f11eed51b28c59411c2169312835a2befde585 Mon Sep 17 00:00:00 2001 From: kju Date: Wed, 13 Jan 2010 03:01:07 +0000 Subject: [PATCH] initial hack for ping pong 12x10 hardware: http://www.elo-web.de/elo/entwicklung-und-projekte/ping-pong/retro-spiel-ping-pong --- borg_hw/Makefile | 4 + borg_hw/borg_hw_pingpong.c | 153 +++++++++++++++++++++++++++++++++++++ borg_hw/config.in | 6 +- borg_hw/config_pingpong.in | 4 + 4 files changed, 166 insertions(+), 1 deletion(-) create mode 100644 borg_hw/borg_hw_pingpong.c create mode 100644 borg_hw/config_pingpong.in diff --git a/borg_hw/Makefile b/borg_hw/Makefile index 64e8948..9a2b06c 100644 --- a/borg_hw/Makefile +++ b/borg_hw/Makefile @@ -34,6 +34,10 @@ ifeq ($(BORG_HW),HW_PD1165) SRC = borg_hw_pd1165.c endif +ifeq ($(BORG_HW),HW_PINGPONG) + SRC = borg_hw_pingpong.c +endif + ifeq ($(SRC),'') $(error no valid hardware driver selected ) endif diff --git a/borg_hw/borg_hw_pingpong.c b/borg_hw/borg_hw_pingpong.c new file mode 100644 index 0000000..fd36e1a --- /dev/null +++ b/borg_hw/borg_hw_pingpong.c @@ -0,0 +1,153 @@ + +#include "../config.h" +#include "../makros.h" + +#include +#include +#include +#include "borg_hw.h" + +#define PIN_DATA PB4 +#define PIN_CLK PB3 +#define PIN_STR PB2 + + + +//Der Puffer, in dem das aktuelle Bild gespeichert wird +unsigned char pixmap[NUMPLANE][NUM_ROWS][LINEBYTES]; + + +//zur nächsten Zeile weiterschalten +inline void nextrow(uint8_t row){ + + //Die Zustände von der vorherigen Zeile löschen + PORTC &= 0xF0; + PORTD &= 0x0F; + PORTB &= 0xFC; + + //kurze Warteschleife, damit die Treiber auch wirklich ausschalten + + unsigned char i; + for(i=0;i<10;i++){ + asm volatile("nop"); + } + + if (row == 0){ + //Zeile 0: Das erste Schieberegister initialisieren + PORTB &= ~(1<