View Single Post
Old 03-19-2012, 08:50 PM   #18
geekmaster
Carpe diem, c'est la vie.
geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.geekmaster ought to be getting tired of karma fortunes by now.
 
geekmaster's Avatar
 
Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
When I get back, I hope to see the following games running in #!/bin/sh using scripts from this thread as a guide:





* HINTS:
Spoiler:
We can draw filled circles by controlling the "count=" param of "dd", using distance between left and right x-coords on each row, in a "filled midpoint circle agorithm". We can draw up to 600 consecutive white pixels like this:
Code:
initvar () {
  W=$(echo -e '\xff');W=$W$W$W$W$W$W;W=$W$W$W$W$W;W=$W$W$W$W$W;W=$W$W$W$W # 600px white
}
...
echo -n $W|dd of=/dev/fb0 bs=1 count=$((x1-x0+1)) seek=$((y0*VX+x0)) 2>/dev/null
And we can draw black pixels from /dev/zero, as shown in previous scripts in this thread.

For fastest eink screen updates, we should use only all-white or all-black pixels (no gray pixels). We can use dithering for grayscale pixels (shadows). A 2x2 checkerboard makes a nice gray fill pattern.

We can make a nice blitter using "dd" to iteratively copy individual scan lines from a rectangular (or circular) portion of a raw image file to a portion of the eink screen. We can use this to copy sprites, game tiles, and bitmap text characters from a character font map and game resources image file.

We can use "hexdump" to read pixels from the framebuffer, if we want to try OCR techniques or other image processing of framework graphic content place onscreen by kindlets or framework menus. We can see how to process binary files with "hexdump" in the touchpaint script here:


Good luck!




Last edited by geekmaster; 03-20-2012 at 10:55 PM. Reason: severe typophrenia
geekmaster is offline   Reply With Quote