Good call, I wrote an ePub reader before and the format for the content is HTML, so you first need to write a HTML rendering engine first.
I’m not sure if it even works on modern PCs today.
Anyway, I really believe that we need applications that fit the strengths of the PicoCalc. I will always have my phone with me, and it is my consumption device.
I believe that the PicoCalc is a content creation device in a very niche area with the built-in keyboard.
Converting epub to text is a three step process, first it needs to be unzipped, then the HTML needs to be stripped out and third the non ASCII characters need to be stripped out.
The first step is pretty easy obviously. For the second step, there are plenty of python scripts out there for stripping HTML, This is the one I use. I wrote a Linux shell script that call the programs to do the first two steps and then performs the last step of converting everything to plain ASCII text. It is a bit slow and it is not perfect, but it works pretty well.
PicoBasic/Applications/PicoPub at main · INSCCOIN/PicoBasic A very simple “e-reader” will be doing updates as time goes, I included a converter.bat to take .txt files and convert them to 30 characters per line. The program reads segments from the loaded .txt file in chunks of 25.
I didnt realize there is a hardware rng on the picos, how do you access it? I was thinking about implementing some PRNGs (mersenne twister?) And it would be interesting to compare to “true random”
Looking at the code it appear the MMBasic RND function produces a true H/W generated random number on the RP2350 and a pseudo random number on the RP2040. In addition, according to the manual, both support the MATH(RAND) function
"Returns a random number 0.0 <= n < 1.0 using the “Mersenne Twister algorithm. If not seeded with MATH RANDOMIZE the first usage seeds with the time in microseconds since boot”
simple idea: help.
i always stumble upon the question.. “which order is that, how is it used” micropython repl has a help which shows the synopis.. MMBasic doesn’t … sadly.. maybe it’s a start to write a help on it so you practise programming and noobs get a program that helps them to learn.. without the need of a 300 page pdf file
There is a help command built in, and mentioned in the huge PDF file on page 117.
Personally I don’t find it very useful though, and I imagine it could be improved. At the very least the help.txt file could be stored on the SD rather than the A: drive, but formatting could be improved as well. I’m not even sure where to get the most recent version of the help.txt file, but it’s probably buried somewhere in TheBackShed posts.
I added color cycling for the text of the book and a screenshot feature in 1.9.
I’m working on adding Hex Color support for text in 2.0. For PicoPub 2.0 I’m trying to work on a custom font to get more than 35 lines on screen at once vs 25 per this suggestion Program Suggestions / Ideas (Basic) - #30 by BlairLeduc.
There’s a “Embedded Fonts” directory in that archive that contains some samples, a PDF describing the fonts, and the FontTweak tool (Windows program). When I edited (or created) fonts, I used FontTweak to load up an existing font, and then toggled pixels on and off with the mouse. FontTweak’s interface doesn’t make that easy, and even running at 1080p it made targeting with the mouse for each pixel a bit of a challenge. I can’t imagine how horrible the experience would be at a higher resolution, and it might even be worth considering running it on a monitor that’s even lower resolution that 1080p. FontTweak can export out the .bas file definition though, which is why I ended up using it. I still hand edited the file it produced to fix the comments, header, and sometimes formatting, but it spits out the data correctly and that was the main thing I wanted.
Someone mentioned on the forums they might be considering building a font editor in MMBasic to run on the PicoCalc and I’m looking forward to that if it happens, because we currently don’t have any good tools to edit fonts. FontTweak is better than nothing, but still frustrating to use, and for folks who don’t have access to a Windows machine and a low enough resolution monitor, it might not even be usable at all. I suspect it would probably work under Wine since it seems to be a relatively simple Win32 application, but I didn’t try.