![]() |
#46 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
Also, I am considering writing a replacement for eips that lets you do partial updates (specifying the corner coordinates of the update area). I was thinking I should call it "eoops". ![]() That way, I can replace individual scripts with compiled C versions that are identical in function (but a lot faster). The first scripts to update to C should be the line and circle functions. That way, existing scripts will not need any changes to run faster (other than removing the embedded functions and adding my "graphics library" folder to the search PATH env var). Thanks for the source code. I will check it out later when I have more time. I like the nice anti-aliased splash screen. Personally, I like mapped memory calls instead of fread and fseek -- you can just treat the framebuffer as a large memory array. There is some sample code posted somewhere here... ![]() ![]() Last edited by geekmaster; 03-27-2012 at 01:03 PM. |
|
![]() |
![]() |
![]() |
#47 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
![]() |
|
![]() |
![]() |
Advert | |
|
![]() |
#48 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
![]()
UPDATE: v1.4 tested and works great on DX, DXG, K3, K4, and Touch!
![]() titty titty - tiny tty (display tiny text on eink display) requirements: titty.png. usage: "titty" cat self "ls -al|titty -" cat STDIN (from "ls" in this example) "titty /etc/shadow" PWN! ![]() hint: This runs at TTY speed. PHP Code:
WARNING: As shown below, the text is REALLY TINY, and even near-sighted people may need magnifying reading glasses to see it clearly on a real eink display, where it is a LOT smaller than on a typical LCD panel where you may be viewing this. Reading text at that size is a difficult task for eyes. (But think of all the text you could cram onto a screensaver image using this script, such as crib notes for an exam, with no batteries needed ![]() ![]() titty.png: ![]() (The tiny low-resolution characters shown above actually look a lot better on the smaller kindle eink display, or from a distance on a large LCD display, due to visual perception properties.) Here are some screen captures from a kindle touch eink display showing "titty" in action: Spoiler:
Spoiler:
Spoiler:
....FAQ: Spoiler:
Enjoy, and learn! ![]() Ongoing optimization investigation updates: Spoiler:
![]() Last edited by geekmaster; 04-11-2012 at 12:49 PM. |
![]() |
![]() |
![]() |
#49 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
![]()
For those too young to remember what "TTY speed" was, teletypes ran at "110 baud", or 10 characters per second. I could type faster than that, so I could not press the next key until the teletype mechanism would allow the key I was pressing to "go down" first. I still own an ASR-33 teletype.
![]() When "glass teletypes" (CRT terminals) were available, they were able to do an "amazingly fast" 30 characters per second (3 times as fast). This was all the faster an accoustic-coupled modem could go, for online access. Back then, it was not legal to connect directly to telephone lines, and using an accoustic coupler was the ONLY way, so this 300bps was the maximum speed. Some BBS systems measured the width of bits you send when you press the Enter key to get a login message. I was able to adust my terminal software to get a fairly reliable local telephone connection at up to about 500bps, but at 600bps there were way too many bad characters getting corrupted over the connection. Because XMODEM protocol used by most BBS systems had built-in error-detection and packet resending, using these faster connections allowed much faster downloads (only 30 minutes to download a crude low-resolution picture of a naked chick.) ![]() Modems that used compression were not available until "MNP-5" compression was introduced in the MultiTech 2400baud modem after the law was changed to allow direct connections to the telephone system. I still have my beta MultiTech MNP-5 modem that I purchased for the cheap wholesale price of $600 USD (back in the days when that was enough money to buy a very nice used automobile). ![]() Even in the olden days before the Internet was open to the public (only universities, government and military), I had access via one of seven BBS systems that were connected to the Internet (for news and email). I had a real Internet email address even back then, long before the World Wide Web was invented. Later, when they opened the Internet to the public, state-of-the-art modem speeds had advanced to 14.4Kbps, and the WWW had a total of 250 web sites (but no search engines like Google, so you had to buy "Internet Guide Books" printed on paper). ![]() Because the "300baud days" were before modem compression, that 300bps really was only 30 characters per second. To give you an idea of what this "amazingly fast" (at the time) online experience was like, just watch this video: As you can see, the script-based text output from the "titty" program is much faster than the text displayed in that video. ![]() ![]() Last edited by geekmaster; 04-03-2012 at 06:11 PM. |
![]() |
![]() |
![]() |
#50 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17
Karma: 2600
Join Date: Mar 2012
Device: Kindle 3
|
K3 (and hopefully K4/K5) single (per line) hexdump titty.
Spoiler:
|
![]() |
![]() |
Advert | |
|
![]() |
#51 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Thanks! It is nice to see that somebody who has some time to spare for this project is actually reading (and implementing!) some of my potential optimization ideas.
I do not have time right now. I want to do a speed comparison test to see how much this speeds it up. ![]() I also want to integrate it with the K3 tiny terminal script that does eips text output now (with its severely limited character set). You are welcome to do that if you wish. Now that this includes your code, I think you should add a compact revision history (including your name and mine) like the one in my touchpaint script here: ![]() Last edited by geekmaster; 04-04-2012 at 12:26 PM. |
![]() |
![]() |
![]() |
#52 | |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17
Karma: 2600
Join Date: Mar 2012
Device: Kindle 3
|
Quote:
Scrolling and some other things that might be useful. Spoiler:
Last edited by kaminkatze; 04-05-2012 at 05:22 PM. |
|
![]() |
![]() |
![]() |
#53 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
![]() Quote:
By "integrate" I did mean to merge them. Although the linux philosophy is to have a bunch of small tools and pipe them together (which I *do* use for prototyping), keeping all the functions in one file prevents missing pieces or mixing wrong versions together. Scripts are "source code" anyway, so you can just cut and paste functions from a "master library" (or source the library, like how the kindle startup scripts source a "functions" file). But sourcing can lead to version conflicts too, and there is plenty of storage space for (complete) monolithic scripts. BTW, I static link my C programs too (all libraries embedded in the executable), to prevent loadable library version conflicts between different kindle models. That works MUCH better for portable programs, to prevent missing or "wrong library version" errors when you run them on a different kindle model. Being an "old-timer", I MUCH prefer larger programs and scripts that do not suffer "bit rot" as quickly as utilities that have external and version-specific dependencies. EDIT: After integrating "tinysh" onscreen shell with "titty" tiny TTY, this new script should have a new name. I would name it something alliterative and easy to say and remember. I (strongly) suggest that we name it "kittycon" (kindle TTY console), and with a new name restart the version number. You can keep the history showing its parentage. I plan to merge in GUI support from my other scripts (with buttons and stuff, and onscreen keyboard for touch and k4), so perhaps the name can later represent "kittycon - kindle tty control panel", making this name somewhat "future proof". I have been working on "gmcp - geekmaster control panel" occasionally for the past few months, but that name feels too egotistical, so I like kittycon "more better"... ![]() Of course, we should keep the individual functions as independent scripts as well (just like you did above), for direct use by other simple scripts, and for prototyping more advanced scripts. As I said, I like it both ways, but I usually *publish* tutorial demo code that I have stripped down to its essence, containing everything it needs (monolithic) but nothing that it does not use. ![]() P.S. Thank you kaminkatze for keeping this project alive and growing. ![]() ![]() Last edited by geekmaster; 04-05-2012 at 04:35 PM. |
|
![]() |
![]() |
![]() |
#54 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Porting this to the K3 shows a little bug in my original code. I did not notice it on the K4 and Touch because it gave a reasonable value for "max stride", but on the K3 it is obviously only half the screen. Fixing it actually made the code a little simpler and a little smaller. I like that! And the fact that it works on all the (tested) kindle models with NO CHANGES means that we did *something* right.
![]() Change this line: MX=$((FW*FS/FW-CW)) ML=$(((FH-TM)/LH-1)); MS=$((ML+FS)) # max X, line, stride to this: MX=$((FW-CW)) MY=$((FH-LH)) # max X, Y and change the "last line" checks to use $MX instead of $MS. EDIT: Tested and working on my DX, DXG, K3, K4, and Touch, using this command: eips -c;hexdump -C /dev/urandom|./titty - which fills all available lines on the screen with a hexdump of random data, and then quits. On the DXG, it stops after the last full line on the larger screen. And while displaying itself, the MIT license wraps at the larger screen right margin. It is nice when things actually work as designed without needing a lot of little bug fixes. ![]() UPDATE: Original "titty" post updated to v1.4 (which includes above changes): EDIT: Now I tested the scrolling with v1.4 (posted above) on my DX, and that works too. On a DX 824x1200 display, that is 206 columns of readable tiny text, or 300 columns wide if we used landscape mode. In DX landscape mode, we could display 4 side-by-side pages of 75-character lines, or 3 pages of 100-character lines. Cool. ![]() ![]() ![]() Last edited by geekmaster; 04-06-2012 at 12:26 AM. |
![]() |
![]() |
![]() |
#55 |
Member
![]() Posts: 18
Karma: 10
Join Date: Feb 2012
Device: K4NT
|
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
![]() EDIT>> Disregard my comment about the script not stopping, I must have accidentally started the script more than once. Also, I ended up running the script and then displaying a black png on the screen to get a clear view of the output. Here is what I found. ![]() 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 ![]() Last edited by aBP; 04-06-2012 at 03:09 AM. |
![]() |
![]() |
![]() |
#56 | |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17
Karma: 2600
Join Date: Mar 2012
Device: Kindle 3
|
Quote:
Temporarily you could use this kite script. Code:
usleep 2000000; titty & |
|
![]() |
![]() |
![]() |
#57 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
![]() |
|
![]() |
![]() |
![]() |
#58 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#59 | |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17
Karma: 2600
Join Date: Mar 2012
Device: Kindle 3
|
Quote:
Added backslash duplicates so that a single '\' is preserved by read L. New version uses IFS="" because IFS="\n" somehow removed 'n's at the end of a line. Spoiler:
|
|
![]() |
![]() |
![]() |
#60 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
The character(s) in the Input Field Seperator (IFS) string are always removed. Translation: IFS characters are never passed unless escaped or quoted. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Scripting with epub-meta | averyml | Calibre | 20 | 11-17-2016 10:13 AM |
Bunny + Scripting + Calibre = here | tBunnyMan | Introduce Yourself | 4 | 02-06-2012 12:16 AM |
Possible scripting engine for Sigil | Valloric | Sigil | 48 | 10-17-2009 09:58 AM |
Any NetNewsWire Scripting Pros out there? | adinb | Sony Reader | 0 | 02-25-2007 01:44 AM |