Skip to content

Commit 07c7cb3

Browse files
committed
Merge branch 'master' into newdebugger
2 parents 3e3bdab + 399d829 commit 07c7cb3

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

bsnes/snes/chip/sa1/mmio/mmio.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,15 +407,17 @@ void SA1::mmio_w2254(uint8 data) {
407407
if(mmio.acm == 0) {
408408
if(mmio.md == 0) {
409409
//signed multiplication
410-
mmio.mr = (int16)mmio.ma * (int16)mmio.mb;
410+
mmio.mr = (uint32)((int16)mmio.ma * (int16)mmio.mb);
411411
mmio.mb = 0;
412412
} else {
413413
//unsigned division
414414
if(mmio.mb == 0) {
415415
mmio.mr = 0;
416416
} else {
417-
int16 quotient = (int16)mmio.ma / (uint16)mmio.mb;
418-
uint16 remainder = (int16)mmio.ma % (uint16)mmio.mb;
417+
int16 dividend = mmio.ma;
418+
uint16 divisor = mmio.mb;
419+
uint16 remainder = (dividend >= 0) ? (dividend % divisor) : ((dividend % divisor + divisor) % divisor);
420+
uint16 quotient = (dividend - remainder) / divisor;
419421
mmio.mr = (remainder << 16) | quotient;
420422
}
421423
mmio.ma = 0;

bsnes/snes/ppu/ppu.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ void PPU::enter() {
3838
}
3939

4040
scanline();
41-
add_clocks(68);
41+
add_clocks(28);
4242

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

63-
add_clocks(14);
63+
add_clocks(14 + 34*2);
6464
oam.tilefetch();
65-
} else {
66-
add_clocks(1052 + 14 + 136);
6765
}
6866

69-
add_clocks(lineclocks() - 68 - 1052 - 14 - 136);
67+
add_clocks(lineclocks() - hcounter());
7068
}
7169
}
7270

bsnes/snes/ppu/sprite/sprite.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,13 @@ void PPU::Sprite::tilefetch() {
146146

147147
oam_tile[n].d0 = memory::vram[addr + 0];
148148
oam_tile[n].d1 = memory::vram[addr + 1];
149-
self.add_clocks(2);
150-
151149
oam_tile[n].d2 = memory::vram[addr + 16];
152150
oam_tile[n].d3 = memory::vram[addr + 17];
153151
self.add_clocks(2);
154152
}
155153
}
156154

157-
if(t.tile_count < 34) self.add_clocks((34 - t.tile_count) * 4);
155+
if(t.tile_count < 34) self.add_clocks((34 - t.tile_count) * 2);
158156
regs.time_over |= (t.tile_count > 34);
159157
regs.range_over |= (t.item_count > 32);
160158
}

common/nall/snes/cartridge.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,10 @@ SNESCartridge::SNESCartridge(const uint8_t *data, unsigned size) {
283283
xml << " <map mode='shadow' address='00-0f:8000-ffff'/>\n";
284284
xml << " <map mode='shadow' address='80-bf:8000-ffff'/>\n";
285285
xml << " <map mode='linear' address='c0-cf:0000-ffff'/>\n";
286+
if (size >= 0x700000) {
287+
// Tengai Makyou Zero english translation
288+
xml << " <map mode='linear' address='40-4f:0000-ffff' offset='600000'/>\n";
289+
}
286290
xml << " </rom>\n";
287291

288292
xml << " <spc7110>\n";

0 commit comments

Comments
 (0)