mirror of
https://github.com/andwati/mos-6502.git
synced 2026-10-18 03:02:51 +00:00
1.1 KiB
1.1 KiB
Contributor notes
Commands
make # build bin/mos6502
make test # core checks
make debug # strict warning build and checks
make sanitize # ASan/UBSan build and checks
make snake # assemble and run the SDL game (requires SDL2 + cc65)
Architecture
CPU6502contains CPU-visible and interrupt-line state.Bus6502owns RAM and Easy6502 MMIO; CPU code only uses bus accessors.cpu_stepexecutes one instruction or interrupt and returns status/opcode/cycles.src/opcode.chas a 256-entry descriptor table for all 151 official encodings.src/frontend.cis an optional SDL2 frontend with a dependency-free stub.tests/run_tests.cis the in-tree test harness;tests/run_suite.cruns external ROMs.
The target is the NMOS 6502. Preserve decimal-mode flag behavior, zero-page wrapping, the indirect-JMP page-wrap bug, stack push order, and page-cross cycle rules. Do not silently accept undocumented opcodes.
The virtual machine exposes game state at $00FB, high/game score at $00FC/$00FD, random input
at $00FE, keyboard input at $00FF, and a 32x32 framebuffer at
$0200-$05FF.