{"id":27139512,"url":"https://github.com/ddrcode/c64rust","last_synced_at":"2025-04-08T04:58:26.307Z","repository":{"id":196266687,"uuid":"687020217","full_name":"ddrcode/c64rust","owner":"ddrcode","description":"MOS6502 and C64 Emulators written in Rust","archived":false,"fork":false,"pushed_at":"2023-11-26T20:42:30.000Z","size":5054,"stargazers_count":1,"open_issues_count":11,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-04-14T14:43:59.969Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ddrcode.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-04T12:37:17.000Z","updated_at":"2024-01-08T22:03:21.000Z","dependencies_parsed_at":"2023-09-26T05:16:47.063Z","dependency_job_id":null,"html_url":"https://github.com/ddrcode/c64rust","commit_stats":null,"previous_names":["ddrcode/c64rust"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddrcode%2Fc64rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddrcode%2Fc64rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddrcode%2Fc64rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ddrcode%2Fc64rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ddrcode","download_url":"https://codeload.github.com/ddrcode/c64rust/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247779699,"owners_count":20994573,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-08T04:58:25.811Z","updated_at":"2025-04-08T04:58:26.286Z","avatar_url":"https://github.com/ddrcode.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# c64rust\n\nThis is a simple (and incomplete) CMOS6502 and C64 emulator/debugger implemented in Rust.\nThe main purpose of this project is to\npractice my Rust skills and turn into reality my old dream of building an emulator.\n\nWhen built, the project provides three binaries (in `target/debug`)\n\n- `machine`: a generic 6502 emulator (CPU and memory only) for CLI,\n- `c64`: CLI-based C64 emulator built on top of the above - good for testing: it\n  can execute a binary and exit (on BRK or specific address) with processor status\n  (or full disassembly)\n- `gui`: ncurses-based client that allows for interaction with the emulator\n\n## How to run\n\n1. Download ROM file\n2. Execute:\n   `cargo run --bin gui  -- --rom path-to-rom`\n\nIf you don't have any ROM file, don't worry - I've created a test ROM from scratch!\nIt doesn't do much, but at least it displays a welcome message and a cursor.\nYou are welcome to contribute and help to make it an alternative C64 OS :-)\n(the source is [here](https://github.com/ddrcode/c64rust/tree/main/rom))\nBut for now, just hit:\n`cargo run --bin gui -- --rom rom/hello.rom`\n\n### Running options:\n\n```text\nOptions:\n  -r, --rom \u003cROM\u003e\n      --ram \u003cRAM\u003e\n      --ram-file-addr \u003cRAM_FILE_ADDR\u003e\n      --ram-size \u003cRAM_SIZE\u003e            [default: 65536]\n  -a, --start-addr \u003cSTART_ADDR\u003e\n  -s, --show-screen\n      --show-status\n  -d, --disassemble\n      --max-cycles \u003cMAX_CYCLES\u003e\n      --max-time \u003cMAX_TIME\u003e\n      --stop-on-addr \u003cSTOP_ON_ADDR\u003e\n      --stop-on-brk\n  -v, --verbose\n      --char-rom \u003cCHARACTER_ROM\u003e\n      --profile \u003cPROFILE\u003e\n  -h, --help                           Print help\n  -V, --version                        Print version\n```\n\n## Current state\n\n- MOS6502 (6510) instruction set fully implemented (no illegal opcodes)\n- C64 memory addressing implemented (RAM/ROM switching, with partial CIA)\n- The emulator boots with provided C64 ROM (some cartridges work too)\n- Text client with keyboard emulation - possible to run BASIC commands\n- The client has integrated simple debugging features: memory view, disassembler, and processor state\n- Step-by-step debugging: including breakpoints, variables and dissassembler (see the screenshots\n  below)\n\nThis is the result of running current version of the emulator:\n\n\u003cimg src=\"screenshots/debugger.png?raw=true\" width=\"800\"/\u003e\n\n## Features and goals\n\n### Short-term / realistic goals\n\n- Clock emulation (right now the emu ticks at host speed; it's not an issue as there is no emulation of\n  other devices like GPU/VIC II, so sync is not required).\n- Basic CIA features (other than the keyboard)\n\n### Ambitions\n\n- VIC II graphics (without sprites and smooth scrolling)\n- Improved debugger (variables, breakpoints)\n\n### Long-term goals\n\n- Sprites and smooth scrolling\n- Sound\n- Joystick emulation\n- Cartridge binaries support\n\n### No-goals\n\n- Making competitive product to Vice and other well-established emulators.\n- CRT emulation\n\n## Screenshots\n\n\u003cimg src=\"screenshots/full_debugger.png?raw=true\" width=\"300\"/\u003e\n\nDebugger in its current full capabilities - memory view, disassembler, variables watch and\nbreakpoints. Variables and breakpoints must be at this stage configured in\na [profile file](profiles/hello-os.toml), but I debug my [HelloOS](/rom) that way,\nand it's usable, so - the first step towards MVP!\n\n\u003cimg src=\"screenshots/dead_test.png?raw=true\" width=\"300\"/\u003e\n\n[The Dead Test cartridge](http://blog.worldofjani.com/?p=164) image executed quite fine, but the two timers\nat the bottom-right of the scrren show zeros, which - according to the documentation - means\n\"Possible 6526 CIA Failure\". Well, it's quite right as CIA is not implemented at this stage\nat all (apart keyboard support).\n\n\u003cimg src=\"screenshots/diagnostic.png?raw=true\" width=\"300\"/\u003e\n\nAnother diagnostic tool - this one - besides proving that I've found the right Unicode characters\nfor C64 graphics characters, seems to be failing miserably. At least it's doing nothing (perhaps depends\nheavily on clock).\n\n\u003cimg src=\"screenshots/cli-emu.png?raw=true\" width=\"300\"/\u003e\n\nThis is how it looks like when run the raw 6502 \"machine\" emulator in CLI.\nIt's configured as 1kB machine that starts loaded program at 0x200. The provided ROM\nis 6-byte jump vector setting the reset vector to 0x200. Some \"static\" debugging\nis possible that way.\n\n## Credits\n\n- [srounce](https://github.com/srounce) - made the environment work with Nix Flakes. So cool!\n\n## References\n\nI've compiled much longer list of topic-specific links in a separate\n[references document](docs/references.md), but here I'd like to mention a few sites\nI was returning to constantly in order to gain my knowledge about 6502 and C64 internals.\n\n- [6502.org](http://6502.org/)\n  An absolute must-visit page for all 6502 enthusiasts: documents, active forum and plenty\n  of links to existing projects, tools, assemblers, etc.\n- [C64 Wiki](https://www.c64-wiki.com/wiki/Main_Page)\n  Another very detailed knowledge base site, but focused on C64.\n  Lot of information about C64-specific chips, Kernal functions, graphics\n  and C64 software.\n- [Codebase 64](https://codebase64.org/)\n  This is a deep-dive into C64 world. Lot of ASM examples, advanced topics\n  and many how-to guides.\n- [C64OS](https://c64os.com/)\n  C64OS is a name of a modern operating system for C64, but the site\n  provides much more than that. The author invested a lot of time in understanding\n  and explaining the details of how C64/6510 functions and has a great talent\n  in presenting that knowledge in digestible form.\n- [pagetable.com](https://www.pagetable.com/)\n  Great blog and reference docs about 6502, C64 and many other topics.\n  It provides super detailed C64 [Memory Map](https://www.pagetable.com/c64ref/c64mem) and\n  [ROM Disassembly](https://www.pagetable.com/c64ref/c64disasm/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddrcode%2Fc64rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fddrcode%2Fc64rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fddrcode%2Fc64rust/lists"}