View Single Post
Old 04-06-2012, 10:46 AM   #58
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
Quote:
Originally Posted by aBP View Post
Just ran this on my K4 with Kite. The text appeared as white on top of my home screen, also the script would not stop running! haha, I hit the home button, went to the settings page, but the script was still drawing tiny white characters on the screen I had to restart the kindle to get it back to normal. Just thought I'd give you some feedback, I am not sure if this is normal lol
...
I am guessing the text is showing as white boxes because the letters are actually bits of a png image. Not sure if what I am sharing is helping at all but I thought I'd chime in.
That happens because the first row of characters at the very top of the screen is where all other characters are copied FROM. When the status bar overwrites that, then we copy bits of the status bar instead of the original characters.

I prevented this in my earlier version by pausing (killall -stop) and resuming (killall -cont) the kindle framework. That code was removed when kaminkatze added updates, because he calls this from a parent script (that presumable does the framework pause and resume). You can download the v1.1 code above to see the differences.

I simplified this to use characters that were onscreen, for the simplest possible code (for a tutorial demo).

My original (unpublished) code used larger characters that required two rows in the PNG file, and more complicated code to handle splitting the character set into multiple rows. After displaying the character map image, it copied the top part of the framebuffer to to /tmp/chars.bin and cleared the screen. Then the main code did "dd" from the temp file instead of from the top of the screen. To make the published tutorial demo code as simple as possible, I switched to a smaller character set that could fit on one row, and used the onscreen copy with no temp files.

I plan to add support for multiple character sets in other languages (UTF-8 support?) and different font sizes, using temp files again, but I will create a long single line temp file (too big to display on the screen) from the multi-line PNG, during the initialization (initvar).

If UTF-8 is too complicated to do in a shell script, I may go with codepages instead. Ideas?

Again -- you need to disable the framework writing on top of the character set at the top of the screen, of the characters being printed will contain the wrong pixels (like your screenshot image). Of course, that will not be an issue after we go back to copying characters from a temp file instead of top of screen.
geekmaster is offline   Reply With Quote