c64bridge 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -12
- package/data/embeddings_basic.json +1 -1
- package/data/embeddings_hardware.json +1 -1
- package/data/embeddings_mixed.json +1 -1
- package/data/embeddings_other.json +1 -1
- package/data/graphics/character-set.csv +64 -64
- package/dist/.tsbuildinfo +1 -1
- package/dist/c64Client.js +68 -61
- package/dist/config.js +75 -38
- package/dist/device.js +154 -120
- package/dist/knowledge.js +2 -1
- package/dist/petscii.js +18 -15
- package/dist/petsciiArt.js +40 -14
- package/dist/rag/indexer.js +2 -1
- package/dist/sidwave.js +1 -1
- package/dist/sidwaveCompiler.js +3 -9
- package/dist/tools/audio.js +34 -8
- package/dist/tools/debug.js +9 -9
- package/dist/tools/errors.js +12 -1
- package/dist/tools/hex.js +9 -0
- package/dist/tools/input.js +13 -7
- package/dist/tools/memory.js +5 -4
- package/dist/tools/meta/artifacts.js +8 -3
- package/dist/tools/meta/audio.js +25 -28
- package/dist/tools/meta/background.js +6 -1
- package/dist/tools/meta/config.js +12 -4
- package/dist/tools/meta/configInventory.js +4 -1
- package/dist/tools/meta/filesystem.js +37 -10
- package/dist/tools/meta/graphics.js +10 -15
- package/dist/tools/meta/memory.js +12 -18
- package/dist/tools/meta/program.js +44 -16
- package/dist/tools/pollValidator.js +30 -2
- package/dist/tools/programRunners.js +5 -4
- package/dist/tools/registry/batch.js +4 -2
- package/dist/tools/registry/config.js +1 -1
- package/dist/tools/registry/disk.js +5 -0
- package/dist/tools/registry/extract.js +3 -0
- package/dist/tools/registry/graphics.js +1 -0
- package/dist/tools/registry/program.js +1 -1
- package/dist/tools/registry/sound.js +3 -3
- package/dist/tools/registry/system.js +3 -3
- package/dist/tools/storage.js +2 -2
- package/dist/tools/translation/assembler.js +150 -47
- package/dist/tools/translation/basicTokenizer.js +39 -9
- package/dist/tools/types.js +11 -4
- package/dist/vicBitmap.js +16 -0
- package/dist/vice/mockServer.js +7 -3
- package/dist/vice/viceClient.js +16 -6
- package/mcp/schemas/c64_config.schema.json +2 -2
- package/mcp/schemas/c64_program.schema.json +10 -18
- package/mcp/schemas/c64_sound.schema.json +8 -6
- package/mcp/schemas/c64_system.schema.json +9 -7
- package/mcp/server.json +1 -1
- package/mcp/tools.json +58 -43
- package/mcp.json +1 -1
- package/package.json +1 -1
- package/scripts/mockC64Server.mjs +98 -19
- package/server.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"dim":384,"model":"LocalMiniHashEmbedding","records":[{"name":"data/context/bootstrap.md","language":"mixed","vector":[0.009326282888650894,0.009326282888650894,0,-0.009326282888650894,-0.011191539466381073,0,0.01865256577730179,0.021450450643897057,0,-0.03357461839914322,-0.020051507279276848,0,0.01678730919957161,0.015388366766273975,0,-0.057822953909635544,-0.01725362241268158,0,0.20144771039485931,0.027046220377087593,0,-0.027978848665952682,-0.012590481899678707,0,0.011191539466381073,0.00792734045535326,0,-0.01678730919957161,-0.013056796044111252,0,0.020517822355031967,0.11797747761011124,0,-0.01492205262184143,-0.012124167755246162,0,0.009326282888650894,0.01585468091070652,0,-0.007461026310920715,-0.013989424332976341,0,0.01492205262184143,0.01632099412381649,0,-0.01865256577730179,-0.0177199374884367,0,0.03357461839914322,0.012590481899678707,0,-0.0354398749768734,-0.010725225321948528,0,0.03170936182141304,0.019585194066166878,0,-0.022383078932762146,-0.03497356176376343,0,0.009326282888650894,0.013523110188543797,0,-0.020517822355031967,-0.01492205262184143,0,0.01492205262184143,0.01492205262184143,0,-0.024248335510492325,-0.03124304674565792,0,0.007461026310920715,0.009792597033083439,0,-0.0055957697331905365,-0.023782020434737206,0,0.0354398749768734,0.020984135568141937,0,-0.08953231573104858,-0.015388366766273975,0,0.01678730919957161,0.00885996874421835,0,-0.16600783169269562,-0.03031041845679283,0,0.013056796044111252,0.021450450643897057,0,-0.020517822355031967,-0.023315707221627235,0,0.5036192536354065,0.00885996874421835,0,-0.0055957697331905365,-0.00792734045535326,0,0.23502232134342194,0.01585468091070652,0,-0.0018652565777301788,-0.03497356176376343,0,0.007461026310920715,0.013523110188543797,0,-0.01492205262184143,-0.0461651012301445,0,0.013056796044111252,0.10212279856204987,0,-0.0037305131554603577,-0.01725362241268158,0,0.020517822355031967,0.010725225321948528,0,-0.013056796044111252,-0.0177199374884367,0,0.345072478055954,0.012590481899678707,0,-0.1678730845451355,-0.009326282888650894,0,0.007461026310920715,0.011191539466381073,0,-0.02984410524368286,-0.008393654599785805,0,0.05222718417644501,0.008393654599785805,0,-0.03170936182141304,-0.014455738477408886,0,0.01492205262184143,0.04849667102098465,0,-0.024248335510492325,-0.022383078932762146,0,0.19025616347789764,0.020984135568141937,0,-0.04476615786552429,-0.01725362241268158,0,0.007461026310920715,0.010725225321948528,0,-0.03357461839914322,-0.013523110188543797,0,0.0876670554280281,0.009792597033083439,0,-0.011191539466381073,-0.015388366766273975,0,0.02984410524368286,0.009792597033083439,0,-0.05036192759871483,-0.01632099412381649,0,0.026113592088222504,0.021450450643897057,0,-0.01865256577730179,-0.04896298423409462,0,0.04476615786552429,0.010258911177515984,0,-0.0055957697331905365,-0.09512808173894882,0,0.04290090128779411,0.00885996874421835,0,-0.054092440754175186,-0.01818625070154667,0,0.055957697331905365,0.2602033019065857,0,-0.013056796044111252,-0.00792734045535326,0,0.024248335510492325,0.12030904740095139,0,-0.011191539466381073,-0.015388366766273975,0,0.21823501586914062,0.012124167755246162,0,-0.011191539466381073,-0.01492205262184143,0,0.022383078932762146,0.00885996874421835,0,-0.007461026310920715,-0.004196827299892902,0,0.01678730919957161,0.01492205262184143,0,-0.04476615786552429,-0.01492205262184143,0,0.03170936182141304,0.17673306167125702,0,-0.01678730919957161,-0.09839228540658951,0,0.02984410524368286,0.054092440754175186,0,-0.03170936182141304,-0.021916763857007027,0,0.024248335510492325,0.028911476954817772,0,-0.026113592088222504,-0.020051507279276848,0,0.04476615786552429,0.012590481899678707,0,-0.027978848665952682,-0.01585468091070652,0,0.020517822355031967,0.09745965898036957,0,-0.03170936182141304,-0.024248335510492325,0,0.01678730919957161,0.007461026310920715,0,-0.020517822355031967,-0.021450450643897057,0,0.013056796044111252,0.05222718417644501,0,-0.0055957697331905365,-0.014455738477408886,0,0.01865256577730179,0.022849392145872116,0,-0.03357461839914322,-0.03077673353254795,0,0.01678730919957161,0.015388366766273975,0,-0.013056796044111252,-0.014455738477408886,0,0.026113592088222504,0.026113592088222504,0,-0.07274500280618668,-0.00885996874421835,0,0.020517822355031967,0.023315707221627235,0,-0.06901448965072632,-0.028445161879062653,0,0.0055957697331905365,0.03683881834149361,0,-0.013056796044111252,-0.028911476954817772,0,0.020517822355031967,0.01632099412381649,0,-0.03730513155460358,-0.04709772765636444,0,0.009326282888650894,0.112381711602211,0,-0.007461026310920715,-0.010725225321948528,0,0.026113592088222504,0.1370963603258133,0,-0.01865256577730179,-0.005129455588757992,0,0.0037305131554603577,0.06714923679828644,0,-0.020517822355031967,-0.022849392145872116,0,0.12683744728565216,0.0177199374884367,0,-0.01865256577730179,-0.012124167755246162,0,0.020517822355031967,0.01818625070154667,0,-0.024248335510492325,-0.01678730919957161,0,0.024248335510492325,0.01725362241268158,0,-0.013056796044111252,-0.01632099412381649,0,0.009326282888650894,0.10865119844675064,0,-0.013056796044111252,-0.055957697331905365,0,0.024248335510492325,0.012124167755246162,0,-0.054092440754175186,-0.023315707221627235,0,0.01492205262184143,0.021450450643897057,0,-0.01678730919957161,-0.01818625070154667,0,0.007461026310920715,0.010258911177515984,0,-0.04849667102098465,-0.00885996874421835,0,0.009326282888650894,0.056890323758125305,0,-0.03170936182141304,-0.027978848665952682,0,0.03357461839914322,0.010258911177515984,0,-0.020517822355031967,-0.01492205262184143,0,0.011191539466381073,0.03497356176376343,0,-0.057822953909635544,-0.039170388132333755,0,0.03357461839914322,0.0177199374884367,0,-0.02984410524368286,-0.04709772765636444,0],"text":"<!-- Source: data/context/bootstrap.md -->\n# C64 Knowledge Bootstrap\n\nHigh-level overview for C64 development. For more details, see linked spec documents.\n\n## Backend Selection\n\nTwo backends may be available: `c64u` (physical C64 Ultimate hardware) and `vice`\n(VICE emulator). Use `c64_select_backend` to switch.\n\n**Routing rules — call `c64_select_backend` first when the user:**\n- Says \"use vice\", \"on vice\", \"in the emulator\", \"via vice\", or similar\n- Says \"use c64u\", \"on hardware\", \"on the Ultimate\", \"on the real machine\", or similar\n- Prefixes a request with a backend name, e.g. \"vice: run this program\"\n\nDo not assume the current backend is correct without checking\n`c64://platform/status` if the user has expressed a preference.\n\n## Fast Paths\n\n- Grouped MCP tools are never called bare. For tools such as `c64_program`, `c64_memory`, `c64_graphics`, `c64_sound`, and `c64_system`, always send an object with `op` first.\n- Wrong: `c64_program {}`. Correct: `c64_program { op: \"cross_platform_greeting\" }`.\n- For simple visible confirmation on `vice`, `c64u`, or both, prefer `c64_program` with `op: \"cross_platform_greeting\"`.\n- For trivial hello-world and smoke-test requests, route to `.github/skills/hello-world/SKILL.md` and let that skill use the shortest greeting workflow.\n- That workflow switches backends internally, writes a platform-customized BASIC greeting, captures screenshots, and verifies the rendered text without extra tool composition.\n- Use manual `c64_select_backend` plus `upload_run_basic` only when the user needs custom program logic beyond a quick greeting or text demo.\n- On local machines with a graphical session, assume VICE should be visible by default. Only expect Xvfb or other headless fallback in CI or when no framebuffer/display session exists.\n- For manual visible VICE BASIC runs, avoid immediate `read_screen` or `wait_for_text` calls, because Binary Monitor traffic traps execution while servicing requests.\n\n## Device & Services\n\n- MCP server controls Ultimate 64/C64 via REST: upload/run BASIC or ASM, screen/memory I/O, drives, SID music, audio analysis, local RAG.\n- Key chips: VIC-II ($D000), SID ($D400), CIA1 ($DC00), CIA2 ($DD00).\n\n## Memory Map (default RAM layout)\n\nFor Full details see `../memory/memory-map.md` with focus on low-memory (pages 0-3) in `../memory/low-memory-map.md` and KERNAL memory in `../memory/kernal-memory-map.md`.\n\n- $0000–$00FF: Zero page\n- $0100–$01FF: Stack\n- $0200–$02FF: Workspace, vectors ($0314/$0315 IRQ, $0318/$0319 BRK)\n- $0400–$07E7: Screen RAM (text 40×25)\n- $0801–: BASIC program area (defaults)\n- $A000–$BFFF: BASIC ROM (banked; RAM when LORAM/HIRAM cleared)\n- $C000–$CFFF: RAM (common for ASM)\n- $D000–$DFFF: I/O area (VIC-II $D000–$D02E; SID $D400–$D418; Color RAM $D800–$DBE7; CIA1/2 $DC00/$DD00)\n- $E000–$FFFF: KERNAL ROM (banked)\n\nBank control (6510 at $0001):\n\n- Bits: 0 LORAM, 1 HIRAM, 2 CHAREN. Typical full RAM: %0000_0011 → clear for RAM, set for ROM.\n\n## Video (VIC-II)\n\nThe VIC-II chip handles graphics and sprites. Fore more information see `data/graphics/vic-spec.md`.\n\n- Sprites: X ($D000..$D00E even), Y ($D001..$D00F odd), X MSBs $D010.\n- Control: $D011 (bit 7: 25th row; bit 6: RST8; bit 5: bitmap on; bits 0–2: vertical scroll).\n- Raster line: $D012 (LSB), $D011 bit 7 forms MSB; raster IRQ: mask $D01A, status $D019, vector $0314/$0315.\n- Control 2/Multicolour: $D016 (bit 4: 38/40 cols; bit 5: multicolour; bits 0–2: horizontal scroll).\n- Memory pointers: $D018 (bits 1–3: screen base; bits 4–7: charset/bitmap base).\n- Sprite enable: $D015; expand X: $D01D; expand Y: $D017; priority: $D01B; multicolour: $D01C.\n- Colors: Border $D020; background 0–3 $D021–$D023; sprite multicolour $D025–$D026; sprite colours $D027–$D02E.\n- Collisions: sprite-sprite $D01E (read/clear by write); sprite-background $D01F.\n\nVideo modes:\n\n- Text: $D011 bit 5=0; $D016 bit 5=0 (hi-res); charset and screen from $D018.\n- Bitmap: $D011 bit 5=1; hi-res (single colour per 8×8) or multicolour ($D016 bit 5=1).\n- Multicolour text/bitmap: wide pixels using $D022–$D024 and colour RAM.\n\nBitmap setup (typical):\n\n- Screen map at $0400 ($D018 bits 1–3 = 1), bitmap at $2000 ($D018 bits 4–7 = 8).\n- Enable bitmap: set $D011 bit 5; optional multicolour: set $D016 bit 5.\n\n### PETSCII, Screen & Colors\n\n- Screen at $0400 (40×25); write screen codes. Colour RAM at $D800 (nybbles). Border $D020, background $D021.\n- To draw pixels: use bitmap mode and write to bitmap memory; control colours via attributes (screen/colour RAM in text, nybbles per cell in bitmap multicolour).\n\n### PETSCII String Pitfalls\n\n- PETSCII is not ASCII: characters such as the backslash map to control codes (e.g. `$1C` toggles reverse video in the default upper/graphics set). Switch to the lower/upper character set first (`CHR$(14)` or `POKE 53272,14`) or pick alternative glyphs if you need a literal `\\` on screen.\n- Commodore BASIC does not interpret `\\n` as a newline. When emitting multi-line art, either print each line separately or inject carriage returns explicitly with `CHR$(13)`.\n\nExample:\n\n```basic\n10 PRINT CHR$(147);CHR$(14);\" /\\\\_/\\\\\"\n20 PRINT \" ( o.o )\"\n30 PRINT \" > ^ <\"\n40 PRINT CHR$(142)\n```\n\n## Raster IRQ Setup\n\nUse this to trigger code at a specific raster line, e.g. for split-screen effects, multiplexing sprites, or scrolling in the border without screen tear.\n\n1. Disable interrupts: `SEI`.\n2. Set raster line `$D012`, configure `$D011` bit 7 accordingly.\n3. Set IRQ vector `$0314/$0315` to handler.\n4. Enable IRQ in `$D01A` and global `CLI`.\n5. In handler: do work (e.g., change colours/sprites), then `LDA $D019`/`STA $D019` to clear and `RTI`.\n\n## Image & Sprites\n\n- Bitmap (hi-res): set `$D011` bit 5=1, `$D016` bit 5=0; point `$D018` to screen/bitmap; write bits into bitmap memory.\n- Multicolour bitmap: also set `$D016` bit 5=1; use `$D022–$D024` and colour RAM per cell.\n- Sprites: define 63-byte patterns; set sprite pointers at $07F8–$07FF; position with `$D000–$D00F`, enable with `$D015`.\n\n## Audio (SID)\n\nThe SID chip handles audio synthesis. For more information see `data/sound/sid-spec.md`.\n\nPer voice (1..3; base offsets +0x07 per voice):\n\n- FREQ LO/HI: $D400/$D401, $D407/$D408, $D40E/$D40F.\n- PULSE LO/HI: $D402/$D403, $D409/$D40A, $D410/$D411.\n- CONTROL: $D404, $D40B, $D412 (bit 0 GATE; 1 SYNC; 2 RING; 3 TEST; 4 TRI; 5 SAW; 6 PULSE; 7 NOISE).\n- ADSR: $D405 (A hi-nibble, D lo-nibble), $D406 (S hi-nibble, R lo-nibble).\n\nFilter/Master:\n\n- Cutoff: $D415/$D416; resonance/voice routing: $D417; volume/filter mode: $D418 (low 4 bits volume 0–15; bits 4–7 filter + third-voice mute).\n\nMaking sound (basic):\n\n1. Set frequency ($D400/01).\n2. Set pulse width ($D402/03) if pulse.\n3. Set ADSR ($D405/06).\n4. Set waveform + GATE in CONTROL ($D404).\n5. Set master volume at $D418.\n\n## BASIC\n\nBasic is used for simple programs and quick prototyping. It is very slow compared to assembly. For more information see `data/basic/basic-spec.md`.\n\n- Program: numbered lines; end with `END` or stop on last line.\n- Variables: A–Z (and arrays A()(numeric), A$() string); strings end with `$`.\n- Assignment: `LET A=expr` (LET optional) | `A$=\"TEXT\"`.\n- I/O: `PRINT expr[,;expr...]` | `INPUT var` | `GET A$` | `OPEN ch,dev,sa,\"name\"` | `PRINT#ch,expr` | `CLOSE ch`.\n- Control: `IF expr THEN <stmt|line>` | `GOTO n` | `GOSUB n` | `RETURN` | `FOR v=start TO end STEP s: ... : NEXT v` | `ON x GOTO l1,...` | `ON x GOSUB l1,...`.\n- Data: `DATA v1,v2,...` | `READ var` | `RESTORE`.\n- System: `POKE addr,val` | `PEEK(addr)` | `SYS addr` | `RUN` | `STOP` | `NEW`.\n- Strings: `LEFT$(s,n)` `RIGHT$(s,n)` `MID$(s,p[,n])` `CHR$(n)` `ASC(s)` `LEN(s)`.\n- Math: `+ - * / ^` | `ABS` `INT` `SGN` `SQR` `SIN` `COS` `TAN` `ATN` `RND([n])` `FRE(0)` `TI$`.\n- Relational: `= <> < > <= >=` (boolean as -1/0).\n- Remarks: `REM text` (tokens ignored till end of line).\n- Example (print to printer device 4): `OPEN 4,4:PRINT#4,\"HELLO\":CLOSE 4`.\n\n## 6502/6510 Assembly\n\nAssembly is used for maximum performance and control. For more information see `data/assembly/assembly-spec.md`.\n\n- Addressing modes: `#imm, zp, zp,X, zp,Y, abs, abs,X, abs,Y, (zp), (zp,X), (zp),Y, rel`.\n- Key opcodes (full set):\n - Load/Store: `LDA LDX LDY` / `STA STX STY`.\n - ALU: `ADC SBC AND ORA EOR ASL LSR ROL ROR`.\n - Inc/Dec: `INC INX INY DEC DEX DEY`.\n - Compare/Bit: `CMP CPX CPY BIT`.\n - Branch: `BCC BCS BEQ BMI BNE BPL BVC BVS`.\n - Jump/Call: `JMP JSR RTS RTI`.\n - Status: `CLC SEC CLI SEI CLD SED CLV NOP`.\n - Stack: `PHA PHP PLA PLP TAX TXA TAY TYA TSX TXS BRK`.\n- Directives (assembler used here): `.org/*=`, `.byte`, `.word`, `.text/.ascii`, `ds` (fill), labels `name:`.\n- Interrupts: set IRQ vector at $0314/$0315 to your routine; acknowledge VIC-II IRQ by writing back bit to $D019.\n- Example (border flash): write to `$D020` inside raster IRQ (`$D012`/`$D011`), mask `$D01A`, acknowledge `$D019`.\n\n## Context & RAG\n\n- Layers: `data/context/bootstrap.md` → `AGENTS.md` / `CLAUDE.md` / `.github/copilot-instructions.md` → `.github/prompts/*.prompt.md` → `.github/skills/*/SKILL.md` → `data/context/chat.md` → RAG docs (`doc/**/*.md`, `data/**/*.md`).\n- Retrieval returns relevant chunks with provenance comments for transparency.\n","sourcePath":"data/context/bootstrap.md","sourceMtimeMs":1778169591173,"origin":"data/context/bootstrap.md"},{"name":"doc/c64u/c64-rest-api.md","language":"mixed","vector":[0.00823826901614666,0,0,0,-0.00823826901614666,0,0,0.002059567254036665,0,0,-0.010297836735844612,0,0.01647653803229332,0.00823826901614666,0,0,-0.020595673471689224,0,0.12357404083013535,0.00411913450807333,0,-0.04119134694337845,-0.014416971243917942,0,0.01647653803229332,0.01235740352421999,0,0,0,0,0,0.00823826901614666,0,0,-0.01235740352421999,0,0,0.006178701762109995,0,-0.00823826901614666,-0.00823826901614666,0,0.02471480704843998,0.00823826901614666,0,-0.00823826901614666,-0.010297836735844612,0,0.00823826901614666,0.01235740352421999,0,-0.04119134694337845,-0.00411913450807333,0,0.04942961409687996,0.006178701762109995,0,0,-0.010297836735844612,0,0.00823826901614666,0.006178701762109995,0,-0.12357404083013535,-0.006178701762109995,0,0,0.00411913450807333,0,0,-0.00823826901614666,0,0.00823826901614666,0,0,0,-0.05148918181657791,0,0,0.002059567254036665,0,-0.05766788497567177,-0.028833942487835884,0,0,0.01235740352421999,0,-0.00823826901614666,-0.07620399445295334,0,0.01647653803229332,0.01235740352421999,0,-0.00823826901614666,-0.010297836735844612,0,0.46134307980537415,0.006178701762109995,0,-0.00823826901614666,-0.002059567254036665,0,0.1647653877735138,0.002059567254036665,0,-0.01647653803229332,-0.00411913450807333,0,0.07414442300796509,0.00823826901614666,0,-0.00823826901614666,-0.1338718682527542,0,0.02471480704843998,0.06178702041506767,0,0,-0.022655241191387177,0,0.01647653803229332,0.00823826901614666,0,-0.00823826901614666,-0.002059567254036665,0,0.1812419295310974,0.002059567254036665,0,-0.01647653803229332,-0.002059567254036665,0,0.02471480704843998,0.002059567254036665,0,-0.00823826901614666,-0.010297836735844612,0,0.01647653803229332,0.01647653803229332,0,-0.00823826901614666,-0.00411913450807333,0,0.00823826901614666,0.00411913450807333,0,-0.01647653803229332,-0.026774374768137932,0,0.2553863525390625,0.026774374768137932,0,-0.00823826901614666,-0.002059567254036665,0,0.00823826901614666,0.006178701762109995,0,-0.13181230425834656,-0.06384658813476562,0,0.06590615212917328,0.002059567254036665,0,-0.00823826901614666,0,0,0.01647653803229332,0.006178701762109995,0,-0.02471480704843998,-0.002059567254036665,0,0,0.002059567254036665,0,-0.01647653803229332,-0.030893510207533836,0,0.00823826901614666,0,0,-0.02471480704843998,-0.00411913450807333,0,0.01647653803229332,0.00823826901614666,0,-0.06590615212917328,-0.028833942487835884,0,0,0.23067153990268707,0,-0.00823826901614666,-0.018536105751991272,0,0.01647653803229332,0.08856139332056046,0,0,-0.04531048238277435,0,0.03295307606458664,0.04119134694337845,0,0,-0.006178701762109995,0,0.00823826901614666,0.014416971243917942,0,-0.01647653803229332,0,0,0.01647653803229332,0.00823826901614666,0,-0.02471480704843998,-0.00411913450807333,0,0.03295307606458664,0.09474010020494461,0,-0.01647653803229332,-0.00823826901614666,0,0.00823826901614666,0.0432509146630764,0,-0.02471480704843998,-0.014416971243917942,0,0.00823826901614666,0.01235740352421999,0,-0.00823826901614666,-0.00411913450807333,0,0.01647653803229332,0.00411913450807333,0,-0.03295307606458664,-0.00823826901614666,0,0,0.12769317626953125,0,-0.00823826901614666,-0.006178701762109995,0,0.00823826901614666,0.010297836735844612,0,0,-0.06796572357416153,0,0,0.03501264378428459,0,-0.00823826901614666,-0.014416971243917942,0,0.01647653803229332,0.020595673471689224,0,-0.02471480704843998,-0.01235740352421999,0,0.00823826901614666,0.002059567254036665,0,-0.00823826901614666,-0.039131779223680496,0,0.00823826901614666,0.00411913450807333,0,-0.01647653803229332,-0.01235740352421999,0,0,0.010297836735844612,0,-0.5354874730110168,-0.03295307606458664,0,0,0,0,-0.00823826901614666,-0.018536105751991272,0,0,0.00823826901614666,0,-0.00823826901614666,-0.002059567254036665,0,0.00823826901614666,0.020595673471689224,0,-0.00823826901614666,-0.002059567254036665,0,0.00823826901614666,0.11945490539073944,0,-0.02471480704843998,-0.010297836735844612,0,0.01647653803229332,0.04942961409687996,0,0,-0.01647653803229332,0,0,0.03501264378428459,0,-0.02471480704843998,-0.010297836735844612,0,0.00823826901614666,0.010297836735844612,0,-0.00823826901614666,-0.01235740352421999,0,0.00823826901614666,0.00823826901614666,0,-0.00823826901614666,-0.006178701762109995,0,0.00823826901614666,0.053548749536275864,0,0,-0.020595673471689224,0,0.00823826901614666,0.006178701762109995,0,-0.00823826901614666,-0.006178701762109995,0,0.00823826901614666,0.00823826901614666,0,-0.00823826901614666,-0.002059567254036665,0,0,0.002059567254036665,0,0,-0.00823826901614666,0,0,0.07208485901355743,0,-0.09885922819375992,-0.014416971243917942,0,0,0.006178701762109995,0,-0.05766788497567177,-0.037072211503982544,0,0.02471480704843998,0.020595673471689224,0,-0.14828884601593018,-0.010297836735844612,0,0.01647653803229332,0.00411913450807333,0,-0.00823826901614666,-0.2739224433898926,0],"text":"<!-- Source: doc/c64u/c64-rest-api.md#Machine -->\n### Machine\n\n| Method | Path | Parameters | Action |\n| --- | --- | --- | --- |\n| PUT | `/v1/machine:reset` | – | Sends a reset to the machine. Configuration remains unchanged. |\n| PUT | `/v1/machine:reboot` | – | Restarts the machine and re-initialises the cartridge configuration. |\n| PUT | `/v1/machine:pause` | – | Pulls the DMA line low at a safe moment, stopping the CPU while timers continue. |\n| PUT | `/v1/machine:resume` | – | Releases the DMA line so the CPU resumes execution. |\n| PUT | `/v1/machine:poweroff` | – | Powers off the machine. Responses are not guaranteed. |\n| PUT | `/v1/machine:menu_button` | – | Toggles the Ultimate menu just like the physical button. |\n| PUT | `/v1/machine:writemem` | `address`, `data` | Writes data to C64 memory through DMA using the currently selected memory map. Writing to 6510 I/O registers is not possible. Up to 128 bytes are written. |\n| POST | `/v1/machine:writemem` | `address` | Writes attached binary data starting at the supplied address. The data must not wrap beyond `$FFFF`. |\n| GET | `/v1/machine:readmem` | `address`, `[length]` | Performs a DMA read and returns binary data. The default length is 256 bytes. |\n| GET | `/v1/machine:debugreg` | – | Reads `$D7FF` and returns the value field in hexadecimal. Ultimate 64 only. |\n| PUT | `/v1/machine:debugreg` | `value` | Writes the hexadecimal value to `$D7FF`, then reads it back. Ultimate 64 only. |\n\nExample for `/v1/machine:writemem`:\n\n```text\nPUT /v1/machine:writemem?address=D020&data=0504\n```\n\nThis sequence writes `05` to `$D020` and `04` to `$D021`.","sourcePath":"doc/c64u/c64-rest-api.md","sourceMtimeMs":1778169591305,"origin":"doc/c64u/c64-rest-api.md#Machine"},{"name":"video/hello_world.asm","language":"mixed","vector":[0,0.005313626956194639,0,0,-0.01594088040292263,0,0.010627253912389278,0.010627253912389278,0,-0.021254507824778557,-0.01594088040292263,0,0.021254507824778557,0.005313626956194639,0,-0.010627253912389278,-0.02391131967306137,0,0.09564527869224548,0.029224947094917297,0,-0.010627253912389278,-0.03719538822770119,0,0,0.018597694113850594,0,-0.010627253912389278,-0.007970440201461315,0,0.021254507824778557,0.19394737482070923,0,-0.010627253912389278,-0.029224947094917297,0,0,0.010627253912389278,0,-0.021254507824778557,-0.007970440201461315,0,0.010627253912389278,0.005313626956194639,0,-0.03188176080584526,-0.042509015649557114,0,0,0.026568133383989334,0,-0.05313626676797867,-0.005313626956194639,0,0,0.010627253912389278,0,-0.05313626676797867,-0.013284066691994667,0,0.010627253912389278,0,0,-0.03188176080584526,-0.013284066691994667,0,0.010627253912389278,0.0026568134780973196,0,-0.10627253353595734,-0.007970440201461315,0,0.010627253912389278,0.010627253912389278,0,0,-0.005313626956194639,0,0,0.005313626956194639,0,-0.042509015649557114,0,0,0,0.010627253912389278,0,-0.12752704322338104,-0.021254507824778557,0,0,0.010627253912389278,0,-0.03188176080584526,-0.010627253912389278,0,0.010627253912389278,0.0026568134780973196,0,0,-0.0026568134780973196,0,0.6588897109031677,0.010627253912389278,0,0,-0.010627253912389278,0,0,0.018597694113850594,0,0,-0.005313626956194639,0,0.010627253912389278,0.050479453057050705,0,-0.021254507824778557,-0.010627253912389278,0,0,0,0,-0.021254507824778557,-0.005313626956194639,0,0.1381542980670929,0.013284066691994667,0,-0.1381542980670929,-0.010627253912389278,0,0.03188176080584526,0.013284066691994667,0,-0.05313626676797867,-0.029224947094917297,0,0.021254507824778557,0.010627253912389278,0,0,-0.018597694113850594,0,0.03188176080584526,0.05579308047890663,0,0,-0.03719538822770119,0,0.042509015649557114,0.0026568134780973196,0,-0.010627253912389278,-0.029224947094917297,0,0.010627253912389278,0.005313626956194639,0,-0.042509015649557114,-0.034538574516773224,0,0.010627253912389278,0.01594088040292263,0,0,-0.05313626676797867,0,0.010627253912389278,0.007970440201461315,0,-0.010627253912389278,-0.005313626956194639,0,0,0,0,-0.021254507824778557,-0.02391131967306137,0,0.042509015649557114,0,0,-0.06376352161169052,-0.06642033159732819,0,0,0.0026568134780973196,0,-0.05313626676797867,-0.018597694113850594,0,0.010627253912389278,0.007970440201461315,0,0,0,0,0.03188176080584526,0.3347584903240204,0,-0.010627253912389278,-0.010627253912389278,0,0.32944485545158386,0.0026568134780973196,0,-0.03188176080584526,-0.0026568134780973196,0,0.021254507824778557,0.005313626956194639,0,-0.010627253912389278,-0.010627253912389278,0,0.021254507824778557,0.0026568134780973196,0,-0.021254507824778557,-0.01594088040292263,0,0.021254507824778557,0.07439077645540237,0,-0.021254507824778557,-0.07173395901918411,0,0.021254507824778557,0.03985220193862915,0,-0.010627253912389278,-0.029224947094917297,0,0,0.010627253912389278,0,-0.03188176080584526,-0.0026568134780973196,0,0.010627253912389278,0.021254507824778557,0,-0.010627253912389278,-0.0026568134780973196,0,0.021254507824778557,0.021254507824778557,0,0,-0.010627253912389278,0,0,0.007970440201461315,0,0,-0.029224947094917297,0,0,0.005313626956194639,0,0,-0.013284066691994667,0,0.021254507824778557,0.005313626956194639,0,-0.021254507824778557,-0.018597694113850594,0,0.010627253912389278,0.0026568134780973196,0,-0.010627253912389278,-0.018597694113850594,0,0.021254507824778557,0.02391131967306137,0,0,-0.058449894189834595,0,0.03188176080584526,0.0026568134780973196,0,0,-0.026568133383989334,0,0.010627253912389278,0.005313626956194639,0,-0.021254507824778557,-0.010627253912389278,0,0,0.01594088040292263,0,0,-0.03719538822770119,0,0.010627253912389278,0.16472242772579193,0,-0.021254507824778557,-0.02391131967306137,0,0.05313626676797867,0.013284066691994667,0,-0.07439077645540237,-0.005313626956194639,0,0.021254507824778557,0.17534968256950378,0,-0.010627253912389278,-0.010627253912389278,0,0.22317232191562653,0.010627253912389278,0,-0.042509015649557114,-0.010627253912389278,0,0.010627253912389278,0.013284066691994667,0,-0.010627253912389278,-0.010627253912389278,0,0,0,0,-0.07439077645540237,-0.021254507824778557,0,0.042509015649557114,0.03985220193862915,0,0,-0.03985220193862915,0,0.010627253912389278,0.018597694113850594,0,-0.021254507824778557,-0.013284066691994667,0,0,0.005313626956194639,0,-0.010627253912389278,0,0,0,0.007970440201461315,0,-0.010627253912389278,0,0,0.010627253912389278,0.021254507824778557,0,-0.010627253912389278,-0.013284066691994667,0,0.010627253912389278,0.007970440201461315,0,0,-0.01594088040292263,0,0.021254507824778557,0.013284066691994667,0,-0.042509015649557114,0,0,0.010627253912389278,0.018597694113850594,0,-0.010627253912389278,-0.0026568134780973196,0],"text":"; hello_world_prg.asm\n; Single-file PRG layout:\n; - Tokenized one-line BASIC at $0801: 10 SYS 4096\n; - Machine code placed at $1000 which writes the message directly to screen RAM ($0400)\n; (no KERNAL CHROUT or BASIC printing is used)\n\n .org $0801\n ; next-line pointer (little-endian) -> $080C (start + line length)\n .byte $0C, $08\n ; line number 10\n .byte $0A, $00\n ; tokenized content: SYS (0x9E), space (0x20), '4','0','9','6' (ASCII/PETSCII digits)\n .byte $9E, $20, $34, $30, $39, $36\n ; line terminator\n .byte $00\n ; program end marker (two zero bytes)\n .byte $00, $00\n\n ; -- machine code at $1000 ------------------------------------------------\n .org $1000\nstart:\n ldx #$00 ; X = 0\nwrite_loop:\n lda message, x ; load byte from message\n beq done ; zero terminator -> finished\n sta $0400, x ; write character to screen RAM (fast direct write)\n inx\n jmp write_loop\n\ndone:\n rts\n\nmessage:\n ; ASCII bytes for: HELLO, WORLD! (0-terminated)\n ; VIC-II screen codes for: HELLO, WORLD! (screen codes from data/graphics/character-set.csv)\n ; H E L L O , <space> W O R L D !\n .byte $08, $05, $0C, $0C, $0F, $2C, $20, $17, $0F, $12, $0C, $04, $21, $00\n\n ; End of file\n","sourcePath":"data/assembly/examples/video/hello_world.asm","sourceMtimeMs":1778169591129}]}
|
|
1
|
+
{"dim":384,"model":"LocalMiniHashEmbedding","records":[{"name":"data/context/bootstrap.md","language":"mixed","vector":[0.008939674124121666,0.008939674124121666,0,-0.008939674124121666,-0.009833642281591892,0,0.017879348248243332,0.02190220169723034,0,-0.03218282759189606,-0.021008234471082687,0,0.021455219015479088,0.0138564957305789,0,-0.053638048470020294,-0.01698538102209568,0,0.20024870336055756,0.025925057008862495,0,-0.026819024235010147,-0.012068560346961021,0,0.010727609507739544,0.00849269051104784,0,-0.01609141379594803,-0.012515543960034847,0,0.019667284563183784,0.1171097382903099,0,-0.014303479343652725,-0.011621576733887196,0,0.008939674124121666,0.015197446569800377,0,-0.007151739671826363,-0.012962528504431248,0,0.014303479343652725,0.015644431114196777,0,-0.021455219015479088,-0.01698538102209568,0,0.03218282759189606,0.010280625894665718,0,-0.03397076204419136,-0.010280625894665718,0,0.030394893139600754,0.019667284563183784,0,-0.021455219015479088,-0.03441774845123291,0,0.007151739671826363,0.012962528504431248,0,-0.019667284563183784,-0.01609141379594803,0,0.01609141379594803,0.013409512117505074,0,-0.02324315346777439,-0.029947910457849503,0,0.007151739671826363,0.009833642281591892,0,-0.005363804753869772,-0.02190220169723034,0,0.03397076204419136,0.02190220169723034,0,-0.08582087606191635,-0.014750462956726551,0,0.019667284563183784,0.00849269051104784,0,-0.15555033087730408,-0.031288862228393555,0,0.014303479343652725,0.020561251789331436,0,-0.019667284563183784,-0.02234918624162674,0,0.5077735185623169,0.008939674124121666,0,-0.007151739671826363,-0.0075987232849001884,0,0.2270677387714386,0.015197446569800377,0,-0.0035758698359131813,-0.03888758271932602,0,0.007151739671826363,0.01653839834034443,0,-0.01609141379594803,-0.04469837248325348,0,0.012515543960034847,0.10146530717611313,0,-0.0035758698359131813,-0.01609141379594803,0,0.019667284563183784,0.010280625894665718,0,-0.012515543960034847,-0.017879348248243332,0,0.3557990491390228,0.011621576733887196,0,-0.15912620723247528,-0.008939674124121666,0,0.007151739671826363,0.010727609507739544,0,-0.02860695868730545,-0.008045706897974014,0,0.05006217584013939,0.008045706897974014,0,-0.030394893139600754,-0.015644431114196777,0,0.014303479343652725,0.047827258706092834,0,-0.02324315346777439,-0.021455219015479088,0,0.19488491117954254,0.020114267244935036,0,-0.042910438030958176,-0.01653839834034443,0,0.007151739671826363,0.009386658668518066,0,-0.03397076204419136,-0.012962528504431248,0,0.08224500715732574,0.010280625894665718,0,-0.012515543960034847,-0.014750462956726551,0,0.02860695868730545,0.009833642281591892,0,-0.0554259829223156,-0.01609141379594803,0,0.025031087920069695,0.020561251789331436,0,-0.017879348248243332,-0.046933289617300034,0,0.048274241387844086,0.01117459312081337,0,-0.005363804753869772,-0.08939674496650696,0,0.04112250357866287,0.009386658668518066,0,-0.053638048470020294,-0.01743236556649208,0,0.053638048470020294,0.26282644271850586,0,-0.012515543960034847,-0.00849269051104784,0,0.026819024235010147,0.1162157654762268,0,-0.010727609507739544,-0.01653839834034443,0,0.21455219388008118,0.011621576733887196,0,-0.010727609507739544,-0.015197446569800377,0,0.021455219015479088,0.00849269051104784,0,-0.005363804753869772,-0.004022853448987007,0,0.01609141379594803,0.014303479343652725,0,-0.042910438030958176,-0.014303479343652725,0,0.02324315346777439,0.18326333165168762,0,-0.01609141379594803,-0.09297261387109756,0,0.02860695868730545,0.053638048470020294,0,-0.030394893139600754,-0.021008234471082687,0,0.02324315346777439,0.0277129914611578,0,-0.03218282759189606,-0.019220300018787384,0,0.042910438030958176,0.012068560346961021,0,-0.026819024235010147,-0.015197446569800377,0,0.021455219015479088,0.09967736899852753,0,-0.026819024235010147,-0.02324315346777439,0,0.01609141379594803,0.007151739671826363,0,-0.019667284563183784,-0.02234918624162674,0,0.012515543960034847,0.04916821047663689,0,-0.007151739671826363,-0.014750462956726551,0,0.017879348248243332,0.02190220169723034,0,-0.03218282759189606,-0.03307679668068886,0,0.017879348248243332,0.014303479343652725,0,-0.012515543960034847,-0.0138564957305789,0,0.025031087920069695,0.02815997414290905,0,-0.09118468314409256,-0.00849269051104784,0,0.02324315346777439,0.02234918624162674,0,-0.07151739299297333,-0.02815997414290905,0,0.005363804753869772,0.03531171381473541,0,-0.010727609507739544,-0.0277129914611578,0,0.019667284563183784,0.018326332792639732,0,-0.03933456912636757,-0.04425138980150223,0,0.007151739671826363,0.1108519658446312,0,-0.007151739671826363,-0.010280625894665718,0,0.025031087920069695,0.13767099380493164,0,-0.017879348248243332,-0.004469837062060833,0,0.0035758698359131813,0.06481263786554337,0,-0.019667284563183784,-0.02234918624162674,0,0.12694337964057922,0.013409512117505074,0,-0.017879348248243332,-0.012068560346961021,0,0.019667284563183784,0.01743236556649208,0,-0.02324315346777439,-0.01609141379594803,0,0.02324315346777439,0.01653839834034443,0,-0.012515543960034847,-0.019220300018787384,0,0.008939674124121666,0.11040498316287994,0,-0.012515543960034847,-0.053191062062978745,0,0.025031087920069695,0.012515543960034847,0,-0.053638048470020294,-0.020561251789331436,0,0.014303479343652725,0.020561251789331436,0,-0.01609141379594803,-0.01743236556649208,0,0.005363804753869772,0.009833642281591892,0,-0.04648630693554878,-0.009386658668518066,0,0.008939674124121666,0.05766090005636215,0,-0.030394893139600754,-0.026819024235010147,0,0.035758696496486664,0.010727609507739544,0,-0.019667284563183784,-0.014750462956726551,0,0.010727609507739544,0.03307679668068886,0,-0.059001851826906204,-0.048721227794885635,0,0.03218282759189606,0.018773317337036133,0,-0.02860695868730545,-0.04961519315838814,0],"text":"<!-- Source: data/context/bootstrap.md -->\n# C64 Knowledge Bootstrap\n\nHigh-level overview for C64 development. For more details, see linked spec documents.\n\n## Backend Selection\n\nTwo backends may be available: `c64u` (physical C64 Ultimate hardware) and `vice`\n(VICE emulator). Use `c64_select_backend` to switch.\n\n**Routing rules — call `c64_select_backend` first when the user:**\n- Says \"use vice\", \"on vice\", \"in the emulator\", \"via vice\", or similar\n- Says \"use c64u\", \"on hardware\", \"on the Ultimate\", \"on the real machine\", or similar\n- Prefixes a request with a backend name, e.g. \"vice: run this program\"\n\nDo not assume the current backend is correct without checking\n`c64://platform/status` if the user has expressed a preference.\n\n## Fast Paths\n\n- Grouped MCP tools are never called bare. For tools such as `c64_program`, `c64_memory`, `c64_graphics`, `c64_sound`, and `c64_system`, call the tool with flat arguments that include `op`.\n- Wrong: `c64_program {}` or `{ \"c64_program\": { \"op\": \"cross_platform_greeting\" } }`. Correct: call tool `c64_program` with `{ \"op\": \"cross_platform_greeting\" }`.\n- For simple visible confirmation on `vice`, `c64u`, or both, prefer `c64_program` with `op: \"cross_platform_greeting\"`.\n- For trivial hello-world and smoke-test requests, route to `.github/skills/hello-world/SKILL.md` and let that skill use the shortest greeting workflow.\n- That workflow switches backends internally, writes a platform-customized BASIC greeting, captures screenshots, and verifies the rendered text without extra tool composition.\n- Use manual `c64_select_backend` with `op: \"select\"` plus `c64_program` with `op: \"upload_run_basic\"` only when the user needs custom program logic beyond a quick greeting or text demo.\n- On local machines with a graphical session, assume VICE should be visible by default. Only expect Xvfb or other headless fallback in CI or when no framebuffer/display session exists.\n- For manual visible VICE BASIC runs, avoid immediate `read_screen` or `wait_for_text` calls, because Binary Monitor traffic traps execution while servicing requests.\n\n## Device & Services\n\n- MCP server controls Ultimate 64/C64 via REST: upload/run BASIC or ASM, screen/memory I/O, drives, SID music, audio analysis, local RAG.\n- Key chips: VIC-II ($D000), SID ($D400), CIA1 ($DC00), CIA2 ($DD00).\n\n## Memory Map (default RAM layout)\n\nFor full details see `../memory/memory-map.md`. Use `../memory/low-memory-map.md` for zero page/pages 0-3, `../basic/rom-routines.md` for BASIC ROM routines, `../kernal/rom-routines.md` for KERNAL ROM routines, and `../io/io-spec.md` or `../io/cia-spec.md` for hardware registers.\n\n- $0000–$00FF: Zero page\n- $0100–$01FF: Stack\n- $0200–$02FF: Workspace, vectors ($0314/$0315 IRQ, $0318/$0319 BRK)\n- $0400–$07E7: Screen RAM (text 40×25)\n- $0801–: BASIC program area (defaults)\n- $A000–$BFFF: BASIC ROM (banked; RAM when LORAM/HIRAM cleared)\n- $C000–$CFFF: RAM (common for ASM)\n- $D000–$DFFF: I/O area (VIC-II $D000–$D02E; SID $D400–$D418; Color RAM $D800–$DBE7; CIA1/2 $DC00/$DD00)\n- $E000–$FFFF: KERNAL ROM (banked)\n\nBank control (6510 at $0001):\n\n- Bits: 0 LORAM, 1 HIRAM, 2 CHAREN. Typical full RAM: %0000_0011 → clear for RAM, set for ROM.\n\n## Video (VIC-II)\n\nThe VIC-II chip handles graphics and sprites. Fore more information see `data/graphics/vic-spec.md`.\n\n- Sprites: X ($D000..$D00E even), Y ($D001..$D00F odd), X MSBs $D010.\n- Control: $D011 (bit 7: 25th row; bit 6: RST8; bit 5: bitmap on; bits 0–2: vertical scroll).\n- Raster line: $D012 (LSB), $D011 bit 7 forms MSB; raster IRQ: mask $D01A, status $D019, vector $0314/$0315.\n- Control 2/Multicolour: $D016 (bit 4: 38/40 cols; bit 5: multicolour; bits 0–2: horizontal scroll).\n- Memory pointers: $D018 (bits 1–3: screen base; bits 4–7: charset/bitmap base).\n- Sprite enable: $D015; expand X: $D01D; expand Y: $D017; priority: $D01B; multicolour: $D01C.\n- Colors: Border $D020; background 0–3 $D021–$D023; sprite multicolour $D025–$D026; sprite colours $D027–$D02E.\n- Collisions: sprite-sprite $D01E (read/clear by write); sprite-background $D01F.\n\nVideo modes:\n\n- Text: $D011 bit 5=0; $D016 bit 5=0 (hi-res); charset and screen from $D018.\n- Bitmap: $D011 bit 5=1; hi-res (single colour per 8×8) or multicolour ($D016 bit 5=1).\n- Multicolour text/bitmap: wide pixels using $D022–$D024 and colour RAM.\n\nBitmap setup (typical):\n\n- Screen map at $0400 ($D018 bits 1–3 = 1), bitmap at $2000 ($D018 bits 4–7 = 8).\n- Enable bitmap: set $D011 bit 5; optional multicolour: set $D016 bit 5.\n\n### PETSCII, Screen & Colors\n\n- Screen at $0400 (40×25); write screen codes. Colour RAM at $D800 (nybbles). Border $D020, background $D021.\n- To draw pixels: use bitmap mode and write to bitmap memory; control colours via attributes (screen/colour RAM in text, nybbles per cell in bitmap multicolour).\n\n### PETSCII String Pitfalls\n\n- PETSCII is not ASCII: characters such as the backslash map to control codes (e.g. `$1C` toggles reverse video in the default upper/graphics set). Switch to the lower/upper character set first (`CHR$(14)` or `POKE 53272,14`) or pick alternative glyphs if you need a literal `\\` on screen.\n- Commodore BASIC does not interpret `\\n` as a newline. When emitting multi-line art, either print each line separately or inject carriage returns explicitly with `CHR$(13)`.\n\nExample:\n\n```basic\n10 PRINT CHR$(147);CHR$(14);\" /\\\\_/\\\\\"\n20 PRINT \" ( o.o )\"\n30 PRINT \" > ^ <\"\n40 PRINT CHR$(142)\n```\n\n## Raster IRQ Setup\n\nUse this to trigger code at a specific raster line, e.g. for split-screen effects, multiplexing sprites, or scrolling in the border without screen tear.\n\n1. Disable interrupts: `SEI`.\n2. Set raster line `$D012`, configure `$D011` bit 7 accordingly.\n3. Set IRQ vector `$0314/$0315` to handler.\n4. Enable IRQ in `$D01A` and global `CLI`.\n5. In handler: do work (e.g., change colours/sprites), then `LDA $D019`/`STA $D019` to clear and `RTI`.\n\n## Image & Sprites\n\n- Bitmap (hi-res): set `$D011` bit 5=1, `$D016` bit 5=0; point `$D018` to screen/bitmap; write bits into bitmap memory.\n- Multicolour bitmap: also set `$D016` bit 5=1; use `$D022–$D024` and colour RAM per cell.\n- Sprites: define 63-byte patterns; set sprite pointers at $07F8–$07FF; position with `$D000–$D00F`, enable with `$D015`.\n\n## Audio (SID)\n\nThe SID chip handles audio synthesis. For more information see `data/sound/sid-spec.md`.\n\nPer voice (1..3; base offsets +0x07 per voice):\n\n- FREQ LO/HI: $D400/$D401, $D407/$D408, $D40E/$D40F.\n- PULSE LO/HI: $D402/$D403, $D409/$D40A, $D410/$D411.\n- CONTROL: $D404, $D40B, $D412 (bit 0 GATE; 1 SYNC; 2 RING; 3 TEST; 4 TRI; 5 SAW; 6 PULSE; 7 NOISE).\n- ADSR: $D405 (A hi-nibble, D lo-nibble), $D406 (S hi-nibble, R lo-nibble).\n\nFilter/Master:\n\n- Cutoff: $D415/$D416; resonance/voice routing: $D417; volume/filter mode: $D418 (low 4 bits volume 0–15; bits 4–7 filter + third-voice mute).\n\nMaking sound (basic):\n\n1. Set frequency ($D400/01).\n2. Set pulse width ($D402/03) if pulse.\n3. Set ADSR ($D405/06).\n4. Set waveform + GATE in CONTROL ($D404).\n5. Set master volume at $D418.\n\n## BASIC\n\nBasic is used for simple programs and quick prototyping. It is very slow compared to assembly. For more information see `data/basic/basic-spec.md`.\n\n- Program: numbered lines; end with `END` or stop on last line.\n- Variables: A–Z (and arrays A()(numeric), A$() string); strings end with `$`.\n- Assignment: `LET A=expr` (LET optional) | `A$=\"TEXT\"`.\n- I/O: `PRINT expr[,;expr...]` | `INPUT var` | `GET A$` | `OPEN ch,dev,sa,\"name\"` | `PRINT#ch,expr` | `CLOSE ch`.\n- Control: `IF expr THEN <stmt|line>` | `GOTO n` | `GOSUB n` | `RETURN` | `FOR v=start TO end STEP s: ... : NEXT v` | `ON x GOTO l1,...` | `ON x GOSUB l1,...`.\n- Data: `DATA v1,v2,...` | `READ var` | `RESTORE`.\n- System: `POKE addr,val` | `PEEK(addr)` | `SYS addr` | `RUN` | `STOP` | `NEW`.\n- Strings: `LEFT$(s,n)` `RIGHT$(s,n)` `MID$(s,p[,n])` `CHR$(n)` `ASC(s)` `LEN(s)`.\n- Math: `+ - * / ^` | `ABS` `INT` `SGN` `SQR` `SIN` `COS` `TAN` `ATN` `RND([n])` `FRE(0)` `TI$`.\n- Relational: `= <> < > <= >=` (boolean as -1/0).\n- Remarks: `REM text` (tokens ignored till end of line).\n- Example (print to printer device 4): `OPEN 4,4:PRINT#4,\"HELLO\":CLOSE 4`.\n\n## 6502/6510 Assembly\n\nAssembly is used for maximum performance and control. For more information see `data/assembly/assembly-spec.md`.\n\n- Addressing modes: `#imm, zp, zp,X, zp,Y, abs, abs,X, abs,Y, (zp), (zp,X), (zp),Y, rel`.\n- Key opcodes (full set):\n - Load/Store: `LDA LDX LDY` / `STA STX STY`.\n - ALU: `ADC SBC AND ORA EOR ASL LSR ROL ROR`.\n - Inc/Dec: `INC INX INY DEC DEX DEY`.\n - Compare/Bit: `CMP CPX CPY BIT`.\n - Branch: `BCC BCS BEQ BMI BNE BPL BVC BVS`.\n - Jump/Call: `JMP JSR RTS RTI`.\n - Status: `CLC SEC CLI SEI CLD SED CLV NOP`.\n - Stack: `PHA PHP PLA PLP TAX TXA TAY TYA TSX TXS BRK`.\n- Directives (assembler used here): `.org/*=`, `.byte`, `.word`, `.text/.ascii`, `ds` (fill), labels `name:`.\n- Interrupts: set IRQ vector at $0314/$0315 to your routine; acknowledge VIC-II IRQ by writing back bit to $D019.\n- Example (border flash): write to `$D020` inside raster IRQ (`$D012`/`$D011`), mask `$D01A`, acknowledge `$D019`.\n\n## Context & RAG\n\n- Layers: `data/context/bootstrap.md` → `AGENTS.md` / `CLAUDE.md` / `.github/copilot-instructions.md` → `.github/prompts/*.prompt.md` → `.github/skills/*/SKILL.md` → `data/context/chat.md` → RAG docs (`doc/**/*.md`, `data/**/*.md`).\n- Retrieval returns relevant chunks with provenance comments for transparency.\n","sourcePath":"data/context/bootstrap.md","sourceMtimeMs":1783848418891,"origin":"data/context/bootstrap.md"},{"name":"doc/c64u/c64-rest-api.md","language":"mixed","vector":[0.00823826901614666,0,0,0,-0.00823826901614666,0,0,0.002059567254036665,0,0,-0.010297836735844612,0,0.01647653803229332,0.00823826901614666,0,0,-0.020595673471689224,0,0.12357404083013535,0.00411913450807333,0,-0.04119134694337845,-0.014416971243917942,0,0.01647653803229332,0.01235740352421999,0,0,0,0,0,0.00823826901614666,0,0,-0.01235740352421999,0,0,0.006178701762109995,0,-0.00823826901614666,-0.00823826901614666,0,0.02471480704843998,0.00823826901614666,0,-0.00823826901614666,-0.010297836735844612,0,0.00823826901614666,0.01235740352421999,0,-0.04119134694337845,-0.00411913450807333,0,0.04942961409687996,0.006178701762109995,0,0,-0.010297836735844612,0,0.00823826901614666,0.006178701762109995,0,-0.12357404083013535,-0.006178701762109995,0,0,0.00411913450807333,0,0,-0.00823826901614666,0,0.00823826901614666,0,0,0,-0.05148918181657791,0,0,0.002059567254036665,0,-0.05766788497567177,-0.028833942487835884,0,0,0.01235740352421999,0,-0.00823826901614666,-0.07620399445295334,0,0.01647653803229332,0.01235740352421999,0,-0.00823826901614666,-0.010297836735844612,0,0.46134307980537415,0.006178701762109995,0,-0.00823826901614666,-0.002059567254036665,0,0.1647653877735138,0.002059567254036665,0,-0.01647653803229332,-0.00411913450807333,0,0.07414442300796509,0.00823826901614666,0,-0.00823826901614666,-0.1338718682527542,0,0.02471480704843998,0.06178702041506767,0,0,-0.022655241191387177,0,0.01647653803229332,0.00823826901614666,0,-0.00823826901614666,-0.002059567254036665,0,0.1812419295310974,0.002059567254036665,0,-0.01647653803229332,-0.002059567254036665,0,0.02471480704843998,0.002059567254036665,0,-0.00823826901614666,-0.010297836735844612,0,0.01647653803229332,0.01647653803229332,0,-0.00823826901614666,-0.00411913450807333,0,0.00823826901614666,0.00411913450807333,0,-0.01647653803229332,-0.026774374768137932,0,0.2553863525390625,0.026774374768137932,0,-0.00823826901614666,-0.002059567254036665,0,0.00823826901614666,0.006178701762109995,0,-0.13181230425834656,-0.06384658813476562,0,0.06590615212917328,0.002059567254036665,0,-0.00823826901614666,0,0,0.01647653803229332,0.006178701762109995,0,-0.02471480704843998,-0.002059567254036665,0,0,0.002059567254036665,0,-0.01647653803229332,-0.030893510207533836,0,0.00823826901614666,0,0,-0.02471480704843998,-0.00411913450807333,0,0.01647653803229332,0.00823826901614666,0,-0.06590615212917328,-0.028833942487835884,0,0,0.23067153990268707,0,-0.00823826901614666,-0.018536105751991272,0,0.01647653803229332,0.08856139332056046,0,0,-0.04531048238277435,0,0.03295307606458664,0.04119134694337845,0,0,-0.006178701762109995,0,0.00823826901614666,0.014416971243917942,0,-0.01647653803229332,0,0,0.01647653803229332,0.00823826901614666,0,-0.02471480704843998,-0.00411913450807333,0,0.03295307606458664,0.09474010020494461,0,-0.01647653803229332,-0.00823826901614666,0,0.00823826901614666,0.0432509146630764,0,-0.02471480704843998,-0.014416971243917942,0,0.00823826901614666,0.01235740352421999,0,-0.00823826901614666,-0.00411913450807333,0,0.01647653803229332,0.00411913450807333,0,-0.03295307606458664,-0.00823826901614666,0,0,0.12769317626953125,0,-0.00823826901614666,-0.006178701762109995,0,0.00823826901614666,0.010297836735844612,0,0,-0.06796572357416153,0,0,0.03501264378428459,0,-0.00823826901614666,-0.014416971243917942,0,0.01647653803229332,0.020595673471689224,0,-0.02471480704843998,-0.01235740352421999,0,0.00823826901614666,0.002059567254036665,0,-0.00823826901614666,-0.039131779223680496,0,0.00823826901614666,0.00411913450807333,0,-0.01647653803229332,-0.01235740352421999,0,0,0.010297836735844612,0,-0.5354874730110168,-0.03295307606458664,0,0,0,0,-0.00823826901614666,-0.018536105751991272,0,0,0.00823826901614666,0,-0.00823826901614666,-0.002059567254036665,0,0.00823826901614666,0.020595673471689224,0,-0.00823826901614666,-0.002059567254036665,0,0.00823826901614666,0.11945490539073944,0,-0.02471480704843998,-0.010297836735844612,0,0.01647653803229332,0.04942961409687996,0,0,-0.01647653803229332,0,0,0.03501264378428459,0,-0.02471480704843998,-0.010297836735844612,0,0.00823826901614666,0.010297836735844612,0,-0.00823826901614666,-0.01235740352421999,0,0.00823826901614666,0.00823826901614666,0,-0.00823826901614666,-0.006178701762109995,0,0.00823826901614666,0.053548749536275864,0,0,-0.020595673471689224,0,0.00823826901614666,0.006178701762109995,0,-0.00823826901614666,-0.006178701762109995,0,0.00823826901614666,0.00823826901614666,0,-0.00823826901614666,-0.002059567254036665,0,0,0.002059567254036665,0,0,-0.00823826901614666,0,0,0.07208485901355743,0,-0.09885922819375992,-0.014416971243917942,0,0,0.006178701762109995,0,-0.05766788497567177,-0.037072211503982544,0,0.02471480704843998,0.020595673471689224,0,-0.14828884601593018,-0.010297836735844612,0,0.01647653803229332,0.00411913450807333,0,-0.00823826901614666,-0.2739224433898926,0],"text":"<!-- Source: doc/c64u/c64-rest-api.md#Machine -->\n### Machine\n\n| Method | Path | Parameters | Action |\n| --- | --- | --- | --- |\n| PUT | `/v1/machine:reset` | – | Sends a reset to the machine. Configuration remains unchanged. |\n| PUT | `/v1/machine:reboot` | – | Restarts the machine and re-initialises the cartridge configuration. |\n| PUT | `/v1/machine:pause` | – | Pulls the DMA line low at a safe moment, stopping the CPU while timers continue. |\n| PUT | `/v1/machine:resume` | – | Releases the DMA line so the CPU resumes execution. |\n| PUT | `/v1/machine:poweroff` | – | Powers off the machine. Responses are not guaranteed. |\n| PUT | `/v1/machine:menu_button` | – | Toggles the Ultimate menu just like the physical button. |\n| PUT | `/v1/machine:writemem` | `address`, `data` | Writes data to C64 memory through DMA using the currently selected memory map. Writing to 6510 I/O registers is not possible. Up to 128 bytes are written. |\n| POST | `/v1/machine:writemem` | `address` | Writes attached binary data starting at the supplied address. The data must not wrap beyond `$FFFF`. |\n| GET | `/v1/machine:readmem` | `address`, `[length]` | Performs a DMA read and returns binary data. The default length is 256 bytes. |\n| GET | `/v1/machine:debugreg` | – | Reads `$D7FF` and returns the value field in hexadecimal. Ultimate 64 only. |\n| PUT | `/v1/machine:debugreg` | `value` | Writes the hexadecimal value to `$D7FF`, then reads it back. Ultimate 64 only. |\n\nExample for `/v1/machine:writemem`:\n\n```text\nPUT /v1/machine:writemem?address=D020&data=0504\n```\n\nThis sequence writes `05` to `$D020` and `04` to `$D021`.","sourcePath":"doc/c64u/c64-rest-api.md","sourceMtimeMs":1778169591305,"origin":"doc/c64u/c64-rest-api.md#Machine"},{"name":"video/hello_world.asm","language":"mixed","vector":[0,0.005313626956194639,0,0,-0.01594088040292263,0,0.010627253912389278,0.010627253912389278,0,-0.021254507824778557,-0.01594088040292263,0,0.021254507824778557,0.005313626956194639,0,-0.010627253912389278,-0.02391131967306137,0,0.09564527869224548,0.029224947094917297,0,-0.010627253912389278,-0.03719538822770119,0,0,0.018597694113850594,0,-0.010627253912389278,-0.007970440201461315,0,0.021254507824778557,0.19394737482070923,0,-0.010627253912389278,-0.029224947094917297,0,0,0.010627253912389278,0,-0.021254507824778557,-0.007970440201461315,0,0.010627253912389278,0.005313626956194639,0,-0.03188176080584526,-0.042509015649557114,0,0,0.026568133383989334,0,-0.05313626676797867,-0.005313626956194639,0,0,0.010627253912389278,0,-0.05313626676797867,-0.013284066691994667,0,0.010627253912389278,0,0,-0.03188176080584526,-0.013284066691994667,0,0.010627253912389278,0.0026568134780973196,0,-0.10627253353595734,-0.007970440201461315,0,0.010627253912389278,0.010627253912389278,0,0,-0.005313626956194639,0,0,0.005313626956194639,0,-0.042509015649557114,0,0,0,0.010627253912389278,0,-0.12752704322338104,-0.021254507824778557,0,0,0.010627253912389278,0,-0.03188176080584526,-0.010627253912389278,0,0.010627253912389278,0.0026568134780973196,0,0,-0.0026568134780973196,0,0.6588897109031677,0.010627253912389278,0,0,-0.010627253912389278,0,0,0.018597694113850594,0,0,-0.005313626956194639,0,0.010627253912389278,0.050479453057050705,0,-0.021254507824778557,-0.010627253912389278,0,0,0,0,-0.021254507824778557,-0.005313626956194639,0,0.1381542980670929,0.013284066691994667,0,-0.1381542980670929,-0.010627253912389278,0,0.03188176080584526,0.013284066691994667,0,-0.05313626676797867,-0.029224947094917297,0,0.021254507824778557,0.010627253912389278,0,0,-0.018597694113850594,0,0.03188176080584526,0.05579308047890663,0,0,-0.03719538822770119,0,0.042509015649557114,0.0026568134780973196,0,-0.010627253912389278,-0.029224947094917297,0,0.010627253912389278,0.005313626956194639,0,-0.042509015649557114,-0.034538574516773224,0,0.010627253912389278,0.01594088040292263,0,0,-0.05313626676797867,0,0.010627253912389278,0.007970440201461315,0,-0.010627253912389278,-0.005313626956194639,0,0,0,0,-0.021254507824778557,-0.02391131967306137,0,0.042509015649557114,0,0,-0.06376352161169052,-0.06642033159732819,0,0,0.0026568134780973196,0,-0.05313626676797867,-0.018597694113850594,0,0.010627253912389278,0.007970440201461315,0,0,0,0,0.03188176080584526,0.3347584903240204,0,-0.010627253912389278,-0.010627253912389278,0,0.32944485545158386,0.0026568134780973196,0,-0.03188176080584526,-0.0026568134780973196,0,0.021254507824778557,0.005313626956194639,0,-0.010627253912389278,-0.010627253912389278,0,0.021254507824778557,0.0026568134780973196,0,-0.021254507824778557,-0.01594088040292263,0,0.021254507824778557,0.07439077645540237,0,-0.021254507824778557,-0.07173395901918411,0,0.021254507824778557,0.03985220193862915,0,-0.010627253912389278,-0.029224947094917297,0,0,0.010627253912389278,0,-0.03188176080584526,-0.0026568134780973196,0,0.010627253912389278,0.021254507824778557,0,-0.010627253912389278,-0.0026568134780973196,0,0.021254507824778557,0.021254507824778557,0,0,-0.010627253912389278,0,0,0.007970440201461315,0,0,-0.029224947094917297,0,0,0.005313626956194639,0,0,-0.013284066691994667,0,0.021254507824778557,0.005313626956194639,0,-0.021254507824778557,-0.018597694113850594,0,0.010627253912389278,0.0026568134780973196,0,-0.010627253912389278,-0.018597694113850594,0,0.021254507824778557,0.02391131967306137,0,0,-0.058449894189834595,0,0.03188176080584526,0.0026568134780973196,0,0,-0.026568133383989334,0,0.010627253912389278,0.005313626956194639,0,-0.021254507824778557,-0.010627253912389278,0,0,0.01594088040292263,0,0,-0.03719538822770119,0,0.010627253912389278,0.16472242772579193,0,-0.021254507824778557,-0.02391131967306137,0,0.05313626676797867,0.013284066691994667,0,-0.07439077645540237,-0.005313626956194639,0,0.021254507824778557,0.17534968256950378,0,-0.010627253912389278,-0.010627253912389278,0,0.22317232191562653,0.010627253912389278,0,-0.042509015649557114,-0.010627253912389278,0,0.010627253912389278,0.013284066691994667,0,-0.010627253912389278,-0.010627253912389278,0,0,0,0,-0.07439077645540237,-0.021254507824778557,0,0.042509015649557114,0.03985220193862915,0,0,-0.03985220193862915,0,0.010627253912389278,0.018597694113850594,0,-0.021254507824778557,-0.013284066691994667,0,0,0.005313626956194639,0,-0.010627253912389278,0,0,0,0.007970440201461315,0,-0.010627253912389278,0,0,0.010627253912389278,0.021254507824778557,0,-0.010627253912389278,-0.013284066691994667,0,0.010627253912389278,0.007970440201461315,0,0,-0.01594088040292263,0,0.021254507824778557,0.013284066691994667,0,-0.042509015649557114,0,0,0.010627253912389278,0.018597694113850594,0,-0.010627253912389278,-0.0026568134780973196,0],"text":"; hello_world_prg.asm\n; Single-file PRG layout:\n; - Tokenized one-line BASIC at $0801: 10 SYS 4096\n; - Machine code placed at $1000 which writes the message directly to screen RAM ($0400)\n; (no KERNAL CHROUT or BASIC printing is used)\n\n .org $0801\n ; next-line pointer (little-endian) -> $080C (start + line length)\n .byte $0C, $08\n ; line number 10\n .byte $0A, $00\n ; tokenized content: SYS (0x9E), space (0x20), '4','0','9','6' (ASCII/PETSCII digits)\n .byte $9E, $20, $34, $30, $39, $36\n ; line terminator\n .byte $00\n ; program end marker (two zero bytes)\n .byte $00, $00\n\n ; -- machine code at $1000 ------------------------------------------------\n .org $1000\nstart:\n ldx #$00 ; X = 0\nwrite_loop:\n lda message, x ; load byte from message\n beq done ; zero terminator -> finished\n sta $0400, x ; write character to screen RAM (fast direct write)\n inx\n jmp write_loop\n\ndone:\n rts\n\nmessage:\n ; ASCII bytes for: HELLO, WORLD! (0-terminated)\n ; VIC-II screen codes for: HELLO, WORLD! (screen codes from data/graphics/character-set.csv)\n ; H E L L O , <space> W O R L D !\n .byte $08, $05, $0C, $0C, $0F, $2C, $20, $17, $0F, $12, $0C, $04, $21, $00\n\n ; End of file\n","sourcePath":"data/assembly/examples/video/hello_world.asm","sourceMtimeMs":1778169591129}]}
|