1
0
mirror of git://projects.qi-hardware.com/iris.git synced 2024-12-28 12:39:52 +02:00

real demo

This commit is contained in:
Bas Wijnen 2010-02-18 17:35:37 +01:00
parent fb85d0f1d7
commit 7c43204a7e
3 changed files with 12 additions and 7 deletions

View File

@ -29,7 +29,7 @@ arch_iris_sources = mips/interrupts.cc mips/arch.cc
boot_sources = mips/init.cc mips/nanonote/board.cc
arch_headers = mips/arch.hh mips/nanonote/jz4740.hh mips/nanonote/board.hh devices.hh
boot_threads = init udc
programs = \#nanonote-gpio \#lcd display-emu bsquare display-emu2 ball
programs = \#nanonote-gpio \#lcd display-emu bsquare display-emu2 ball \#buzzer metronome
all: test

6
plan
View File

@ -36,3 +36,9 @@ te doen:
- display interface: put pixel commando
- typewriter: print toetsen op scherm; shell?
- terminal
- emulaties automatisch per proces
- start programma van filesystem
- nand driver
- filesystems met backing store

View File

@ -21,9 +21,8 @@
static unsigned *framebuffer
static int const r = 10
static int colour
void ball (int x, int y, bool print):
void ball (int x, int y, unsigned colour):
for int ty = y - r; ty < y + r; ++ty:
if ty < 0 || ty >= 240:
continue
@ -32,11 +31,11 @@ void ball (int x, int y, bool print):
continue
if (x - tx) * (x - tx) + (y - ty) * (y - ty) > r * r:
continue
framebuffer[ty * 320 + tx] = (print ? colour : 0)
framebuffer[ty * 320 + tx] = (colour)
Kernel::Num start ():
Kernel::my_parent.init_done ()
colour = 0x3f30ff
int colour = 0x3f30ff
framebuffer = (unsigned *)0x15000
Display display = Kernel::my_parent.get_device <Display> (0x10000)
int x = r, y = r, dx = 3, dy = 0
@ -44,7 +43,7 @@ Kernel::Num start ():
while true:
display.set_eof_cb (eof)
Kernel::wait ()
ball (x, y, false)
ball (x, y, 0)
x += dx
y += dy
if y + r >= 240:
@ -59,4 +58,4 @@ Kernel::Num start ():
if y == 240 - r && dy == 0:
dy = -21
++dy
ball (x, y, true)
ball (x, y, colour)