Skip to content

blahness/nes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Summary

This is an NES emulator library written in D. It started as a port to D from Go of github.com/fogleman/nes. It's pure D & has no dependencies.

Installation

Just add "nes": "~>0.2.0" or "nes" version="~>0.2.0" to the dependencies section of your dub.json or dub.sdl file.

Usage

See github.com/blahness/nes_test for an example usage.

Mappers

The following mappers have been implemented:

  • NROM (0)
  • MMC1 (1)
  • UNROM (2)
  • CNROM (3)
  • MMC3 (4)
  • AOROM (7)
  • 255

Test ROM Results

CPU Tests

Name Results
branch_timing_tests
3/3 Pass1.Branch_Basics ✔️
2.Backward_Branch ✔️
3.Forward_Branch ✔️
cpu_interrupts_v2
6/6 Passcpu_interrupts ✔️
1-cli_latency ✔️
2-nmi_and_brk ✔️
3-nmi_and_irq ✔️
4-irq_and_dma ✔️
5-branch_delays_irq ✔️
cpu_timing_test6 Pass
instr_test-v5
18/18 Passall_instrs ✔️
official_only ✔️
01-basics ✔️
02-implied ✔️
03-immediate ✔️
04-zero_page ✔️
05-zp_xy ✔️
06-absolute ✔️
07-abs_xy ✔️
08-ind_x ✔️
09-ind_y ✔️
10-branches ✔️
11-stack ✔️
12-jmp_jsr ✔️
13-rts ✔️
14-rti ✔️
15-brk ✔️
16-special ✔️
instr_timing
3/3 Passinstr_timing ✔️
1-instr_timing ✔️
2-branch_timing ✔️
nestest Pass

PPU Tests

Name Results
blargg_ppu_tests_2005.09.15b
5/5 Passpalette_ram ✔️
power_up_palette ✔️
sprite_ram ✔️
vbl_clear_time ✔️
vram_access ✔️
nmi_sync
0/2 Passdemo_ntsc ❌
demo_pal ❌
ppu_sprite_hit
11/11 Passppu_sprite_hit ✔️
01-basics ✔️
02-alignment ✔️
03-corners ✔️
04-flip ✔️
05-left_clip ✔️
06-right_edge ✔️
07-screen_bottom ✔️
08-double_height ✔️
09-timing ✔️
10-timing_order ✔️
ppu_vbl_nmi
11/11 Passppu_vbl_nmi ✔️
01-vbl_basics ✔️
02-vbl_set_time ✔️
03-vbl_clear_time ✔️
04-nmi_control ✔️
05-nmi_timing ✔️
06-suppression ✔️
07-nmi_on_timing ✔️
08-nmi_off_timing ✔️
09-even_odd_frames ✔️
10-even_odd_timing ✔️
scanline Pass

APU Tests

Name Results Notes
apu_mixer
4/4 Passdmc ✔️
noise ✔️
square ✔️
triangle ✔️
apu_phase_reset Pass
apu_reset
6/6 Pass4015_cleared ✔️
4017_timing ✔️
4017_written ✔️
irq_flag_cleared ✔️
len_ctrs_enabled ✔️
works_immediately ✔️
apu_test
9/9 Passapu_test ✔️
1-len_ctr ✔️
2-len_table ✔️
3-irq_flag ✔️
4-jitter ✔️
5-len_timing ✔️
6-irq_flag_timing ✔️
7-dmc_basics ✔️
8-dmc_rates ✔️
blargg_apu_2005.07.30
11/11 Pass01.len_ctr ✔️
02.len_table ✔️
03.irq_flag ✔️
04.clock_jitter ✔️
05.len_timing_mode0 ✔️
06.len_timing_mode1 ✔️
07.irq_flag_timing ✔️
08.irq_timing ✔️
09.reset_timing ✔️
10.len_halt_timing ✔️
11.len_reload_timing ✔️
dmc_tests
4/4 Passbuffer_retained ✔️
latency ✔️
status ✔️
status_irq ✔️
dpcmletterbox Pass HSYNC timing issues create flicker when scrolling
fadeout_and_triangle_test Pass
square_timer_div2 Pass
test_apu_2
10/10 Passtest_1 ✔️
test_2 ✔️
test_3 ✔️
test_4 ✔️
test_5 ✔️
test_6 ✔️
test_7 ✔️
test_8 ✔️
test_9 ✔️
test_10 ✔️
test_apu_env Pass
test_apu_m
3/3 Passtest_9 ✔️
test_10 ✔️
test_11 ✔️
test_apu_sweep
2/2 Passsweep_cutoff ✔️
sweep_sub ✔️
test_apu_timers
4/4 Passdmc_pitch ✔️
noise_pitch ✔️
square_pitch ✔️
triangle_pitch ✔️
test_tri_lin_ctr Pass
volume_tests Pass

Known Issues

  • there are some minor issues with PPU timing, but most games work OK anyway
  • the APU emulation isn't quite perfect, but not far off
  • only NTSC timing supported for now