c64-kb 0.17.0

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.
Files changed (970) hide show
  1. package/CHANGELOG.md +2082 -0
  2. package/LICENSE +29 -0
  3. package/README.md +559 -0
  4. package/VERSION +25 -0
  5. package/dist/cli/setup.js +66 -0
  6. package/dist/cli/setup.js.map +1 -0
  7. package/dist/cli-memorize-audit.js +97 -0
  8. package/dist/cli-memorize-audit.js.map +1 -0
  9. package/dist/cli.js +335 -0
  10. package/dist/cli.js.map +1 -0
  11. package/dist/config.js +83 -0
  12. package/dist/config.js.map +1 -0
  13. package/dist/context.js +53 -0
  14. package/dist/context.js.map +1 -0
  15. package/dist/domain/budget-notes.js +104 -0
  16. package/dist/domain/budget-notes.js.map +1 -0
  17. package/dist/domain/budget.js +417 -0
  18. package/dist/domain/budget.js.map +1 -0
  19. package/dist/domain/game-design.js +77 -0
  20. package/dist/domain/game-design.js.map +1 -0
  21. package/dist/domain/timing.js +39 -0
  22. package/dist/domain/timing.js.map +1 -0
  23. package/dist/graph/apply.js +132 -0
  24. package/dist/graph/apply.js.map +1 -0
  25. package/dist/graph/claims.js +231 -0
  26. package/dist/graph/claims.js.map +1 -0
  27. package/dist/graph/extract/archetype.js +118 -0
  28. package/dist/graph/extract/archetype.js.map +1 -0
  29. package/dist/graph/extract/common.js +69 -0
  30. package/dist/graph/extract/common.js.map +1 -0
  31. package/dist/graph/extract/failure.js +37 -0
  32. package/dist/graph/extract/failure.js.map +1 -0
  33. package/dist/graph/extract/game-design.js +189 -0
  34. package/dist/graph/extract/game-design.js.map +1 -0
  35. package/dist/graph/extract/hardware.js +124 -0
  36. package/dist/graph/extract/hardware.js.map +1 -0
  37. package/dist/graph/extract/pitfall.js +62 -0
  38. package/dist/graph/extract/pitfall.js.map +1 -0
  39. package/dist/graph/extract/raster-band.js +56 -0
  40. package/dist/graph/extract/raster-band.js.map +1 -0
  41. package/dist/graph/extract/recipe.js +71 -0
  42. package/dist/graph/extract/recipe.js.map +1 -0
  43. package/dist/graph/extract/technique-entities.js +180 -0
  44. package/dist/graph/extract/technique-entities.js.map +1 -0
  45. package/dist/graph/extract/technique.js +179 -0
  46. package/dist/graph/extract/technique.js.map +1 -0
  47. package/dist/graph/extract/toolchain.js +67 -0
  48. package/dist/graph/extract/toolchain.js.map +1 -0
  49. package/dist/graph/extract/types.js +3 -0
  50. package/dist/graph/extract/types.js.map +1 -0
  51. package/dist/graph/extract/vocabulary.js +65 -0
  52. package/dist/graph/extract/vocabulary.js.map +1 -0
  53. package/dist/graph/extract.js +43 -0
  54. package/dist/graph/extract.js.map +1 -0
  55. package/dist/graph/kernal-clobbers.js +64 -0
  56. package/dist/graph/kernal-clobbers.js.map +1 -0
  57. package/dist/graph/machine-variants.js +208 -0
  58. package/dist/graph/machine-variants.js.map +1 -0
  59. package/dist/ingest/files.js +99 -0
  60. package/dist/ingest/files.js.map +1 -0
  61. package/dist/ingest/passes.js +104 -0
  62. package/dist/ingest/passes.js.map +1 -0
  63. package/dist/ingest/points.js +50 -0
  64. package/dist/ingest/points.js.map +1 -0
  65. package/dist/ingest/report.js +140 -0
  66. package/dist/ingest/report.js.map +1 -0
  67. package/dist/ingest/tally.js +81 -0
  68. package/dist/ingest/tally.js.map +1 -0
  69. package/dist/ingest/verified-on.js +43 -0
  70. package/dist/ingest/verified-on.js.map +1 -0
  71. package/dist/ingest.js +135 -0
  72. package/dist/ingest.js.map +1 -0
  73. package/dist/schemas/cost-basis.js +5 -0
  74. package/dist/schemas/cost-basis.js.map +1 -0
  75. package/dist/schemas/machine-variant.js +25 -0
  76. package/dist/schemas/machine-variant.js.map +1 -0
  77. package/dist/schemas/plan-budget.js +121 -0
  78. package/dist/schemas/plan-budget.js.map +1 -0
  79. package/dist/schemas/tool-outputs.js +526 -0
  80. package/dist/schemas/tool-outputs.js.map +1 -0
  81. package/dist/server/define-tool.js +52 -0
  82. package/dist/server/define-tool.js.map +1 -0
  83. package/dist/server/defined-only.js +9 -0
  84. package/dist/server/defined-only.js.map +1 -0
  85. package/dist/server/tools-briefings.js +70 -0
  86. package/dist/server/tools-briefings.js.map +1 -0
  87. package/dist/server/tools-lookup.js +180 -0
  88. package/dist/server/tools-lookup.js.map +1 -0
  89. package/dist/server/tools-maintenance.js +116 -0
  90. package/dist/server/tools-maintenance.js.map +1 -0
  91. package/dist/server/tools-pitfalls.js +89 -0
  92. package/dist/server/tools-pitfalls.js.map +1 -0
  93. package/dist/server/tools-recipes.js +296 -0
  94. package/dist/server/tools-recipes.js.map +1 -0
  95. package/dist/server/tools-runtime.js +48 -0
  96. package/dist/server/tools-runtime.js.map +1 -0
  97. package/dist/server/tools.js +43 -0
  98. package/dist/server/tools.js.map +1 -0
  99. package/dist/server.js +95 -0
  100. package/dist/server.js.map +1 -0
  101. package/dist/services/analytics/schema.js +78 -0
  102. package/dist/services/analytics/schema.js.map +1 -0
  103. package/dist/services/analytics/statements.js +99 -0
  104. package/dist/services/analytics/statements.js.map +1 -0
  105. package/dist/services/analytics.js +195 -0
  106. package/dist/services/analytics.js.map +1 -0
  107. package/dist/services/bm25.js +158 -0
  108. package/dist/services/bm25.js.map +1 -0
  109. package/dist/services/chunker.js +81 -0
  110. package/dist/services/chunker.js.map +1 -0
  111. package/dist/services/embeddings.js +58 -0
  112. package/dist/services/embeddings.js.map +1 -0
  113. package/dist/services/falkor/base.js +85 -0
  114. package/dist/services/falkor/base.js.map +1 -0
  115. package/dist/services/falkor/links.js +361 -0
  116. package/dist/services/falkor/links.js.map +1 -0
  117. package/dist/services/falkor/nodes.js +183 -0
  118. package/dist/services/falkor/nodes.js.map +1 -0
  119. package/dist/services/falkor/params.js +45 -0
  120. package/dist/services/falkor/params.js.map +1 -0
  121. package/dist/services/falkor/schema.js +77 -0
  122. package/dist/services/falkor/schema.js.map +1 -0
  123. package/dist/services/falkor.js +100 -0
  124. package/dist/services/falkor.js.map +1 -0
  125. package/dist/services/qdrant.js +238 -0
  126. package/dist/services/qdrant.js.map +1 -0
  127. package/dist/services/versions.js +73 -0
  128. package/dist/services/versions.js.map +1 -0
  129. package/dist/services/vice-bin.js +51 -0
  130. package/dist/services/vice-bin.js.map +1 -0
  131. package/dist/tools/briefings/archetype.js +174 -0
  132. package/dist/tools/briefings/archetype.js.map +1 -0
  133. package/dist/tools/briefings/budget.js +177 -0
  134. package/dist/tools/briefings/budget.js.map +1 -0
  135. package/dist/tools/briefings/build-order.js +135 -0
  136. package/dist/tools/briefings/build-order.js.map +1 -0
  137. package/dist/tools/briefings/build.js +185 -0
  138. package/dist/tools/briefings/build.js.map +1 -0
  139. package/dist/tools/briefings/discovery.js +290 -0
  140. package/dist/tools/briefings/discovery.js.map +1 -0
  141. package/dist/tools/briefings/plan-pitfalls.js +69 -0
  142. package/dist/tools/briefings/plan-pitfalls.js.map +1 -0
  143. package/dist/tools/briefings/render.js +151 -0
  144. package/dist/tools/briefings/render.js.map +1 -0
  145. package/dist/tools/briefings/rows.js +41 -0
  146. package/dist/tools/briefings/rows.js.map +1 -0
  147. package/dist/tools/briefings/toolchain.js +63 -0
  148. package/dist/tools/briefings/toolchain.js.map +1 -0
  149. package/dist/tools/briefings/why-proposed.js +69 -0
  150. package/dist/tools/briefings/why-proposed.js.map +1 -0
  151. package/dist/tools/briefings.js +44 -0
  152. package/dist/tools/briefings.js.map +1 -0
  153. package/dist/tools/feedback.js +97 -0
  154. package/dist/tools/feedback.js.map +1 -0
  155. package/dist/tools/hydrate.js +75 -0
  156. package/dist/tools/hydrate.js.map +1 -0
  157. package/dist/tools/intelligence.js +67 -0
  158. package/dist/tools/intelligence.js.map +1 -0
  159. package/dist/tools/lint/asm-decimal.js +86 -0
  160. package/dist/tools/lint/asm-decimal.js.map +1 -0
  161. package/dist/tools/lint/asm-rules.js +221 -0
  162. package/dist/tools/lint/asm-rules.js.map +1 -0
  163. package/dist/tools/lint/asm-shared.js +3 -0
  164. package/dist/tools/lint/asm-shared.js.map +1 -0
  165. package/dist/tools/lint/c-rules.js +215 -0
  166. package/dist/tools/lint/c-rules.js.map +1 -0
  167. package/dist/tools/lint/text.js +122 -0
  168. package/dist/tools/lint/text.js.map +1 -0
  169. package/dist/tools/lint/types.js +40 -0
  170. package/dist/tools/lint/types.js.map +1 -0
  171. package/dist/tools/lint.js +76 -0
  172. package/dist/tools/lint.js.map +1 -0
  173. package/dist/tools/memorization-mcp.js +111 -0
  174. package/dist/tools/memorization-mcp.js.map +1 -0
  175. package/dist/tools/pitfalls/bm25.js +53 -0
  176. package/dist/tools/pitfalls/bm25.js.map +1 -0
  177. package/dist/tools/pitfalls/format.js +58 -0
  178. package/dist/tools/pitfalls/format.js.map +1 -0
  179. package/dist/tools/pitfalls/graph.js +124 -0
  180. package/dist/tools/pitfalls/graph.js.map +1 -0
  181. package/dist/tools/pitfalls.js +134 -0
  182. package/dist/tools/pitfalls.js.map +1 -0
  183. package/dist/tools/prompts.js +81 -0
  184. package/dist/tools/prompts.js.map +1 -0
  185. package/dist/tools/query/compatibility/closure.js +62 -0
  186. package/dist/tools/query/compatibility/closure.js.map +1 -0
  187. package/dist/tools/query/compatibility/facts.js +28 -0
  188. package/dist/tools/query/compatibility/facts.js.map +1 -0
  189. package/dist/tools/query/compatibility/fetch.js +164 -0
  190. package/dist/tools/query/compatibility/fetch.js.map +1 -0
  191. package/dist/tools/query/compatibility/hard-rules.js +159 -0
  192. package/dist/tools/query/compatibility/hard-rules.js.map +1 -0
  193. package/dist/tools/query/compatibility/index.js +27 -0
  194. package/dist/tools/query/compatibility/index.js.map +1 -0
  195. package/dist/tools/query/compatibility/kernal-zp-rule.js +90 -0
  196. package/dist/tools/query/compatibility/kernal-zp-rule.js.map +1 -0
  197. package/dist/tools/query/compatibility/render.js +106 -0
  198. package/dist/tools/query/compatibility/render.js.map +1 -0
  199. package/dist/tools/query/compatibility/rules.js +337 -0
  200. package/dist/tools/query/compatibility/rules.js.map +1 -0
  201. package/dist/tools/query/compatibility/unit-rules.js +253 -0
  202. package/dist/tools/query/compatibility/unit-rules.js.map +1 -0
  203. package/dist/tools/query/game-design.js +83 -0
  204. package/dist/tools/query/game-design.js.map +1 -0
  205. package/dist/tools/query/lookups.js +220 -0
  206. package/dist/tools/query/lookups.js.map +1 -0
  207. package/dist/tools/query/plan-budget.js +266 -0
  208. package/dist/tools/query/plan-budget.js.map +1 -0
  209. package/dist/tools/query/recipes.js +214 -0
  210. package/dist/tools/query/recipes.js.map +1 -0
  211. package/dist/tools/query/retrieval.js +128 -0
  212. package/dist/tools/query/retrieval.js.map +1 -0
  213. package/dist/tools/query/shared.js +121 -0
  214. package/dist/tools/query/shared.js.map +1 -0
  215. package/dist/tools/query/techniques.js +331 -0
  216. package/dist/tools/query/techniques.js.map +1 -0
  217. package/dist/tools/query/timing.js +106 -0
  218. package/dist/tools/query/timing.js.map +1 -0
  219. package/dist/tools/query/types.js +11 -0
  220. package/dist/tools/query/types.js.map +1 -0
  221. package/dist/tools/query.js +21 -0
  222. package/dist/tools/query.js.map +1 -0
  223. package/dist/tools/resources.js +186 -0
  224. package/dist/tools/resources.js.map +1 -0
  225. package/dist/tools/run-game.js +249 -0
  226. package/dist/tools/run-game.js.map +1 -0
  227. package/dist/tools/selfimprovement.js +367 -0
  228. package/dist/tools/selfimprovement.js.map +1 -0
  229. package/docker-compose.yml +35 -0
  230. package/docs/ARCHITECTURE.md +164 -0
  231. package/docs/CONVENTIONS-archetypes.md +158 -0
  232. package/docs/CONVENTIONS-failures.md +46 -0
  233. package/docs/CONVENTIONS-game-designs.md +75 -0
  234. package/docs/CONVENTIONS-hardware-reference.md +184 -0
  235. package/docs/CONVENTIONS-pitfalls.md +91 -0
  236. package/docs/CONVENTIONS-recipes.md +106 -0
  237. package/docs/CONVENTIONS-techniques.md +309 -0
  238. package/docs/CONVENTIONS-toolchain-reference.md +89 -0
  239. package/docs/ONTOLOGY.md +655 -0
  240. package/docs/art/art-production-reference.md +157 -0
  241. package/docs/art/asset-pipelines.md +586 -0
  242. package/docs/c64-failure-patterns.md +693 -0
  243. package/docs/demo-design/demo-composition.md +349 -0
  244. package/docs/demo-design/demo-design-philosophy.md +320 -0
  245. package/docs/demo-design/intro-cracktro-patterns.md +435 -0
  246. package/docs/figures/ctm-spd-embed-probe.png +0 -0
  247. package/docs/figures/dot-flag-mid-5000000.png +0 -0
  248. package/docs/figures/dot-flag-no-erase-12000000.png +0 -0
  249. package/docs/figures/edges.json +1 -0
  250. package/docs/figures/fig6-architecture.png +0 -0
  251. package/docs/figures/fig7-ontology.png +0 -0
  252. package/docs/figures/screen-dissolve-mid-frame25.png +0 -0
  253. package/docs/figures/screen-dissolve-wipe-frame25.png +0 -0
  254. package/docs/figures/spindle-two-parts-part1.png +0 -0
  255. package/docs/figures/spindle-two-parts-part2.png +0 -0
  256. package/docs/figures/starters/action-puzzle.png +0 -0
  257. package/docs/figures/starters/adventure.png +0 -0
  258. package/docs/figures/starters/beat-em-up.png +0 -0
  259. package/docs/figures/starters/demo.png +0 -0
  260. package/docs/figures/starters/platformer.png +0 -0
  261. package/docs/figures/starters/shmup-vertical.png +0 -0
  262. package/docs/figures/tape-kernal-master-ntsc.png +0 -0
  263. package/docs/figures/tape-kernal-master-pal.png +0 -0
  264. package/docs/figures/tape-turbo-loader-ntsc.png +0 -0
  265. package/docs/figures/tape-turbo-loader-pal.png +0 -0
  266. package/docs/figures/tape-turbo-master-ntsc.png +0 -0
  267. package/docs/figures/tape-turbo-master-pal.png +0 -0
  268. package/docs/figures/tech-tech-pad2-12000000.png +0 -0
  269. package/docs/figures/tech-tech-pad4-12000000.png +0 -0
  270. package/docs/figures/tech-tech-seven-12000000.png +0 -0
  271. package/docs/figures/twister-mid-5000000.png +0 -0
  272. package/docs/figures/twister-straight-12000000.png +0 -0
  273. package/docs/figures/vector-balls-nosort-ntsc.png +0 -0
  274. package/docs/figures/vector-balls-nosort.png +0 -0
  275. package/docs/formats/c64-file-formats.md +1212 -0
  276. package/docs/formats/iec-disk-reference.md +754 -0
  277. package/docs/game-design/c64-game-archetypes.md +273 -0
  278. package/docs/game-design/designs/falling-blocks.md +54 -0
  279. package/docs/game-design/designs/platformer-scaffold.md +48 -0
  280. package/docs/game-design/designs/simple-shmup.md +27 -0
  281. package/docs/game-design/enemy-behaviour-and-difficulty.md +349 -0
  282. package/docs/game-design/game-design-patterns.md +1189 -0
  283. package/docs/game-design/game-structure.md +354 -0
  284. package/docs/game-design/production-planning.md +349 -0
  285. package/docs/game-design/reference-game-sources.md +90 -0
  286. package/docs/hardware/6502-illegal-opcodes.md +1353 -0
  287. package/docs/hardware/6510-cpu-reference.md +2112 -0
  288. package/docs/hardware/c64-memory-map.md +3184 -0
  289. package/docs/hardware/c64-registers-reference.md +996 -0
  290. package/docs/hardware/cia-reference.md +1281 -0
  291. package/docs/hardware/kernal-routines-reference.md +1836 -0
  292. package/docs/hardware/pal-ntsc-reference.md +813 -0
  293. package/docs/hardware/sid-reference.md +1137 -0
  294. package/docs/hardware/vic-ii-reference.md +1714 -0
  295. package/docs/music/music-production-reference.md +403 -0
  296. package/docs/pitfalls/banking.md +1067 -0
  297. package/docs/pitfalls/cia.md +1147 -0
  298. package/docs/pitfalls/cpu.md +874 -0
  299. package/docs/pitfalls/input.md +282 -0
  300. package/docs/pitfalls/kernal-and-io.md +1615 -0
  301. package/docs/pitfalls/loader.md +1191 -0
  302. package/docs/pitfalls/logic.md +94 -0
  303. package/docs/pitfalls/maths.md +187 -0
  304. package/docs/pitfalls/raster-and-badline.md +721 -0
  305. package/docs/pitfalls/region-timing.md +660 -0
  306. package/docs/pitfalls/scroll.md +207 -0
  307. package/docs/pitfalls/sid.md +738 -0
  308. package/docs/pitfalls/sprite.md +979 -0
  309. package/docs/pitfalls/text-mode-render.md +1172 -0
  310. package/docs/recipes/cc65/cartridge-8k.md +398 -0
  311. package/docs/recipes/cc65/hello-world-conio.md +76 -0
  312. package/docs/recipes/cc65/memory-layout.md +312 -0
  313. package/docs/recipes/cc65/screenshots/README.md +14 -0
  314. package/docs/recipes/cc65/screenshots/cartridge-8k-ntsc.png +0 -0
  315. package/docs/recipes/cc65/screenshots/cartridge-8k.png +0 -0
  316. package/docs/recipes/cc65/screenshots/hello-world-conio.png +0 -0
  317. package/docs/recipes/cc65/screenshots/memory-layout-ntsc.png +0 -0
  318. package/docs/recipes/cc65/screenshots/memory-layout.png +0 -0
  319. package/docs/recipes/kickassembler/basic-float-calls.md +578 -0
  320. package/docs/recipes/kickassembler/basic-wedge.md +398 -0
  321. package/docs/recipes/kickassembler/big-font-scroller.md +620 -0
  322. package/docs/recipes/kickassembler/charset-copy-rom-to-ram.md +623 -0
  323. package/docs/recipes/kickassembler/cia-revision-detect.md +366 -0
  324. package/docs/recipes/kickassembler/colour-cycling.md +343 -0
  325. package/docs/recipes/kickassembler/colour-fade.md +303 -0
  326. package/docs/recipes/kickassembler/compare-16bit-signed.md +1007 -0
  327. package/docs/recipes/kickassembler/cracktro-template.md +526 -0
  328. package/docs/recipes/kickassembler/crt-banked.md +276 -0
  329. package/docs/recipes/kickassembler/dos-error-codes.md +466 -0
  330. package/docs/recipes/kickassembler/dot-flag.md +576 -0
  331. package/docs/recipes/kickassembler/drive-job-queue.md +667 -0
  332. package/docs/recipes/kickassembler/drive-via-probe.md +690 -0
  333. package/docs/recipes/kickassembler/dycp-scroller.md +568 -0
  334. package/docs/recipes/kickassembler/dypp-sprite-scroller.md +681 -0
  335. package/docs/recipes/kickassembler/dysp.md +670 -0
  336. package/docs/recipes/kickassembler/easyflash-save.md +800 -0
  337. package/docs/recipes/kickassembler/eight-way-scroll.md +1484 -0
  338. package/docs/recipes/kickassembler/file-io-roundtrip.md +546 -0
  339. package/docs/recipes/kickassembler/fire-effect.md +420 -0
  340. package/docs/recipes/kickassembler/fld.md +414 -0
  341. package/docs/recipes/kickassembler/fli-image.md +336 -0
  342. package/docs/recipes/kickassembler/four-player-read.md +672 -0
  343. package/docs/recipes/kickassembler/headless-verify.md +228 -0
  344. package/docs/recipes/kickassembler/hello-world.md +98 -0
  345. package/docs/recipes/kickassembler/high-score-insert.md +660 -0
  346. package/docs/recipes/kickassembler/hires-plot-line.md +723 -0
  347. package/docs/recipes/kickassembler/irq-chain.md +316 -0
  348. package/docs/recipes/kickassembler/irq-owns-port.md +668 -0
  349. package/docs/recipes/kickassembler/isometric-room.md +1145 -0
  350. package/docs/recipes/kickassembler/light-pen-read.md +926 -0
  351. package/docs/recipes/kickassembler/logic-rate-decoupling.md +670 -0
  352. package/docs/recipes/kickassembler/mci-interlace.md +543 -0
  353. package/docs/recipes/kickassembler/memory-layout.md +277 -0
  354. package/docs/recipes/kickassembler/mouse-1351-read.md +801 -0
  355. package/docs/recipes/kickassembler/nmi-timer-tick.md +562 -0
  356. package/docs/recipes/kickassembler/own-keyscan.md +881 -0
  357. package/docs/recipes/kickassembler/paddle-read.md +751 -0
  358. package/docs/recipes/kickassembler/palette-cells.md +219 -0
  359. package/docs/recipes/kickassembler/pseudo-3d-road.md +930 -0
  360. package/docs/recipes/kickassembler/pwm-digi.md +463 -0
  361. package/docs/recipes/kickassembler/raster-bars.md +264 -0
  362. package/docs/recipes/kickassembler/reu-dma.md +1019 -0
  363. package/docs/recipes/kickassembler/runtime-relocation.md +743 -0
  364. package/docs/recipes/kickassembler/screen-dissolve.md +545 -0
  365. package/docs/recipes/kickassembler/screen-wipe.md +408 -0
  366. package/docs/recipes/kickassembler/screenshots/README.md +72 -0
  367. package/docs/recipes/kickassembler/screenshots/basic-float-calls-ntsc.png +0 -0
  368. package/docs/recipes/kickassembler/screenshots/basic-float-calls.png +0 -0
  369. package/docs/recipes/kickassembler/screenshots/basic-wedge-ntsc.png +0 -0
  370. package/docs/recipes/kickassembler/screenshots/basic-wedge.png +0 -0
  371. package/docs/recipes/kickassembler/screenshots/big-font-scroller-ntsc.png +0 -0
  372. package/docs/recipes/kickassembler/screenshots/big-font-scroller.png +0 -0
  373. package/docs/recipes/kickassembler/screenshots/charset-copy-rom-to-ram-ntsc.png +0 -0
  374. package/docs/recipes/kickassembler/screenshots/charset-copy-rom-to-ram.png +0 -0
  375. package/docs/recipes/kickassembler/screenshots/cia-revision-detect-ntsc.png +0 -0
  376. package/docs/recipes/kickassembler/screenshots/cia-revision-detect.png +0 -0
  377. package/docs/recipes/kickassembler/screenshots/colour-cycling-ntsc.png +0 -0
  378. package/docs/recipes/kickassembler/screenshots/colour-cycling.png +0 -0
  379. package/docs/recipes/kickassembler/screenshots/colour-fade-ntsc.png +0 -0
  380. package/docs/recipes/kickassembler/screenshots/colour-fade.png +0 -0
  381. package/docs/recipes/kickassembler/screenshots/compare-16bit-signed-ntsc.png +0 -0
  382. package/docs/recipes/kickassembler/screenshots/compare-16bit-signed.png +0 -0
  383. package/docs/recipes/kickassembler/screenshots/cracktro-template.png +0 -0
  384. package/docs/recipes/kickassembler/screenshots/crt-banked-ntsc.png +0 -0
  385. package/docs/recipes/kickassembler/screenshots/crt-banked.png +0 -0
  386. package/docs/recipes/kickassembler/screenshots/dos-error-codes-ntsc.png +0 -0
  387. package/docs/recipes/kickassembler/screenshots/dos-error-codes.png +0 -0
  388. package/docs/recipes/kickassembler/screenshots/dot-flag-ntsc.png +0 -0
  389. package/docs/recipes/kickassembler/screenshots/dot-flag.png +0 -0
  390. package/docs/recipes/kickassembler/screenshots/drive-job-queue-ntsc.png +0 -0
  391. package/docs/recipes/kickassembler/screenshots/drive-job-queue.png +0 -0
  392. package/docs/recipes/kickassembler/screenshots/drive-via-probe-ntsc.png +0 -0
  393. package/docs/recipes/kickassembler/screenshots/drive-via-probe.png +0 -0
  394. package/docs/recipes/kickassembler/screenshots/dycp-scroller-ntsc.png +0 -0
  395. package/docs/recipes/kickassembler/screenshots/dycp-scroller.png +0 -0
  396. package/docs/recipes/kickassembler/screenshots/dypp-sprite-scroller-ntsc.png +0 -0
  397. package/docs/recipes/kickassembler/screenshots/dypp-sprite-scroller.png +0 -0
  398. package/docs/recipes/kickassembler/screenshots/dysp-ntsc.png +0 -0
  399. package/docs/recipes/kickassembler/screenshots/dysp.png +0 -0
  400. package/docs/recipes/kickassembler/screenshots/easyflash-save-ntsc-run2.png +0 -0
  401. package/docs/recipes/kickassembler/screenshots/easyflash-save-ntsc.png +0 -0
  402. package/docs/recipes/kickassembler/screenshots/easyflash-save-run2.png +0 -0
  403. package/docs/recipes/kickassembler/screenshots/easyflash-save.png +0 -0
  404. package/docs/recipes/kickassembler/screenshots/eight-way-scroll-ntsc.png +0 -0
  405. package/docs/recipes/kickassembler/screenshots/eight-way-scroll.png +0 -0
  406. package/docs/recipes/kickassembler/screenshots/file-io-roundtrip-ntsc.png +0 -0
  407. package/docs/recipes/kickassembler/screenshots/file-io-roundtrip.png +0 -0
  408. package/docs/recipes/kickassembler/screenshots/fire-effect-ntsc.png +0 -0
  409. package/docs/recipes/kickassembler/screenshots/fire-effect.png +0 -0
  410. package/docs/recipes/kickassembler/screenshots/fld-ntsc.png +0 -0
  411. package/docs/recipes/kickassembler/screenshots/fld.png +0 -0
  412. package/docs/recipes/kickassembler/screenshots/fli-image.png +0 -0
  413. package/docs/recipes/kickassembler/screenshots/four-player-read-ntsc.png +0 -0
  414. package/docs/recipes/kickassembler/screenshots/four-player-read.png +0 -0
  415. package/docs/recipes/kickassembler/screenshots/headless-verify-ntsc.png +0 -0
  416. package/docs/recipes/kickassembler/screenshots/headless-verify.png +0 -0
  417. package/docs/recipes/kickassembler/screenshots/hello-world.png +0 -0
  418. package/docs/recipes/kickassembler/screenshots/high-score-insert-ntsc.png +0 -0
  419. package/docs/recipes/kickassembler/screenshots/high-score-insert.png +0 -0
  420. package/docs/recipes/kickassembler/screenshots/hires-plot-line-ntsc.png +0 -0
  421. package/docs/recipes/kickassembler/screenshots/hires-plot-line.png +0 -0
  422. package/docs/recipes/kickassembler/screenshots/irq-chain-ntsc.png +0 -0
  423. package/docs/recipes/kickassembler/screenshots/irq-chain.png +0 -0
  424. package/docs/recipes/kickassembler/screenshots/irq-owns-port-ntsc.png +0 -0
  425. package/docs/recipes/kickassembler/screenshots/irq-owns-port.png +0 -0
  426. package/docs/recipes/kickassembler/screenshots/isometric-room-ntsc.png +0 -0
  427. package/docs/recipes/kickassembler/screenshots/isometric-room.png +0 -0
  428. package/docs/recipes/kickassembler/screenshots/light-pen-read-ntsc.png +0 -0
  429. package/docs/recipes/kickassembler/screenshots/light-pen-read.png +0 -0
  430. package/docs/recipes/kickassembler/screenshots/logic-rate-decoupling-ntsc.png +0 -0
  431. package/docs/recipes/kickassembler/screenshots/logic-rate-decoupling.png +0 -0
  432. package/docs/recipes/kickassembler/screenshots/mci-interlace-average.png +0 -0
  433. package/docs/recipes/kickassembler/screenshots/mci-interlace-frame-b.png +0 -0
  434. package/docs/recipes/kickassembler/screenshots/mci-interlace-ntsc.png +0 -0
  435. package/docs/recipes/kickassembler/screenshots/mci-interlace.png +0 -0
  436. package/docs/recipes/kickassembler/screenshots/memory-layout-ntsc.png +0 -0
  437. package/docs/recipes/kickassembler/screenshots/memory-layout.png +0 -0
  438. package/docs/recipes/kickassembler/screenshots/mouse-1351-read-ntsc.png +0 -0
  439. package/docs/recipes/kickassembler/screenshots/mouse-1351-read.png +0 -0
  440. package/docs/recipes/kickassembler/screenshots/nmi-timer-tick-ntsc.png +0 -0
  441. package/docs/recipes/kickassembler/screenshots/nmi-timer-tick.png +0 -0
  442. package/docs/recipes/kickassembler/screenshots/own-keyscan-ntsc.png +0 -0
  443. package/docs/recipes/kickassembler/screenshots/own-keyscan.png +0 -0
  444. package/docs/recipes/kickassembler/screenshots/paddle-read-ntsc.png +0 -0
  445. package/docs/recipes/kickassembler/screenshots/paddle-read.png +0 -0
  446. package/docs/recipes/kickassembler/screenshots/palette-cells-ntsc.png +0 -0
  447. package/docs/recipes/kickassembler/screenshots/palette-cells.png +0 -0
  448. package/docs/recipes/kickassembler/screenshots/pseudo-3d-road-ntsc.png +0 -0
  449. package/docs/recipes/kickassembler/screenshots/pseudo-3d-road.png +0 -0
  450. package/docs/recipes/kickassembler/screenshots/pwm-digi-ntsc.png +0 -0
  451. package/docs/recipes/kickassembler/screenshots/pwm-digi.png +0 -0
  452. package/docs/recipes/kickassembler/screenshots/raster-bars.png +0 -0
  453. package/docs/recipes/kickassembler/screenshots/reu-dma-ntsc.png +0 -0
  454. package/docs/recipes/kickassembler/screenshots/reu-dma.png +0 -0
  455. package/docs/recipes/kickassembler/screenshots/runtime-relocation-ntsc.png +0 -0
  456. package/docs/recipes/kickassembler/screenshots/runtime-relocation.png +0 -0
  457. package/docs/recipes/kickassembler/screenshots/screen-dissolve-ntsc.png +0 -0
  458. package/docs/recipes/kickassembler/screenshots/screen-dissolve.png +0 -0
  459. package/docs/recipes/kickassembler/screenshots/screen-wipe-ntsc.png +0 -0
  460. package/docs/recipes/kickassembler/screenshots/screen-wipe.png +0 -0
  461. package/docs/recipes/kickassembler/screenshots/scroll-panel-split-ntsc.png +0 -0
  462. package/docs/recipes/kickassembler/screenshots/scroll-panel-split.png +0 -0
  463. package/docs/recipes/kickassembler/screenshots/sfx-in-player-ntsc.png +0 -0
  464. package/docs/recipes/kickassembler/screenshots/sfx-in-player.png +0 -0
  465. package/docs/recipes/kickassembler/screenshots/shadebobs-ntsc.png +0 -0
  466. package/docs/recipes/kickassembler/screenshots/shadebobs.png +0 -0
  467. package/docs/recipes/kickassembler/screenshots/sideborder-open.png +0 -0
  468. package/docs/recipes/kickassembler/screenshots/sine-scroller.png +0 -0
  469. package/docs/recipes/kickassembler/screenshots/sine-table-runtime-ntsc.png +0 -0
  470. package/docs/recipes/kickassembler/screenshots/sine-table-runtime.png +0 -0
  471. package/docs/recipes/kickassembler/screenshots/software-sprite-preshifted-ntsc.png +0 -0
  472. package/docs/recipes/kickassembler/screenshots/software-sprite-preshifted.png +0 -0
  473. package/docs/recipes/kickassembler/screenshots/speedcode-generator-ntsc.png +0 -0
  474. package/docs/recipes/kickassembler/screenshots/speedcode-generator.png +0 -0
  475. package/docs/recipes/kickassembler/screenshots/sprite-border-scroller-ntsc.png +0 -0
  476. package/docs/recipes/kickassembler/screenshots/sprite-border-scroller.png +0 -0
  477. package/docs/recipes/kickassembler/screenshots/sprite-cache-flip-ntsc.png +0 -0
  478. package/docs/recipes/kickassembler/screenshots/sprite-cache-flip.png +0 -0
  479. package/docs/recipes/kickassembler/screenshots/sprite-multiplex-24.png +0 -0
  480. package/docs/recipes/kickassembler/screenshots/sprite-multiplex-game-ntsc.png +0 -0
  481. package/docs/recipes/kickassembler/screenshots/sprite-multiplex-game.png +0 -0
  482. package/docs/recipes/kickassembler/screenshots/sprite-priority-classes-ntsc.png +0 -0
  483. package/docs/recipes/kickassembler/screenshots/sprite-priority-classes.png +0 -0
  484. package/docs/recipes/kickassembler/screenshots/sprite-sine-chain-ntsc.png +0 -0
  485. package/docs/recipes/kickassembler/screenshots/sprite-sine-chain.png +0 -0
  486. package/docs/recipes/kickassembler/screenshots/sprite-stretcher-ntsc.png +0 -0
  487. package/docs/recipes/kickassembler/screenshots/sprite-stretcher.png +0 -0
  488. package/docs/recipes/kickassembler/screenshots/sprites-only-screen-ntsc.png +0 -0
  489. package/docs/recipes/kickassembler/screenshots/sprites-only-screen.png +0 -0
  490. package/docs/recipes/kickassembler/screenshots/sqrt-atan2-ntsc.png +0 -0
  491. package/docs/recipes/kickassembler/screenshots/sqrt-atan2.png +0 -0
  492. package/docs/recipes/kickassembler/screenshots/stable-raster-irq-control.png +0 -0
  493. package/docs/recipes/kickassembler/screenshots/stable-raster-irq.png +0 -0
  494. package/docs/recipes/kickassembler/screenshots/tech-tech-ntsc.png +0 -0
  495. package/docs/recipes/kickassembler/screenshots/tech-tech.png +0 -0
  496. package/docs/recipes/kickassembler/screenshots/tod-alarm-ntsc.png +0 -0
  497. package/docs/recipes/kickassembler/screenshots/tod-alarm.png +0 -0
  498. package/docs/recipes/kickassembler/screenshots/topbottom-border-open.png +0 -0
  499. package/docs/recipes/kickassembler/screenshots/twister-ntsc.png +0 -0
  500. package/docs/recipes/kickassembler/screenshots/twister.png +0 -0
  501. package/docs/recipes/kickassembler/screenshots/unit-test-driver-ntsc.png +0 -0
  502. package/docs/recipes/kickassembler/screenshots/unit-test-driver.png +0 -0
  503. package/docs/recipes/kickassembler/screenshots/vector-balls-ntsc.png +0 -0
  504. package/docs/recipes/kickassembler/screenshots/vector-balls.png +0 -0
  505. package/docs/recipes/kickassembler/screenshots/wireframe-ships-ntsc.png +0 -0
  506. package/docs/recipes/kickassembler/screenshots/wireframe-ships.png +0 -0
  507. package/docs/recipes/kickassembler/scroll-panel-split.md +381 -0
  508. package/docs/recipes/kickassembler/sfx-in-player.md +907 -0
  509. package/docs/recipes/kickassembler/shadebobs.md +522 -0
  510. package/docs/recipes/kickassembler/sideborder-open.md +338 -0
  511. package/docs/recipes/kickassembler/sine-scroller.md +321 -0
  512. package/docs/recipes/kickassembler/sine-table-runtime.md +815 -0
  513. package/docs/recipes/kickassembler/software-sprite-preshifted.md +725 -0
  514. package/docs/recipes/kickassembler/speedcode-generator.md +606 -0
  515. package/docs/recipes/kickassembler/sprite-border-scroller.md +696 -0
  516. package/docs/recipes/kickassembler/sprite-cache-flip.md +1071 -0
  517. package/docs/recipes/kickassembler/sprite-multiplex-24.md +326 -0
  518. package/docs/recipes/kickassembler/sprite-multiplex-game.md +986 -0
  519. package/docs/recipes/kickassembler/sprite-priority-classes.md +463 -0
  520. package/docs/recipes/kickassembler/sprite-sine-chain.md +338 -0
  521. package/docs/recipes/kickassembler/sprite-stretcher.md +501 -0
  522. package/docs/recipes/kickassembler/sprites-only-screen.md +550 -0
  523. package/docs/recipes/kickassembler/sqrt-atan2.md +1014 -0
  524. package/docs/recipes/kickassembler/stable-raster-irq.md +360 -0
  525. package/docs/recipes/kickassembler/tape-turbo-loader.md +875 -0
  526. package/docs/recipes/kickassembler/tech-tech.md +679 -0
  527. package/docs/recipes/kickassembler/tod-alarm.md +754 -0
  528. package/docs/recipes/kickassembler/topbottom-border-open.md +407 -0
  529. package/docs/recipes/kickassembler/twister.md +518 -0
  530. package/docs/recipes/kickassembler/unit-test-driver.md +314 -0
  531. package/docs/recipes/kickassembler/vector-balls.md +545 -0
  532. package/docs/recipes/kickassembler/wireframe-ships.md +2324 -0
  533. package/docs/recipes/oscar64/actor-activation-window.md +807 -0
  534. package/docs/recipes/oscar64/adventure-engine.md +1094 -0
  535. package/docs/recipes/oscar64/attract-replay.md +465 -0
  536. package/docs/recipes/oscar64/beat-em-up-lanes.md +563 -0
  537. package/docs/recipes/oscar64/bfs-distance-map.md +723 -0
  538. package/docs/recipes/oscar64/bitmap-koala-viewer.md +355 -0
  539. package/docs/recipes/oscar64/car-contact.md +950 -0
  540. package/docs/recipes/oscar64/cave-scan.md +609 -0
  541. package/docs/recipes/oscar64/char-bullets.md +477 -0
  542. package/docs/recipes/oscar64/charset-animation.md +383 -0
  543. package/docs/recipes/oscar64/charset-parallax.md +401 -0
  544. package/docs/recipes/oscar64/destructible-terrain.md +1099 -0
  545. package/docs/recipes/oscar64/difficulty-tables.md +654 -0
  546. package/docs/recipes/oscar64/dig-and-guards.md +975 -0
  547. package/docs/recipes/oscar64/directory-reader.md +535 -0
  548. package/docs/recipes/oscar64/divide-check.md +581 -0
  549. package/docs/recipes/oscar64/double-buffer-nomirror.md +205 -0
  550. package/docs/recipes/oscar64/double-buffer.md +255 -0
  551. package/docs/recipes/oscar64/falling-blocks.md +874 -0
  552. package/docs/recipes/oscar64/fixed-point-jump-velocity.md +289 -0
  553. package/docs/recipes/oscar64/fixed-point-jump.md +210 -0
  554. package/docs/recipes/oscar64/flip-screen-rooms.md +793 -0
  555. package/docs/recipes/oscar64/frame-sync-loop-overrun.md +214 -0
  556. package/docs/recipes/oscar64/frame-sync-loop.md +254 -0
  557. package/docs/recipes/oscar64/game-tree-search.md +743 -0
  558. package/docs/recipes/oscar64/ghost-targeting.md +867 -0
  559. package/docs/recipes/oscar64/headless-verify.md +345 -0
  560. package/docs/recipes/oscar64/hello-world.md +83 -0
  561. package/docs/recipes/oscar64/high-score-persist.md +772 -0
  562. package/docs/recipes/oscar64/iffl-kernal-skip.md +421 -0
  563. package/docs/recipes/oscar64/joystick-input.md +358 -0
  564. package/docs/recipes/oscar64/lane-pursuit.md +1028 -0
  565. package/docs/recipes/oscar64/level-rle-decoder.md +620 -0
  566. package/docs/recipes/oscar64/lfsr-random-seed2.md +338 -0
  567. package/docs/recipes/oscar64/lfsr-random.md +403 -0
  568. package/docs/recipes/oscar64/load-asset-runtime.md +492 -0
  569. package/docs/recipes/oscar64/memory-layout.md +232 -0
  570. package/docs/recipes/oscar64/mixed-fighters.md +781 -0
  571. package/docs/recipes/oscar64/multi-sprite-object.md +533 -0
  572. package/docs/recipes/oscar64/nav-area-pathfinding.md +881 -0
  573. package/docs/recipes/oscar64/object-pool.md +572 -0
  574. package/docs/recipes/oscar64/pal-ntsc-detect.md +257 -0
  575. package/docs/recipes/oscar64/password-state.md +532 -0
  576. package/docs/recipes/oscar64/per-frame-hitbox.md +651 -0
  577. package/docs/recipes/oscar64/petscii-screen-codes.md +428 -0
  578. package/docs/recipes/oscar64/platformer-scaffold.md +1467 -0
  579. package/docs/recipes/oscar64/print-number.md +367 -0
  580. package/docs/recipes/oscar64/raster-bars.md +239 -0
  581. package/docs/recipes/oscar64/raster-profile-bars.md +404 -0
  582. package/docs/recipes/oscar64/rel-side-sectors.md +391 -0
  583. package/docs/recipes/oscar64/relative-file-records.md +378 -0
  584. package/docs/recipes/oscar64/save-load-seq-file.md +365 -0
  585. package/docs/recipes/oscar64/screenshots/README.md +99 -0
  586. package/docs/recipes/oscar64/screenshots/actor-activation-window-ntsc.png +0 -0
  587. package/docs/recipes/oscar64/screenshots/actor-activation-window.png +0 -0
  588. package/docs/recipes/oscar64/screenshots/adventure-engine-ntsc.png +0 -0
  589. package/docs/recipes/oscar64/screenshots/adventure-engine.png +0 -0
  590. package/docs/recipes/oscar64/screenshots/attract-replay-ntsc.png +0 -0
  591. package/docs/recipes/oscar64/screenshots/attract-replay.png +0 -0
  592. package/docs/recipes/oscar64/screenshots/beat-em-up-lanes-ntsc.png +0 -0
  593. package/docs/recipes/oscar64/screenshots/beat-em-up-lanes.png +0 -0
  594. package/docs/recipes/oscar64/screenshots/bfs-distance-map-ntsc.png +0 -0
  595. package/docs/recipes/oscar64/screenshots/bfs-distance-map.png +0 -0
  596. package/docs/recipes/oscar64/screenshots/bitmap-koala-viewer.png +0 -0
  597. package/docs/recipes/oscar64/screenshots/car-contact-ntsc.png +0 -0
  598. package/docs/recipes/oscar64/screenshots/car-contact.png +0 -0
  599. package/docs/recipes/oscar64/screenshots/cave-scan-ntsc.png +0 -0
  600. package/docs/recipes/oscar64/screenshots/cave-scan.png +0 -0
  601. package/docs/recipes/oscar64/screenshots/char-bullets-ntsc.png +0 -0
  602. package/docs/recipes/oscar64/screenshots/char-bullets.png +0 -0
  603. package/docs/recipes/oscar64/screenshots/charset-animation-ntsc.png +0 -0
  604. package/docs/recipes/oscar64/screenshots/charset-animation.png +0 -0
  605. package/docs/recipes/oscar64/screenshots/charset-parallax-ntsc.png +0 -0
  606. package/docs/recipes/oscar64/screenshots/charset-parallax.png +0 -0
  607. package/docs/recipes/oscar64/screenshots/destructible-terrain-ntsc.png +0 -0
  608. package/docs/recipes/oscar64/screenshots/destructible-terrain.png +0 -0
  609. package/docs/recipes/oscar64/screenshots/difficulty-tables-ntsc.png +0 -0
  610. package/docs/recipes/oscar64/screenshots/difficulty-tables.png +0 -0
  611. package/docs/recipes/oscar64/screenshots/dig-and-guards-ntsc.png +0 -0
  612. package/docs/recipes/oscar64/screenshots/dig-and-guards.png +0 -0
  613. package/docs/recipes/oscar64/screenshots/directory-reader-ntsc.png +0 -0
  614. package/docs/recipes/oscar64/screenshots/directory-reader.png +0 -0
  615. package/docs/recipes/oscar64/screenshots/divide-check-ntsc.png +0 -0
  616. package/docs/recipes/oscar64/screenshots/divide-check.png +0 -0
  617. package/docs/recipes/oscar64/screenshots/double-buffer-nomirror.png +0 -0
  618. package/docs/recipes/oscar64/screenshots/double-buffer-ntsc.png +0 -0
  619. package/docs/recipes/oscar64/screenshots/double-buffer.png +0 -0
  620. package/docs/recipes/oscar64/screenshots/falling-blocks-ntsc.png +0 -0
  621. package/docs/recipes/oscar64/screenshots/falling-blocks.png +0 -0
  622. package/docs/recipes/oscar64/screenshots/fixed-point-jump-ntsc.png +0 -0
  623. package/docs/recipes/oscar64/screenshots/fixed-point-jump-velocity-ntsc.png +0 -0
  624. package/docs/recipes/oscar64/screenshots/fixed-point-jump-velocity.png +0 -0
  625. package/docs/recipes/oscar64/screenshots/fixed-point-jump.png +0 -0
  626. package/docs/recipes/oscar64/screenshots/flip-screen-rooms-ntsc.png +0 -0
  627. package/docs/recipes/oscar64/screenshots/flip-screen-rooms.png +0 -0
  628. package/docs/recipes/oscar64/screenshots/frame-sync-loop-ntsc.png +0 -0
  629. package/docs/recipes/oscar64/screenshots/frame-sync-loop-overrun.png +0 -0
  630. package/docs/recipes/oscar64/screenshots/frame-sync-loop.png +0 -0
  631. package/docs/recipes/oscar64/screenshots/game-tree-search-ntsc.png +0 -0
  632. package/docs/recipes/oscar64/screenshots/game-tree-search.png +0 -0
  633. package/docs/recipes/oscar64/screenshots/ghost-targeting-ntsc.png +0 -0
  634. package/docs/recipes/oscar64/screenshots/ghost-targeting.png +0 -0
  635. package/docs/recipes/oscar64/screenshots/headless-verify-ntsc.png +0 -0
  636. package/docs/recipes/oscar64/screenshots/headless-verify.png +0 -0
  637. package/docs/recipes/oscar64/screenshots/hello-world.png +0 -0
  638. package/docs/recipes/oscar64/screenshots/high-score-persist-ntsc.png +0 -0
  639. package/docs/recipes/oscar64/screenshots/high-score-persist.png +0 -0
  640. package/docs/recipes/oscar64/screenshots/iffl-kernal-skip-ntsc.png +0 -0
  641. package/docs/recipes/oscar64/screenshots/iffl-kernal-skip.png +0 -0
  642. package/docs/recipes/oscar64/screenshots/joystick-input-ntsc.png +0 -0
  643. package/docs/recipes/oscar64/screenshots/joystick-input.png +0 -0
  644. package/docs/recipes/oscar64/screenshots/lane-pursuit-ntsc.png +0 -0
  645. package/docs/recipes/oscar64/screenshots/lane-pursuit.png +0 -0
  646. package/docs/recipes/oscar64/screenshots/level-rle-decoder-ntsc.png +0 -0
  647. package/docs/recipes/oscar64/screenshots/level-rle-decoder.png +0 -0
  648. package/docs/recipes/oscar64/screenshots/lfsr-random-ntsc.png +0 -0
  649. package/docs/recipes/oscar64/screenshots/lfsr-random-seed2.png +0 -0
  650. package/docs/recipes/oscar64/screenshots/lfsr-random.png +0 -0
  651. package/docs/recipes/oscar64/screenshots/load-asset-runtime-ntsc.png +0 -0
  652. package/docs/recipes/oscar64/screenshots/load-asset-runtime.png +0 -0
  653. package/docs/recipes/oscar64/screenshots/memory-layout-ntsc.png +0 -0
  654. package/docs/recipes/oscar64/screenshots/memory-layout.png +0 -0
  655. package/docs/recipes/oscar64/screenshots/mixed-fighters-ntsc.png +0 -0
  656. package/docs/recipes/oscar64/screenshots/mixed-fighters.png +0 -0
  657. package/docs/recipes/oscar64/screenshots/multi-sprite-object-ntsc.png +0 -0
  658. package/docs/recipes/oscar64/screenshots/multi-sprite-object.png +0 -0
  659. package/docs/recipes/oscar64/screenshots/nav-area-pathfinding-ntsc.png +0 -0
  660. package/docs/recipes/oscar64/screenshots/nav-area-pathfinding.png +0 -0
  661. package/docs/recipes/oscar64/screenshots/object-pool-ntsc.png +0 -0
  662. package/docs/recipes/oscar64/screenshots/object-pool.png +0 -0
  663. package/docs/recipes/oscar64/screenshots/pal-ntsc-detect-ntsc.png +0 -0
  664. package/docs/recipes/oscar64/screenshots/pal-ntsc-detect-oldntsc.png +0 -0
  665. package/docs/recipes/oscar64/screenshots/pal-ntsc-detect-pal.png +0 -0
  666. package/docs/recipes/oscar64/screenshots/password-state-ntsc.png +0 -0
  667. package/docs/recipes/oscar64/screenshots/password-state.png +0 -0
  668. package/docs/recipes/oscar64/screenshots/per-frame-hitbox-ntsc.png +0 -0
  669. package/docs/recipes/oscar64/screenshots/per-frame-hitbox.png +0 -0
  670. package/docs/recipes/oscar64/screenshots/petscii-screen-codes-ntsc.png +0 -0
  671. package/docs/recipes/oscar64/screenshots/petscii-screen-codes.png +0 -0
  672. package/docs/recipes/oscar64/screenshots/platformer-scaffold-d64-ntsc.png +0 -0
  673. package/docs/recipes/oscar64/screenshots/platformer-scaffold-d64.png +0 -0
  674. package/docs/recipes/oscar64/screenshots/platformer-scaffold-ntsc.png +0 -0
  675. package/docs/recipes/oscar64/screenshots/platformer-scaffold.png +0 -0
  676. package/docs/recipes/oscar64/screenshots/print-number-ntsc.png +0 -0
  677. package/docs/recipes/oscar64/screenshots/print-number.png +0 -0
  678. package/docs/recipes/oscar64/screenshots/raster-bars.png +0 -0
  679. package/docs/recipes/oscar64/screenshots/raster-profile-bars-ntsc.png +0 -0
  680. package/docs/recipes/oscar64/screenshots/raster-profile-bars.png +0 -0
  681. package/docs/recipes/oscar64/screenshots/rel-side-sectors-ntsc.png +0 -0
  682. package/docs/recipes/oscar64/screenshots/rel-side-sectors.png +0 -0
  683. package/docs/recipes/oscar64/screenshots/relative-file-records-ntsc.png +0 -0
  684. package/docs/recipes/oscar64/screenshots/relative-file-records.png +0 -0
  685. package/docs/recipes/oscar64/screenshots/save-load-seq-file-ntsc.png +0 -0
  686. package/docs/recipes/oscar64/screenshots/save-load-seq-file.png +0 -0
  687. package/docs/recipes/oscar64/screenshots/seeded-level-fill-ntsc.png +0 -0
  688. package/docs/recipes/oscar64/screenshots/seeded-level-fill.png +0 -0
  689. package/docs/recipes/oscar64/screenshots/sfx-engine-ntsc.png +0 -0
  690. package/docs/recipes/oscar64/screenshots/sfx-engine.png +0 -0
  691. package/docs/recipes/oscar64/screenshots/sid-music-player.png +0 -0
  692. package/docs/recipes/oscar64/screenshots/simple-shmup.png +0 -0
  693. package/docs/recipes/oscar64/screenshots/slope-collision-ntsc.png +0 -0
  694. package/docs/recipes/oscar64/screenshots/slope-collision.png +0 -0
  695. package/docs/recipes/oscar64/screenshots/soft-scroll-h.png +0 -0
  696. package/docs/recipes/oscar64/screenshots/sprite-animation-table-ntsc.png +0 -0
  697. package/docs/recipes/oscar64/screenshots/sprite-animation-table.png +0 -0
  698. package/docs/recipes/oscar64/screenshots/sprite-multiplex-8.png +0 -0
  699. package/docs/recipes/oscar64/screenshots/stable-raster-irq.png +0 -0
  700. package/docs/recipes/oscar64/screenshots/text-input-ntsc.png +0 -0
  701. package/docs/recipes/oscar64/screenshots/text-input.png +0 -0
  702. package/docs/recipes/oscar64/screenshots/text-overlay-playfield-gameover.png +0 -0
  703. package/docs/recipes/oscar64/screenshots/text-overlay-playfield-notrail-control.png +0 -0
  704. package/docs/recipes/oscar64/screenshots/text-overlay-playfield-ntsc.png +0 -0
  705. package/docs/recipes/oscar64/screenshots/text-overlay-playfield-ungated-control.png +0 -0
  706. package/docs/recipes/oscar64/screenshots/text-overlay-playfield.png +0 -0
  707. package/docs/recipes/oscar64/screenshots/text-window-menu-ntsc.png +0 -0
  708. package/docs/recipes/oscar64/screenshots/text-window-menu.png +0 -0
  709. package/docs/recipes/oscar64/screenshots/tile-grid-collision-ntsc.png +0 -0
  710. package/docs/recipes/oscar64/screenshots/tile-grid-collision.png +0 -0
  711. package/docs/recipes/oscar64/screenshots/tile-map-render-ntsc.png +0 -0
  712. package/docs/recipes/oscar64/screenshots/tile-map-render.png +0 -0
  713. package/docs/recipes/oscar64/screenshots/two-player-ntsc.png +0 -0
  714. package/docs/recipes/oscar64/screenshots/two-player.png +0 -0
  715. package/docs/recipes/oscar64/screenshots/two-word-parser-ntsc.png +0 -0
  716. package/docs/recipes/oscar64/screenshots/two-word-parser.png +0 -0
  717. package/docs/recipes/oscar64/screenshots/vehicle-control-ntsc.png +0 -0
  718. package/docs/recipes/oscar64/screenshots/vehicle-control.png +0 -0
  719. package/docs/recipes/oscar64/screenshots/wave-director-ntsc.png +0 -0
  720. package/docs/recipes/oscar64/screenshots/wave-director.png +0 -0
  721. package/docs/recipes/oscar64/seeded-level-fill.md +364 -0
  722. package/docs/recipes/oscar64/sfx-engine.md +514 -0
  723. package/docs/recipes/oscar64/sid-music-player.md +441 -0
  724. package/docs/recipes/oscar64/simple-shmup.md +1000 -0
  725. package/docs/recipes/oscar64/slope-collision.md +610 -0
  726. package/docs/recipes/oscar64/soft-scroll-h.md +261 -0
  727. package/docs/recipes/oscar64/sprite-animation-table.md +671 -0
  728. package/docs/recipes/oscar64/sprite-multiplex-8.md +314 -0
  729. package/docs/recipes/oscar64/stable-raster-irq.md +236 -0
  730. package/docs/recipes/oscar64/text-input.md +274 -0
  731. package/docs/recipes/oscar64/text-overlay-playfield.md +617 -0
  732. package/docs/recipes/oscar64/text-window-menu.md +551 -0
  733. package/docs/recipes/oscar64/tile-grid-collision.md +563 -0
  734. package/docs/recipes/oscar64/tile-map-render.md +395 -0
  735. package/docs/recipes/oscar64/two-player.md +528 -0
  736. package/docs/recipes/oscar64/two-word-parser.md +510 -0
  737. package/docs/recipes/oscar64/vehicle-control.md +771 -0
  738. package/docs/recipes/oscar64/wave-director.md +787 -0
  739. package/docs/recipes/runs.json +1606 -0
  740. package/docs/runtime/sim6502-reference.md +466 -0
  741. package/docs/runtime/vice-mcp-reference.md +351 -0
  742. package/docs/runtime/vice-reference.md +1393 -0
  743. package/docs/techniques/bitmap-modes.md +685 -0
  744. package/docs/techniques/cpu-cycle-tricks.md +1570 -0
  745. package/docs/techniques/effects-vector-3d.md +1431 -0
  746. package/docs/techniques/file-io.md +1427 -0
  747. package/docs/techniques/input.md +1072 -0
  748. package/docs/techniques/loaders-packers.md +768 -0
  749. package/docs/techniques/logic.md +3091 -0
  750. package/docs/techniques/maths.md +1524 -0
  751. package/docs/techniques/memory-banking.md +1686 -0
  752. package/docs/techniques/music-sid.md +1144 -0
  753. package/docs/techniques/raster.md +1543 -0
  754. package/docs/techniques/scroll.md +1292 -0
  755. package/docs/techniques/sprite.md +2566 -0
  756. package/docs/techniques/text-mode-render.md +717 -0
  757. package/docs/techniques/text.md +1095 -0
  758. package/docs/techniques/transitions.md +405 -0
  759. package/docs/toolchains/cartconv-reference.md +262 -0
  760. package/docs/toolchains/cc1541-reference.md +316 -0
  761. package/docs/toolchains/cc65-reference.md +667 -0
  762. package/docs/toolchains/error-sources/cc65/README.md +1 -0
  763. package/docs/toolchains/error-sources/cc65/missing-setcpu.s +4 -0
  764. package/docs/toolchains/error-sources/cc65/range-error.s +4 -0
  765. package/docs/toolchains/error-sources/cc65/segment-overflow.c +6 -0
  766. package/docs/toolchains/error-sources/cc65/unresolved-external.c +6 -0
  767. package/docs/toolchains/error-sources/kickassembler/README.md +1 -0
  768. package/docs/toolchains/error-sources/kickassembler/branch-out-of-range.asm +4 -0
  769. package/docs/toolchains/error-sources/kickassembler/failed-assert.asm +3 -0
  770. package/docs/toolchains/error-sources/kickassembler/flat-lib.asm +4 -0
  771. package/docs/toolchains/error-sources/kickassembler/import-source-no-namespace.asm +5 -0
  772. package/docs/toolchains/error-sources/kickassembler/macro-without-parentheses.asm +6 -0
  773. package/docs/toolchains/error-sources/kickassembler/memory-block-overlap.asm +4 -0
  774. package/docs/toolchains/error-sources/kickassembler/symbol-clash-lib.asm +5 -0
  775. package/docs/toolchains/error-sources/kickassembler/symbol-clash-main.asm +6 -0
  776. package/docs/toolchains/error-sources/kickassembler/unknown-symbol.asm +4 -0
  777. package/docs/toolchains/error-sources/oscar64/README.md +1 -0
  778. package/docs/toolchains/error-sources/oscar64/asm-addressing-mode.c +7 -0
  779. package/docs/toolchains/error-sources/oscar64/region-overflow.c +6 -0
  780. package/docs/toolchains/error-sources/oscar64/undefined-extern-var.c +5 -0
  781. package/docs/toolchains/error-sources/oscar64/undefined-extern.c +6 -0
  782. package/docs/toolchains/error-sources/oscar64/unknown-vic-field.c +6 -0
  783. package/docs/toolchains/error-sources/oscar64/void-main.c +3 -0
  784. package/docs/toolchains/kickassembler-reference.md +1020 -0
  785. package/docs/toolchains/memory-layout-planning.md +362 -0
  786. package/docs/toolchains/oscar64-headers-reference.md +583 -0
  787. package/docs/toolchains/oscar64-reference.md +892 -0
  788. package/docs/toolchains/petcat-reference.md +290 -0
  789. package/docs/toolchains/png2prg.md +188 -0
  790. package/docs/toolchains/release-disk.md +314 -0
  791. package/docs/toolchains/sidreloc.md +236 -0
  792. package/docs/toolchains/spindle-reference.md +487 -0
  793. package/docs/toolchains/tape-mastering.md +592 -0
  794. package/docs/toolchains/unit-testing-6502.md +281 -0
  795. package/docs/workflow/agent-harness.md +478 -0
  796. package/package.json +105 -0
  797. package/templates/_harness/CLAUDE.md.template +91 -0
  798. package/templates/_harness/PLAN.md.template +72 -0
  799. package/templates/_harness/check.py +442 -0
  800. package/templates/_harness/claude/settings.json +17 -0
  801. package/templates/_harness/gen-asm-header.py +96 -0
  802. package/templates/_harness/harness.mk +273 -0
  803. package/templates/_harness/hooks/plan-gate.py +185 -0
  804. package/templates/_harness/meter/frame_meter.asm +311 -0
  805. package/templates/_harness/meter/frame_meter.c +155 -0
  806. package/templates/_harness/meter/frame_meter.h +80 -0
  807. package/templates/_harness/zp-used.py +104 -0
  808. package/templates/action-puzzle/.claude/settings.json +17 -0
  809. package/templates/action-puzzle/.mcp.json +10 -0
  810. package/templates/action-puzzle/CLAUDE.md +120 -0
  811. package/templates/action-puzzle/Makefile +125 -0
  812. package/templates/action-puzzle/PLAN.md +388 -0
  813. package/templates/action-puzzle/README.md +240 -0
  814. package/templates/action-puzzle/expect.json +25 -0
  815. package/templates/action-puzzle/src/cave.c +280 -0
  816. package/templates/action-puzzle/src/cave.h +80 -0
  817. package/templates/action-puzzle/src/gen_autopilot.h +20 -0
  818. package/templates/action-puzzle/src/gen_caves.h +59 -0
  819. package/templates/action-puzzle/src/gen_notes.h +16 -0
  820. package/templates/action-puzzle/src/hiscore.c +152 -0
  821. package/templates/action-puzzle/src/hiscore.h +41 -0
  822. package/templates/action-puzzle/src/level.c +64 -0
  823. package/templates/action-puzzle/src/level.h +24 -0
  824. package/templates/action-puzzle/src/main.c +599 -0
  825. package/templates/action-puzzle/src/render.c +239 -0
  826. package/templates/action-puzzle/src/render.h +31 -0
  827. package/templates/action-puzzle/src/sound.c +158 -0
  828. package/templates/action-puzzle/src/sound.h +22 -0
  829. package/templates/action-puzzle/tools/disk_check.py +77 -0
  830. package/templates/action-puzzle/tools/drive.py +106 -0
  831. package/templates/action-puzzle/tools/gen.py +454 -0
  832. package/templates/action-puzzle/tools/model_check.py +49 -0
  833. package/templates/action-puzzle/tools/verdict_codes.py +24 -0
  834. package/templates/adventure/.claude/settings.json +17 -0
  835. package/templates/adventure/.mcp.json +10 -0
  836. package/templates/adventure/CLAUDE.md +118 -0
  837. package/templates/adventure/Makefile +113 -0
  838. package/templates/adventure/PLAN.md +396 -0
  839. package/templates/adventure/README.md +277 -0
  840. package/templates/adventure/expect.json +25 -0
  841. package/templates/adventure/src/engine.c +543 -0
  842. package/templates/adventure/src/engine.h +48 -0
  843. package/templates/adventure/src/gen_script.h +141 -0
  844. package/templates/adventure/src/gen_world.h +511 -0
  845. package/templates/adventure/src/main.c +439 -0
  846. package/templates/adventure/src/picture.c +83 -0
  847. package/templates/adventure/src/picture.h +16 -0
  848. package/templates/adventure/src/save.c +159 -0
  849. package/templates/adventure/src/save.h +25 -0
  850. package/templates/adventure/src/sound.c +71 -0
  851. package/templates/adventure/src/sound.h +16 -0
  852. package/templates/adventure/src/text.c +349 -0
  853. package/templates/adventure/src/text.h +40 -0
  854. package/templates/adventure/tools/disk_check.py +128 -0
  855. package/templates/adventure/tools/drive.py +119 -0
  856. package/templates/adventure/tools/gen.py +1033 -0
  857. package/templates/adventure/tools/world.py +356 -0
  858. package/templates/beat-em-up/.claude/settings.json +17 -0
  859. package/templates/beat-em-up/.mcp.json +10 -0
  860. package/templates/beat-em-up/CLAUDE.md +136 -0
  861. package/templates/beat-em-up/Makefile +96 -0
  862. package/templates/beat-em-up/PLAN.md +502 -0
  863. package/templates/beat-em-up/README.md +315 -0
  864. package/templates/beat-em-up/expect-gameover.json +8 -0
  865. package/templates/beat-em-up/expect.json +29 -0
  866. package/templates/beat-em-up/src/anim.c +70 -0
  867. package/templates/beat-em-up/src/art.c +344 -0
  868. package/templates/beat-em-up/src/autopilot.h +154 -0
  869. package/templates/beat-em-up/src/brute.c +273 -0
  870. package/templates/beat-em-up/src/enemy.c +281 -0
  871. package/templates/beat-em-up/src/engine.asm +512 -0
  872. package/templates/beat-em-up/src/fighter.c +384 -0
  873. package/templates/beat-em-up/src/game.h +269 -0
  874. package/templates/beat-em-up/src/hud.c +135 -0
  875. package/templates/beat-em-up/src/main.c +341 -0
  876. package/templates/beat-em-up/src/sound.c +44 -0
  877. package/templates/beat-em-up/src/street.c +93 -0
  878. package/templates/beat-em-up/src/verdict.h +523 -0
  879. package/templates/beat-em-up/src/view.c +362 -0
  880. package/templates/beat-em-up/tools/drive.py +105 -0
  881. package/templates/beat-em-up/tools/flickercheck.py +273 -0
  882. package/templates/demo/.claude/settings.json +17 -0
  883. package/templates/demo/.mcp.json +10 -0
  884. package/templates/demo/CLAUDE.md +129 -0
  885. package/templates/demo/Makefile +66 -0
  886. package/templates/demo/PLAN.md +401 -0
  887. package/templates/demo/README.md +322 -0
  888. package/templates/demo/expect.json +945 -0
  889. package/templates/demo/src/config.asm +80 -0
  890. package/templates/demo/src/framework.asm +390 -0
  891. package/templates/demo/src/main.asm +139 -0
  892. package/templates/demo/src/music.asm +197 -0
  893. package/templates/demo/src/part_main.asm +279 -0
  894. package/templates/demo/src/part_title.asm +79 -0
  895. package/templates/demo/src/parts.asm +43 -0
  896. package/templates/demo/src/tables.asm +73 -0
  897. package/templates/demo/src/verdict.asm +179 -0
  898. package/templates/demo/tools/audio.py +80 -0
  899. package/templates/demo/tools/gen_expect.py +167 -0
  900. package/templates/demo/tools/probe.py +95 -0
  901. package/templates/hello/.claude/settings.json +17 -0
  902. package/templates/hello/.mcp.json +10 -0
  903. package/templates/hello/CLAUDE.md +100 -0
  904. package/templates/hello/Makefile +38 -0
  905. package/templates/hello/PLAN.md +200 -0
  906. package/templates/hello/expect.json +20 -0
  907. package/templates/hello/src/main.c +161 -0
  908. package/templates/hello/src/sprite.asm +27 -0
  909. package/templates/hello-kick/.claude/settings.json +17 -0
  910. package/templates/hello-kick/.mcp.json +10 -0
  911. package/templates/hello-kick/CLAUDE.md +100 -0
  912. package/templates/hello-kick/Makefile +17 -0
  913. package/templates/hello-kick/PLAN.md +199 -0
  914. package/templates/hello-kick/expect.json +20 -0
  915. package/templates/hello-kick/src/main.asm +233 -0
  916. package/templates/platformer/.claude/settings.json +17 -0
  917. package/templates/platformer/.mcp.json +10 -0
  918. package/templates/platformer/CLAUDE.md +125 -0
  919. package/templates/platformer/Makefile +86 -0
  920. package/templates/platformer/PLAN.md +360 -0
  921. package/templates/platformer/README.md +277 -0
  922. package/templates/platformer/expect.json +32 -0
  923. package/templates/platformer/src/actors.c +289 -0
  924. package/templates/platformer/src/anim.c +51 -0
  925. package/templates/platformer/src/art.c +212 -0
  926. package/templates/platformer/src/autopilot.h +30 -0
  927. package/templates/platformer/src/engine.asm +253 -0
  928. package/templates/platformer/src/game.h +248 -0
  929. package/templates/platformer/src/hud.c +90 -0
  930. package/templates/platformer/src/level.c +184 -0
  931. package/templates/platformer/src/main.c +306 -0
  932. package/templates/platformer/src/player.c +268 -0
  933. package/templates/platformer/src/sound.c +42 -0
  934. package/templates/platformer/src/verdict.h +206 -0
  935. package/templates/platformer/src/view.c +331 -0
  936. package/templates/platformer/stage-expect.json +6 -0
  937. package/templates/platformer/tools/drive.py +112 -0
  938. package/templates/platformer/tools/tearcheck.py +229 -0
  939. package/templates/shmup-vertical/.claude/settings.json +17 -0
  940. package/templates/shmup-vertical/.mcp.json +10 -0
  941. package/templates/shmup-vertical/CLAUDE.md +137 -0
  942. package/templates/shmup-vertical/Makefile +131 -0
  943. package/templates/shmup-vertical/PLAN.md +569 -0
  944. package/templates/shmup-vertical/README.md +189 -0
  945. package/templates/shmup-vertical/expect.json +38 -0
  946. package/templates/shmup-vertical/src/bullets.c +158 -0
  947. package/templates/shmup-vertical/src/bullets.h +35 -0
  948. package/templates/shmup-vertical/src/display.c +239 -0
  949. package/templates/shmup-vertical/src/display.h +40 -0
  950. package/templates/shmup-vertical/src/game.h +85 -0
  951. package/templates/shmup-vertical/src/glyph.asm +358 -0
  952. package/templates/shmup-vertical/src/hiscore.c +141 -0
  953. package/templates/shmup-vertical/src/hiscore.h +16 -0
  954. package/templates/shmup-vertical/src/hit.asm +180 -0
  955. package/templates/shmup-vertical/src/hitbox.c +59 -0
  956. package/templates/shmup-vertical/src/hitbox.h +25 -0
  957. package/templates/shmup-vertical/src/kernel.asm +330 -0
  958. package/templates/shmup-vertical/src/level.c +174 -0
  959. package/templates/shmup-vertical/src/level.h +27 -0
  960. package/templates/shmup-vertical/src/main.c +824 -0
  961. package/templates/shmup-vertical/src/mux.asm +321 -0
  962. package/templates/shmup-vertical/src/sound.asm +255 -0
  963. package/templates/shmup-vertical/src/step.asm +169 -0
  964. package/templates/shmup-vertical/src/waves.c +195 -0
  965. package/templates/shmup-vertical/src/waves.h +33 -0
  966. package/templates/shmup-vertical/stage-expect.json +6 -0
  967. package/templates/shmup-vertical/tools/drive.py +152 -0
  968. package/templates/shmup-vertical/tools/joytest.py +159 -0
  969. package/templates/shmup-vertical/tools/meter.py +15 -0
  970. package/templates/shmup-vertical/tools/phases.py +73 -0
@@ -0,0 +1,667 @@
1
+ ---
2
+ tool: cc65
3
+ tool_kind: c-compiler
4
+ maintainer: cc65-team
5
+ license: Zlib
6
+ home_url: https://cc65.github.io/
7
+ version_verified: "2.18"
8
+ # cl65 --version reports 2.18 while the Homebrew package is labelled 2.19; the Krill page says tagged 2.18 miscompiles Krill, so do not install tagged 2.18 on the strength of this line.
9
+ ---
10
+
11
+ <!-- doc-type: toolchain-reference -->
12
+
13
+ # cc65 — C Compiler and Assembler Suite
14
+
15
+ ## Tool
16
+
17
+ cc65 is a complete cross-development package for 65(C)02 systems. It includes a
18
+ C compiler (`cc65`), a macro assembler (`ca65`), a linker (`ld65`), a librarian
19
+ (`ar65`), and a driver wrapper (`cl65`) that orchestrates the whole pipeline. The
20
+ suite targets a wide range of retro platforms; for c64-kb purposes the relevant
21
+ target is `-t c64`.
22
+
23
+ cc65 has an enormous published corpus — decades of tutorials, forum posts, and
24
+ open-source games — which makes it the path of least resistance for LLMs trained
25
+ on that data. **This doc exists primarily to help the agent recognize cc65 patterns
26
+ and evaluate whether switching to [oscar64](oscar64-reference.md) would produce
27
+ tighter, faster code.** In most action-game and demo contexts, it would.
28
+
29
+ **Targets:** 6510
30
+
31
+ ## Quick reference
32
+
33
+ ```bash
34
+ # macOS
35
+ brew install cc65
36
+
37
+ # Debian / Ubuntu
38
+ sudo apt install cc65
39
+
40
+ # Arch Linux
41
+ sudo pacman -S cc65
42
+
43
+ # Build a single-file program
44
+ cl65 -O -t c64 -o hello.prg hello.c
45
+ ```
46
+
47
+ ## Build pipeline
48
+
49
+ The full cc65 pipeline runs three tools in sequence:
50
+
51
+ ```
52
+ hello.c →[cc65]→ hello.s →[ca65]→ hello.o →[ld65]→ hello.prg
53
+ ```
54
+
55
+ `cl65` is the driver that invokes each step automatically (see next section).
56
+ Individual tools can be called directly when fine-grained control is needed —
57
+ for example, mixing hand-written ca65 assembly with C translation units.
58
+
59
+ ### .PRG — Program file (executable)
60
+
61
+ **Produced by:** cc65
62
+ **Consumed by:** vice, c1541
63
+
64
+ Two-byte load address prefix followed by machine code. The standard C64
65
+ executable format. `ld65` writes this when given the `c64` target config.
66
+
67
+ ### .S — C compiler assembly output
68
+
69
+ **Produced by:** cc65
70
+
71
+ Human-readable 6502 assembly emitted by the `cc65` compiler stage. Useful for
72
+ inspecting codegen quality and understanding what overhead the compiler is
73
+ adding. Pass directly to `ca65` or let `cl65` handle it.
74
+
75
+ ### .O — Object file
76
+
77
+ **Produced by:** cc65
78
+ **Consumed by:** cc65
79
+
80
+ Relocatable object produced by `ca65`. Contains code, data segments, and
81
+ symbol information. Linked by `ld65` to produce the final binary.
82
+
83
+ ### .LIB — Library archive
84
+
85
+ **Produced by:** cc65
86
+ **Consumed by:** cc65
87
+
88
+ Static library archive produced by `ar65`. The standard C64 runtime and
89
+ platform libraries ship as `.lib` files bundled with the cc65 distribution.
90
+
91
+ ## The cl65 wrapper
92
+
93
+ `cl65` is the recommended entry point. It detects file types by extension and
94
+ invokes `cc65 → ca65 → ld65` in the right order.
95
+
96
+ Common flags:
97
+
98
+ | Flag | Effect |
99
+ |------|--------|
100
+ | `-t c64` | Set target platform to Commodore 64 |
101
+ | `-O` | Enable basic optimizer pass |
102
+ | `-o hello.prg` | Name the output file |
103
+ | `-Cl` | Static locals (faster, not reentrant; see Pitfalls) |
104
+ | `--config path.cfg` | Use a custom linker config instead of the built-in c64 one |
105
+ | `-T` (`--add-source`) | Interleave the C source as comments in the generated assembly. An earlier version of this row said `-T` keeps intermediate files; it does not, and `cl65` has no such flag. To inspect the `.s`, stop the pipeline with `-S` (or run `cc65 -O -t c64 file.c` directly); `-c` stops after assembling. `cl65` leaves the `.o` files in place by default. |
106
+
107
+ The `-Cl` flag places local variables in BSS rather than on the software stack.
108
+ This cuts call overhead noticeably but breaks reentrancy. Acceptable for most
109
+ C64 code where recursion is deliberate and bounded.
110
+
111
+ For multi-file projects, name each `.c` and `.s` source on the command line and
112
+ `cl65` links them in one pass:
113
+
114
+ ```bash
115
+ cl65 -O -t c64 -Cl -o game.prg main.c sprite.c irq.s
116
+ ```
117
+
118
+ ### ca65 notes
119
+
120
+ Hand-written `.s` files go through `ca65`, which differs from KickAssembler in
121
+ three ways that bite (measured with ca65 V2.18, Homebrew cc65 2.19):
122
+
123
+ - Illegal opcodes (`lax`, `sax`, `dcp`, …) need `.setcpu "6502X"` in the file
124
+ or `--cpu 6502X` on the command line; without it every illegal mnemonic
125
+ fails with `Error: ':' expected`, a message that does not name the CPU.
126
+ `lsr a` is accepted. Spellings are in
127
+ [6502-illegal-opcodes.md](../hardware/6502-illegal-opcodes.md) (Pitfalls).
128
+ - Under `-t c64` a string literal is translated to PETSCII, not screen codes:
129
+ `.byte "FILM"` emits `$C6 $C9 $CC $CD` (shifted letters, which `CHROUT`
130
+ draws as graphics glyphs on the power-on charset) and `.byte "film"` emits
131
+ `$46 $49 $4C $4D` (which `CHROUT` draws as `FILM`). Write lowercase in
132
+ source for uppercase on screen. For screen RAM use `.macpack cbm` and
133
+ `scrcode "film"`, which emits `$06 $09 $0C $0D`. There is no
134
+ `cbm_screen_charmap.inc` for ca65; `cbm_screen_charmap.h` is the C-side
135
+ equivalent.
136
+ - A `.s` file linked on its own needs
137
+ `cl65 -t c64 -C c64-asm.cfg -u __EXEHDR__`; the default `c64.cfg` expects
138
+ the C runtime and fails with "Start address of memory area 'BSS' is not
139
+ constant".
140
+
141
+ ## Multi-file projects
142
+
143
+ `cl65` compiles each `.c` with `cc65`, assembles each `.s` (and each
144
+ generated `.s`) with `ca65` into a `.o`, and links every `.o` with `ld65`
145
+ in one command; the `cl65` line above is the whole build system. Symbols
146
+ cross the C/assembly boundary by name, with one rule: a C identifier `x`
147
+ is the assembler symbol `_x`. Measured with cl65 V2.18 (Homebrew cc65 2.19)
148
+ on the three files below; the 290-byte `out.prg` turned the border and
149
+ screen green in VICE x64sc 3.10.
150
+
151
+ The header is ordinary C. `__fastcall__` passes the last (here the only)
152
+ argument in A instead of on the software stack, which is what an assembly
153
+ routine wants:
154
+
155
+ ```text
156
+ /* border.h */
157
+ #ifndef BORDER_H
158
+ #define BORDER_H
159
+ extern unsigned char border_calls; /* defined in border.s as _border_calls */
160
+ void __fastcall__ border_set(unsigned char colour);
161
+ #endif
162
+ ```
163
+
164
+ The module exports the underscored names. `.bss` with `.res` is a variable,
165
+ `.code` is code; both segments are ones `c64.cfg` already places:
166
+
167
+ ```text
168
+ ; border.s: ca65 module. C sees border_set and border_calls; the
169
+ ; assembler names carry a leading underscore.
170
+ .export _border_set
171
+ .export _border_calls
172
+
173
+ .bss
174
+ _border_calls: .res 1
175
+
176
+ .code
177
+ ; void __fastcall__ border_set(unsigned char colour): colour arrives in A
178
+ _border_set:
179
+ sta $d020
180
+ sta $d021
181
+ inc _border_calls
182
+ rts
183
+ ```
184
+
185
+ ```text
186
+ /* main.c */
187
+ #include "border.h"
188
+ int main(void)
189
+ {
190
+ border_set(5);
191
+ while (border_calls) ;
192
+ return 0;
193
+ }
194
+ ```
195
+
196
+ ```
197
+ cl65 -t c64 -O -o out.prg main.c border.s --mapfile out.map
198
+ ```
199
+
200
+ The other direction is `.import _name` in the `.s` for a C function or
201
+ variable, and `jsr _name` (not measured here). `--mapfile` is how to
202
+ confirm what linked. Its "Segment list" gives every segment's start, end
203
+ and size (`CODE 000840 0008B5 000076`, `BSS 0008FB 0008FB 000001` for this
204
+ build) and its "Exports list" gives every cross-unit symbol with its
205
+ address and the module that defined it: `_main 000840`,
206
+ `_border_set 00084C`, `_border_calls 0008FB`, each followed by `RLA`
207
+ (relocatable label address). A symbol you expected and cannot find in the
208
+ Exports list was never `.export`ed, which is the failing form. Delete the
209
+ `.export _border_set` line and the link stops:
210
+
211
+ ```text
212
+ Unresolved external '_border_set' referenced in:
213
+ main.s(29)
214
+ ld65: Error: 1 unresolved external(s) found - cannot create output file
215
+ ```
216
+
217
+ `main.s(29)` is the generated assembly of `main.c`, not a line of the C
218
+ file; `cl65 -S main.c` writes it if you need the line. The whole-program
219
+ view of where each segment lands, and how to move one, is
220
+ [memory-layout-planning.md](memory-layout-planning.md).
221
+
222
+ ## Standard library highlights
223
+
224
+ cc65 ships extensive C64-specific headers alongside the standard ones. The
225
+ table below covers the subset relevant to typical C64 use:
226
+
227
+ | Header | Purpose |
228
+ |--------|---------|
229
+ | `conio.h` | Text-mode console I/O: `clrscr()`, `cputs()`, `gotoxy()`, `cgetc()` |
230
+ | `cbm.h` | KERNAL and BASIC bindings: `cbm_open()`, `cbm_read()`, `cbm_close()` |
231
+ | `peekpoke.h` | `PEEK(addr)` / `POKE(addr, val)` macros for direct memory access |
232
+ | `joystick.h` | Joystick port reading via `joy_read()` |
233
+ | `6502.h` | Low-level CPU operations: `BRK()`, `CLI()`, `SEI()` |
234
+ | `stdio.h` | Standard I/O — available but large; prefer `conio.h` for text output |
235
+ | `string.h` | Standard string functions |
236
+
237
+ `conio.h` is the idiomatic output library for text-mode programs. `cbm.h`
238
+ exposes the KERNAL routines via C-callable wrappers without requiring inline
239
+ assembly. `peekpoke.h` fills the gap where C's type system would otherwise
240
+ require casts through pointers.
241
+
242
+ ## When to use cc65
243
+
244
+ - **Text-mode utilities and tools** — BASIC replacements, directory listers,
245
+ config editors. The `conio.h` API covers the use-case well and the corpus
246
+ of examples is large.
247
+ - **Corpus-heavy domains** — when training data for a specific pattern (e.g. CBM
248
+ serial bus access via `cbm.h`) is overwhelmingly cc65-flavored, using cc65
249
+ lowers the chance the agent generates incorrect Oscar64 translations.
250
+ - **Educational contrast** — studying a cc65 `.s` output alongside Oscar64's
251
+ output for the same source is a reliable way to demonstrate where and why
252
+ Oscar64 wins on codegen.
253
+ - **Porting POSIX-adjacent code** — cc65's header set is closer to standard C
254
+ than Oscar64's, so porting a small existing utility is occasionally easier
255
+ here first.
256
+
257
+ ## When NOT to use cc65
258
+
259
+ - **Action games, scrollers, platformers** — frame budgets are tight. cc65's
260
+ function-call overhead and absence of register allocation make inner loops
261
+ measurably slower than Oscar64 equivalents.
262
+ - **Demos, raster effects, sprite multiplexers** — cycle-exact timing work.
263
+ cc65 is not cycle-aware. Use Oscar64 for C code and KickAssembler for
264
+ hand-rolled timing routines.
265
+ - **Anything that needs bitfields or packed structs** — cc65 as installed
266
+ (V2.18; the Homebrew Cellar directory says 2.19 but `cl65 --version` reports
267
+ V2.18) accepts bit-fields only of type `int`, `unsigned int` or `enum`. It
268
+ is not a size rule, as an earlier version of this page said ("int-sized or
269
+ smaller"): `unsigned char x:3;` AND `unsigned short x:3;` (int-sized on
270
+ cc65) both fail with `Bit-field has invalid type` (measured 2026-09-22).
271
+ Newer git cc65 is reported to relax this (unverified here); do not rely on
272
+ char-typed bit-fields from a distro package. Oscar64 treats them as
273
+ first-class.
274
+ - **Code-size-sensitive releases** — cc65 produces larger binaries for
275
+ equivalent logic. Under the built-in `c64.cfg` a program gets
276
+ `$080D`–`$D000`: 51,187 bytes, about 50 KB, the top 2 KB of it the software
277
+ stack (`cl65 -Ln` symbols `__MAIN_START__`, `__HIMEM__`, `__STACKSIZE__`;
278
+ the startup code banks BASIC ROM out). An earlier version of this page said
279
+ 38 KB, which is BASIC's free-bytes figure, not cc65's. Code size still
280
+ matters on a machine this small.
281
+
282
+ The rule of thumb: if Oscar64 has a clear idiom for the task (see
283
+ [oscar64-reference.md](oscar64-reference.md)), use Oscar64. Reach for cc65 only
284
+ when the corpus availability advantage is concrete and measurable.
285
+
286
+ ## Linker configs
287
+
288
+ `ld65` is driven by a linker configuration file that describes the target's
289
+ memory map, segments, and output format. The cc65 distribution ships a
290
+ ready-made config for the C64 at `cfg/c64.cfg`. For most programs, the
291
+ `-t c64` flag loads this config automatically.
292
+
293
+ The built-in config maps the standard segments:
294
+
295
+ - `EXEHDR` — the BASIC stub (`SYS 2061`) at `$0801`–`$080C`; `STARTUP` — the
296
+ C runtime entry, at `$080D` (the stub's SYS target); `LOWCODE` (optional)
297
+ then `CODE` — your compiled code, after STARTUP (`$0840` for a minimal
298
+ conio program built with cc65 2.19 — read the `--mapfile` segment list
299
+ rather than assuming a fixed address; an earlier version of this page put
300
+ `CODE` at `$0801`, which is the stub itself); then `RODATA`, `DATA`,
301
+ `INIT`, `ONCE` in that order within MAIN.
302
+ - `RODATA` — read-only data, placed after CODE
303
+ - `DATA` — initialized writable data
304
+ - `BSS` — zero-initialised (cleared at startup by the runtime)
305
+ - `ZEROPAGE` — `$02–$1B`, 26 bytes, all consumed by the cc65 runtime
306
+ (`zpspace = 26` in `asminc/zeropage.inc`). An earlier version of this page
307
+ said "allocate sparingly"; there is nothing to allocate. Adding even one
308
+ byte to this segment under the built-in c64 config fails to link
309
+ (`Segment 'ZEROPAGE' overflows memory area 'ZP' by 1 byte`, measured with
310
+ cc65 2.19). For your own zero-page variables, copy `cfg/c64.cfg` and add a
311
+ second zero-page area on the four bytes BASIC and the KERNAL leave free —
312
+ e.g. `ZP2: file = "", start = $00FB, size = $0004;` in MEMORY and
313
+ `EXTZP: load = ZP2, type = zp, optional = yes;` in SEGMENTS — then define
314
+ the variable in assembly (`.segment "EXTZP" : zeropage` / `_myzp: .res 1`)
315
+ and expose it to C with `extern unsigned char myzp; #pragma zpsym("myzp")`
316
+ (the pragma must follow the declaration). Do not simply enlarge `ZP` past
317
+ `$1B`: `$1C` onward is BASIC/KERNAL workspace. Six of the runtime's 26
318
+ bytes are the `register` bank, so `register` locals (with `-Or`) are the
319
+ only zero-page you get without a custom config.
320
+
321
+ For non-standard layouts — cartridges, custom load addresses, split-bank
322
+ programs — write a custom `.cfg` file and pass it with `--config`. The
323
+ linker config language is well-documented in the cc65 `ld65` manual and
324
+ the existing `cfg/c64.cfg` is a readable starting template.
325
+
326
+ ## Cartridge builds
327
+
328
+ A generic 8 KB cartridge is a linker configuration, a start-up routine
329
+ and a container. The [cartridge-8k](../recipes/cc65/cartridge-8k.md)
330
+ recipe is the worked example; every figure below was measured on it with
331
+ cc65 2.19 (`cl65` reports V2.18) and VICE x64sc 3.10.
332
+
333
+ **The configuration.** Line by line, what each area and segment does:
334
+
335
+ ```cfg
336
+ SYMBOLS {
337
+ __STACKSIZE__: type = weak, value = $0800;
338
+ __STARTUP__: type = export, value = 1;
339
+ }
340
+ MEMORY {
341
+ ZP: file = "", start = $0002, size = $001A, define = yes;
342
+ CRTHDR: file = "game.crt", start = $0000, size = $0050, fill = yes;
343
+ ROML: file = "game.crt", start = $8000, size = $2000, fill = yes, fillval = $FF, define = yes;
344
+ RAM: file = "", start = $0800, size = $D000 - __STACKSIZE__ - $0800, define = yes;
345
+ }
346
+ SEGMENTS {
347
+ ZEROPAGE: load = ZP, type = zp;
348
+ CRTHDR: load = CRTHDR, type = ro;
349
+ CBM80: load = ROML, type = ro;
350
+ STARTUP: load = ROML, type = ro;
351
+ ONCE: load = ROML, type = ro, optional = yes;
352
+ CODE: load = ROML, type = ro;
353
+ RODATA: load = ROML, type = ro;
354
+ DATA: load = ROML, run = RAM, type = rw, define = yes;
355
+ BSS: load = RAM, type = bss, define = yes;
356
+ }
357
+ FEATURES {
358
+ CONDES: type = constructor, label = __CONSTRUCTOR_TABLE__, count = __CONSTRUCTOR_COUNT__, segment = ONCE;
359
+ CONDES: type = destructor, label = __DESTRUCTOR_TABLE__, count = __DESTRUCTOR_COUNT__, segment = RODATA;
360
+ CONDES: type = interruptor, label = __INTERRUPTOR_TABLE__, count = __INTERRUPTOR_COUNT__, segment = RODATA, import = __CALLIRQ__;
361
+ }
362
+ ```
363
+
364
+ This is the recipe's file with its comments and two empty optional
365
+ segments (`LOWCODE`, `INIT`) removed; the recipe page holds the complete
366
+ file, and this block links as it stands (run here: the same `.crt`,
367
+ byte for byte).
368
+
369
+ - `__STACKSIZE__` is the C stack, which the start-up code puts at the top
370
+ of `RAM`, so `RAM` ends `$0800` below `$D000`.
371
+ - `__STARTUP__` exported here satisfies the `.forceimport __STARTUP__`
372
+ the compiler emits for `main`, so the library's `crt0` stays out.
373
+ Without the export the link fails with `Unresolved external
374
+ '__MAIN_SIZE__' referenced in: c64/crt0.s(96)` and the same for
375
+ `__MAIN_START__` (run here): that `crt0` sizes its stack from a `MAIN`
376
+ area a cartridge configuration does not have.
377
+ - `ZP` is the runtime's 26 zero-page bytes, unchanged from `c64.cfg`.
378
+ - `CRTHDR` is the 80 bytes of `.CRT` header and `CHIP` packet, at file
379
+ offset 0; `fill = yes` keeps it 80 bytes if the segment is short.
380
+ - `ROML` is the 8 KB the cartridge maps at `$8000`, padded with `$FF`
381
+ to the size the packet declares.
382
+ - `RAM` is where writable data runs; it is written to no file.
383
+ - `CBM80` comes first in `ROML` so its nine bytes land at `$8000`.
384
+ - `STARTUP` is the cold-start routine; `ONCE` holds library constructor
385
+ code (12 bytes for conio); `CODE` and `RODATA` are read-only and stay
386
+ in ROM.
387
+ - `DATA` has `load = ROML` and `run = RAM`: the image is in ROM, every
388
+ address the code uses is in RAM, and `define = yes` gives `copydata`
389
+ the three symbols it needs.
390
+ - `BSS` is RAM only, zeroed at start.
391
+ - `FEATURES` is `c64.cfg`'s own block and must stay: the runtime's
392
+ `condes.s` imports the constructor and destructor table symbols
393
+ whether or not anything uses them. With the block left out, `ld65`
394
+ stops with `Unresolved external '__CONSTRUCTOR_COUNT__' referenced
395
+ in: runtime/condes.s(30)`, the same for `__CONSTRUCTOR_TABLE__`,
396
+ `__DESTRUCTOR_COUNT__` and `__DESTRUCTOR_TABLE__`, then `4 unresolved
397
+ external(s) found`, and writes no `.crt` (run here). The constructor
398
+ table goes in `ONCE`, the other two in `RODATA`, all in ROM, which is
399
+ where a table of addresses belongs.
400
+
401
+ Both areas that reach a file name it outright, so `ld65` writes the
402
+ finished container and the `.prg` named by `-o` never appears. This is
403
+ the route the repository's recipe verifier needs, since it boots what
404
+ the build leaves behind; `c64.cfg`'s `LOADADDR` and `EXEHDR` segments,
405
+ and the `__LOADADDR__`/`__EXEHDR__` imports that pull them in, are gone
406
+ with the stub. With `__EXEHDR__: type = import;` left in, `ld65` stops
407
+ with `Missing memory area assignment for segment 'EXEHDR'`, after a
408
+ warning that it cannot evaluate an assertion in `cbm/exehdr.s`, and it
409
+ still left a `.crt` behind (run here), so read the messages and not the
410
+ directory.
411
+
412
+ **The signature.** The KERNAL's reset code compares the five bytes at
413
+ `$8004` with `$C3 $C2 $CD $38 $30` before it initialises anything, and on
414
+ a match jumps through the vector at `$8000`; the `RESTORE` key's NMI
415
+ makes the same test and takes `$8002`. In C, a `const` struct of two
416
+ function pointers and five bytes in the `CBM80` segment is nine bytes
417
+ with no padding.
418
+
419
+ **The start-up code.** cc65 2.19 has no file-scope `asm` (`__asm__ is
420
+ not allowed here`) and its inline `asm` refuses `.segment`, `.byte` and
421
+ `.res`, so the routine is a C function of inline instructions in the
422
+ `STARTUP` segment, no arguments and no locals, which gives it no
423
+ prologue. It sets the hardware stack, calls `IOINIT`, `RAMTAS`, `RESTOR`
424
+ and `CINT` in that order, then `zerobss`, `copydata`, sets `sp` to the
425
+ top of `RAM`, and calls `initlib` and `callmain`. The library names
426
+ resolve because the compiler switches `.autoimport` on in every file it
427
+ emits. Measured: the KERNAL takes the vector 109 cycles after power-on;
428
+ `main` is entered 1,650,044 cycles later on PAL and 1,643,133 on NTSC.
429
+ The split, from `trace exec` on each call (run here, PAL): `IOINIT` and
430
+ the stack set 147, `RAMTAS` 1,593,289, `RESTOR` 889, `CINT` 53,221,
431
+ `CLI` to `main` 2,498, of which the on-screen CIA timer covers 2,281.
432
+ `RAMTAS`, the KERNAL's test of every RAM byte below the cartridge, is
433
+ 96.5 % of it; `CINT` is the one stage that differs on NTSC (46,310).
434
+ `IOINIT` writes all four CIA control registers 34 to 46 cycles after the
435
+ first cartridge instruction (stopwatch 143 to 155, `trace store` on
436
+ `$DC0E`, `$DC0F`, `$DD0E`, `$DD0F`), which is why a CIA timer cannot span
437
+ the KERNAL part and the monitor's stopwatch has to.
438
+
439
+ **Load versus run.** The `DATA` copy exists because a cartridge cannot
440
+ take a write. With `load = ROML` alone the same program booted, entered
441
+ `main`, and hit a `BRK` 1,049 cycles into its first `cprintf`; nothing
442
+ was printed and the KERNAL's `BRK` path at `$FE66` ran fifty-five times
443
+ before the cycle limit. The runtime keeps writable state in `DATA` too,
444
+ and it was reading its image back from ROM. The globals did not read as
445
+ zero; they read as their initialisers, and writes to them were lost.
446
+
447
+ **The wrap.** The recipe's header is written by the linker, and the same
448
+ 8 KB image fed to `cartconv -t normal -i rom.bin -o game.crt -n "NAME"`
449
+ gave a byte-identical file. Either route ends in `cartconv -c` (exit 0)
450
+ and `cartconv -f`, which prints the hardware id, the `EXROM`/`GAME`
451
+ levels and one `CHIP` at `$8000`
452
+ ([cartconv-reference](cartconv-reference.md)).
453
+
454
+ **Pitfalls met.** Character literals are translated to PETSCII by
455
+ `-t c64`, so `'C'` in the header initialiser became `$C3`; VICE answered
456
+ `no CRT header found` and `cartconv -f` printed nothing and exited 0.
457
+ Write the signature and name as numeric bytes. And a `DATA` segment
458
+ without `run` links clean, boots, and fails inside the library, not in
459
+ your own code.
460
+
461
+ ## Idioms — cc65 vs Oscar64
462
+
463
+ cc65 and Oscar64 differ in ways that matter at the codegen level. The agent
464
+ should recognize these patterns to avoid inadvertently reaching for the weaker
465
+ option.
466
+
467
+ **Function call overhead.** cc65 uses a software stack (pointed to by `sp`
468
+ in zero page, but located in main RAM below `__HIMEM__`; an earlier version
469
+ of this page put the stack itself in zero page) for passing arguments. Each
470
+ call pushes and pops arguments through this stack, adding several cycles per
471
+ parameter. Oscar64 passes leaf-function arguments in fixed zero-page slots
472
+ (what its manual calls "zero-page registers": `$0D` upward, `P0`/`P1`/…),
473
+ chosen by whole-program analysis, and falls back to its own software stack
474
+ only for non-leaf or recursive functions (see
475
+ [oscar64-reference.md](oscar64-reference.md)); nothing is passed in A/X/Y.
476
+ cc65's default `__fastcall__` convention does put the rightmost argument in
477
+ A/X and pushes the rest through its `sp`-indexed software stack. Oscar64's
478
+ inner loops are substantially cheaper. If a function is called in a tight
479
+ raster IRQ or per-scanline loop, the cc65 overhead accumulates into missed
480
+ raster windows.
481
+
482
+ **Bitfields.** Oscar64 supports bitfields in structs natively and maps them
483
+ to efficient read-modify-write sequences. cc65 supports them with restrictions
484
+ (only `int`/`unsigned int`/`enum` members; `unsigned char` fields do not
485
+ compile) and the codegen is less predictable. Writing a hardware
486
+ register struct like `VIC_CR1` with bitfields is idiomatic Oscar64; in cc65
487
+ the same code requires explicit masks and shifts or falls back to `POKE`.
488
+
489
+ **Struct-by-value.** Passing structs by value in cc65 is expensive — the
490
+ compiler copies through the software stack. Oscar64 handles small structs in
491
+ registers. Where the code passes hardware-register shadow structs or sprite
492
+ coordinate pairs around frequently, Oscar64's ABI wins clearly.
493
+
494
+ **Static locals via `-Cl`.** cc65's `-Cl` flag converts local variables to
495
+ static (BSS) allocation. This is a performance hack that produces faster code
496
+ at the cost of reentrancy. Oscar64 does not need this flag because it performs
497
+ stack allocation analysis and promotes locals to registers or static storage
498
+ automatically where safe.
499
+
500
+ **Choosing cc65.** The agent picks cc65 when the corpus availability advantage
501
+ is real: a known-working cc65 snippet for CBM serial I/O, or a text-mode UI
502
+ library built around `conio.h`, is worth more than a theoretically optimal
503
+ Oscar64 translation that may contain ABI errors. When the task is creative
504
+ (new code, not porting), default to Oscar64.
505
+
506
+ ## Debugging with VICE
507
+
508
+ `cl65 -Ln <file>` makes the linker write a VICE label file. Built from
509
+ [recipes/cc65/hello-world-conio.md](../recipes/cc65/hello-world-conio.md):
510
+
511
+ ```bash
512
+ cl65 -O -t c64 -Ln hello.lbl -o hello.prg hello.c
513
+ ```
514
+
515
+ `hello.lbl` is one `al` command per symbol, six hex digits, no memspace
516
+ prefix, and a leading underscore on every C symbol. The file also names
517
+ the KERNAL entries the library imports:
518
+
519
+ ```text
520
+ al 000840 ._main
521
+ al 0008EA ._cputs
522
+ al 00E544 ._clrscr
523
+ al 00FFD2 .BSOUT
524
+ ```
525
+
526
+ Load it and arm a breakpoint from a `-moncommands` file:
527
+
528
+ ```text
529
+ ll "hello.lbl"
530
+ break ._main
531
+ ```
532
+
533
+ Run with the remote text monitor and connect to the port (the flags and
534
+ the reason `-console` is not used are in
535
+ [../runtime/vice-reference.md](../runtime/vice-reference.md), "Text
536
+ monitor for debugging"):
537
+
538
+ ```bash
539
+ GSETTINGS_SCHEMA_DIR=/opt/homebrew/share/glib-2.0/schemas timeout 180 x64sc -default -warp +sound \
540
+ +autostart-delay-random -autostartprgmode 1 -limitcycles 6000000 \
541
+ -remotemonitor -remotemonitoraddress ip4://127.0.0.1:6510 \
542
+ -moncommands hello.mon -autostart hello.prg
543
+ ```
544
+
545
+ The break hit, with the label resolved in both the stop and the
546
+ disassembly of the first instruction of `main()`:
547
+
548
+ ```text
549
+ #1 (Stop on exec 0840) 55/$037, 52/$34
550
+ .C:0840 20 44 E5 JSR ._clrscr - A:00 X:00 Y:04 SP:f4 ..-....C 2971573
551
+ (C:$0840) break
552
+ BREAK: 1 C:$0840 (Stop on exec)
553
+ ```
554
+
555
+ `$0840` is `_main` in the label file and in `--mapfile`'s Exports list
556
+ (see Multi-file projects). Measured with cc65 V2.18 and VICE x64sc 3.10.
557
+ `print ._main` is refused with `Wrong syntax`; the label is usable as an
558
+ address in `break`, `watch`, `m` and `until`, not as an expression to
559
+ print. The symbol export material for the other toolchains is in
560
+ [kickassembler-reference.md](kickassembler-reference.md) ("Symbol export
561
+ for VICE/vice-mcp" and "Debugging with VICE") and
562
+ [oscar64-reference.md](oscar64-reference.md) ("Debugging").
563
+
564
+ ## Pitfalls
565
+
566
+ **Static initializers in ROM sections.** The cc65 `DATA` segment holds
567
+ initialized writable data. If a custom linker config accidentally places `DATA`
568
+ in a ROM region, the program links clean and misbehaves at run time.
569
+ Always verify the segment map with `--mapfile` output. An earlier version of
570
+ this entry said the globals read back as zeros; measured on the
571
+ [cartridge-8k](../recipes/cc65/cartridge-8k.md) recipe with `DATA` in ROM,
572
+ they read back their initialisers, writes to them were lost, and the run
573
+ ended in a `BRK` inside `cprintf` ("Cartridge builds" above).
574
+
575
+ **Stack overflow with deep call trees.** cc65's software stack is 2 KB by
576
+ default on the C64 (`__STACKSIZE__ = $0800` in `c64.cfg`); it starts at
577
+ `__HIMEM__` ($D000) and grows downward through $C800, immediately above the
578
+ heap and BSS. Only the two-byte stack pointer `sp` lives in zero page
579
+ ($02/$03). An earlier version of this page said the stack was in zero page
580
+ and about 256 bytes; both were wrong. Deep recursion overflows it silently
581
+ downward into heap and BSS data, not into zero page. Raise it with
582
+ `-Wl -D,__STACKSIZE__=0x1000` (if you write `$1000`, quote it — an unquoted
583
+ `$1000` is eaten by the shell and ld65 reports `Invalid definition`) or a
584
+ custom linker config; keep call depth shallow and prefer iterative
585
+ algorithms. `-Cl` moves locals off the stack, which reduces per-frame usage,
586
+ but does not protect against deep recursion itself.
587
+
588
+ **`printf` code size.** `printf` from `stdio.h` pulls in the full format-string
589
+ parser, adding roughly 2–3 KB to the binary. For output in a C64 program,
590
+ `cputs()` from `conio.h` or a direct KERNAL `CHROUT` call (via `cbm.h`) is
591
+ far smaller. Reserve `printf` for debugging builds only.
592
+
593
+ **Mixing `conio.h` screen coordinates with direct VIC writes.** `conio.h`
594
+ maintains its own cursor state. Writing directly to screen RAM (`$0400`) or
595
+ color RAM (`$D800`) bypasses that state. Either use `conio.h` exclusively for
596
+ text output, or bypass it entirely and drive the hardware directly.
597
+
598
+ **Implicit `int` promotions.** 8-bit values compared or computed in expressions
599
+ get promoted to `int` (16-bit) in C. cc65 emits 16-bit arithmetic sequences
600
+ for these promotions. Use explicit `uint8_t` casts in hot paths to get 8-bit
601
+ sequences.
602
+
603
+ ## Reading the errors
604
+
605
+ Every message below was provoked with cl65 V2.18 (Homebrew cc65 2.19,
606
+ `cl65 -t c64 -O`) on the minimal source named in the second column; the
607
+ sources are files in `error-sources/cc65/` and are shown after the table.
608
+ Compiler and assembler errors read `file(line): Error: text`; linker errors
609
+ are prefixed `ld65:` and name the linker config and its line, not your
610
+ source. Each build exits 1 and writes no PRG.
611
+
612
+ | Message (verbatim) | Source | Cause | Fix |
613
+ |---|---|---|---|
614
+ | `ld65: Warning: .../cfg/c64.cfg(15): Segment 'BSS' overflows memory area 'BSS' by 1088 bytes` then `ld65: Error: Cannot generate most of the files due to memory area overflow` | `segment-overflow.c` | The program's data (here a 50,000-byte array) does not fit between the end of the code and the software stack under `$D000`. The overflow is reported as a warning; the error line is the one that stops the build | Shrink the data, lower `__STACKSIZE__` (see Pitfalls), or a custom config: [memory-layout-planning.md](memory-layout-planning.md) |
615
+ | `Unresolved external '_missing' referenced in:` then ` unresolved-external.s(27)` then `ld65: Error: 1 unresolved external(s) found - cannot create output file` | `unresolved-external.c` | A function or variable was declared and used but no object defined it: a `.s` module without `.export _name`, or a `.c` or `.s` left off the `cl65` line. The reference is located in the generated `.s`, not in the C source | Add the `.export`, or the file to the command line (see Multi-file projects) |
616
+ | `range-error.s(3): Error: Range error (300 not in [0..255])` | `range-error.s` | An 8-bit operand or `.byte` given a value outside 0..255, here `lda #300`. A `.word` beyond 65535 gives the same shape with `[0..65535]` (arithmetic, not measured here) | Use `#<value` / `#>value` for one byte of a 16-bit constant, or `.word` |
617
+ | `missing-setcpu.s(3): Error: ':' expected` then `missing-setcpu.s(3): Error: Unexpected trailing garbage characters` | `missing-setcpu.s` | An illegal mnemonic (`lax $10`) under the default CPU. `ca65` does not know the word, reads it as a label and expects a colon; the message never names the CPU (see ca65 notes) | `.setcpu "6502X"` at the top of the file, or `--cpu 6502X` on the command line; both assemble the file (measured) |
618
+
619
+ Sources (each is meant to fail, so none is in a buildable fence):
620
+
621
+ `segment-overflow.c`
622
+
623
+ ```text
624
+ unsigned char big[50000U];
625
+ int main(void)
626
+ {
627
+ big[0] = 1;
628
+ return big[1];
629
+ }
630
+ ```
631
+
632
+ `unresolved-external.c`
633
+
634
+ ```text
635
+ extern void missing(void);
636
+ int main(void)
637
+ {
638
+ missing();
639
+ return 0;
640
+ }
641
+ ```
642
+
643
+ `range-error.s`
644
+
645
+ ```text
646
+ .export _main
647
+ _main:
648
+ lda #300
649
+ rts
650
+ ```
651
+
652
+ `missing-setcpu.s`
653
+
654
+ ```text
655
+ .export _main
656
+ _main:
657
+ lax $10
658
+ rts
659
+ ```
660
+
661
+ ## See also
662
+
663
+ - [oscar64-reference.md](oscar64-reference.md) — primary toolchain; most C64 code should start here
664
+ - [kickassembler-reference.md](kickassembler-reference.md) — cycle-tight assembly escape hatch
665
+ - [recipes/cc65/hello-world-conio.md](../recipes/cc65/hello-world-conio.md) — minimal working cc65 program
666
+ - [memory-layout-planning.md](memory-layout-planning.md) — whole-program layout: the constraints, one worked layout in all three toolchains, confirmed from `--mapfile`
667
+ - [release-disk.md](release-disk.md) — putting the built PRG on a bootable D64 with c1541, proving it boots by autostarting the image headless, and a Makefile target that does both
@@ -0,0 +1 @@
1
+ Minimal sources that provoke the messages in the "Reading the errors" table of ../../cc65-reference.md; each is meant to fail, so none is in a buildable fence.
@@ -0,0 +1,4 @@
1
+ .export _main
2
+ _main:
3
+ lax $10
4
+ rts
@@ -0,0 +1,4 @@
1
+ .export _main
2
+ _main:
3
+ lda #300
4
+ rts
@@ -0,0 +1,6 @@
1
+ unsigned char big[50000U];
2
+ int main(void)
3
+ {
4
+ big[0] = 1;
5
+ return big[1];
6
+ }