{"id":13829755,"url":"https://github.com/visrealm/hbc-56","last_synced_at":"2025-04-09T09:03:50.771Z","repository":{"id":45234439,"uuid":"374049442","full_name":"visrealm/hbc-56","owner":"visrealm","description":"Homebrew 65C02 computer on a backplane","archived":false,"fork":false,"pushed_at":"2025-03-30T04:16:44.000Z","size":68968,"stargazers_count":209,"open_issues_count":2,"forks_count":28,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-04-02T08:03:26.256Z","etag":null,"topics":["6502","6502-processor","8-bit","assembly","ay-3-8910","backplane","c","commodore","emulation","emulator","homebrew","pcb","tms9918","z80"],"latest_commit_sha":null,"homepage":"https://youtube.com/@TroySchrapel","language":"Assembly","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/visrealm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-05T07:27:34.000Z","updated_at":"2025-03-30T04:16:48.000Z","dependencies_parsed_at":"2023-12-19T00:40:20.666Z","dependency_job_id":"db67b144-5849-4c3e-bea3-c934ad0a70da","html_url":"https://github.com/visrealm/hbc-56","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visrealm%2Fhbc-56","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visrealm%2Fhbc-56/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visrealm%2Fhbc-56/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/visrealm%2Fhbc-56/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/visrealm","download_url":"https://codeload.github.com/visrealm/hbc-56/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248008628,"owners_count":21032556,"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":["6502","6502-processor","8-bit","assembly","ay-3-8910","backplane","c","commodore","emulation","emulator","homebrew","pcb","tms9918","z80"],"created_at":"2024-08-04T10:00:44.515Z","updated_at":"2025-04-09T09:03:50.755Z","avatar_url":"https://github.com/visrealm.png","language":"Assembly","funding_links":[],"categories":["Assembly"],"sub_categories":[],"readme":"# HBC-56\n\n\u003ca href=\"https://github.com/visrealm/hbc-56/actions/workflows/pages/pages-build-deployment\"\u003e\u003cimg src=\"https://github.com/visrealm/hbc-56/actions/workflows/pages/pages-build-deployment/badge.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/visrealm/hbc-56/actions/workflows/cmake-multi-platform.yml\"\u003e\u003cimg src=\"https://github.com/visrealm/hbc-56/actions/workflows/cmake-multi-platform.yml/badge.svg\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/visrealm/hbc-56/actions/workflows/emulator-wasm.yml\"\u003e\u003cimg src=\"https://github.com/visrealm/hbc-56/actions/workflows/emulator-wasm.yml/badge.svg\"/\u003e\u003c/a\u003e\n\nA homebrew 8-bit computer on a (56 pin) backplane.\n\nInitially supporting the 65C02 CPU, TMS9918A VDP and Dual AY-3-8910 PSG's. With plans to add support for Z80 and perhaps other CPUs in the future.\n\nCurrent cards:\n* 65C02 CPU card with 65C22 VIA and Interrupt controller\n* RAM/ROM card (32KB of each) + optional 32KB shadow RAM\n* LCD display card (supports regular character LCD and 12864B graphics LCD)\n* TMS9918A display card (composite output)\n* Dual AY-3-8910 sound card\n* PS/2 keyboard and dual NES controller card\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"img/hbc56-1-sm.jpg\" alt=\"HBC-56\" width=\"640px\"\u003e\u003c/p\u003e\n\nAll [source code](code/6502) and [schematics](schematics) are available in this repository.\n\n## Emulator\nI have also included an emulator for this system. The emulator supports the following:\n\n* Realtime execution of code (at ~3.7MHz).\n* Step through disassembled code with labels.\n* Source code debugging (using ACME assembler .rpt file).\n* TMS9918 VRAM visualisation of pattern and sprite pattern tables.\n* Examine CPU and VDP registers, RAM and VRAM.\n* Full support for all TMS9918A display modes. See my TMS9918 emulator here: [github.com/visrealm/vrEmuTms9918](https://github.com/visrealm/vrEmuTms9918)\n* Support for the dual AY-3-8910 audio, keyboard and NES controller.\n\nThe emulator is also available for Web (Beta). [HBC-56 Emulator Online](https://visrealm.github.io/hbc-56/github-pages/emulator)\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"img/emulator-qbert.gif\" alt=\"HBC-56\" width=\"800px\"\u003e\u003c/p\u003e\n\nFull details on the Emulator and source code here: [emulator](emulator)\n\n### PICO-56\n\nThe PICO-56 project emulates the entire HBC-56 system on a single Raspberry Pi Pico.\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://github.com/visrealm/pico-56/raw/main/img/thumb.png\" alt=\"PICO\" width=\"640px\"\u003e\u003c/p\u003e\n\nPICO-56 repository: [https://github.com/visrealm/pico-56](https://github.com/visrealm/pico-56)\n\n## Building\n\nThis project uses the CMAKE build system to build the emulator and assembler. VSCode works very well with CMAKE, but you can also build manually:\n\n### Windows or Linux\n\n```\n$ git clone --recurse-submodules https://github.com/visrealm/hbc-56.git\n$ cd hbc-56\n$ cmake -B build -DCMAKE_BUILD_TYPE=Release -S .\n$ cmake --build build --config Release\n```\n\nThe `hbc-56/build/bin` directory will then hold everything you need to run the emulator.\n\n### WebAssembly\n\nTo build the WebAssembly version of the emulator (from `/hbc-56`): \n\n##### Windows (Developer Command Prompt)\n```\n$ ./emconfigure build_wasm\n$ cmake --build build_wasm --config Release\n```\n\n##### Linux\n```\n$ ./emconfigure.sh build_wasm\n$ cmake --build build_wasm --config Release\n```\n\nTo test the WebAssembly build, you will need to serve the files from a web server. A simple python http.server will work just fine:\n\n```\n$ cd build_wasm/bin\n$ python -m http.server\nServing HTTP on :: port 8000 (http://[::]:8000/) ...\n```\n\nThen navigate to [http://localhost:8000](http://localhost:8000)\n\n## Running the demos\nThere are several ways to build and run the demos. They are set up with makefiles, so it is preferred to have [MAKE](http://gnuwin32.sourceforge.net/packages/make.htm) installed and in your PATH environment variable.\n#### VSCode\n1. Open the [code/6502](code/6502) directory in VSCode\n2. For each test/demo program (eg. basic, invaders, tests\\tms, tests\\sfx, etc.) navigate to the .asm file and hit **\\\u003cCtrl\\\u003e+\\\u003cF5\\\u003e**. This will build and run the program in the emulator. **\\\u003cCtrl\\\u003e+\\\u003cShift\\\u003e+\\\u003cB\\\u003e** to just build the ROM image without running.\n  \n#### Command-line (MAKE)\n  \nFor each path ([basic](code/6502/basic), [invaders](code/6502/invaders), [tests/tms](code/6502/tests/tms),[tests/sfx](code/6502/tests/sfx)):\n1. Open a console to the path\n2. Type `make` (this will build the default program and run it in the emulator:\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"img/make.png\" alt=\"Make the demos\" width=\"640px\"\u003e\u003c/p\u003e\n\n * Type `make all` to build and run all demos in the directory\n * Type `make \u003cbasefile\u003e` (filename without extension) to build and run a specific demo eg:\n \n```\ncd code/6502/tests/inp\nmake kbtest\n```\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"img/kb_nes_tests.gif\" alt=\"HBC-56 Emulator\" width=\"800px\"\u003e\u003c/p\u003e\n\n#### Manually building a demo (without MAKE)\nExample: invaders\n```\ncd code\\6502\\invaders\n..\\..\\..\\tools\\acme\\acme -I ..\\lib -I ..\\kernel -o invaders.o -l invaders.o.lmap invaders.asm\n```\n#### Manually running a demo  (without MAKE)\nExample: invaders\n```\ncd code\\6502\\invaders\n..\\..\\..\\emulator\\bin\\Hbc56Emu.exe --rom invaders.o\n```\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/visrealm/vrEmuTms9918/main/res/mode1demo.gif\" alt=\"HBC-56 Emulator\" width=\"800px\"\u003e\u003c/p\u003e\n\nExample: basic\n```\ncd code\\6502\\basic\n..\\..\\..\\emulator\\bin\\Hbc56Emu.exe --rom basic_tms.o\n```\n\n\u003cp align=\"center\"\u003e\u003cimg src=\"img/basic.gif\" alt=\"HBC-56 Emulator\" width=\"800px\"\u003e\u003c/p\u003e\n\n## Memory map\n\nThe HBC-56 has 64KB addressable memory divided into RAM, ROM and IO as follows:\n\n| From | To | Purpose |\n|--|--|--|\n| $0000 | $7eff | RAM |\n| $7f00 | $7fff | I/O |\n| $8000 | $ffff | ROM |\n\nThe RAM and ROM is further divided by the HBC-56 Kernel:\n\n| From | To | Size | Purpose |\n|--|--|--|--|\n| $0000 | $00ff | 256 bytes | Zero page |\n| $0100 | $01ff | 256 bytes | Stack |\n| $0200 | $79ff | 30 kilobytes | User RAM |\n| $7a00 | $7eff | 1280 bytes | Kernel RAM |\n| $7f00 | $7fff | 256 bytes | I/O |\n| $8000 | $dfff | 24 kilobytes | User ROM |\n| $e000 | $ffff | 8 kilobytes | Kernel ROM |\n\nIO ports for current devices (all at $7fxx)\n\n| Port | Purpose |\n|--|--|\n| $02 | LCD Command |\n| $03 | LCD Data |\n| $08 | ROM Banking Register |\n| $10 | TMS9918A Command |\n| $11 | TMS9918A Data |\n| $20 | UART MC68B50 Register |\n| $21 | UART MC68B50 Data |\n| $40 | AY-3-8910 A Register |\n| $41 | AY-3-8910 A Write |\n| $42 | AY-3-8910 A Read |\n| $44 | AY-3-8910 B Register |\n| $45 | AY-3-8910 B Write |\n| $46 | AY-3-8910 B Read |\n| $80 | PS/2 Keyboard Data |\n| $81 | PS/2 Keyboard Status |\n| $82 | NES 1 Data |\n| $83 | NES 2 Data |\n| $df | Interrupt Register |\n| $f0 - $ff | 65c22 VIA |\n\n### Thanks\n\nThanks to PCBWay for supporting this project.\n\n[![PCBWay](/img/pcbway_sm.png)](https://pcbway.com/g/186WQ9)\n\n## Videos\n[![Backplane 6502 + TMS9918: Breakout](https://img.visualrealmsoftware.com/youtube/thumb/4C_1yekWGg4)](https://www.youtube.com/watch?v=4C_1yekWGg4 \"Backplane 6502 + TMS9918: Breakout\")\n\n[![Backplane 6502 + TMS9918: Invaders](https://img.visualrealmsoftware.com/youtube/thumb/Ug6Ppz-NF2Q)](https://www.youtube.com/watch?v=Ug6Ppz-NF2Q \"Backplane 6502 + TMS9918: Invaders\")\n\n[![6502 8-bit homebrew with backplane. Troy's HBC-56 project preview.](https://img.visualrealmsoftware.com/youtube/thumb/x4IN8i7_U_4?t=3)](https://www.youtube.com/watch?v=x4IN8i7_U_4 \"6502 8-bit homebrew with backplane. Troy's HBC-56 project preview.\")\n\n## License\nThis code is licensed under the [MIT](https://opensource.org/licenses/MIT \"MIT\") license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisrealm%2Fhbc-56","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvisrealm%2Fhbc-56","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvisrealm%2Fhbc-56/lists"}