https://github.com/markolson/nex
Why on earth would I try to write an NES emulator in Elixir? This is so dumb
https://github.com/markolson/nex
Last synced: 4 months ago
JSON representation
Why on earth would I try to write an NES emulator in Elixir? This is so dumb
- Host: GitHub
- URL: https://github.com/markolson/nex
- Owner: markolson
- Created: 2016-05-26T01:11:50.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-06-15T04:36:54.000Z (about 10 years ago)
- Last Synced: 2025-05-05T20:42:00.607Z (about 1 year ago)
- Language: Elixir
- Size: 202 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# NEX
Elixir/OpenGL NES Emulator, because why the heck not.
All technology is pointless.
## Short-term TODO list
* Turn CPU into a Genserver
* Macro the hell out of opcodes
* Get something nicer around setting flags/registers
## Notes
http://nesdev.com/6502.txt
http://www.intel-assembler.it/portale/5/6502_undocumented_opcodes/CPU_6502_features.asp
NesTest is a NROM-128 with no mapper
In NROM-128, the 16k PRG ROM is mirrored into both $8000-$BFFF and $C000-$FFFF.
So execution can start at C000, which is really location 0000 in the ROM itself.
What have I gotten myself into. Mappers are going to require some thought...
```
t = Nex.CPU.boot("test/roms/nestest/nestest.nes")
{t2, _} = Nex.CPU.run_instruction(t) # JPM
{t3, _} = Nex.CPU.run_instruction(t2) # LDX
{t4, _} = Nex.CPU.run_instruction(t3) # STX
{t5, _} = Nex.CPU.run_instruction(t4) # STX
{t6, _} = Nex.CPU.run_instruction(t5) # STX
{t7, _} = Nex.CPU.run_instruction(t6) # JSR
cpu = Nex.CPU.boot('test/roms/nestest/nestest.nes')
Nex.CPU.flock(cpu)
```