{"id":16838513,"url":"https://github.com/zserge/bsoz","last_synced_at":"2025-04-11T05:20:29.763Z","repository":{"id":218214702,"uuid":"745889368","full_name":"zserge/bsoz","owner":"zserge","description":"One of the most minimal MOS6502 and retro computer emulators!","archived":false,"fork":false,"pushed_at":"2024-01-21T22:06:11.000Z","size":127,"stargazers_count":17,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T03:23:33.615Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zserge.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,"roadmap":null,"authors":null}},"created_at":"2024-01-20T13:06:59.000Z","updated_at":"2025-03-09T12:43:55.000Z","dependencies_parsed_at":"2024-01-20T14:25:52.350Z","dependency_job_id":"b4913554-87ee-4504-ac2f-845e0b9c0de2","html_url":"https://github.com/zserge/bsoz","commit_stats":null,"previous_names":["zserge/bsoz"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zserge%2Fbsoz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zserge%2Fbsoz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zserge%2Fbsoz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zserge%2Fbsoz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zserge","download_url":"https://codeload.github.com/zserge/bsoz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248345978,"owners_count":21088384,"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":"2024-10-13T12:24:01.900Z","updated_at":"2025-04-11T05:20:29.736Z","avatar_url":"https://github.com/zserge.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bsoz - Bang Some Ones \u0026 Zeros\n\n[![Build Status](https://github.com/zserge/bsoz/actions/workflows/ci.yaml/badge.svg)](https://github.com/zserge/bsoz/actions)\n\n```\n@@@@@@@@@@@@@@@@@@###@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#=!,;=%@@@@@@@@\n@@@@@@@@@@@@@@@@#%%%%%%%#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#+,...,^%@@@@@@@\n@@@@@@@@@@@@@@#%%%######%%%%#@@@@@@@@@@@@@@@@@@#%*%@@@@@@@@@@@@@*-::;;,!?@@@@@@@\n@@@@@@@@@@@@#%%##############%%%##@@@@@@@@@@@@*^:.!?@@@@@@@@@@@@%+!!++^^=#@@@@@@\n@@@@@@@@@@@#%###################%%%%%#@@@@@@@*-. .:!?@@@@@@@@@@@@*=^^+^^=%@@@@@@\n@@@@@@@@@@#%######################%%%\u0026=@@@@@@?!;!^--+*@@@@@@@@@@@@\u0026-;;!!+*@@@@@@\n@@@@@@@@*%%######%#@@@##@@#######%#%?^!#@@@@@\u0026^!-+^+?#@@@@@@@@@@@@*^;,;!+\u0026@@@@@@\n@@@@@@@#*??*%###=-+=*#@@@@#@######*=-;-@@@@@@%+!!!!^\u0026#@@@@@@@@@@@@#*=^^=\u0026#@@@@@@\n@@@@@@%%###*\u0026\u0026\u0026%\u0026?+^^^?@####@                    :,^*@@@@@@@@@@@@@@@@%%#@@@@@@@@\n@@@@#%%%=;+*##%\u0026\u0026\u0026*\u0026??%######  _   ___ ___ ___   .;=#@@@@@@@@@@##@@@@@@@@@@###@@\n@@@#%#%!   .;=*#@%*\u0026\u0026*####### | |_|  _|   |_  |  ;-?%@@@@@@@@@@#%#@@@@@@@@#%%%#@\n@@%%#\u0026; ....  .;+*#@#*\u0026\u0026\u0026%##@ | . |_  | | |  _|  \u0026?\u0026*%%##@@@@@#%%#@@@@@@@#%**%##\n#%%%#?.   .....  .;+*#@#*\u0026?\u0026* |___|___|___|___|  ##%%%%%#@@@@@@%*%#@@@##@#%**%##\n*-=%##%,... ....... .;+*#@#%*                    ######%******\u0026?===??=?*##%\u0026\u0026*#@\n@%-:^\u0026#?;..... .:......\u0026%%#@*                    ###%%#%?^!!-!!!!!;!!-+\u0026#@%\u0026\u0026*%#\n@@@?;:;?%*^,..:.  ::..*@###\u0026^^^^!=@@@@@@##%%*\u0026**%#@#%%*\u0026+-!;;;;;;;;!!-+\u0026#@#***%#\n@@@@@%^,,^*%\u0026-:.:.  ;#@##@\u0026^^^^!\u0026@@@@@@@*%%%***%#@@@#%\u0026=+^-!;;!!;;;;,,-?%@@@#%%*\n@@@@@@@@\u0026!:;=%%?##?^#@##@*^^^-!*@@@@@@@@%**%%####@@%\u0026=+^^!;,;--;,,,:,;^?*%###%%%\n@@@@@@@@@@#+,,-\u0026%#@@###@*^^^--#@@@@@@@@@%\u0026=?\u0026%###%*=^-^+++^-^+==^--!-^^+++=?%@@@\n@@@@@@@@@@@@@*-:,^*#@#@%^^^!^@@@@@@@@@@@@%\u0026===?====+++=?*#@##@#%\u0026???=+^^+=?*#@@@\n@@@@@@@@@@@@@@@#=;:;=**+^^!=@@@@@@@@@@@@@@%?+^^+==???=+?%@@@@@@*=+======?\u0026?\u0026%@@@\n@@@@@@@@@@@@@@@@@@%^:.:,,;\u0026@@@@@@@@@@@@@@@%=-!-----!;:,-*@@@@@@#=!,,;;;;!!!-?#@@\n@@@@@@@@@@@@@@@@@@@@@\u0026=++*@@@@@@@@@@@@@@@@#+, ..:,,:. .!\u0026@@@@@@@?!::::,,;!-+\u0026#@@  \n```\n\nbsoz is a tiny and versatile emulator suite designed to bring the nostalgic charm of vintage computers to the modern era. It provides accurate emulation for the [MOS 6502 CPU](https://en.wikipedia.org/wiki/MOS_Technology_6502) and currently supports [Apple 1](https://en.wikipedia.org/wiki/Apple_I) computer. There is ongoing development of [KIM-1](https://en.wikipedia.org/wiki/KIM-1) and hopefully [Apple II](https://en.wikipedia.org/wiki/Apple_II) emulators.\n\n## Features\n\n* ~300 lines of \"pedantic\" C89 code\n* No external dependencies\n* All documented 6502 instructions supported\n* Correct handling of decimal mode (BCD).\n* User-supplied memory-mapped I/O callbacks.\n* IRQ and NMI signals.\n* Multiple CPUs can be emulated (no global state).\n* Instruction disassembler.\n* Comprehensive test coverage.\n* Designed to be cross-platform and should run on macOS, Linux and maybe even Windows.\n* A full-functional lo-fi Apple 1 emulator is included!\n\n## Usage\n\n```c\n#include \"bsoz.h\"\n\nuint8_t mem[0x10000];\nuint8_t r8(struct cpu *c, uint16_t addr) { (void)c; return mem[addr]; }\nuint8_t w8(struct cpu *c, uint16_t addr, uint8_t b) { (void)c; return mem[addr] = b; }\n\nint main() {\n  struct cpu cpu;\n  rst(\u0026cpu);\n  while (step(\u0026cpu) \u003e= 0);\n  return 0;\n}\n```\n\nInclude a header, provide `r8` and `w8` callback for memory access, reset the CPU and run it step by step.\n\n## Apple 1\n\nTo run Apple 1 emulator:\n\n```\ncd apple1\ncat ./rom/hello.txt\n# \"tapes\" are raw text input to Apple 1 WozMon monitor.\n# This one loads machine code at address 0x0280 and runs is:\n280:A2 C BD 8B 2 20 EF FF CA D0 F7 60 8D C4 CC D2 CF D7 A0 CF CC CC C5 C8\n280.297\n280\nR\n\n./apple1 ./rom/hello.txt\n\n\\\n280:A2 C BD 8B 2 20 EF FF CA D0 F7 60 8D\n C4 CC D2 CF D7 A0 CF CC CC C5 C8\n\n0280: 00\n280.297\n\n0280: A2 0C BD 8B 02 20 EF FF\n0288: CA D0 F7 60 8D C4 CC D2\n0290: CF D7 A0 CF CC CC C5 C8\n280\n\n0280: A2\nR\nHELLO WORLD\n```\n\nAlternatively, an \"autorun\" script may call BASIC and type a program there:\n\n```\ncd apple1\ncat rom/hello.bas\nE000R\nPRINT \"HELLO WORLD\"\n\n\\\nE000R\n\nE000: 4C\n\u003ePRINT \"HELLO WORLD\"\nHELLO WORLD\n\n\u003e\n```\n\nPressing \u003ckbd\u003eCtlr+R\u003c/kbd\u003e resets Apple1 computer and loads the monitor again. However, all the memory contents are preserved and BASIC can be reloaded by typing `E2B3R` in the monitor:\n\n```\n./apple1\n\\\nE000R\n\nE000: 4C\n\u003eA=1\n\n\u003ePRINT A\n1\n\n\u003cpress Ctrl+R\u003e\n\\\nE2B3R  # E2B3 is BASIC entry-point that preserves RAM, while E000 clears it\n\u003ePRINT A\n1\n```\n\nTo learn more about Apple1 I suggest to read the original manual and endless [forums](https://applefritter.com/), it's quite a rabbit hole!\n\n## License\n\nThis project is licensed under the MIT License. Contributions are welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzserge%2Fbsoz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzserge%2Fbsoz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzserge%2Fbsoz/lists"}