View Single Post
Old 03-20-2012, 05:18 PM   #25
kaminkatze
Member
kaminkatze plays well with otherskaminkatze plays well with otherskaminkatze plays well with otherskaminkatze plays well with otherskaminkatze plays well with otherskaminkatze plays well with otherskaminkatze plays well with otherskaminkatze plays well with otherskaminkatze plays well with otherskaminkatze plays well with otherskaminkatze plays well with others
 
Posts: 17
Karma: 2600
Join Date: Mar 2012
Device: Kindle 3
Quote:
Originally Posted by geekmaster View Post
2) I originally had a setpixel function, but testing showed that it was quite a bit faster on my 5.0.0 firmware to put the "dd" inline, and wrapping a single line dd call in a function actually consumes more screen space. But it *does* make it more readable though, and in your case it allows you to pipe it to other commands, so it may well be worth the speed trade-off here if simple to understand code is the goal (which is that I aim for in tutorials like this thread).
The goal was to access single pixels. With 4 bits per pixel one dd call set 2 pixels. "setpix" reads 2 pixels, modifies one side and writes them back. But a 2x2 pixel grid and dd updates would be the better choice.

Quote:
Originally Posted by geekmaster View Post
This does not seem to do anything other than clear the screen on my K3 with firmware 3.3, and I do not have time to study your code in any detail right now. Are there any special requirements to run this?
You should see the glider in the top left corner. At the moment only a 8x8 pixel field is updated. Change the last line to "loop 100" so it runs more iterations.
kaminkatze is offline   Reply With Quote