Sr. Developer @easytechgreen

Week of the 07/04/2022 - #27

Contents

tech

  • Rendering fonts in SDL
  • Some demos from the Traction scene group
  • Smartport Nano Shield and other variations for the Apple IIc
  • Prog8: a compiled programming language targeting the 8-bit 6502
  • Learn OpenGL
  • TensorFlow Lite

science

  • Newton Fractal

art

  • Netflix Documentaries for Graphic Designers

Newton Fractal

The Newton fractal is a boundary set in the complex plane which is characterized by Newton’s method applied to a fixed polynomial p(Z) ∈ ℂ[Z] or transcendental function. It is the Julia set of the meromorphic function z ↦ z − p(z) / p′(z) which is given by Newton’s method. When there are no attractive cycles (of order greater than 1), it divides the complex plane into regions Gk, each of which is associated with a root ζk of the polynomial, k = 1, …, deg(p). In this way the Newton fractal is similar to the Mandelbrot set, and like other fractals it exhibits an intricate appearance arising from a simple description. It is relevant to numerical analysis because it shows that (outside the region of quadratic convergence) the Newton method can be very sensitive to its choice of start point.

You can read the full article in wikipedia

Here are some example images generated from the equations:

Newton Fractal sample 1

Newton Fractal sample 2

Newton Fractal sample 3

Rendering fonts in SDL

I’m working on simulating VGA textmode with SDL on Linux. To render the fonts I need to get the bitmaps of the PC era VGA characters. This is a great resource:

I ended up using the fonts that are used in the Moebius ASCII editor. For fonts that are 8 pixels wide (the ones I need) the files have a very basic structure: n bytes for each character where each byte corresponds to one row. To create an image with all 256 characters I wrote a small python script that reads the font files and outputs an 128x128 PBM file (Netpbm) to the standard output:

from struct import *

def outputRow(buffer):  
    for y in range(0,8):
        line = ''
        for x in range(0,16):
            b = buffer[x*8+y]
            for bit in range(8,0,-1):
                if b & (1 << (bit-1)) == 0:
                    line = line + "1"
                else:
                    line = line + "0"
        print(line)
fileName = 'CP437.F08'

print("P1")
print("128 128")
row = 0
col = 0
with open(fileName, mode='rb') as file:
    fileContent = file.read()
    for i in range(0,16):
        outputRow(fileContent[i*8*16:(i+1)*8*16])

Here’s the output for the 8x8 VGA font:

8x8 VGA Font

Some demos from the Traction scene group

PICO-8 Tweetcarts

“Tweetcarts are PICO-8 cartridges whose code fits inside a single tweet. Basically, you can copy the code, paste it into a blank PICO-8 cart, and see the same effect that’s shown in the original tweet.”

Smartport Nano Shield and other variations for the Apple IIc

It is possible to use an Arduino Nano (or an ESP32) to connecta an SD card to the Apple IIc floppy port and provide software via FAT formatted SD cards. The wiring is pretty simple and doesn’t require much. Here’s all the info:

  • Smartport Nano Shield Github page - This repo has the diagrams to create a board for the Arduino + SD Card reader to connect to the Apple IIc.
  • SmartportSD FAT - This is an enhancement of the SmartportCFA/SmartportSD project by Robert Justice and Andrea Ottaviani. Instead of relying on four raw disk images written sequentially to an SD card, this version allows you to have up to four files on a FAT or FAT32 formatted SD card instead. The software that runs the shield is here.
  • Interactive bill of materials for the shield - This is an interactive BOM that shows what components you need.
  • Hardware Component Choices and Assembly - This page details the hardware requirements. Here’s the summary:
    • 16Mhz ATMEGA328P board running at 5V.
    • Micro SD Card Connector - 5PCS for Micro SD Storage Board for Mciro SD TF Card Adapter Memory Shield Expansion Module SPI For Arduino AVR Microcontroller. Sometimes it may say “Catalex” (maybe the original designer?) on the back of the PCB.

Micro SD Module

  • The Apple IIc Smartport firmware listing (PDF) - This is the assembly code that controls de Smartport on the Apple IIc.
  • Apple //c Smartport Compact Flash Adapter - This is what inspired the Arduino version.
  • Port to Arduino - This is the first version of the Arduino port.

  • FujiNet 8-Bit Computer Network Adapter - I found the previous project because it was mentioned in the Kansasfest 2022 stream in a talk about the FujiNet. “FujiNet is a multi-peripheral emulator and WiFi network device for vintage computers. The first completed hardware was for the Atari 8-Bit line of computers and development has begun for other systems (Coleco ADAM, Apple II, Commodore 64, Atari Lynx, ZX Spectrum and more) with the goal of supporting as many old systems as possible.”. The FujiNet is based off an ESP32 and is much more powerful than the Arduino version: it has the same functionality of the Arduino version but can also boot from the network, allow you to connect online, act as a printer and do a lot more stuff. The only drawback (for me) is that it requires an ESP32 version which is difficult to source here in Argentina (the ESP32-WROVER instead of the more available ESP32-WROOT). When I get an ESP32-WROVER I’ll try to build my own FujiNet.
  • Board Bring Up Hardware - This document will take you thru most of the steps needed to source, build, and setup the FujiNet hardware to connect and interface with specific platform. The software bring up is covered in the Board Bring Up Software document. It has been created with valuable snippets of information that has been posted on the Discord server and by research notes and diagrams from various team members working on FN and communicating via Discord.
  • the #FujiNet wiki - All the documentation related to the FujiNet.
  • The FujiNet Atari Network Adapter Project Gitub page - The repos for the project.
  • IRATA.ONLINE Patreon site - Creating retro-computing connectivity solutions.

Prog8: a compiled programming language targeting the 8-bit 6502

This is a compiled programming language targeting the 8-bit 6502 / 6510 / 65c02 microprocessors. This CPU is from the late 1970’s and early 1980’s and was used in many home computers from that era, such as the Commodore-64. The language aims to provide many conveniences over raw assembly code (even when using a macro assembler), while still being low level enough to create high performance programs. You can compile programs for various machines with this CPU:

  • Commodore 64
  • Commander X16
  • Commodore 128 (limited support for now)
  • Atari 800 XL (limited support for now)

  • Manual - The documentation
  • Github project - the Github project
  • Petaxian - A sample Galaxian like game coded in prog8

Learn OpenGL

  • Learn OpenGL web - “Since you came here you probably want to learn the inner workings of computer graphics and do all the stuff the cool kids do by yourself. Doing things by yourself is extremely fun and resourceful and gives you a great understanding of graphics programming. However, there are a few items that need to be taken into consideration before starting your journey.”

TensorFlow Lite

There is a TensorFlow version for microcontrollers and someone made a C64 version! Here are a couple of links:

  • TensorFlow Lite Micro: Embedded Machine Learning on TinyML Systems - The original paper. Abstrace: “Deep learning inference on embedded devices is a burgeoning field with myriad applications because tiny embedded devices are omnipresent. But we must overcome major challenges before we can benefit from this opportunity. Embedded processors are severely resource constrained. Their nearest mobile counterparts exhibit at least a 100 – 1,000x difference in compute capability, memory availability, and power consumption. As a result, the machine-learning (ML) models and associated ML inference framework must not only execute efficiently but also operate in a few kilobytes of memory. Also, the embedded devices’ ecosystem is heavily fragmented. To maximize efficiency, system vendors often omit many features that commonly appear in mainstream systems, including dynamic memory allocation and virtual memory, that allow for cross-platform interoperability. The hardware comes in many flavors (e.g., instruction-set architecture and FPU support, or lack thereof). We introduce TensorFlow Lite Micro (TF Micro), an open-source ML inference framework for running deep-learning models on embedded systems. TF Micro tackles the efficiency requirements imposed by embedded-system resource constraints and the fragmentation challenges that make cross-platform interoperability nearly impossible. The framework adopts a unique interpreter-based approach that provides flexibility while overcoming these challenges. This paper explains the design decisions behind TF Micro and describes its implementation details. Also, we present an evaluation to demonstrate its low resource requirement and minimal run-time performance overhead.”. PDF version of the paper
  • TensorFlow Lite for Microcontrollers - Official page in Google’s TensorFlow page. “TensorFlow Lite for Microcontrollers is written in C++ 11 and requires a 32-bit platform. It has been tested extensively with many processors based on the Arm Cortex-M Series architecture, and has been ported to other architectures including ESP32. The framework is available as an Arduino library. It can also generate projects for development environments such as Mbed. It is open source and can be included in any C++ 11 project.”
  • TensorFlow Lite for Microcontrollers - Github Page - Official Github page.
  • TensorFlow Lite for Commodore 64s - The C64 version

Netflix Documentaries for Graphic Designers

Top 10 Netflix Documentaries for Graphic Designers

  1. Abstract: The Art of Design
  2. The Toys that Made Us
  3. High Score
  4. The Andy Warhol Diaries
  5. Print the Legend
  6. Struggle: The Life and Logs Art of Szukalski
  7. They’ll Love me when I’m Dead
  8. The B-Size: Elsa Dorman’s Portrait Photograppy
  9. The Creative Indians
  10. Bob Ross: Happy Accidents, Betrayal & Greed