Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-07-2024, 02:21 PM   #1
diegoocampo
Connoisseur
diegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipse
 
Posts: 71
Karma: 8068
Join Date: May 2012
Device: PocketBook Inkpad Color 3
What would it take to port an Infocom/Z-machine interpreter to PocketBook eReaders

Being able to play interactive fiction in eReaders seems like a good way of expanding its possibilities. There are already interpreters available for Kindle and Kobo eReaders.

For those that have experience developing software for PocketBook eReaders, could you give me an idea of how difficult or how long can it take to port an interpreter like Frotz? What would be the right approach: an independent app or maybe a KOReader plugin since KOReader might offer a better base to build upon?

I am a developer but I never worked in this sort of environment (probably C langue and linux) since I mostly do web development and Godot game development... but if it doesn't sound too big of a project I might give it a go. It would be awesome to have hundreds of IF adventures playable from my eReader.
diegoocampo is offline   Reply With Quote
Old 01-07-2024, 03:55 PM   #2
orontee
Connoisseur
orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.
 
orontee's Avatar
 
Posts: 52
Karma: 84266
Join Date: Sep 2023
Location: Toulouse, France
Device: Vivlio Touch HD Plus
Quote:
Originally Posted by diegoocampo View Post
Being able to play interactive fiction in eReaders seems like a good way of expanding its possibilities. There are already interpreters available for Kindle and Kobo eReaders.
Interesting project!

Quote:
Originally Posted by diegoocampo View Post
For those that have experience developing software for PocketBook eReaders, could you give me an idea of how difficult or how long can it take to port an interpreter like Frotz? What would be the right approach: an independent app or maybe a KOReader plugin since KOReader might offer a better base to build upon?
I am speaking as the author of Taranis, an application to browse local weather data using a PocketBook reader. It's written in C++. But note that I didn't knew Frotz so far and my knowledge of IF is quite limited...

According to the documentation of the Unix port of Frotz, it includes "a curses interface, an SDL interface, and a dumb interface that requires absolutely no other libraries besides the standard C library."

Thus, if you stick to the dumb interface (to start with ), it should be easy since a modern C compiler with the standard C library is provided by Pocketbook SDK. What's left is a problem of configuring a build system (but there are many examples already available). Maybe more difficult and with unexpected results is: Reversing the behavior of the keyboard functions offered by the Pocketbook SDK (for example, the default behavior of OpenKeyboard() function is to gray out the upper part of the screen, which is certainly not what you want, but there's no documentation on how to achieve different behavior...).

I'll try to find time to cross-compile Frotz to complete this first analysis of the work to be done.

Complement: I just realized that the curses programming library is in Pocketbook SDK!

Again very nice project ! Keep us informed.

Last edited by orontee; 01-07-2024 at 05:22 PM. Reason: Rewording
orontee is offline   Reply With Quote
Advert
Old 01-07-2024, 04:55 PM   #3
orontee
Connoisseur
orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.
 
orontee's Avatar
 
Posts: 52
Karma: 84266
Join Date: Sep 2023
Location: Toulouse, France
Device: Vivlio Touch HD Plus
For the dumb interface, it's really easy. On a Linux box with "build essentials", execute the following commands:
Code:
git clone https://gitlab.com/DavidGriffith/frotz.git
git clone https://github.com/pocketbook/SDK_6.3.0.git
pushd SDK_6.3.0
git checkout 6.5
pushd ../frotz
CROSS=arm-obreey-linux-gnueabi \
CC=$PWD/../SDK_6.3.0/SDK-B288/usr/bin/$CROSS-clang \
CXX=$PWD/../SDK_6.3.0/SDK-B288/usr/bin/$CROSS-clang++ \
AR=$PWD/../SDK_6.3.0/SDK-B288/usr/bin/$CROSS-ar \
STRIP=$PWD/../SDK_6.3.0/SDK-B288/usr/bin/$CROSS-strip \
RANLIB=$PWD/../SDK_6.3.0/SDK-B288/usr/bin/$CROSS-ranlib \
PKGCONFIG=$PWD/../SDK_6.3.0/SDK-B288/usr/bin/pkg-config \
 CFLAGS="-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp" make dumb
Then copy the generated dfrotz executable to the /mnt/ext1/applications, copy a Z file to the /mnt/ext1/Downloads directory, say espions.z5 and from PBTerm, run
Code:
/mnt/ext1/applications/dfrotz /mnt/ext1/Downloads/espions.z5
Enjoy!
Attached Images
File Type: bmp scr0016.bmp (758.1 KB, 65 views)

Last edited by orontee; 01-07-2024 at 05:04 PM.
orontee is offline   Reply With Quote
Old 01-07-2024, 05:20 PM   #4
orontee
Connoisseur
orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.
 
orontee's Avatar
 
Posts: 52
Karma: 84266
Join Date: Sep 2023
Location: Toulouse, France
Device: Vivlio Touch HD Plus
My recommendation would be to forget the ncurse interface since the reader has no term info library, nor ncursesw (ncurses with support for UTF-8)...

Build the dumb executable dfrotz and write an independent interface using Pocketbook SDK that starts a dfrotz sub-process and is responsible for the text rendering; It could handle selecting a Z file, using buttons, etc. In a second time add support for images and why not audio.
orontee is offline   Reply With Quote
Old 01-08-2024, 03:26 AM   #5
wold
Zealot
wold knows better than to ask about the Gravitic Imploder Lance.wold knows better than to ask about the Gravitic Imploder Lance.wold knows better than to ask about the Gravitic Imploder Lance.wold knows better than to ask about the Gravitic Imploder Lance.wold knows better than to ask about the Gravitic Imploder Lance.wold knows better than to ask about the Gravitic Imploder Lance.wold knows better than to ask about the Gravitic Imploder Lance.wold knows better than to ask about the Gravitic Imploder Lance.wold knows better than to ask about the Gravitic Imploder Lance.wold knows better than to ask about the Gravitic Imploder Lance.wold knows better than to ask about the Gravitic Imploder Lance.
 
Posts: 120
Karma: 87007
Join Date: Apr 2021
Device: Lux 5, Libra 2, PRS-T2N
Way back Pocketbook organized an app development challenge of sorts. IIRC an Z-interpreter was a honorable mention, but I can't find the page anymore. It looked basic and probably came without its source anyway.

See also this Frotz for Kobo thread:
https://www.mobileread.com/forums/sh...42#post2711142
wold is offline   Reply With Quote
Advert
Old 01-08-2024, 06:21 AM   #6
diegoocampo
Connoisseur
diegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipse
 
Posts: 71
Karma: 8068
Join Date: May 2012
Device: PocketBook Inkpad Color 3
Thanks guys!, fantastic information there.

@wold it's a shame that the development challenge results are not available anymore. That sounds like Pocketbook community development was a bit more active back then, or maybe the PocketBook company was involving the community more.

@orontee. Thank you for all the information and I find it amazing that you basically already built the most basic version of it by looking into it a couple of hours.
I will look into this. Unfortunately I have almost zero free time but I plan to put a bit of time each week and see if I make progress. Of course if you want to look into it since you clearly have more experience with this, please go ahead (I don't mean this as an attempt for you do to the work I planned to do, but just in case you got to know about this possibility now and its something you want to do, then don't feel that you are stealing my idea or anything like that, all I want is to play this kind of text adventure in my new Inkpad Color 3 some day).
diegoocampo is offline   Reply With Quote
Old 01-13-2024, 09:25 PM   #7
orontee
Connoisseur
orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.
 
orontee's Avatar
 
Posts: 52
Karma: 84266
Join Date: Sep 2023
Location: Toulouse, France
Device: Vivlio Touch HD Plus
Quote:
Originally Posted by diegoocampo View Post
Thanks guys!, fantastic information there.

@wold it's a shame that the development challenge results are not available anymore. That sounds like Pocketbook community development was a bit more active back then, or maybe the PocketBook company was involving the community more.
Not sure whether it's what @wold had in mind but you can read about a 2009 contest where a program to read interactive fiction in QSP format has been proposed from here. Source code can be downloaded has archive or cloned through SVN.

Quote:
Originally Posted by diegoocampo View Post
@orontee. Thank you for all the information and I find it amazing that you basically already built the most basic version of it by looking into it a couple of hours.
I will look into this. Unfortunately I have almost zero free time but I plan to put a bit of time each week and see if I make progress. Of course if you want to look into it since you clearly have more experience with this, please go ahead (I don't mean this as an attempt for you do to the work I planned to do, but just in case you got to know about this possibility now and its something you want to do, then don't feel that you are stealing my idea or anything like that, all I want is to play this kind of text adventure in my new Inkpad Color 3 some day).
I'll definitively try to implement a PocketBook UI for interactive fictions but I first want to understand what format is still alive; Not sure Z is where efforts are worth investing...

Last edited by orontee; 01-13-2024 at 09:43 PM.
orontee is offline   Reply With Quote
Old 01-14-2024, 03:08 AM   #8
pkbo
Addict
pkbo ought to be getting tired of karma fortunes by now.pkbo ought to be getting tired of karma fortunes by now.pkbo ought to be getting tired of karma fortunes by now.pkbo ought to be getting tired of karma fortunes by now.pkbo ought to be getting tired of karma fortunes by now.pkbo ought to be getting tired of karma fortunes by now.pkbo ought to be getting tired of karma fortunes by now.pkbo ought to be getting tired of karma fortunes by now.pkbo ought to be getting tired of karma fortunes by now.pkbo ought to be getting tired of karma fortunes by now.pkbo ought to be getting tired of karma fortunes by now.
 
Posts: 251
Karma: 214890
Join Date: Sep 2006
Device: none
Quote:
Originally Posted by diegoocampo View Post
sounds like Pocketbook community development was a bit more active back then, or maybe the PocketBook company was involving the community more.
It was different company back then, it had other owners. The current management is clearly not interested in the development community.
pkbo is offline   Reply With Quote
Old 01-14-2024, 03:47 AM   #9
diegoocampo
Connoisseur
diegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipse
 
Posts: 71
Karma: 8068
Join Date: May 2012
Device: PocketBook Inkpad Color 3
Quote:
Originally Posted by orontee View Post
I'll definitively try to implement a PocketBook UI for interactive fictions but I first want to understand what format is still alive; Not sure Z is where efforts are worth investing...
You are right about this. I was focusing on Frotz because I knew it was very basic and portable and since I have zero experience with C++ and Linux development it seemed a less daring challenge.

With Z-machine only you still get A LOT of good IF games and there is still some activity going on nowadays. Z-machine games evolved themselves, if they have extensions ending in .z3 or .z5 those are built for older versions of the interpreter, with no images or sounds. If their extensions are .z8 or .zblorb, they are more modern and can contain some media files.
But yes, it is a limited interpreter and there are other options.

A much more interesting port would be Gargoyle https://github.com/garglk/garglk/ that includes a big number of interpreters, including Z-Machine (it includes a ported version of Frotz) and more modern ones (but not all the big modern ones), in a single package. And it was actually ported for Kindle https://www.mobileread.com/forums/sh...d.php?t=223455
With Gargoyle you would be covering most of the IF games available out there. The full list of supported interpreters is here https://github.com/garglk/garglk/wik...rpreter-Status

There is also lectrote https://github.com/erkyrath/lectrote that also covers a lot of interpreters but this is based in Electron (a Javascript framework) so maybe even harder to port.
diegoocampo is offline   Reply With Quote
Old 01-14-2024, 04:46 AM   #10
orontee
Connoisseur
orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.
 
orontee's Avatar
 
Posts: 52
Karma: 84266
Join Date: Sep 2023
Location: Toulouse, France
Device: Vivlio Touch HD Plus
Quote:
Originally Posted by diegoocampo View Post
(...)A much more interesting port would be Gargoyle
This message reached me while reading on... Gargoyle. Looks very interesting!
orontee is offline   Reply With Quote
Old 01-19-2024, 04:19 AM   #11
diegoocampo
Connoisseur
diegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipse
 
Posts: 71
Karma: 8068
Join Date: May 2012
Device: PocketBook Inkpad Color 3
Quote:
Originally Posted by orontee View Post
This message reached me while reading on... Gargoyle. Looks very interesting!
What are your first impressions on porting Gargoyle? does the Pocketbook SDK lack any essential libraries? I kept looking at other possible options to port but I don't think there is anything out there as interesting as Gargoyle.
diegoocampo is offline   Reply With Quote
Old 01-19-2024, 05:04 PM   #12
orontee
Connoisseur
orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.
 
orontee's Avatar
 
Posts: 52
Karma: 84266
Join Date: Sep 2023
Location: Toulouse, France
Device: Vivlio Touch HD Plus
Quote:
Originally Posted by diegoocampo View Post
What are your first impressions on porting Gargoyle? does the Pocketbook SDK lack any essential libraries? I kept looking at other possible options to port but I don't think there is anything out there as interesting as Gargoyle.
The SDK lacks Qt (but if I remember correctly some applications present on PocketBook devices uses QML thus Qt libraries must be installed...).

That said, almost all Qt usages are in few relatively small files.

The launcher looks easy to port.
In sysqt.cpp, the Qt event loop and image rendering are used but there're replacements in the SDK. Thus tere should not be much troubles.

Look:
Code:
↳ find garglk/ \( -name "*.h" -or -name "*.hpp" -or -name "*.cpp" -or -name "*.cxx" \) -print | xargs grep -E 'sysqt\.h|<Q' | cut -d':' -f 1 | uniq | sort | xargs wc -l
  313 garglk/launchqt.cpp
  948 garglk/sndqt.cpp
  762 garglk/sysqt.cpp
   69 garglk/sysqt.h
 2092 total
I was frighten that font rendering implied a dependency to Harfbuzz since Gargoyle claims to support UTF-8 and ligatures but it's not the case. AFAIU there's a custom implementation without other dependencies than freetype2 and fontconfig libraries which are available in the SDK (this implementation supports a subset of possible ligatures).

Depending on the weather and cycling conditions, I'll have time to explore further this week-end.

Last edited by orontee; 01-19-2024 at 05:18 PM. Reason: Update stats
orontee is offline   Reply With Quote
Old 01-20-2024, 11:10 AM   #13
diegoocampo
Connoisseur
diegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipse
 
Posts: 71
Karma: 8068
Join Date: May 2012
Device: PocketBook Inkpad Color 3
Thanks for the reply! please keep us updated if you make any good findings.

When I read their INSTALL.md and saw Qt 5 or 6 as a requirement I thought that could be the biggest problem since, from my little knowledge, I knew it is a big library for graphical interface building that I couldn't find any references for in the Pocketbook SDK.
Do you know of any modern Pocketbook apps that use Qt? I searched the forums and found this https://www.mobileread.com/forums/sh...d.php?t=265941 but since it is form firmware 4 pocketbook might as well have removed Qt support in recent SDKs.

Again, thank you for looking into this!
diegoocampo is offline   Reply With Quote
Old 02-05-2024, 04:38 PM   #14
orontee
Connoisseur
orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.orontee invented the internet.
 
orontee's Avatar
 
Posts: 52
Karma: 84266
Join Date: Sep 2023
Location: Toulouse, France
Device: Vivlio Touch HD Plus
News

Quote:
Originally Posted by diegoocampo View Post
Thanks for the reply! please keep us updated if you make any good findings.(...)
Time is passing so even if I've not reach a concrete milestone I thought I'll gave you some news:
- The CMake configuration has been updated to define a new "INKVIEW" interface with dependency to the corresponding library
- A recent version of libpng is cross-compiled to match garglk requirements
- Compilation succeeds for some interpreters and fails at linkage for the others since the C++ files garglk/sysinkview.cpp and garglk/sysinkview.h corresponding to the new "INKVIEW" interface are almost empty

So I've reach the point where one has to convert Qt based code; There's not a huge code base, just the two sysqt.cpp and sysqt.h files to convert. The interface to implement is described here: https://eblong.com/zarf/glk/Glk-Spec-075.html.

That said note that CMake outputs the following dependency error (but make find the headers; Will have to study this...):
Code:
-- The following REQUIRED packages have not been found:

 * Freetype
In conclusion things are going as expected, just time that's missing! I plan to work on this project next week.

Last edited by orontee; 02-05-2024 at 04:52 PM.
orontee is offline   Reply With Quote
Old 02-06-2024, 11:03 AM   #15
diegoocampo
Connoisseur
diegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipsediegoocampo can illuminate an eclipse
 
Posts: 71
Karma: 8068
Join Date: May 2012
Device: PocketBook Inkpad Color 3
Very exciting, and it seems good progress already! though I understand that the QT to Inkview conversion is the heavy part... hopefully your experience developing Taranis interface will help with that process.

I got to know about IF games because as a child I bought and played gamebooks (like the old popular Fighting Fantasy gamebooks) and some IF games have a similar playstyle as those gamebooks but you can read them in your phone or computer and no need to carry dice or paper and pen... Now an eReader seems like the perfect device for it: bigger and with less distractions than a smartphone, more portable than a computer. Pocketbook allows you to install external apps without jailbreak which is great.

If you manage to get a working version of Gargoyle for Pocketbook it will be great way of experience IF games. The Pocketbook community is not very big unfortunately, I will surely help spreading the word.

In any case take your time! and thanks for the update! looking forward to your next post.
diegoocampo is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Buy Older Pocketbook Ereaders. MonsteraPeru Flea Market 12 05-19-2022 07:38 PM
Has anybody tried installing KIF (Infocom Interpreter) lately? curtw Kindle Developer's Corner 7 11-22-2018 11:20 AM
KIF: a native infocom interpreter for the kindle adq Kindle Developer's Corner 45 07-29-2013 10:40 PM
Kindle Paperwhite: Frotz or other Z-Machine interpreter? ezuk Kindle Developer's Corner 10 01-29-2013 12:18 PM
Can PocketBook 360 be charged only with usb cable port ? Greenhat PocketBook 7 12-19-2010 12:32 AM


All times are GMT -4. The time now is 11:06 AM.


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