![]() |
#61 | |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17
Karma: 2600
Join Date: Mar 2012
Device: Kindle 3
|
Quote:
Oooh, I see. I changed the IFS=$'\n' to $"\n", which isn't the same. Edit: IFS=$'\n' isn't working on the K3. Last edited by kaminkatze; 04-06-2012 at 02:28 PM. |
|
![]() |
![]() |
![]() |
#62 | |
Going Viral
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17,212
Karma: 18210809
Join Date: Feb 2012
Location: Central Texas
Device: No K1, PW2, KV, KOA
|
Quote:
Not all implementations behave the same for various reasons and then even some implementations vary from one release to another. One thing to try - see if the make/model/version/etc of the "shell" program will let you write the newline character as hex: IFS=$'\x0A' If your using the "shell" program provided by Busybox, then there are some more chances for "gotcha's" .... Over the years (and versions) Busybox has provided more than one "shell" application. So with some versions, it depends on which one was selected at build time. More recently, the 'ash' shell application has been the prefered one in Busybox builds. That one is the most complete and correct. But that doesn't mean it is the one lab126 choose to build. ![]() And of course, as can be seen in the Amazon source catalog, not all builds for all Kindles used the same version of Busybox. (Also, you can see that Amazon did not ship the .config file "as built" with their source code releases which would let us just look-up which shell application got built.) But putting in characters by their Hex or Octal code __usually__ works. Last edited by knc1; 04-06-2012 at 02:50 PM. |
|
![]() |
![]() |
![]() |
#63 |
BLAM!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 13,506
Karma: 26047190
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
|
AFAIR, The K3's busybox uses ash, but *without* the bash compatibilty option (which 'breaks' a bunch of substring fun stuff, among other things).
|
![]() |
![]() |
![]() |
#64 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17
Karma: 2600
Join Date: Mar 2012
Device: Kindle 3
|
|
![]() |
![]() |
![]() |
#65 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I tried all kinds of options the *should* have worked (but didn't on the busybox versions I was using). I finally settled on something that *did* work (for the application I used it in). I have published a number of different solutions (with and without IFS) that each worked for *that* program. Substring stuff that works on k4 and touch does not work on k3, and some IFS stuff that works on k3 does not work on touch. It makes things a bit difficult to write code that works on all the kindle models.
|
![]() |
![]() |
![]() |
#66 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 17
Karma: 2600
Join Date: Mar 2012
Device: Kindle 3
|
The CW/CH/LH variables are set according to the width and height of the png image.
Added support for some of the color/cursor movement escape sequences. Changed the end of page behaviour to auto scrolling. Spoiler:
Tinysh mod which uses the escape sequences to control titty. Spoiler:
Last edited by kaminkatze; 04-11-2012 at 11:44 AM. |
![]() |
![]() |
![]() |
#67 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
![]() I plan to use this in my touchscreen code I have been working on, which will also support 5-way pads and keyboards on the K3 and DX. I do not have a K2 or K1 to test on, or I would support those too. Does anybody have a K2 or K1 collecting dust? If yes, then please PM me! ![]() Let's replace that comment line containing this HUGE pile of incomprehensible legal mumbo jumbo: Code:
# MIT License: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Code:
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php Thanks. ![]() |
|
![]() |
![]() |
![]() |
#68 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
On a K3 and earlier, eips is very slow, but there is a faster way. You can echo characters to the eink /proc files that can do different types of eink updates, some of which are much faster than using eips. This is how all the scripts did eink display updates before the K4 and touch were available. You might want to use a script function to do the updates: PHP Code:
EDIT: I am now using this eupd function in my new scripts. ![]() Last edited by geekmaster; 04-11-2012 at 03:27 PM. |
|
![]() |
![]() |
![]() |
#69 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,016
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
3D - An Interactive animated projection of an object on a 2D screen
After seeing geekmaster's "eink algorithmic art" demos, I fancied and dusted off a 30 years old demo -- see the included original Byte Magazine extract! (with a bonus p486 rescan to fix original download URL ![]() Teaser code for illustrative purpose only, Spoiler:
extract the attached zip to preserve tabs, escaped characters, etc.In particular, note the echo $((VECTX$i=$1))>$DN construct to dynamically define and assign VECTOR$i variables in absence of shell arrays ![]() I have included definitions for a couple of objects. It should be somewhat easy to modify and define vectors for more. Use the keyboard to interactively control viewing angles and distance. When in trouble, press Home key twice to exit. WARNINGS: Well, this script is certainly not fast, and only meant for as a fun demo in /bin/sh education. It will only work on the K3, when started from an ssh session or from a launchpad shortcut. I have not thoroughly tested it (I am a bit surprised that it even works at all given the /bin/sh quirks I encountered). A "C formula'42" implementation would be a relief. It will fail displaying correctly when zooming too close. Proper clipping is not implemented. And Oh, sorry for too much white space... I felt it was cryptic enough without "optimizing" further. |
![]() |
![]() |
![]() |
#70 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
There IS a C "formula 42" in the original dithermatron program. I have been developing faster and simpler replacements for it that also support the K4 in main boot mode (hybrid K3/K5 eink driver mode), and it does dithering to display 256 colors on the 16-color display (the framebuffer is always dithered 16-color on the K4 and K4 by the image display software, such as eips and screensavers). The C "gmlib" code supports all eink kindles. I could wrap it into a simple replacement for eips, that you call to draw graphics primitives (lines, circles, etc.) and do eink updates. Go check out the demos in the dithermatron and newtrix threads. I have in my "to do" list a gmlib function that you call "gmlib opcode params" that can do graphics stuff from shell scripts. I plan to add keyboard and touchscreen support to gmlib too, and later sound and network functions (for network video games -- turn-based games should work well, especially with the new 256-color dithered drawing functions I added). With the (unfinished) gmlib program, it can be used in shell scripts to make all the existing "algorithmic art" scripts a LOT faster... I will do that soon, after I complete a couple C things I have in progress. |
|
![]() |
![]() |
![]() |
#71 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7
Karma: 2614
Join Date: May 2012
Device: Kindle Touch
|
Ants in the Kindle Touch!
Here's a little script that lets Ants (well, ONE Ant) crawl over the display of the Kindle Touch.
usage: ants [-c]
PHP Code:
|
![]() |
![]() |
![]() |
#72 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
It took me awhile to remember that waitforkey does not work while the kindle is in screensaver mode. Tapping the power button while this program is running fixes that though.
![]() In the past, waitforkey returned a keycode for rotation events even when in screensaver mode. After upgrading to 5.1.0, I see that it no longer returns rotation events. Perhaps the accelerometer defaults to OFF instead of ON as it did in 5.0.x firmware. Last edited by geekmaster; 05-09-2016 at 06:06 PM. |
![]() |
![]() |
![]() |
#73 | |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
Quote:
I am thinking somebody needs to port this 3D program to C now that we have the tcc package. ![]() Last edited by geekmaster; 05-10-2012 at 09:57 PM. |
|
![]() |
![]() |
![]() |
#74 |
curly᷂͓̫̙᷊̥̮̾ͯͤͭͬͦͨ ʎʌɹnɔ
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 3,016
Karma: 50506927
Join Date: Dec 2010
Location: ♁ ᴺ₄₅°₃₀' ᵂ₇₃°₃₇' ±₆₀"
Device: K3₃.₄.₃ PW3&4₅.₁₃.₃
|
![]() |
![]() |
![]() |
![]() |
#75 | |
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,586
Karma: 6299991
Join Date: Jun 2012
Location: uti gratia usura (Yao ying da ying; Mo ying da yieng)
Device: PW-WIFI|K5-3G+WIFI| K4|K3-3G|DXG|K2| Rooted Nook Touch
|
Superb Seggie
Quote:
But superb. Love this. Excellent |
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |