Paolo Amoroso's Journal

Tech projects, hobby programming, and geeky thoughts of Paolo Amoroso

This is the 200th post over 10 months of my blog hosted at Write.as. The milestone is even more significant considering I published 146 posts over 3 years to my previous blog hosted at the bloated, inflexible, and clunky old Blogger.

I credit the milestone in large part to Write.as, a lightweight blogging platform that nearly eliminates friction with its Markdown support and minimalist design.

Typing into the Write.as editing area is all it takes to insert, format, and present the content of a post. With Blogger, even basic text formatting requires laboriously moving and clicking the mouse to select text, click icons, pick menu items, and apply formatting. It all adds up to enough friction to dread the experience and be discouraged from posting.

I started this blog on February 28, 2022. I stumbled upon Write.as at the end of a long research process that led to the best platform for my technical writing needs.

#blogging

Discuss... Email | Reply @amoroso@fosstodon.org

I'm always looking for terminal emulators and communication programs for controlling the Z80-MBC2 and V20-MBC, hoping they provide useful features Minicom misses.

That's why when stumbling upon CuteCom I eagerly checked it out. CuteCom is a graphical serial terminal program for Linux with a clean and simple user interface.

I tried it in Crostini Linux on my Chromebox connected to the Z80-MBC2 and the V20-MBC. The layout of CuteCom's window reminds me of the Serial USB Terminal app for Android which, unlike Minicom's single input and output area, has an input field separate from the output area.

The basic features of CuteCom are okay, but the program has major limitations when used with my homebrew computers. The main one is the program does no terminal emulation, doesn't support the escape codes for terminal control, and doesn't even properly align the output of a simple program like DIR. This screenshot of a V20-MBC CP/M-86 session shows the issue:

CuteCom terminal connected to a V20-MBC homebrew CP/M-86 computer.

I checked out CuteCom also with the Z80-MBC2 and tried to upload a file with XMODEM to a CP/M Plus session. However, an error informed CuteCom was unable to start the Linux program sz. There were no other clues and CuteCom has no documentation, so I have no idea what may be wrong. sz seems correctly set up under Crostini.

Given these issues, I can't unfortunately use CuteCom with the Z80-MBC2 and the V20-MBC.

The program is not a full terminal emulator to run programs that send terminal control codes to format the output. Instead, it's designed for the different use case of accessing electronic boards, embedded systems, and other devices via a serial connection, which typically produce line-oriented output.

#z80mbc2 #v20mbc

Discuss... Email | Reply @amoroso@fosstodon.org

The great experience with Mastodon and the Fediverse made me curious about other decentralized and federated platforms.

As the next step, I decided to check out the Matrix messaging and communication network. Browsing the list of the main homeservers led me to join aria-net.org, the only one in Italy where I live.

As Matrix clients I use the Element web app on my Chromebox and the Element Android app on my Pixel 4 XL. Element has a clean, modern design the developers rightly describe as “glossy”. I also love the Markdown support, a key productivity feature. There are several features and settings I need to study in more detail, especially the message encryption options.

However, my experience with the Matrix infrastructure has been a bit bumpy so far as the homeserver has configuration, stability, and certificate issues.

When signing up, an error reported the handle of my account was already in use, but the server let me sign in with and use it anyway. As prompted, I tried to verify my phone numer but received another error. According to the server's help desk phone verification was disabled.

Sometimes the Element web app doesn't load or is slow. But an even more serious issue prevents me from using the web app. For the past severel days, visiting the website has been returning the error NET::ERR_CERT_COMMON_NAME_INVALID due to certificate issues.

If these issues persist, I will have to migrate to a more stable homeserver. It won't be a problem as only one of my contacts uses Matrix so far.

#misc

Discuss... Email | Reply @amoroso@fosstodon.org

I'm collecting and reading more Pascal programming books than I ever did.

My Z80-MBC2 and V20-MBC come with Turbo Pascal for CP/M preinstalled. Using the environment is making me rediscover Turbo Pascal and realize it's great for creating small CP/M tools and programs.

To take advantage of Turbo Pascal I have been gathering old books and other Pascal learning resources that cover the CP/M version I use, selecting only the best and most interesting.

All of them are available online, for example at the Open Library or Bitsavers.org. But these works are too precious and may disappear, not to mention the high prices of rare retrocomputing books. I want backups, so I bought used copies of some of these. Here's what my Pascal programming retro bookshelf looks like:

Pascal programming books.

These are the Pascal books and resources I reference most often, along with notes on what they cover or why I like them:

#pascal #retrocomputing #books

Discuss... Email | Reply @amoroso@fosstodon.org

I’m typing this with a keyboard that is cheap and looks cheap. And I’m loving it.

My appreciation for cheap keyboards began with my first Chromebook, an Acer C720 I got to learn and explore chromeOS. I loved the device so much I switched to using chromeOS as my only desktop operating system. Back then my daily driver was an i3 ASUS Chromebox 2 hooked to a Logitech K120 full travel keyboard from my last PC.

With the Chromebox as the main desktop machine, I put aside the Chromebook for a while. But something later motivated me to play more with the Chromebook: its keyboard.

The screen of the Acer C720 has notoriously poor viewing angles. But I realized I could improve legibility by setting the Chromebook on a slightly taller desk, which made the viewing angle optimal. This led me to use the device more and appreciate its chiclet keyboard with good feedback.

To have a similar experience on the ASUS Chromebox 2 I used at the time, I bought the only low profile chiclet unit I found that provided the extended Italian layout with accented letters I wanted, an Atlantis Chocolate 1300 wired keyboard. It was cheap and came from a little known manufacturer, but worked great. I began enjoying typing on the Chromebox more and more.

When I upgraded to my current i7 ASUS Chromebox 3, I plugged the Atlantis keyboard into it. However, its cable and that of the mouse contributed to the mess on my desk, so I replaced the input devices with wireless units. I bought a Logitech M220 mouse and, again, the only low profile chiclet keyboard with the required layout I found, this Nilox Kt40W:

Nilox Kt40W wireless chiclet keyboard.

The keyboard cost me all of €14.69. Besides being cheap and from an unknown brand, the plastic finish and feel make it also look cheap.

But I really enjoy using the Nilox keyboard.

Pressing the keys makes a clunky noise, a satisfying kind of clunky with a pleasant feedback. At first the pressure of the keys felt hard, slightly more than the Atlantis. But I eventually got used to the keyboard and came to love it.

#chromeOS

Discuss... Email | Reply @amoroso@fosstodon.org

Write.as, where this blog is hosted, supports embedding rich media from many social platforms and websites such as YouTube videos and Twitter tweets. It's enough to insert in a post the bare URL of the content to embed, on a line by itself, for Writes.as to render the media.

I wonder whether media embedding works also with Fediverse platforms, so this test post includes some of this content. Let's start with a toot of my Mastodon profile:

https://fosstodon.org/@amoroso/109360170388228216

Here is the URL of a PeerTube video:

https://diode.zone/w/9edtkEZ3QcmfMZStyrEjgB

Another option with PeerTube is to insert the HTML video embedding code, as Write.as renders some HTML in Markdown:

Does it work?

After checking out the published post I updated it to report on the embeds.

Write.as doesn't render the URLs of both the toot and the PeerTube video. The HTML embedding code does work, but the rendered video is not responsive and doesn't blend well with the page on mobile.

#blogging #fediverse

Discuss... Email | Reply @amoroso@fosstodon.org

I assumed in Turbo Pascal for CP/M, when printing to a terminal, writeln wraps lines longer than the screen width. A quick test under CP/M-86 on the V20-MBC proved such lines are truncated instead. In hindsight it makes sense, as there's limited output state on a terminal system with no frame buffer.

#v20mbc #retrocomputing #development

Discuss... Email | Reply @amoroso@fosstodon.org

Large tablets and desktop screens are the best for reading PDF ebooks and files.

However, a medium-size Android tablet is the next best thing as tweaking the Google Play Books reading settings provides an acceptable experience. Under these conditions, Google Play Books works better with PDFs than Kindle for Android.

This setup is helping me read more PDF ebooks unlike with my previous tablet, a 7” Lenovo Tab E7. On its small screen, the text of nearly all PDF ebooks and files was too small no matter what reading options were set. Landscape mode didn't help much.

Let’s see why PDFs require specific reading tools, what my setup is, and how I read PDFs.

Reflowable vs fixed-layout ebooks

With reflowable ebook file formats, such as ePub and Mobi, reading apps rearrange the text and other content to fit any screen size, much like web browsers do with HTML pages. Text fills the viewing area while maintaining a comfortable, legible size.

In fixed-layout ebooks like PDF files, the pages have a predetermined size and the text, images, and other document elements are fixed in size and laid out on the page at specific locations. The result looks like the pages of printed books. By default, reading apps zoom out the full page to fit the screen. The smaller the screen, the smaller the text. In addition, blank margins waste part of the page.

This makes it impractical to read PDFs on the screens of smartphones and small tablets. Reading apps allow zooming in the page until the text is legible. But, like looking through a keyhole, you view a small portion of the content at a time and have to drag around the page to bring into view the rest.

Minimum viable tablet

Up to the current one, I always owned 7” tablets like the Lenovo Tab E7.

While great for reflowable ebooks, a 7” screen is too small for comfortably reading nearly all PDFs. Even with the reading settings I discuss here, text remains small. The low resolution of cheap devices pixelates small text and doesn’t help legibility either.

After the Lenovo Tab E7, I switched to a Lenovo Tab M8 HD 8” tablet. An extra inch is enough to make a difference in the PDF reading experience. The screen has the right size so that the text area on the page, when zoomed in to fit the screen width, is large enough for comfortable reading. The low resolution of the Lenovo Tab M8 HD screen doesn’t affect legibility much, as the panel doesn’t degrade it.

With this 8” device, all it takes for a satisfactory experience with PDF files is to turn on two options of the Google Play Books reading settings.

Google Play Books reading settings

Two specific options improve the reading experience with Google Play Books. Although turning them on is a one-time action, there’s an adjustment I need to make at the beginning of every reading session of PDF ebooks.

The one-time options are accessible by opening a PDF book and tapping the page, which brings up the reading controls. Next, I tap the Aa icon and, under Zoom, turn on the Remember zoom and Tap to scroll options. These are the options on my Lenovo Tab M8 HD:

Google Play Books fixed layout reading controls on Android.

Once the one-time configuration is complete, the first thing to do at each new session is to pinch the page to zoom in until the text area fits the width of the screen, with little or no margin. The Remember zoom option preserves that width for the duration of the session. In the example of the previous screenshot, this is the page after zooming the page to fit:

PDF ebook adjusted to fit the screen in Google Play Books on Android.

In most cases, some vertical scrolling is still required to bring the bottom of the page into view.

When turning a page, the zoom level is usually reset and I’d have to drag the text area again to match it to the screen width. This is where the Tap to scroll option comes in, as it lets me scroll down and turn the page by tapping one of the screen's edges. The option takes care of maintaining the text area centered horizontally, with full lines always in view.

These settings and adjustments go a long way to enabling reading more content on compact and affordable devices.

#Android #ebooks

Discuss... Email | Reply @amoroso@fosstodon.org

To code on the Z80-MBC2 and V20-MBC homebrew computers I often transfer text files to and from their CP/M environments.

In one direction I send files from Crostini Linux by dumping them to CP/M, where PIP saves the text to CP/M files. In the opposite direction I run PIP on CP/M to print the files to the screen, where Minicom captures the text and saves it to files on Crostini.

CP/M and Unix have different line break and end of file encodings. In addition, the transfer process may introduce unwanted text. That's why the text files exchanged between the systems need some conversion, to automate which I wrote two short Bash scripts.

The first script, unix2cpm, converts line breaks and the end of file marker in the input to the CP/M encoding and prints the result to stdout. If the optional file name argument isn't supplied the script reads from stdin with a technique I researched. This is the script:

#!/usr/bin/env bash

# Convert line breaks and end of file from Unix to CP/M.
#
# Usage:
#
#   unix2cpm [filename]
#
# Reads from stdin if the optional argument is missing.

input_file="${1:-/dev/stdin}"

cat "$input_file" | unix2dos
echo -e -n '\x1a'

The script calls unix2dos distributed with the dos2unix / unix2dos tools. unix2dos converts line breaks from Unix to MS-DOS, which borrows the encoding from CP/M. unix2cpm needs only to append with echo the ^Z end of file control character.

Once converted, the file is ready to be dumped from Linux to CP/M.

I initiate file transfers in the oppostite direction by executing the Minicom command to capture the terminal output to a file, Ctrl-A L (Capture on/off). Then, at the CP/M prompt, I execute a command like this to print a file to the console:

A>a:pip con:=filename.txt

When printing ends and the A> prompt reappears, I turn off output capture in Minicom to close the capture file. The captured output contains the PIP command in the first line, then the text of the file, and finally the A> prompt in the last line.

To remove the unwanted first and last line I wrote the second script, skipfl (skip first and last). Again, the script reads from stdin if the optional file name isn't supplied and writes to stdout. The code is:

#!/usr/bin/env bash

# Skip the first and last file of the argument file
#
# Usage:
#
#   skipfl [filename]
#
# Reads from stdin if the optional argument is missing.

input_file="${1:-/dev/stdin}"

cat "$input_file" | sed '1d' | sed '$d'

The script calls sed to delete the first and last line with the d command.

No further processing of the captured CP/M output file is necessary as Minicom takes care of inserting the proper line break and end of file encodings.

#z80mbc2 #v20mbc #linux #retrocomputing

Discuss... Email | Reply @amoroso@fosstodon.org

Turbo Pascal 3.0 for CP/M has a display issue I noticed on the Z80-MBC2 and V20-MBC homebrew computers. When using the development environment, text in the terminal remained stuck with boldface turned on.

It was enough to launch Turbo Pascal and execute any command (e.g. compiler Options), or exit Turbo Pascal, to turn on boldface and leave it stuck in the IDE, in CCP, and when running other programs. Everything went bold such as code in source files edited in Turbo Pascal, CCP command lines, and the output of transient programs.

The issue occurred under CP/M 3.0 on the Z80-MBC2 and CP/M-86 1.1 on the V20-MBC, both accessed from the Minicom terminal emulator under Crostini Linux on my Chromebox.

I tried ANSI and VT102 emulation in Minicom and run the Turbo Pascal configuration utility TINST to set the terminal to ANSI, but the issue persisted. The only workaround was to resize the terminal window, which reinitializes the display.

I posted to comp.os.cpm for help and learnt Borland left the terminal reset string blank in the ANSI entry, which thus doesn't reset text attributes.

The fix was simple. I run TINST, selected the ANSI terminal, and edited the definition to insert the following reset string via the option Send a reset string to the terminal (the corresponding escape code strings and descriptions are below the hex values):

$1b $63    $1b  $5b $32 $4a

ESC c      ESC  [   2   J
Reset      Clear screen

ESC c is not enough as it only resets the terminal but doesn't clear the screen. With the new string the text attributes are now properly handled and the terminal is no longer stuck in boldface after using Turbo Pascal.

#z80mbc2 #v20mbc #retrocomputing

Discuss... Email | Reply @amoroso@fosstodon.org

Enter your email to subscribe to updates.