Skip to content

Commit

Permalink
Merge branch 'devel'
Browse files Browse the repository at this point in the history
  • Loading branch information
lukexor committed May 1, 2020
2 parents 46459c2 + f1db014 commit 73692f6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
5 changes: 1 addition & 4 deletions bin/run_failing_test_roms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ tests/ppu/sprdma_and_dmc_dma_512.nes # Supposed to print a table and instead jus
tests/ppu/sprite_hit/09-timing.nes # Flag set too soon for upper-right corner #5
tests/ppu/sprite_overflow/3.Timing.nes # Failed #5
tests/ppu/sprite_overflow/4.Obscure.nes # Failed #2

## MAPPERS ========================================================================================
# tests/mapper/mmc3/5.MMC3_rev_A.nes # Can only pass rev_A or rev_B at the same time. Passes rev_B

tests/ppu/vbl_nmi/10-even_odd_timing.nes # Failed #3
)

trap ctrl_c INT
Expand Down
13 changes: 8 additions & 5 deletions bin/run_passing_test_roms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ tests/apu/test_6.nes
## PPU ============================================================================================
tests/ppu/oam_read.nes
tests/ppu/oam_stress.nes
tests/ppu/oamtest3.nes # Not really sure what this tests
tests/ppu/open_bus.nes
tests/ppu/palette.nes
tests/ppu/palette_ram.nes
Expand All @@ -99,6 +100,7 @@ tests/ppu/vbl_nmi/03-vbl_clear_time.nes
tests/ppu/vbl_nmi/04-nmi_control.nes
tests/ppu/vbl_nmi/05-nmi_timing.nes
tests/ppu/vbl_nmi/06-suppression.nes
tests/ppu/vbl_nmi/07-nmi_on_timing.nes
tests/ppu/vbl_nmi/08-nmi_off_timing.nes
tests/ppu/vbl_nmi/09-even_odd_frames.nes
tests/ppu/vbl_nmi_timing/1.frame_basics.nes
Expand All @@ -110,18 +112,19 @@ tests/ppu/vbl_nmi_timing/6.nmi_disable.nes
tests/ppu/vbl_nmi_timing/7.nmi_timing.nes
tests/ppu/vram_access.nes

# Video - Skip for now
# tests/ppu/240pee.nes
# tests/ppu/color.nes
# tests/ppu/ntsc_torture.nes
# tests/ppu/tv.nes
# Video
tests/ppu/240pee.nes
tests/ppu/color.nes
tests/ppu/ntsc_torture.nes
tests/ppu/tv.nes

## MAPPERS ========================================================================================
tests/mapper/mmc3/1.Clocking.nes
tests/mapper/mmc3/2.Details.nes
tests/mapper/mmc3/3.A12_clocking.nes
tests/mapper/mmc3/4.Scanline_timing.nes
tests/mapper/mmc3/6.MMC3_rev_B.nes
# tests/mapper/mmc3/5.MMC3_rev_A.nes # Can only pass rev_A or rev_B at the same time. Passes rev_
tests/mapper/mmc3/mmc3bigchrram.nes

)
Expand Down
6 changes: 3 additions & 3 deletions src/cpu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ impl Cpu {
self.push_stackb((self.status | U as u8) & !(B as u8));
self.set_flag(I, true);
self.pc = self.readw(NMI_ADDR);
self.nmi_pending = false;
self.bus.ppu.nmi_pending = false;
}

fn run_cycle(&mut self) {
Expand Down Expand Up @@ -572,8 +574,6 @@ impl Clocked for Cpu {
if self.has_irq(Irq::Reset) {
self.irq();
} else if self.last_nmi {
self.nmi_pending = false;
self.bus.ppu.nmi_pending = false;
self.nmi();
} else if self.last_irq {
self.irq();
Expand Down Expand Up @@ -685,7 +685,7 @@ impl Clocked for Cpu {
ANC => self.anc(), // AND #imm
SLO => self.slo(), // ASL & ORA
XXX => self.xxx(), // Unimplemented opcode
};
}

self.step += 1;
self.cycle_count - start_cycles
Expand Down
4 changes: 2 additions & 2 deletions src/mapper/m004_txrom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@ impl Txrom {
has_chr_ram,
mirroring,
irq_pending: false,
mmc3_revb: true, // TODO compare to known games
mmc_acc: false, // TODO - compare to known games
mmc3_revb: false, // TODO compare to known games
mmc_acc: false, // TODO - compare to known games
battery_backed: cart.battery_backed(),
prg_rom_bank_idx: [0, 1, prg_len - 2, prg_len - 1],
chr_bank_idx: [0, 1, 2, 3, 4, 5, 6, 7],
Expand Down
4 changes: 2 additions & 2 deletions src/ppu/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ impl Frame {
pub(super) fn put_ntsc_pixel(&mut self, x: u32, y: u32, pixel: u32, ppu_cycle: u32) {
// Store the RGB color into the frame buffer.
let color =
self.palette[ppu_cycle as usize][(self.prev_pixel % 64) as usize][pixel as usize];
self.palette[ppu_cycle as usize][pixel as usize][(self.prev_pixel % 64) as usize];
self.prev_pixel = pixel;
let red = (color >> 16 & 0xFF) as u8;
let green = (color >> 8 & 0xFF) as u8;
let blue = (color & 0xFF) as u8;
self.put_pixel(x, y, red, green, blue);
self.prev_pixel = pixel;
}

// NOTE: There's lot's to clean up here -- too many magic numbers and duplication but
Expand Down

0 comments on commit 73692f6

Please sign in to comment.