Skip to content

Commit

Permalink
Merge branch 'master' into newdebugger
Browse files Browse the repository at this point in the history
  • Loading branch information
devinacker committed Jul 24, 2019
2 parents 3e3bdab + 399d829 commit 07c7cb3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
8 changes: 5 additions & 3 deletions bsnes/snes/chip/sa1/mmio/mmio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,15 +407,17 @@ void SA1::mmio_w2254(uint8 data) {
if(mmio.acm == 0) {
if(mmio.md == 0) {
//signed multiplication
mmio.mr = (int16)mmio.ma * (int16)mmio.mb;
mmio.mr = (uint32)((int16)mmio.ma * (int16)mmio.mb);
mmio.mb = 0;
} else {
//unsigned division
if(mmio.mb == 0) {
mmio.mr = 0;
} else {
int16 quotient = (int16)mmio.ma / (uint16)mmio.mb;
uint16 remainder = (int16)mmio.ma % (uint16)mmio.mb;
int16 dividend = mmio.ma;
uint16 divisor = mmio.mb;
uint16 remainder = (dividend >= 0) ? (dividend % divisor) : ((dividend % divisor + divisor) % divisor);
uint16 quotient = (dividend - remainder) / divisor;
mmio.mr = (remainder << 16) | quotient;
}
mmio.ma = 0;
Expand Down
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
4 changes: 4 additions & 0 deletions common/nall/snes/cartridge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,10 @@ SNESCartridge::SNESCartridge(const uint8_t *data, unsigned size) {
xml << " <map mode='shadow' address='00-0f:8000-ffff'/>\n";
xml << " <map mode='shadow' address='80-bf:8000-ffff'/>\n";
xml << " <map mode='linear' address='c0-cf:0000-ffff'/>\n";
if (size >= 0x700000) {
// Tengai Makyou Zero english translation
xml << " <map mode='linear' address='40-4f:0000-ffff' offset='600000'/>\n";
}
xml << " </rom>\n";

xml << " <spc7110>\n";
Expand Down

0 comments on commit 07c7cb3

Please sign in to comment.