diff --git a/bsnes/sfc/ppu-fast/background.cpp b/bsnes/sfc/ppu-fast/background.cpp index ffa6867c..a9863431 100644 --- a/bsnes/sfc/ppu-fast/background.cpp +++ b/bsnes/sfc/ppu-fast/background.cpp @@ -28,13 +28,13 @@ auto PPU::Line::renderBackground(PPU::IO::Background& self, uint8 source) -> voi uint vmask = (width << self.tileSize << !!(self.screenSize & 2)) - 1; uint y = this->y; - if(self.mosaicEnable) y -= io.mosaic.size - io.mosaic.counter; + if(hires) { hscroll <<= 1; - if(io.interlace) { - y = y << 1 | field(); - if(self.mosaicEnable) y -= io.mosaic.size - io.mosaic.counter + field(); - } + if(io.interlace) y = y << 1 | (field() && !self.mosaicEnable); + } + if(self.mosaicEnable) { + y -= (io.mosaic.size - io.mosaic.counter) << (hires && io.interlace); } uint mosaicCounter = 1; @@ -112,7 +112,7 @@ auto PPU::Line::renderBackground(PPU::IO::Background& self, uint8 source) -> voi color += data >> shift + 49 & 128; } - mosaicCounter = self.mosaicEnable ? io.mosaic.size : 1; + mosaicCounter = self.mosaicEnable ? io.mosaic.size << hires : 1; mosaicPalette = color; mosaicPriority = tilePriority; if(directColorMode) { diff --git a/bsnes/sfc/ppu/background.cpp b/bsnes/sfc/ppu/background.cpp index dcf3cc9d..e9d3dcb3 100644 --- a/bsnes/sfc/ppu/background.cpp +++ b/bsnes/sfc/ppu/background.cpp @@ -37,13 +37,12 @@ auto PPU::Background::fetchNameTable() -> void { uint hscroll = io.hoffset; uint vscroll = io.voffset; - if(mosaic.enable) vpixel -= ppu.mosaic.voffset(); if(hires()) { hscroll <<= 1; - if(ppu.io.interlace) { - vpixel = vpixel << 1 | ppu.field(); - if(mosaic.enable) vpixel -= ppu.mosaic.voffset() + ppu.field(); - } + if(ppu.io.interlace) vpixel = vpixel << 1 | (ppu.field() && !mosaic.enable); + } + if(mosaic.enable) { + vpixel -= ppu.mosaic.voffset() << (hires() && ppu.io.interlace); } bool repeated = false; @@ -197,7 +196,8 @@ auto PPU::Background::run(bool screen) -> void { if(++pixelCounter == 0) renderingIndex++; uint x = ppu.hcounter() - 56 >> 2; - if(x == 0) { + + if(x == 0 && (!hires() || screen == Screen::Below)) { mosaic.hcounter = ppu.mosaic.size; mosaic.pixel = pixel; } else if((!hires() || screen == Screen::Below) && --mosaic.hcounter == 0) {