Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
PocketCompiler
General
AuthorPlanetDogeCodes
TypeOther Apps
Version0.36
LicenseApache-2.0
Last Updated2026/06/17
Links
Download
Website
Source

PocketCompiler is an experimental Nintendo 3DS HTML/JS/CSS compiler and code editor

It's designed to let you write HTML/JS/CSS on the 3DS, allowing for easy development. You can:

  • Edit code on the bottom screen.
  • Preview output/status on the top screen.
  • Save/load projects from the SD card.

The default project path is sdmc:/3ds/PocketCompiler/projects/

Features

  • Basic HTML parsing.
  • Simple CSS.
  • Basic JavaScript runtime capabilities.
  • DOM-like elements.
  • Keyboard/Mouse/Touch events.
  • Nearly complete iframe support.
  • document.write()
  • Limited API and link fetching.
  • IndexedDB-adjacent SD-card storage.
  • Custom Canvas rendering.
  • Custom WebGL rendering.
  • Image loading.
  • Web audio support.

Canvas / WebGL

PocketCompiler has rendering systems for:

  • canvas command buffers
  • rectangles, lines, text, placeholders
  • getContext("webgl") detection
  • buffers
  • shaders/programs
  • uniforms/attributes
  • textures
  • draw calls
  • viewport/depth/blend/scissor state
  • Citro3D backend scaffolding

This is not yet full WebGL.

Storage

PocketCompiler includes SD-card-backed storage systems:

sdmc:/3ds/PocketCompiler/idb/
sdmc:/3ds/PocketCompiler/cache_api/
sdmc:/3ds/PocketCompiler/resource_cache/

Supported or scaffolded:

  • IndexedDB-style databases/object stores
  • putgetdeleteclearcount
  • localStorage-style storage
  • sessionStorage-style storage
  • Cache API-style storage
  • binary-safe values
  • 1 MB per-value/resource cap

Audio

PocketCompiler includes a small Web Audio-style system:

  • AudioContext-like runtime
  • OscillatorNode-like node
  • GainNode-like node
  • sine/square/triangle/sawtooth tones
  • NDSP-backed output when available
  • safe fallback if audio fails

Limitations

PocketCompiler is still in early development.

It does not yet fully support:

  • Complete HTML parsing
  • Full CSS layout/cascade
  • Full modern JavaScript/browser behavior
  • Complete Promise/event-loop behavior
  • Full WebGL 1.0
  • Real GLSL shader translation
  • Full Canvas 2D API
  • Full Web Audio API
  • Full IndexedDB compatibility
  • Complete iframe isolation
  • Pointer lock

The 3DS also has very limited RAM, CPU, GPU power, and screen space, so PocketCompiler uses strict safety limits (1 MB per resource/value/cache entry, bounded event queues, bounded command buffers, bounded editor/runtime structures)

Controls

D-Pad - Arrow key movement

Circle Pad - Move mouse cursor (it's just a dot)

A - Click, Edit code line

B - Undo

X - Save project

Y - Load project

Start - Run/Compile

Select - Show controls menu

Screenshots

PocketCompiler3DS2.png PocketCompiler3DS3.png

Changelog

v0.36

  • Crash / correctness fixes:
    • editor_find and editor_find_prevstart_line was not clamped before use — with a corrupted or uninitialized value it could make editor_get_line walk off the end of the buffer. Now clamped to [0, total-1].
    • editor_replace_at: added col > llen guard so an exact-end-of-line replacement can't produce a negative memcpy count.
    • we_eval_js: added !g_web_engine.loaded check — without it, a stale non-NULL js_ctx pointer left from a previous we_unload() call could be dereferenced.
    • draw_consolei < WJS_LOG_MAX_LINES guard added — a corrupted g_wjs_log_n could have caused a read past the log array bounds.
  • Compiler warning fixes:
    • (down & KEY_X) && ... — explicit parentheses added (GCC -Wall warning eliminated).
    • Two strcat() calls replaced with strncat().
    • LAYOUT_ED_H corrected to 178.0f (was 180.0f) — the 2px mismatch caused the cursor-to-line mapping to select the wrong line near the bottom of the editor panel.

v0.34

  • Slight UI changes
  • Bordered rendering for text & iframe
  • Memory usage fixes
  • More accurate CSS parsing
File Fixes/Changes
web_layout.c Body avail_w bug fixed: was 2×margin_left, now margin_left + margin_right.
web_layout.c Text node lay_w uses full available container width for alignment.
web_render.c Scale formula size/11.0f → size/30.0f (correct for system font at scale 1.0 ≈ 30px).
web_render.c TEXT nodes use parent container width for proper text alignment.
web_render.c Bottom border drawn on document viewport to frame the output area.
web_engine.c css_apply_ua_defaults() called after css_reset(), before parse — so user styles always win.
web_engine.c RUNNING bar cleaned up; conflicting title bar overlay removed.

v0.33.5

  • Hopefully fixed crashing issues

v0.33.4

  • MAYBE fixed crashing issues (untested, will update when tested)

v0.33.3

  • Fixed surface-level crashing issues

v0.33.2

  • Maybe fixed crashing issues
  • Stability fixes
  • Fixed errors while compiling

v0.33

  • Fixed scrolling
  • Fixed line truncation
  • Added more complete rendering capabilities
  • Added pointer lock integration
  • Added page interaction

v0.32

  • Fixed the HTML rendering engine
  • Slight UI changes

v0.31.1

  • Completely overhauled the UI (AI was used to help with this)
  • New frame buffer that minimizes the visual bug to almost unnoticeable proportions.

Pre-Release v0.30

  • Fixed app crashing on file explorer open (MAYBE FR THIS TIME)
  • Fixed the visual bug (kinda)

Credits

PocketCompiler project and idea by PlanetDogeCodes (me). Some browser runtime features, custom Canvas/WebGL Integration, and 3DS Optimizations were all made with help from GPT-5.5 xhigh. Some UI elements and DOM-style event handling were made with help from Claude Sonnet 4.6

Built with:

  • Visual Studio Code
  • devkitPro
  • devkitARM
  • libctru
  • Citro2D
  • Citro3D

External links

Advertising: