Archived
1
Fork 0
This repository has been archived on 2025-04-12. You can view files and clone it, but cannot push or open issues or pull requests.
chip8/README.md

37 lines
2.4 KiB
Markdown
Raw Normal View History

2020-04-29 14:55:53 -04:00
# chip8
2022-02-28 21:25:27 -05:00
[![sourcehut](https://img.shields.io/badge/repository-sourcehut-lightgrey.svg?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSINCiAgICB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCI+DQogIDxkZWZzPg0KICAgIDxmaWx0ZXIgaWQ9InNoYWRvdyIgeD0iLTEwJSIgeT0iLTEwJSIgd2lkdGg9IjEyNSUiIGhlaWdodD0iMTI1JSI+DQogICAgICA8ZmVEcm9wU2hhZG93IGR4PSIwIiBkeT0iMCIgc3RkRGV2aWF0aW9uPSIxLjUiDQogICAgICAgIGZsb29kLWNvbG9yPSJibGFjayIgLz4NCiAgICA8L2ZpbHRlcj4NCiAgICA8ZmlsdGVyIGlkPSJ0ZXh0LXNoYWRvdyIgeD0iLTEwJSIgeT0iLTEwJSIgd2lkdGg9IjEyNSUiIGhlaWdodD0iMTI1JSI+DQogICAgICA8ZmVEcm9wU2hhZG93IGR4PSIwIiBkeT0iMCIgc3RkRGV2aWF0aW9uPSIxLjUiDQogICAgICAgIGZsb29kLWNvbG9yPSIjQUFBIiAvPg0KICAgIDwvZmlsdGVyPg0KICA8L2RlZnM+DQogIDxjaXJjbGUgY3g9IjUwJSIgY3k9IjUwJSIgcj0iMzglIiBzdHJva2U9IndoaXRlIiBzdHJva2Utd2lkdGg9IjQlIg0KICAgIGZpbGw9Im5vbmUiIGZpbHRlcj0idXJsKCNzaGFkb3cpIiAvPg0KICA8Y2lyY2xlIGN4PSI1MCUiIGN5PSI1MCUiIHI9IjM4JSIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSI0JSINCiAgICBmaWxsPSJub25lIiBmaWx0ZXI9InVybCgjc2hhZG93KSIgLz4NCjwvc3ZnPg0KCg==)](https://git.sr.ht/~redstrate/chip8)
[![GitHub
mirror](https://img.shields.io/badge/mirror-GitHub-black.svg?logo=github)](https://github.com/redstrate/chip8)
2022-03-22 10:33:27 -04:00
[![ryne.moe
mirror](https://img.shields.io/badge/mirror-ryne.moe-red.svg?logo=git)](https://git.ryne.moe/redstrate/chip8)
2022-02-28 21:25:27 -05:00
2022-03-30 10:33:26 -04:00
This is a CHIP-8 emulator that I implemented in C++!
Right now it only emulates the SCHIP instruction set, but it can already play many modern roms found online. There's a basic memory viewer and debugger available as well.
My goal is not to create an extremely fast or optimized emulator, but be easy to read and understand for those who wish to
create their own CHIP-8 emulator.
2020-04-29 14:55:53 -04:00
2022-02-28 21:25:27 -05:00
![example result](misc/output.png)
2020-05-30 05:39:38 -04:00
2022-03-30 10:33:26 -04:00
# Usage
It should compile out of the box on Windows, macOS and Linux and it includes a basic [dear imgui interface](https://github.com/ocornut/imgui). There's also
some ROMs included in the repository for convenience. Once you click on a ROM, it will start immediately.
## Debugger
Using the debugger you can step instruction by instruction, stop or restart the program and see the instruction being
executed and the surrounding program. Unfortunately it's not very advanced at the moment.
## Compiler
2020-05-30 05:39:38 -04:00
This emulator also comes with a basic compiler that takes a C-style language as input and can spit out valid CHIP-8 code:
2020-04-29 14:55:53 -04:00
```
var count = 3;
label(main);
count += 3;
draw_char(0, 5, count)
jump(main);
```