Skip to content

Repository files navigation

Rdon Type 100

Rdon Type 100 is a multilingual typing game for the M5Stack Cardputer ADV, built with TinyGo and ModGadget.

The game includes Japanese, English, Simplified Chinese, Korean, and mixed-language courses. Each course contains 20 questions and records the completion time and number of typing mistakes.

Rdon Type 100 is also a demonstration of building an application-level multilingual UI on a microcontroller.

Instead of implementing display control, font rendering, text layout, scrolling, keyboard handling, and audio directly inside the game, the application uses the public APIs provided by ModGadget and ModGadget Fonts.

Rdon Type 100 running on the M5Stack Cardputer ADV

Why this project

Small embedded applications often combine display initialization, font rendering, input scanning, layout, animation, and device-specific control directly in one application.

Rdon Type 100 takes a different approach.

The game is built as an application on top of reusable ModGadget APIs for:

  • display output
  • multilingual bitmap fonts
  • styled text layout
  • Viewports
  • scrolling
  • keyboard events
  • Cardputer ADV device configuration
  • cooperative audio playback
  • software volume control

The game repository imports only public Go packages. ModGadget and ModGadget Fonts are ordinary Go module dependencies and do not need to be cloned beside the application.

This makes Rdon Type 100 both a playable application and a practical demonstration of the reusable embedded application foundation provided by ModGadget.

Features

  • Five courses:

    • Japanese
    • English
    • Chinese
    • Korean
    • All Languages
  • 20 questions per course

  • Japanese, Simplified Chinese, Korean, and Latin bitmap-font rendering

  • Course-specific scrolling instructions

  • Startup, cursor, correct-answer, and mistake sound effects

  • Four-level software volume control, including mute

  • Completion time and miss-count results

  • Direct execution on the M5Stack Cardputer ADV

  • UI, text layout, keyboard input, display control, and audio powered by ModGadget

  • Public Go module dependencies without repository-internal imports

Screens

Title and course menu

After startup, Rdon Type 100 displays its title and opens a menu containing the five available courses.

Use the Cardputer ADV key combinations to move through the menu. Selection wraps at both ends.

Rdon Type 100 course selection menu

Typing screen

The playing screen shows:

  • Elapsed time
  • Current question number
  • Required lowercase ASCII input
  • Multilingual prompt text
  • Framed input field
  • Scrolling instructions for the selected course

Rdon Type 100 multilingual typing screen

Result screen

After all 20 questions are completed, the final time and total number of mistakes are displayed.

Rdon Type 100 result screen

Courses and input

Japanese

Japanese is written with a mix of three scripts: hiragana, katakana, and kanji. Prompts are displayed with Japanese bitmap glyphs, so you can see the word as it is normally written.

You do not need a Japanese keyboard or an IME to play. Every question stores a fixed romanization — the Latin-alphabet spelling of how the word sounds — and that spelling is what you type, in lowercase. A word shown as 桜, for example, is answered by typing sakura.

Japanese words can often be romanized in more than one way. Only the spelling stored with each question is accepted.

English

English prompts use the Latin alphabet directly, so no romanization is needed. Type the displayed word in lowercase.

Chinese

Chinese is primarily written with characters rather than an alphabet, so pronunciation is not written out directly as a sequence of letters. Prompts use Simplified Chinese bitmap glyphs.

Answers are typed in pinyin, the standard system for writing Mandarin pronunciation in the Latin alphabet. Pinyin normally marks the four tones with accents (, , , ) or with trailing digits (ma1, ma2), but this game uses neither. Type the bare lowercase letters only, with no spaces between syllables: 学校 is answered as xuexiao.

Korean

Korean is written in Hangul, an alphabet whose letters are grouped into square syllable blocks. Prompts are displayed with Korean bitmap glyphs.

Hangul keyboard input is not required. Each question stores a fixed lowercase romanization, and that is what you type. A word shown as 학교 is answered by typing hakgyo.

As with Japanese, several romanization systems exist for Korean. Only the spelling stored with each question is accepted.

All Languages

The mixed-language course alternates between Japanese, English, Chinese, and Korean. It contains five questions from each language.

Input rules

Type the exact lowercase ASCII answer associated with the displayed question.

Uppercase letter input is normalized to lowercase. The following forms of input are not currently supported:

  • Alternative romanizations
  • Spaces or punctuation in answers
  • Chinese tone marks
  • Chinese tone numbers
  • IME composition
  • Hangul keyboard input

A wrong letter does not advance the input and increments the miss count.

Controls

Course menu

Action Key
Move up Fn+;
Move down Fn+.
Start selected course Enter

During play

Action Key
Type answer Letter keys
Abandon the current game and return to the menu Fn+Backspace
Increase volume Fn+=
Decrease volume Fn+-
Toggle mute Fn+M

Result screen

Action Key
Return to the course menu Enter

Prebuilt firmware

Prebuilt firmware for the M5Stack Cardputer ADV is available from GitHub Releases.

Firmware asset:

rdon-type100-cardputer-adv.bin

You can also download the latest firmware directly:

Download the latest Cardputer ADV firmware

The prebuilt firmware is intended for the M5Stack Cardputer ADV.

To flash the downloaded firmware without building TinyGo, use Espressif's official web-based ESP Launchpad.

ESP Launchpad requires a browser with Web Serial support, such as Chrome or Edge. Firefox and Safari do not currently support Web Serial. Close any serial monitor or other program using the port before flashing, because the serial port can only be opened by one program at a time.

Connect the Cardputer ADV by USB, select rdon-type100-cardputer-adv.bin as a local firmware image, and use flash address:

0x0

The released firmware image has been verified by flashing it directly at 0x0 and booting it on an M5Stack Cardputer ADV.

Building the application from source is not required if you only want to run the prebuilt firmware. The following sections describe how to reproduce the build using TinyGo.

Project repositories

Rdon Type 100 is the complete application. Its reusable components and examples are maintained in separate repositories.

Repository Purpose
rdon-type100 This multilingual typing game
modgadget TinyGo UI, display, keyboard, and audio foundation
modgadget-fonts Importable multilingual MGF bitmap-font packages
modgadget-examples Standalone examples using public ModGadget APIs

Font source assets, generation, provenance, and validation are maintained separately in modgadget-font-assets.

Requirements

Hardware

  • M5Stack Cardputer ADV
  • USB cable for flashing and power

Software

The following software is required only when building Rdon Type 100 from source:

  • Git
  • Go toolchain compatible with the required TinyGo development revision
  • TinyGo 0.42.0-dev
  • ESP32-S3 large-flash patch from tinygo-org/tinygo#5567

The application uses ModGadget and ModGadget Fonts as Go module dependencies. They are downloaded automatically and do not need to be cloned manually.

TinyGo setup

Rdon Type 100 cannot currently be built with a released version of TinyGo. It requires TinyGo 0.42.0-dev built from the TinyGo dev branch, which includes support for the M5Stamp-S3A.

The application also embeds large multilingual MGF font assets. Its firmware therefore requires the ESP32-S3 large-flash fix provided by PR #5567.

Without this fix, the ESP32-S3 ROM bootloader may reject the firmware image before TinyGo startup code begins executing.

1. Build TinyGo from source

Follow the official TinyGo instructions to prepare and build a development version:

Complete the appropriate instructions for your operating system before continuing.

A manual LLVM build is required when:

  • Building TinyGo on Windows
  • Building TinyGo for ESP32 targets
  • Using a system that does not provide a compatible LLVM version

The official additional-requirements instructions also include the generated files and external tools required for bare-metal targets.

After completing the official procedure, you should have:

  • A TinyGo source checkout
  • The dev branch selected
  • LLVM built or otherwise configured as required
  • TinyGo successfully built once
  • Bare-metal device files generated
  • A TinyGo executable under the repository's build directory

2. Apply the ESP32-S3 large-flash patch

Open a shell in the TinyGo source repository.

On Windows, use Git Bash for the TinyGo build commands.

Make sure the checkout is on the current dev branch:

cd <PATH-TO-TINYGO>

git switch dev
git pull --ff-only
git status --short

The working tree should be clean before applying the patch.

Fetch and cherry-pick PR #5567:

git fetch origin pull/5567/head
git cherry-pick FETCH_HEAD

The patch currently corresponds to the following commit:

d9c452831c7ad2f760158d65c483122b9cf65dd2

If PR #5567, or an equivalent ESP32-S3 large-flash fix, is already included in the selected TinyGo revision, do not cherry-pick it again.

You can check whether the commit is already present with:

git branch --contains d9c452831c7ad2f760158d65c483122b9cf65dd2

3. Rebuild TinyGo

Rebuild TinyGo after applying the patch:

make

If the bare-metal device files were not already generated while following the official build instructions, also run:

make gen-device

The resulting TinyGo executable is placed in the repository's build directory.

Linux and macOS:

./build/tinygo version

Windows from Git Bash:

./build/tinygo.exe version

The output should identify a TinyGo 0.42.0-dev build containing the required ESP32-S3 patch.

When building Rdon Type 100, either add the TinyGo build directory to PATH or invoke the development executable by its full path.

For example, on Windows from a sibling project directory:

../tinygo/build/tinygo.exe version

Clone Rdon Type 100

Clone the application repository:

git clone https://github.com/rdon-key/rdon-type100.git
cd rdon-type100

Download its Go module dependencies:

go mod download

ModGadget and ModGadget Fonts are obtained automatically through the Go module system.

Build

If the patched TinyGo development executable is available as tinygo in PATH, build the application with:

tinygo build \
  -target=m5stamp-s3a \
  -o rdon-type100-cardputer-adv.bin \
  .

This creates:

rdon-type100-cardputer-adv.bin

When the development build is not in PATH, invoke it directly.

Linux and macOS example:

<PATH-TO-TINYGO>/build/tinygo build \
  -target=m5stamp-s3a \
  -o rdon-type100-cardputer-adv.bin \
  .

Windows Git Bash example:

<PATH-TO-TINYGO>/build/tinygo.exe build \
  -target=m5stamp-s3a \
  -o rdon-type100-cardputer-adv.bin \
  .

Flash from TinyGo

Connect the Cardputer ADV by USB.

When only one compatible board is connected, TinyGo can normally detect the serial port automatically on both Windows and Linux:

tinygo flash \
  -target=m5stamp-s3a \
  .

When using the TinyGo development executable directly:

<PATH-TO-TINYGO>/build/tinygo flash \
  -target=m5stamp-s3a \
  .

On Windows:

<PATH-TO-TINYGO>/build/tinygo.exe flash \
  -target=m5stamp-s3a \
  .

If multiple serial devices are connected, or automatic detection does not select the correct device, specify the port explicitly.

Windows

Windows serial ports use names such as COM6:

tinygo flash \
  -target=m5stamp-s3a \
  -port=COM6 \
  .

Linux

Linux serial ports commonly use names such as /dev/ttyACM0 or /dev/ttyUSB0:

tinygo flash \
  -target=m5stamp-s3a \
  -port=/dev/ttyACM0 \
  .

On Linux, the current user may need permission to access the serial device.

On Debian- and Ubuntu-based systems, serial-port access is commonly granted through membership in the dialout group:

sudo usermod -aG dialout "$USER"

Log out and sign in again after changing group membership.

Flash and open the serial monitor

TinyGo can flash the application and then open its serial monitor:

tinygo flash \
  -target=m5stamp-s3a \
  -monitor \
  .

When necessary, specify the serial port explicitly:

tinygo flash \
  -target=m5stamp-s3a \
  -port=<PORT> \
  -monitor \
  .

Replace <PORT> with a value such as:

  • COM6 on Windows
  • /dev/ttyACM0 on Linux

When only one compatible board is connected, the port can normally be omitted on both platforms.

Test

The game logic can be tested with the standard Go toolchain:

go test ./...

The tests cover areas including:

  • Course and question data
  • Game-state transitions
  • Input processing
  • Text measurements
  • Markup validation
  • Font glyph coverage
  • Display layout assumptions
  • Audio-event behavior

The standard Go tests do not access the Cardputer ADV hardware.

Before flashing or publishing a firmware image, also build the complete application with the required patched TinyGo development version.

Dependencies

Rdon Type 100 uses public packages from the following modules.

ModGadget

github.com/rdon-key/modgadget

ModGadget provides:

  • UI layout and rendering
  • Markup-aware text measurement
  • Keyboard events
  • Viewports and scrolling text
  • Cardputer ADV display configuration
  • Cardputer ADV keyboard configuration
  • Cooperative Cardputer ADV audio playback
  • Volume control

ModGadget Fonts

github.com/rdon-key/modgadget-fonts

ModGadget Fonts provides:

  • Efont 16-dot multilingual bitmap font
  • Efont 24-dot multilingual bitmap font

The application imports only public ModGadget and ModGadget Fonts packages. It does not import ModGadget internal packages and does not require a local ModGadget repository checkout.

The main application uses the following public packages:

  • github.com/rdon-key/modgadget
  • github.com/rdon-key/modgadget/device/cardputeradv
  • github.com/rdon-key/modgadget-fonts/efont16
  • github.com/rdon-key/modgadget-fonts/efont24

The Cardputer ADV device package provides the board-specific display, keyboard, and audio configuration used by the application. It is imported as board in the application source.

Technical overview

Fonts and text

The title, menu, and romanized input use the Efont 16-dot MGF font.

Prompts, status text, input fields, and scrolling instructions use the Efont 24-dot MGF font.

Text measurement and layout are handled through ModGadget's public font API. The application does not access raw glyph bitmaps, MGF indexes, font-engine internals, or the internal markup parser.

Display and scrolling

Static title and menu text use ModGadget's direct rendering path.

The course guide is rendered through a ModGadget Viewport and scrolls continuously along the bottom of the display.

The guide language follows the selected course. The All Languages course combines the Japanese, English, Chinese, and Korean guides.

Keyboard

The Cardputer ADV keyboard is configured through ModGadget's public Cardputer ADV device package.

Keyboard events are converted into game input without requiring an IME.

Audio

Audio playback is cooperative and non-blocking.

The main loop updates:

  • Display state
  • Keyboard input
  • Game state
  • Scrolling text
  • Audio playback

No additional operating system or background audio task is required.

Sound effects are provided for:

  • Startup
  • Cursor movement
  • Correct input
  • Incorrect input

The player also provides volume increase, volume decrease, and mute controls.

License

The application source is licensed under BSD 3-Clause. See LICENSE.

The firmware also embeds bitmap glyph data derived from efont, which is distributed under its own terms. See modgadget-font-assets for font provenance and licensing.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages