mirror of
git://projects.qi-hardware.com/iris.git
synced 2024-12-29 19:32:25 +02:00
real demo
This commit is contained in:
parent
fb85d0f1d7
commit
7c43204a7e
@ -29,7 +29,7 @@ arch_iris_sources = mips/interrupts.cc mips/arch.cc
|
|||||||
boot_sources = mips/init.cc mips/nanonote/board.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
|
arch_headers = mips/arch.hh mips/nanonote/jz4740.hh mips/nanonote/board.hh devices.hh
|
||||||
boot_threads = init udc
|
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
|
all: test
|
||||||
|
|
||||||
|
6
plan
6
plan
@ -36,3 +36,9 @@ te doen:
|
|||||||
|
|
||||||
- display interface: put pixel commando
|
- display interface: put pixel commando
|
||||||
- typewriter: print toetsen op scherm; shell?
|
- typewriter: print toetsen op scherm; shell?
|
||||||
|
|
||||||
|
- terminal
|
||||||
|
- emulaties automatisch per proces
|
||||||
|
- start programma van filesystem
|
||||||
|
- nand driver
|
||||||
|
- filesystems met backing store
|
||||||
|
@ -21,9 +21,8 @@
|
|||||||
|
|
||||||
static unsigned *framebuffer
|
static unsigned *framebuffer
|
||||||
static int const r = 10
|
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:
|
for int ty = y - r; ty < y + r; ++ty:
|
||||||
if ty < 0 || ty >= 240:
|
if ty < 0 || ty >= 240:
|
||||||
continue
|
continue
|
||||||
@ -32,11 +31,11 @@ void ball (int x, int y, bool print):
|
|||||||
continue
|
continue
|
||||||
if (x - tx) * (x - tx) + (y - ty) * (y - ty) > r * r:
|
if (x - tx) * (x - tx) + (y - ty) * (y - ty) > r * r:
|
||||||
continue
|
continue
|
||||||
framebuffer[ty * 320 + tx] = (print ? colour : 0)
|
framebuffer[ty * 320 + tx] = (colour)
|
||||||
|
|
||||||
Kernel::Num start ():
|
Kernel::Num start ():
|
||||||
Kernel::my_parent.init_done ()
|
Kernel::my_parent.init_done ()
|
||||||
colour = 0x3f30ff
|
int colour = 0x3f30ff
|
||||||
framebuffer = (unsigned *)0x15000
|
framebuffer = (unsigned *)0x15000
|
||||||
Display display = Kernel::my_parent.get_device <Display> (0x10000)
|
Display display = Kernel::my_parent.get_device <Display> (0x10000)
|
||||||
int x = r, y = r, dx = 3, dy = 0
|
int x = r, y = r, dx = 3, dy = 0
|
||||||
@ -44,7 +43,7 @@ Kernel::Num start ():
|
|||||||
while true:
|
while true:
|
||||||
display.set_eof_cb (eof)
|
display.set_eof_cb (eof)
|
||||||
Kernel::wait ()
|
Kernel::wait ()
|
||||||
ball (x, y, false)
|
ball (x, y, 0)
|
||||||
x += dx
|
x += dx
|
||||||
y += dy
|
y += dy
|
||||||
if y + r >= 240:
|
if y + r >= 240:
|
||||||
@ -59,4 +58,4 @@ Kernel::Num start ():
|
|||||||
if y == 240 - r && dy == 0:
|
if y == 240 - r && dy == 0:
|
||||||
dy = -21
|
dy = -21
|
||||||
++dy
|
++dy
|
||||||
ball (x, y, true)
|
ball (x, y, colour)
|
||||||
|
Loading…
Reference in New Issue
Block a user