Project · HxH Translator for DSi

By · November 26, 2026 · 14 min read

Reading Hunter × Hunter script on a Nintendo DSi

The HxH Translator's three modes, Read, Write and Learn, rebuilt for a handheld from 2008: a Rust app on a 133 MHz ARM9, a 3D beetle drawn by the console's own toon hardware, and a 100 KB int8 reader that does a fifth of the web reader's arithmetic and reads a line through the DSi's camera.

Status, November 27, 2026. The app runs on a real DSi and has passed the owner's tests there, and version 0.3.0 is a free download on itch.io. It reads with dsi_v2, which also reads the cross × of the anime's episode titles. Its source code is not published. Its reader models, dsi_v2 and dsi_v1, are on Hugging Face with the other models.

The DSi app's home: the brown 3D beetle on a sky-blue card with hollow Hunter letters behind it, and an OPEN button on the touch screen.Home, lid shut
The beetle opened, wings up, with three mode cards below: READ, WRITE and LEARN.Opened: pick a mode
Read mode: a line of Hunter script in a green guide bar, read as ハンター シケン, hantā shiken, with a transcript below.Read: one line
Fig. # — The app's own screens, top screen above the touch screen, rendered on a PC by the same Rust code the console runs (the 3D beetle by a software model of the DS's 3D chip). The Read shot uses a test camera that draws a sign; no real photo is used anywhere in this post.

The HxH Translator is a web app with three modes: Read points a phone's camera at Hunter script and turns it into kana and Latin letters, Write turns what you type into Hunter script, and Learn teaches the alphabet. This post is about putting all three on a Nintendo DSi, a handheld from 2008 with two small screens, a stylus, a camera and a 133 MHz processor. The hardest part was Read: a PC reads a line in about a millisecond, and the DS, in an emulator, took eleven seconds. It took a reader that does a fifth of the arithmetic, and hand-written ARM kernels, to bring that down.

A beetle that opens with the lid

The web app's mascot is a beetle whose wings open to show a screen. The DSi is a clamshell, so the idea wrote itself: opening the console opens the beetle. The top screen is the beetle's screen; the bottom touch screen is the panel with the buttons. The three modes stay as they are on the web.

Before any code, the screens were drawn as a page of twelve mockups, each a real 256 × 192 canvas scaled only by whole numbers so every DS pixel shows. Nothing on that page was retyped: it imported the web app's own glyph renderer, beetle model, Learn data and romaji converter. Drawing them settled a few things early. The Hunter Exam's four answers sit where the Y, X, B and A buttons are, so the stylus is optional. Learn's example glyph is ク, not ネ, because ネ is a single closed stroke in Hunter script and can't show stroke order; ク has three.

What the hardware offers decided most of the rest:

133 MHzARM946E-S processor (67 MHz in original-DS mode), with no instructions that work on many small numbers at once
16 MBof memory (4 MB on an original DS)
2 × 256 × 192screens; the bottom one is a touch screen for a stylus
640 × 480two cameras, inner and outer
2,0483D polygons a frame, with toon shading and outlines built into the chip
SD cardfor saving stickers, progress and a reading log

The toon shading was a gift: the web draws the beetle with flat bands of colour and an ink outline, and the DS's 3D chip does exactly that in hardware. The processor was the problem. The web's Fast reader takes 154 million multiply-adds (MACs) to read one line. At a guessed 30–60 million a second, that is 2.6–5 seconds a line, and the line finder that finds text on a whole page would take most of a minute. So the DSi's Read does not look for lines. You aim one line into a guide bar, and only that line is read.

C for the hardware, Rust for the rest

DS homebrew is mostly written in C; this app uses BlocksDS, a free toolchain and set of libraries. Rust can target the DS's processor too (thumbv5te-none-eabi, a nightly-only target), and the project's int8 engine was already written in Rust without the standard library. So the app is split: a thin C layer owns the hardware, and Rust does everything else.

Who owns what
C calls Rust once a frame; Rust asks the hardware for things through a short list of commands

C · BlocksDS

owns the hardware

  • waits for each screen refresh and copies the rows Rust changed
  • 3D: the beetle's display lists, toon table and outlines
  • sound, through maxmod
  • the cameras, the SD card and the files inside the ROM
  • the lid, sleep and the clock
buttons, stylus, date two screens + commands: play a sound, pose the beetle, start the camera

Rust · no_std

everything else

  • every scene: home, Read, Write, Learn
  • draws both screens into 16-bit pictures, with its own font renderer
  • Hunter glyph layout and the kana rules
  • Learn's similarity, exams and puzzles
  • the int8 reader, with ARM9 kernels in fast on-chip memory
Fig. # — The split. The Rust side is a static library linked into the BlocksDS build; the first ROM that drew text this way was 140 KB.

The Rust side is ports of the web app's JavaScript: the kana converter, the Hunter glyph layout, Learn's similarity measure and puzzles. A port can drift from the original in small ways, so every port is tested against the web app's own code. Node scripts run the JavaScript and save its answers, and the Rust tests must match them:

  • the kana converter: 0 mismatches over 5,437 distinct inputs and 10,769 conversion cases;
  • the glyph layout: within 0.0001 of the font size in 120 cases, and text widths within 0.1 px of what Chrome measures;
  • Learn's similarity: all 3,403 pairs of chart kana within 0.00000054 of the font size, the same 200 lookalike lists, 15 seeded exams and 440 days of daily puzzles.

The similarity port needed a second try. Its first version used rounded fixed-point coordinates, and 5 of the 200 lookalike lists came out in a different order. The JavaScript has exact ties (ハ, バ and パ are the same shape apart from their marks) and gaps as small as 0.0000046, so rounding was enough to swap neighbours. Integer coordinates with more bits, taken straight from the glyph data, fixed it.

The tests also found two bugs in the web app itself. Typing the name “Reā” made Write show リーundefined, and the word “constructor” was looked up as JavaScript's own Object function, so the bar showed function Object() { [native code] }. Both are now fixed in the web app's code too.

Six tracks at once

Once the skeleton drew Hunter text in an emulator (melonDS), the work was split into six tracks that ran at the same time, each in its own AI coding session with its own files, and reported back to a coordinating session that merged them, kept the journal and did the checks in the emulator. All six finished in about an hour.

Table # — The six tracks and what each one delivered.
trackwhat it builtthe number that mattered
A textThree free fonts (Dela Gothic One, M PLUS 1p, M PLUS 1 Code) baked into 46 bitmap fonts with kerning; 482 interface strings in English and Japanese.A frame of handwriting went from 72.8 µs to 1.0 µs on the PC by redrawing only the box that changed (a median of 77 pixels instead of 49,152).
B beetleThe web's beetle exported from its own code, cut down, and baked into DS display lists with a toon table and outlines.25,736 triangles down to 1,484; about 800 polygons a frame of the 2,048 allowed.
C WriteThe kana converter and the 12-key multi-tap pad, with the web's timings.0 mismatches over 5,437 inputs; two web bugs found.
D LearnThe chart, its 200 example words, 42 puzzles, the similarity measure, and a new score for tracing with the stylus.Perfect tracings earn 3 stamps for all 83 kana; no lookalike earns 2 or more.
E ReadThe int8 engine built for the DS, plus a hand-written ARM9 kernel for its most common layer.Bit-exact with the PC on about 3,200 random layers and 24 reference outputs.
F soundThe web's 13 sound effects and 12 keypad tones, converted for the DS's mixer.Each keypad tone within 2 Hz of the web's; 478 KB of sound.
The melonDS emulator window: ハンター written in Hunter script on a sky-blue top screen, with an orange pill below.The first ROM
The melonDS window showing the 3D beetle opened with パカッ! written beside it, and a CLOSE button on the touch screen.The 3D beetle, opened
Fig. # — In the melonDS emulator. Left: the first ROM, where Rust writes ハンター stroke by stroke. Right: track B's beetle after A is pressed: wings up, the screen inside showing the app's icon, and パカッ!

What the emulator didn't show

melonDS is a very good emulator, but it draws each 3D frame in one go. A real DS draws its 3D picture line by line while the screen is being shown, with a small buffer of finished lines. The first time the app ran on the owner's DSi, the beetle had holes: rows of white dots across its shell, and a shredded screen when it opened. None of it had ever appeared in the emulator.

The white was the picture behind the beetle showing through, so the beetle's own pixels weren't being drawn on those lines. The holes sat in rows where many layers pile up, such as the eye lenses over the shell. The app had a debug overlay, so the next ROM added four test modes that switch features off. The owner tried each one on the DSi:

Table # — The test modes on a real DSi. Only turning off the rear-plane bitmap made the beetle whole.
T0, as designedT1, no outlinesT2, no rear-plane bitmapT3, neither
home, closedholesholeswholewhole
openedholesholeswholewhole

The culprit was the rear-plane bitmap, a DS feature that puts a picture behind the 3D scene. It makes the 3D chip read a colour and a depth value for every pixel behind the beetle, and on crowded lines that extra reading made it run out of time. The outlines cost nothing visible. The fix moved the picture behind the beetle out of the 3D chip altogether, onto an ordinary 2D layer:

The top screen's layers, front to back
The 2D hardware mixes the layers; the 3D chip only draws the beetle

First build

BG3 · 2D, in fronttitle, words, buttons
3D layerthe beetle
rear plane · inside the 3D chipthe card and hollow letters, read again for every pixel of every line

holes on crowded lines

Fixed

BG3 · 2D, in fronttitle, words, buttons
3D layerthe beetle, on a see-through background
BG2 · 2D, behindthe card and hollow letters, mixed in by the 2D hardware

whole on the DSi

Fig. # — The fix that made the beetle whole on hardware: what sits behind the beetle moved from the 3D chip's rear plane to a second 2D background.

The next hardware test found one more: the whole screen blinked white for a frame whenever a word appeared or the beetle opened or closed. To keep old words from leaving a ghost behind the beetle, every change first sent the background alone and the full picture a frame later, and in between the screen showed only the white paper. In the emulator it was a barely visible flicker. The fix is a new command: a scene hands over the picture that belongs behind the beetle, and both layers change in the same screen refresh. The owner's verdict on the next build: “Working great”.

Fitting in 4 MB

The DSi has 16 MB, but the same ROM also runs on an original DS, which has 4. At first everything lived in the program's memory image: the fonts alone were 1.3 MB, the sounds half a megabyte, and the reader models and their test strips another 0.7 MB. Switching from one reader to the other in original-DS mode showed “NO MEMORY: THE READER NEEDS 360K”. A clean message rather than a crash, because the reader asks for its memory in a way that can fail, but a sign of things to come.

The fix was to move the fonts, strings, sounds and models into the ROM's own file system (NitroFS) and load them when a scene needs them: a font when it is first drawn with, one language's strings at a time, a sound on first play, one reader at a time. Each scene is built when you enter it, and after its first frame everything it didn't use is freed.

Table # — Original-DS mode, before and after loading on demand. The goal was at least 1.5 MB free in every scene.
beforeafter
read-only data in memory2,676,824 B180,992 B
the whole resident image3,196,500 B938,188 B
free memory at start473,516 B2,731,828 B
free in each scene, measured in melonDS
home–2,719 KB
Write, after typing トモダチ–2,428 KB
Learn, the chart–2,661 KB

In every scene the largest free block equalled the free total, so memory was not fragmenting.

Write: a flip phone, a keyboard and a pen

Write works like an old flip phone: tap a key once for ア, twice for イ. The top screen writes each Hunter glyph stroke by stroke as you type, and a meaning card shows known words, such as トモダチ, “friend”. A QWERTY keyboard handles romaji and names. Anything you write can become a sticker in seven styles, saved as a PNG to the SD card by a small PNG writer written for the DS.

After using it, the owner asked for handwriting. You draw a Hunter letter with the stylus, and its kana goes into the text. The pen compares your drawing with 79 templates, every glyph and form with its marks, after every stroke, using the same kind of distance between drawings that Learn uses to find lookalikes. On 3,160 test drawings made from the glyphs' own strokes, the right kana was the top guess 98.9% of the time for neat drawings and 94.3% for sloppy ones, and among the five guesses shown 99.2% of the time or more. A reading takes an estimated 18 ms on an original DS. Real handwriting has only been tried by hand, not measured.

Write mode: ハンター in green Hunter script on a black LCD top screen, and a 12-key pad on the touch screen.The pad
The pen: a glyph drawn by stylus in a box, with the top five guesses beside it, ハ first.The pen
The sticker sheet: トモダチ, tomodachi, Friend, in the Manga style, with style and colour choices and a SAVE PNG button.Stickers
My License: a Hunter license card with a name in Hunter script and three exam stamps.My License
Fig. # — Write's pad, the pen and the sticker sheet, and the license that Learn's exam earns. The name on the license is a test name.
A sticker: アリカト, arikato, in Hunter script on an orange vocabulary card, with the hxhtranslator.com footer.
Fig. # — The first sticker saved on a real DSi, read back from its SD card (229 × 103, shown at 2×). It went through the DS-side PNG writer and the DSi's SD card driver.

Learn: trace, exam, puzzles

On a phone, “trace it with your finger” was always a feature for later. With a stylus it became the centre of Learn. Trace it shows a ghost glyph with numbered strokes; you trace it, and each stroke is scored by how far it strays from the glyph's own stroke, on average and at its ends. Three stamps need an error of 3.2% of the font size or less; a lookalike drawn perfectly never earns more than one. The Hunter Exam asks in three phases (a glyph to its kana, a kana to its glyph, a whole word), with wrong answers picked from the glyph's real lookalikes, and passing it earns the license above.

Today's puzzle gives one word a day to decode a glyph at a time. Puzzle Run came later, at the owner's request: words keep coming until three answers are wrong, and the game gets harder as you go.

Table # — Puzzle Run's difficulty ramp. The rules are tested so that nothing ever gets easier.
words solvedlevelword lengthwrong answersromaji shownclock a glyph
0–211–2nothing alikeyesnone
3–522–3a little alikeyesnone
6–932–3closeryesnone
10–1443–4the closest tennonone
15 on5+3–5the closest sixno10 s, then ½ s less a word, down to 4 s
Learn's chart of Hunter glyphs on the top screen, with ク selected and its example words on the touch screen.The chart
Trace it: a glyph traced with the stylus, three stamps, and a green PASS button.Trace it
The Hunter Exam's result card.The exam
Puzzle Run at level 5: a three-glyph word to decode, three beetle lives with one lost, four kana answers and a clock bar.Puzzle Run
Fig. # — Learn. The answers sit where the console's face buttons are, so every screen can be played with the buttons or the stylus.

Reading on a 133 MHz ARM9

The reader is a small convolutional neural network (the How it works article shows how it reads a line). Its numbers are stored as int8, one byte each, and the project's engine runs it with whole-number maths only. That engine was written in Rust without the standard library for an ESP32 microcontroller, so it compiled for the DS unchanged. The question was speed.

The DS's ARM9 has no instructions that multiply many small numbers at once, which is how phones and PCs run networks quickly. It does have SMLAxy, which multiplies two 16-bit halves of registers and adds the result in one go. Track E wrote a kernel around it for the 1×1 convolution, the layer that does most of the reader's work: it computes 2 outputs × 4 channels at a time, is 508 bytes long, and lives in the ARM9's small on-chip instruction memory, where it runs without waiting for main memory. Every result must be bit-exact: the same bytes as the PC, down to the last digit of every score.

The first try in the emulator never finished a read. The screen showed READING for five minutes. The cause wasn't slowness: a tool that measures how much stack the reader uses works by filling unused stack with a pattern, and after the compiler inlined it, it painted over its caller's own live variables. The next pointer the reader used was the pattern 0xA5C35A3C, the processor faulted, and with no fault handler the screen just froze. PC tests couldn't see it, because the painter does nothing off the DS. With that fixed, the reader ran, and matched the PC exactly: 17,472 of 17,472 output scores.

Fig. # — Time to read one line in the melonDS emulator, in original-DS mode (67 MHz). The emulator's timing is rough; it charged about 1.5 times what the cost model predicted. A DSi runs at twice the clock.

The kernel made the web's Fast reader 2.7 times faster, but 11 seconds a line is still far too slow. A faster kernel can only do so much; the reader itself had to shrink.

dsi_v1: a fifth of the arithmetic

Track E priced several smaller readers with a cost model built from the kernel's measured speed, and recommended the cheapest one with a track record: the first three stages of the same MobileNetV4 network (the full reader has four), at 32 pixels tall instead of 48. The project had trained this shape twice before. This time it was trained on the v6 data, so it also reads digits and some punctuation, then fine-tuned for int8 and converted through the same chain as the web's readers, which checks it bit for bit against Espressif's int8 simulator.

Table # — The DSi reader next to the web's Fast reader.
Fast, on the webdsi_v1
networkMobileNetV4-small, 4 stagesfirst 3 stages
input line48 × 768 px32 × 512 px
parameters323,99596,923
multiply-adds a line154.19 M30.62 M
model file, int8339,552 B103,856 B
working memory368,640 B163,840 B
a line on a PC, WebAssembly5.96 ms1.24 ms

Training took about 30 minutes on one RTX 4080 SUPER: two fine-tuning stages (12,000 and 3,000 steps) and 4,000 steps of quantisation-aware training. The int8 model matches Espressif's simulator on 512 of 512 test lines in every build of the engine, the DS's included.

Fig. # — Character error rate, int8, through the app's own crop path (lower is better). The DSi reader makes about half the mistakes on lines with numbers, because it learned from data the Fast reader never saw; on plain lines it is a little behind. All test sets are generated pictures.

Most of its extra mistakes are the small marks. At 32 pixels tall, the dot that turns カ into ガ is a few pixels across, so ガ → カ and パ → バ are its typical errors, along with missed spaces between words. On the console, the trade is worth it:

The melonDS window running the DSi reader's speed test: BIT-EXACT 11648/11648 logits, ARM9 2.38 s, scalar 6.06 s, speed-up ×2.53, and a bar chart of time per layer.
Fig. # — The speed test in melonDS: the DSi reader in 2.38 s with the ARM9 kernel and 6.06 s without, bit-exact on all 11,648 scores. That is 4.6 times faster than the Fast reader for 5 times fewer multiply-adds.

The speed test's breakdown by layer showed the next target. The 1×1 convolutions ran at 3.7 processor cycles a multiply-add and the larger ones at 4.2, but the depthwise convolutions, which had no kernel yet, took 18.8 cycles each and a quarter of the time. A second kernel reads four channels in one 32-bit load and splits them into 16-bit halves with two masks, with no unpacking: 12 instructions for 4 multiply-adds, about 3.5 cycles each by count. It passed 5,000 random layers with no mismatch.

One more change keeps the screen alive while it reads. A whole read in one go would freeze the app for a second or two, so the reader now runs in small bands of about half a million multiply-adds and stops after about 12 ms each frame. The DSi reader is 86 bands; the progress bar fills as they finish.

Fig. # — Processor cycles per multiply-add on the ARM9, by kind of layer (the DSi reader in melonDS). The depthwise kernel's 3.5 is an estimate from counting instructions; the hardware hasn't measured it yet.

Update, November 27: dsi_v2. Version 0.3.0 reads with dsi_v2: the same network as dsi_v1, with the same file size, memory and speed, trained again on the v7 data so that it reads the cross × of the anime's episode titles (クジラ×ハンター). It finds 76% of the crosses, where dsi_v1 finds none, and its int8 error rate is lower on every test set but one: 13.3% against 20.0% on title-style lines, 2.31% against 2.59% on the hold-out, and 2.97% against 4.95% on 26 real line crops. The one set it is worse on is the number lines in photo-style text, by 0.4 points. The tables are with the model.

Read with the camera

The DSi's camera gives the reader its input almost for free. A full photo comes as brightness plus colour, and the brightness part is exactly the grey picture the reader wants. The camera driver streams a live preview into three buffers in main memory, so the camera never waits for the app, and takes 640 × 480 stills on demand. It uses 888 KB while it is on, and nothing when it is off.

Three pairs of screens: aiming a line of Hunter script into the guide bar, reading with a progress bar, and the result: ハンター シケン, hantā shiken.
Fig. # — Aiming, reading and the result, rendered on a PC with a test camera that draws a sign. The “READ IN ~0.7 s” on this render is an estimate, not a measurement.
  1. Aim. The preview is dimmed outside the guide bar. Every sixth frame a quick check inside the bar moves the signal bars and the tip (“Get closer”, “More light”).
  2. Press A. The app takes a still and cuts the bar out of it. The cut is shrunk and padded to 32 × 512 exactly as the web app prepares a line: a test runs the web's own JavaScript in Node and gets the same bytes.
  3. Read. The camera turns off, so the reader has the processor and memory to itself, and the reader runs in its bands: about 37 frames on the progress bar.
  4. The result. A speech bubble with the kana, the romaji and a meaning when the word is known. Kana the reader is less than 60% sure of are underlined; tap one to see its runner-up. SAVE TO LOG adds the line to a text file on the SD card.

Lines written top to bottom needed one more trick, because there is no small vertical reader. The app cuts a column into glyphs by where the ink is and sets them upright side by side, and then the across reader reads them.

Writing the driver turned up a few surprises in the DS library: it numbers the cameras the other way round (the outer one is 1), it mirrors the outer camera, and if the camera sensor never answers, the DS's second processor waits forever where nothing on the main processor can catch it.

The emulator can't test any of this: it isn't known to emulate the DSi's cameras. So the first time the camera code ran on anything but a PC was on the owner's DSi. The report back: “It all works.” The preview, the still, the light going off, reading lines across and down, and the log on the SD card.

Where it stands

Everything above happened on one day, November 26, 2026, from the first feature list to a ROM the owner tested on a DSi. The final ROM is 3.8 MB, version 0.1.0, and runs the whole app: the beetle, Read, Write with the pen, Learn with Puzzle Run, and saving to the SD card.

  • Released. Version 0.3.0, with dsi_v2, is a free download on itch.io: kokkakniphon.itch.io/hxh-translator-dsi.
  • The speed on a DSi hasn't been written down. The overlay shows it, but the tests so far were about whether things work. The cost model says about 0.6–0.7 s a line in DSi mode; the emulator measured 2.38 s at the original DS's half clock, before the depthwise kernel.
  • Reading photos from the SD card is planned and greyed out for now. It would use the line finder as a slow background job.
  • Not yet tested on an original DS (where Read is greyed out, since there is no camera) or a 3DS.
  • Every accuracy number here is on generated pictures. The pen and Trace it's stamps are tuned on synthetic drawings, not real handwriting.

Words to know

ROM
The file that holds a DS program and its data. Homebrew ROMs run from an SD card through a menu such as TWiLight Menu++.
Homebrew
Programs for a games console made by its users, not its maker.
melonDS
A DS and DSi emulator for the PC. Good for testing, but its timing isn't exact, and it draws 3D differently from the real chip.
ARM9
The DS's main processor. A second, slower one (the ARM7) handles sound, touch and Wi-Fi.
MAC
One multiply-add, the basic step of a neural network. The DSi reader needs 30.6 million for one line.
int8
Storing each of a network's numbers in one byte and doing the maths with whole numbers.
Kernel
A small, hand-tuned piece of code for one kind of layer, written for one processor.
Bit-exact
Giving exactly the same bytes as a reference, not just nearly the same numbers.
NitroFS
A file system inside the ROM, so data can be loaded when it is needed instead of all at start.

More

The reader on the DSi is a smaller member of the same family as the web's readers. How those are trained, quantised and checked is in the deep dive; the DSi model itself is on Hugging Face.

The dsi_v2 model → Read the deep dive Try the web reader