Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jakehffn/zig-nes
NES emulator written in Zig⚡
https://github.com/jakehffn/zig-nes
6502 6502-emulation emulation emulator imgui nes zig
Last synced: 24 days ago
JSON representation
NES emulator written in Zig⚡
- Host: GitHub
- URL: https://github.com/jakehffn/zig-nes
- Owner: jakehffn
- Created: 2023-06-09T21:59:40.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-17T23:19:54.000Z (3 months ago)
- Last Synced: 2024-09-18T03:43:54.205Z (3 months ago)
- Topics: 6502, 6502-emulation, emulation, emulator, imgui, nes, zig
- Language: Zig
- Homepage:
- Size: 423 KB
- Stars: 34
- Watchers: 5
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
ZigNES 🕹️
NES emulator written in Zig with GUI using imgui.
Currently, only mappers 0 and 1 are supported.
## Build
Clone this repository somewhere on your machine with the following:
`git clone --recurse-submodules https://github.com/jakehffn/zig-nes.git && cd zig-nes`
If environment variables for `SDL2_PATH` and `GLEW_PATH` are set, ZigNES can be built with,
`zig build`
The build file also expects the `SDL2` shared libary to have the extension, `.dll`, so other distributions of `SDL2` may require a little tweaking to `build.zig`.
## Usage
### Controls
| Key | Action |
|-----|---------|
| W,A,S,D | D-Pad |
| J | A Button |
| K | B Button |
| Space | Select |
| Return | Start |## CPU tests
To test the CPU, Tom Harte's [nes6502 tests](https://github.com/TomHarte/ProcessorTests/tree/main/nes6502) are used. This is a suite of 10,000 tests for each of the 256 opcodes, both legal and illegal, which describes the initial and final state of the CPU after running one instruction.Currently, the `ZigNES` CPU passes all 1.5 million test cases for the set of legal opcodes, excluding cycle timings.
The test set itself is not included in this repository due to the size of download. If you would like to run the tests yourself, the test runner expects the test cases to exist at the path `.\test-files\tom_harte_nes6502\v1` relative to the root of this project.