From 7c43204a7ee6d9abb321c623a8c30c23e152bd97 Mon Sep 17 00:00:00 2001 From: Bas Wijnen Date: Thu, 18 Feb 2010 17:35:37 +0100 Subject: [PATCH] real demo --- mips/nanonote/Makefile.arch | 2 +- plan | 6 ++++++ source/ball.ccp | 11 +++++------ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/mips/nanonote/Makefile.arch b/mips/nanonote/Makefile.arch index f1a9408..e830130 100644 --- a/mips/nanonote/Makefile.arch +++ b/mips/nanonote/Makefile.arch @@ -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 diff --git a/plan b/plan index 32ae40e..ff7d078 100644 --- a/plan +++ b/plan @@ -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 diff --git a/source/ball.ccp b/source/ball.ccp index 742c807..1c0ad36 100644 --- a/source/ball.ccp +++ b/source/ball.ccp @@ -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 (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)