Skip to content

Commit

Permalink
chore: docs, justfile nit, add a test rom
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanleiby committed Dec 17, 2024
1 parent 2c577fc commit 1827ae4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
11 changes: 4 additions & 7 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
- [ ] Add scrolling support
- [ ] Bug: Why are some sprites flipped around?
- afaict it's a bug with drawing or tile lookup, not with flip horiz / flip vertical
- [ ] Add scrolling support
- [..] Add tests cases for PPU registers
- [ ] Add support for 2 gamepads
- [ ] Separate the core from the specific hardware (screen, input)
- [ ] Try replacing screen and input with macroquad
- [ ] Integrate code coverage into CI. (maybe add a repo tag in README)
https://github.com/xd009642/tarpaulin
https://medium.com/@gnanaganesh/robust-rust-how-code-coverage-powers-rust-software-quality-417ef3ac2360
Expand All @@ -24,12 +27,6 @@
- log the details
- highlight which pattern is being used
- show state of CPU (same idea as "trace")
- Is there a way to get a nice trace that doesn't manipulate registers which cause side effects of READ operations?
- consider a non-mut mem_peek() fn, that's safe in debugging/tracing
- Right now, running a trace causes a program to fail
I wrote a `tracelite` operation to explore this.
I also modified `trace` to skip the address lookups, and this was usable enough for debugging (but broke some hard-coding in tests).
- PR upstream: Explain in the book that trace() needs to be deactivated (if it does) due to side-effects of READ ops
- [ ] More NES Test roms
- Try running more NES Test roms, maybe they can help now that i have some graphics?
- Lots of the PPU test rom links here are broken.. https://www.nesdev.org/wiki/Emulator_tests
Expand Down
4 changes: 2 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ alias pc := pre_commit
alias t := test_all
alias tw := test_watch_all

run:
cargo run
run ROM:
cargo run {{ROM}}

run_with_trace ROM:
RUST_BACKTRACE=1 CPU_TRACE=1 cargo run {{ROM}}
Expand Down
Binary file added roms/test/color_test.nes
Binary file not shown.
1 change: 1 addition & 0 deletions src/bus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ impl Mem for Bus<'_> {
fn mem_peek(&self, addr: u16) -> u8 {
match addr {
RAM..RAM_MIRROR_END => {
// 0x800; // total size of vram (0x800 = 2024)
let a = addr & 0b1110_0111_1111_1111;
self.cpu_vram[a as usize]
}
Expand Down

0 comments on commit 1827ae4

Please sign in to comment.