Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Readers > Amazon Kindle > Kindle Developer's Corner

Notices

Reply
 
Thread Tools Search this Thread
Old 07-25-2012, 04:20 AM   #1
Fvek
Member
Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.
 
Posts: 23
Karma: 193423
Join Date: Jul 2012
Device: Kindle Touch
Frotz curses interface for Kindle Touch & Paperwhite (via kterm)

Frotz version: 2.43d http://frotz.sourceforge.net/
Compiled for Kindle K5 version: 1.1.2

Frotz is an interpreter for Z-machine interactive fiction (Infocom-style text games -- like Zork, Hitchikers Guide to the Galaxy, etc.).

It's a console-based program and thus requires a text display. You can use kterm to run it on a Kindle Touch and Paperwhite (see below). It might also work on other models of Kindle or other ARM devices, but I can't test this.

It should be able to play any game that frotz-2.43d supports. I've only tested a few. Freefall (http://www.wurb.com/if/game/94) works, so you can now have Tetris on your Kindle too (more or less).

For the executable itself, all I did was cross-compile frotz to run on ARM (using the gcc-arm-linux-gnueabi package on Ubuntu). The GPLed source code and more information are on the frotz site (http://frotz.sourceforge.net/). I had to fiddle with the Makefile and use a copy of /usr/lib/libncurses.so.5.6 from the KT to compile, but the only change in the source was to comment-out a sanity check in curses/ux_init.c so it would run as root (there's no regular user account on the Kindle). Otherwise it's vanilla frotz.

Sound is deactivated since frotz uses OSS and Kindle Touch uses ALSA and I don't know how to make that work.

Color modes, especially color backgrounds, cause weird display issues in kterm, but that can be disabled on the command line (see below). Or you can telnet into your Kindle from something with a color display.

Note: Zacaj ported frotz to the Kindle 3 before (http://www.mobileread.com/forums/sho...d.php?t=126768), but he compiled it as the simpler "dumbfrotz" version instead of the normal version that uses the curses library (which lets text displays put characters arbitrarily on the screen, allowing for status bars, etc.). I don't know why he did that, but the curses version is better, ergo this port (also, this is a newer version -- his was 2.32R1).

Click image for larger version

Name:	anchorhead.png
Views:	991
Size:	10.7 KB
ID:	89697 Click image for larger version

Name:	freefall_tetris.png
Views:	785
Size:	8.3 KB
ID:	89698

KINDLE UNIFIED APPLICATIONS LAUNCHER EXTENSION:

Also included are files so you can use it with the Kindle Unified Applications Launcher (KUAL, see below). It will add a "Start Frotz" option that includes a file selector dialog. This is optional, but without it you'll have to start kterm then type stuff to start frotz.

To use the Launcher extension, you will also need the separate "dialog" program installed (see below). I'm distributing it separately since it has general-purpose uses so someone might want just it and I don't want to maintain multiple copies.


Click image for larger version

Name:	frotzfileselect.png
Views:	582
Size:	8.3 KB
ID:	89865

INSTALLATION:

The root of your Kindle's USB drive (what you see when you plug it into your computer) is actually located at "/mnt/us/" inside the Kindle's filesystem. Assume they are the same below for brevity...

Installing frotz:

1) For the Touch & Paperwhite, you need baf's kterm (http://www.fabiszewski.net/kindle-terminal/) and anything it needs to run (jail breaking, etc.). Once you got that up and working, continue...

2) Create a folder called "bin" in /mnt/us. If it's already there, good.

(Note: You can use a different folder, but you will have to edit start_frotz_shell.sh and frotz_shell.sh in /mnt/us/extensions/frotz/bin/ so they can find it.)

3) Copy the file "frotz" from the bin folder into it.


Installing the Launcher extension:

1) Make sure you have KUAL installed (http://www.mobileread.com/forums/sho...d.php?t=203326).

2) Copy the folder "frotz" from the extensions to /mnt/us/extensions/

3) Get the dialog package attached below and copy the files "dialog" and ".dialogrc" into /mnt/us/bin/


Installing Interactive Fiction Files:

You can also create the folder /mnt/us/if/ and put your game files in it. That's where the launcher's file selector defaults to. You can change this location by editing the file /mnt/us/extensions/frotz/bin/frotz_shell.sh


Installation complete!

Note: any editing of text files above should be done with an editor that can handle unix-style text files.

UNINSTALL:

Just remove the stuff you added.

HOW TO USE:

Via Launcher:

Run "Kindle Launcher", tap "Start Frotz".

You'll get a text-based file selector. If you put your game files in /mnt/us/if/ they'll be listed on the right-hand side. If not, you can change folders using the file selector.

Tap the one you want then tap "OK".


Invoked from a term:

You can run it on its own (if you didn't install the launcher) by starting kterm first, then entering:

/mnt/us/bin/frotz -d /mnt/us/if/gamename.z5

If you did the PATH edit mentioned above, you can use just:

frotz -d /mnt/us/if/gamename.z5

In both cases replacing the path to the game file and its name as needed.

Be sure to use the "-d" option to disable color as that can do ugly things on the epaper display.

Hint: In kterm, use the tab key for path/filename completion and the up-arrow to access previous commands. Or type all the above out in full each time on the tiny keyboard as practice for playing text games on your KT.


Quitting:

To quit frotz, use command "q" and follow the prompts, or if that's not available press the "ctrl" key on the screen keyboard, then the "c" key. Or tap the upper right and select "Quit" from kterm's menu.

If launched using the launcher, it will quit to a Kindle screen. If launched from within kterm, it will quit to the command prompt.


Saving:

Save files will be in /mnt/us/extensions/frotz/bin/ (this is not ideal, but it'll have to do until I figure out how to change it).


WHERE TO GET GAME FILES:

You can find many games and more info about interactive fiction at the Interactive Fiction Archive (http://www.ifarchive.org/).
Attached Files
File Type: zip dialog-1.1-20120706-kindle_touch-1.0.2.zip (248.9 KB, 300 views)
File Type: zip frotz-2.43d-kindle_k5_kterm_kual-1.1.2.zip (54.6 KB, 315 views)

Last edited by Fvek; 01-29-2013 at 04:53 PM. Reason: updated for kterm and the new Launcher
Fvek is offline   Reply With Quote
Old 07-25-2012, 07:59 AM   #2
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 4,577
Karma: 4440239
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW & PW2
FWIW, the K3 does have the curse library bundled ;-).
NiLuJe is offline   Reply With Quote
Old 07-28-2012, 01:59 AM   #3
Fvek
Member
Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.
 
Posts: 23
Karma: 193423
Join Date: Jul 2012
Device: Kindle Touch
I updated this with a GUI Launcher extension. Because you need to select which game to play, I needed a file selector, so I also ported dialog. It's attached separately in case anyone wants to use it for something else.

I altered the behavior of dialog's file selector to make it easier to use on a touch screen -- you just tap the desired file then tap OK instead of having to use the space key. Otherwise it's the same as the stock version.

I don't know if I like how it looks, but it works.
Fvek is offline   Reply With Quote
Old 07-28-2012, 05:39 PM   #4
atordo
Connoisseur
atordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to beholdatordo is a splendid one to behold
 
Posts: 89
Karma: 19669
Join Date: Apr 2012
Device: Kindle Touch
Wow, there are almost 600 games in ifarchive, and even more than 50 in my mother language! Entertainment for ages!

Had to edit one of the scripts though, the path wasn't complete (I think a "bin/" was missing in start_frotz_shell.sh, but I'm not 100% sure now).

Thanks for opening the doors of this Z-Machine universe to the KT.

Edit for Spanish speakers: apparently there's an active community that still develops for Z-Machine, here you can find more than 100 games: http://www.caad.es/taxonomy/term/21

Last edited by atordo; 07-28-2012 at 06:02 PM.
atordo is offline   Reply With Quote
Old 07-28-2012, 07:13 PM   #5
Fvek
Member
Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.
 
Posts: 23
Karma: 193423
Join Date: Jul 2012
Device: Kindle Touch
Quote:
Originally Posted by atordo View Post
Had to edit one of the scripts though, the path wasn't complete (I think a "bin/" was missing in start_frotz_shell.sh, but I'm not 100% sure now).
Oops, you're right. Fixed now. After editing the script on the Kindle* I manually changed that version in Ubuntu for zipping instead of copying the working version.

* If anyone wants a copy of the text editor joe, I got that working and can post it too. It's a lot easier to use than vi (I can never remember how you're supposed to quit vi!)
Fvek is offline   Reply With Quote
Old 08-01-2012, 06:59 AM   #6
techiemonkey
Tech Geek Forever
techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.
 
techiemonkey's Avatar
 
Posts: 230
Karma: 568824
Join Date: Jun 2012
Location: USA
Device: Kindle Touch hacked
nothing happens when i tap start frotz in gui launcher.i am using the latest version of this.this works through xterm though.
techiemonkey is offline   Reply With Quote
Old 08-01-2012, 07:16 AM   #7
Fvek
Member
Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.Fvek can program the VCR without an owner's manual.
 
Posts: 23
Karma: 193423
Join Date: Jul 2012
Device: Kindle Touch
Quote:
Originally Posted by techiemonkey View Post
nothing happens when i tap start frotz in gui launcher.i am using the latest version of this.this works through xterm though.
Did you install the attached 'dialog' file (the file inside the zip, not the zip itself) into /mnt/usr/bin too? It needs a separate file selector to be useful from the launcher.

Do you have both start_frotz_shell.sh and frotz_shell.sh in extensions/frotz/bin?

Another possibility... I was having problems getting console commands to run from a launched xterm like this. xterm would start then immediately stop without displaying anything. I solved it by adding a "sleep 1" (pause for 1 second) before the command. Maybe making it 2 seconds?
Fvek is offline   Reply With Quote
Old 08-01-2012, 07:30 AM   #8
techiemonkey
Tech Geek Forever
techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.techiemonkey ought to be getting tired of karma fortunes by now.
 
techiemonkey's Avatar
 
Posts: 230
Karma: 568824
Join Date: Jun 2012
Location: USA
Device: Kindle Touch hacked
yes i have done both yet i dont get anything when i tap start frotz.
UPDATE:sorry for bothering you.i must have messed up somewhere.anyway after i installed the latest version of gui launcher collection,the gui launcher frotz started working.

Last edited by techiemonkey; 08-03-2012 at 11:56 AM.
techiemonkey is offline   Reply With Quote
Old 09-24-2012, 09:47 AM   #9
icantbebothered
Penguin
icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.
 
icantbebothered's Avatar
 
Posts: 1,016
Karma: 4742434
Join Date: Jul 2012
Device: Kindle Touch 5.3.2.1
Where can I get interactive fiction files?
icantbebothered is offline   Reply With Quote
Old 09-24-2012, 10:12 AM   #10
geekmaster
Всё гениальное просто.
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: 5,066
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by icantbebothered View Post
Where can I get interactive fiction files?
Searching for "frotz interactive fiction" with Google returns many hits, starting with this:

The Interactive Fiction Archive: http://ifarchive.org/

Here is a search engine for that archive: http://wurb.com/if/

When you cannot find what you seek, I recommend that you try using Google.

Last edited by geekmaster; 09-24-2012 at 10:18 AM.
geekmaster is offline   Reply With Quote
Old 09-24-2012, 11:06 AM   #11
icantbebothered
Penguin
icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.
 
icantbebothered's Avatar
 
Posts: 1,016
Karma: 4742434
Join Date: Jul 2012
Device: Kindle Touch 5.3.2.1
Thanks.
icantbebothered is offline   Reply With Quote
Old 09-27-2012, 06:22 AM   #12
twobob
( ͡° ͜ʖ ͡°){ʇlnɐɟ ƃǝs}Týr
twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.twobob ought to be getting tired of karma fortunes by now.
 
twobob's Avatar
 
Posts: 6,552
Karma: 6015922
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
hehehe. I managed to lock up my 5 with tetris. Nice work mate.
now where is htop when you need it... *goes off to make one*
twobob is offline   Reply With Quote
Old 10-13-2012, 04:19 PM   #13
icantbebothered
Penguin
icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.icantbebothered ought to be getting tired of karma fortunes by now.
 
icantbebothered's Avatar
 
Posts: 1,016
Karma: 4742434
Join Date: Jul 2012
Device: Kindle Touch 5.3.2.1
Hello people, I think I'm being stupid again.

When I try to save a game, Itried lots of different ones, it says save failed. I type in whatever it says the default file name is.

Edit: oh, you have to enter the full path in the filename.

Last edited by icantbebothered; 10-25-2012 at 11:55 AM.
icantbebothered is offline   Reply With Quote
Old 10-13-2012, 08:17 PM   #14
geekmaster
Всё гениальное просто.
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: 5,066
Karma: 6789001
Join Date: Nov 2011
Location: Щедрость не имеет пределов.
Device: *.*
Quote:
Originally Posted by twobob View Post
hehehe. I managed to lock up my 5 with tetris. Nice work mate.
now where is htop when you need it... *goes off to make one*
There was an htop packaged with NiLuJe's usbnet, as I recall...
geekmaster is offline   Reply With Quote
Old 12-27-2012, 04:16 AM   #15
ezuk
Junior Member
ezuk is clearly one to watchezuk is clearly one to watchezuk is clearly one to watchezuk is clearly one to watchezuk is clearly one to watchezuk is clearly one to watchezuk is clearly one to watchezuk is clearly one to watchezuk is clearly one to watchezuk is clearly one to watchezuk is clearly one to watch
 
Posts: 5
Karma: 10706
Join Date: Nov 2010
Device: Amazon Kindle 3
Does this work on the new Kindle Paperwhite?
ezuk is offline   Reply With Quote
Reply

Tags
dialog, frotz, interactive fiction, launcher add-ons, ncurses, xterm

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
K5 [Kindle Touch] xterm & matchbox-keyboard baf Kindle Developer's Corner 222 02-11-2013 07:14 PM
Kindle touch landscape and new interface with new update arad26 Amazon Kindle 8 04-12-2012 01:28 AM
new kindle touch user interface? geekmaster Kindle Developer's Corner 1 04-10-2012 10:19 AM
Interface Android Cell Phone via Amazon Kindle Touch nealsharmon Kindle Developer's Corner 11 03-01-2012 07:11 PM
Curses, I like the Kindle 3, sorta. LDBoblo Amazon Kindle 27 11-08-2010 05:37 PM


All times are GMT -4. The time now is 05:29 AM.


MobileRead.com is a privately owned, operated and funded community.