Atari XEX Memory Analyzer
A VS Code extension that visualizes and analyzes the memory layout of Atari
8-bit .xex executables produced by llvm-mos (and, in a later phase,
cc65/ca65).
Open a .xex file and it renders an interactive memory map: where each segment
loads in the 64 KB address space, which OS/hardware/ROM regions it touches, how
much RAM is used vs. free, and warnings for overlaps, gaps, and loads over
reserved memory.
Features
Memory map & analysis
- XEX parser — segments, RUNAD/INITAD vectors, truncation detection.
- Linear memory strip — 0000–FFFF canvas with Atari region bands
(zero page, stack, OS vars, DOS, program RAM, cart/BASIC, hardware, OS ROM),
loaded sections colored by kind, and a data-symbol lane naming every
buffer in place. Scroll to zoom, drag to pan, double-click to reset.
- Analysis — loaded/runtime bytes, free RAM, load extent, overlap & gap
detection, and "loads over reserved region" warnings.
- Extra views — zero-page grid, RAM budget bar, largest-contributors,
segment/section/data-buffer tables, warnings, legend.
- Markdown report export (Atari XEX: Export Memory Report).
Map enrichment (auto-discovers a sibling .map / .lbl)
- llvm-mos LLD maps — section split (
.text/.rodata/.data/.bss/.zp*)
with symbol-level detail.
- cc65/ca65 ld65 maps — segment list + exports, with named segments
(
PLAYERMISSILE, MYFONT, DISPLAYLIST, FRAMEBUFFER, …) and VICE .lbl
symbols. Symbol sizes inferred from gaps (cc65 maps carry no sizes).
- Both cross-checked against the file image for a runtime-only (bss) flag.
Graphics / video memory
- Identified from linker symbols and segment names (high confidence on
location): PMG, character sets / fonts, display list, sprite data, frame
buffers — role from the symbol/segment name (always shown). cc65's named
segments make this especially direct.
- Display-list decoding — walks a loaded ANTIC display list's LMS
instructions to locate screen memory with evidence (not name guessing).
- Code-scan heuristics for PMBASE/SDLST/SAVMSC when no map is present
(clearly labeled low-confidence).
Source linking (Phase 3.5)
- Each region/buffer links to its source declaration — type, array
dimensions, comment, and a click-to-open jump to file:line. Prefers DWARF
from the ELF when present; otherwise scans the source tree (config
atariXex.sourceRoot, else auto-detected).
Pixel viewer (Phase 3.6)
- Click a graphics region, a data-buffer row, or a buffer on the strip's symbol
lane to render its bytes as an image: 1bpp sprites/PMG, 8×8 character
sets/fonts, 2bpp multicolor, or hex. Renders only bytes that are actually in
the file — runtime-built (
.bss) buffers are reported as such, never faked.
Opens automatically as a custom read-only editor for *.xex, or via the
Atari XEX: Analyze Memory Layout command.
Develop
npm install
npm run build # or: npm run watch
npm run typecheck
npm run test:unit # vitest
Press F5 in VS Code (or code --extensionDevelopmentPath=.) to launch the
extension development host, then open a .xex file.
Architecture
src/core/ — pure, no vscode import, unit-tested: XEX parser, Atari region
model, analysis engine, wire model.
src/host/ — custom editor provider, CSP webview HTML, messaging.
src/webview/ — separately-bundled Canvas/SVG visualization (zero runtime deps).
| |