Skip to content

Commit

Permalink
backport PPU timing tweaks from v106r124 etc
Browse files Browse the repository at this point in the history
  • Loading branch information
devinacker committed Jun 8, 2019
1 parent a94bd56 commit 399d829
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 3 additions & 5 deletions bsnes/snes/ppu/ppu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void PPU::enter() {
}

scanline();
add_clocks(68);
add_clocks(28);

if(vcounter() <= (!regs.overscan ? 224 : 239)) {
for(signed pixel = -7; pixel <= 255; pixel++) {
Expand All @@ -60,13 +60,11 @@ void PPU::enter() {
add_clocks(2);
}

add_clocks(14);
add_clocks(14 + 34*2);
oam.tilefetch();
} else {
add_clocks(1052 + 14 + 136);
}

add_clocks(lineclocks() - 68 - 1052 - 14 - 136);
add_clocks(lineclocks() - hcounter());
}
}

Expand Down
4 changes: 1 addition & 3 deletions bsnes/snes/ppu/sprite/sprite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,13 @@ void PPU::Sprite::tilefetch() {

oam_tile[n].d0 = memory::vram[addr + 0];
oam_tile[n].d1 = memory::vram[addr + 1];
self.add_clocks(2);

oam_tile[n].d2 = memory::vram[addr + 16];
oam_tile[n].d3 = memory::vram[addr + 17];
self.add_clocks(2);
}
}

if(t.tile_count < 34) self.add_clocks((34 - t.tile_count) * 4);
if(t.tile_count < 34) self.add_clocks((34 - t.tile_count) * 2);
regs.time_over |= (t.tile_count > 34);
regs.range_over |= (t.item_count > 32);
}
Expand Down

0 comments on commit 399d829

Please sign in to comment.