Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions bsnes/sfc/ppu-fast/background.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ auto PPU::Line::renderBackground(PPU::IO::Background& self, uint8 source) -> voi
if(offsetPerTileMode) {
uint validBit = 0x2000 << source;
uint offsetX = x + (hscroll & 7);
if(offsetX >= 8) { //first column is exempt
uint hlookup = getTile(io.bg3, (offsetX - 8) + (io.bg3.hoffset & ~7), io.bg3.voffset + 0);
if(offsetX >= (1 << tileWidth)) { //first column is exempt
uint hlookup = getTile(io.bg3, offsetX - (1 << tileWidth) + ((io.bg3.hoffset & ~7) << hires), io.bg3.voffset + 0);
if(io.bgMode == 4) {
if(hlookup & validBit) {
if(!(hlookup & 0x8000)) {
Expand All @@ -60,7 +60,7 @@ auto PPU::Line::renderBackground(PPU::IO::Background& self, uint8 source) -> voi
}
}
} else {
uint vlookup = getTile(io.bg3, (offsetX - 8) + (io.bg3.hoffset & ~7), io.bg3.voffset + 8);
uint vlookup = getTile(io.bg3, offsetX - (1 << tileWidth) + ((io.bg3.hoffset & ~7) << hires), io.bg3.voffset + 8);
if(hlookup & validBit) {
hoffset = offsetX + (hlookup & ~7);
}
Expand Down
4 changes: 2 additions & 2 deletions bsnes/sfc/ppu/background.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,14 +125,14 @@ auto PPU::Background::fetchNameTable() -> void {
auto PPU::Background::fetchOffset(uint y) -> void {
if(ppu.vcounter() == 0) return;

uint characterIndex = ppu.hcounter() >> 5 << hires();
uint characterIndex = ppu.hcounter() >> 5;
uint x = characterIndex << 3;

uint hoffset = x + (io.hoffset & ~7);
uint voffset = y + (io.voffset);

uint vtiles = 3 + io.tileSize;
uint htiles = !hires() ? vtiles : 4;
uint htiles = !hires() ? vtiles : 3;

uint htile = hoffset >> htiles;
uint vtile = voffset >> vtiles;
Expand Down
Loading