Fixed offset-per-tile regression with accurate PPU renderer.
This commit is contained in:
byuu 2019-10-27 00:51:15 +09:00
parent f51bc06739
commit 819d6dbde4
3 changed files with 10 additions and 8 deletions

View File

@ -29,7 +29,7 @@ using namespace nall;
namespace Emulator {
static const string Name = "bsnes";
static const string Version = "112.2";
static const string Version = "112.3";
static const string Author = "byuu";
static const string License = "GPLv3";
static const string Website = "https://byuu.org";

View File

@ -75,13 +75,13 @@ auto PPU::Background::fetchNameTable() -> void {
if(ppu.io.bgMode == 4) {
if(hlookup & valid) {
if(!(hlookup & 0x8000)) {
hoffset = hpixel + (hlookup & ~7) + (hscroll & ~7);
hoffset = hpixel + (hlookup & ~7) + (hscroll & 7);
} else {
voffset = vpixel + (vlookup);
}
}
} else {
if(hlookup & valid) hoffset = hpixel + (hlookup & ~7) + (hscroll & ~7);
if(hlookup & valid) hoffset = hpixel + (hlookup & ~7) + (hscroll & 7);
if(vlookup & valid) voffset = vpixel + (vlookup);
}
}
@ -141,7 +141,7 @@ auto PPU::Background::fetchNameTable() -> void {
auto PPU::Background::fetchOffset(uint y) -> void {
if(ppu.vcounter() == 0) return;
int x = ppu.hcounter() >> 2;
uint x = characterIndex << 3;
uint hoffset = x + (io.hoffset & ~7);
uint voffset = y + (io.voffset);
@ -162,6 +162,8 @@ auto PPU::Background::fetchOffset(uint y) -> void {
uint16 address = io.screenAddress + offset;
if(y == 0) opt.hoffset = ppu.vram[address];
if(y == 8) opt.voffset = ppu.vram[address];
if(y == 0) characterIndex++;
}
auto PPU::Background::fetchCharacter(uint index) -> void {

View File

@ -94,8 +94,8 @@ auto PPU::cycleBackgroundFetch() -> void {
case 2:
if constexpr(Cycle == 0) bg2.fetchNameTable();
if constexpr(Cycle == 1) bg1.fetchNameTable();
if constexpr(Cycle == 2) bg3.fetchOffset(0);
if constexpr(Cycle == 3) bg3.fetchOffset(8);
if constexpr(Cycle == 2) bg3.fetchOffset(8);
if constexpr(Cycle == 3) bg3.fetchOffset(0);
if constexpr(Cycle == 4) bg2.fetchCharacter(1);
if constexpr(Cycle == 5) bg2.fetchCharacter(0);
if constexpr(Cycle == 6) bg1.fetchCharacter(1);
@ -134,8 +134,8 @@ auto PPU::cycleBackgroundFetch() -> void {
case 6:
if constexpr(Cycle == 0) bg2.fetchNameTable();
if constexpr(Cycle == 1) bg1.fetchNameTable();
if constexpr(Cycle == 2) bg3.fetchOffset(0);
if constexpr(Cycle == 3) bg3.fetchOffset(8);
if constexpr(Cycle == 2) bg3.fetchOffset(8);
if constexpr(Cycle == 3) bg3.fetchOffset(0);
if constexpr(Cycle == 4) bg1.fetchCharacter(1);
if constexpr(Cycle == 5) bg1.fetchCharacter(0);
if constexpr(Cycle == 6) bg1.fetchCharacter(1);