Revert "PPU: Fixed mosaic display when reading/writing to PPU registers in the middle of a scanline"

This reverts commit 98fe9a85d6.
This commit is contained in:
NovaSquirrel 2020-10-10 15:18:20 -04:00
parent 242dd77365
commit c1c161b2a5

View file

@ -949,7 +949,7 @@ void Ppu::RenderTilemap()
TileData* tileData = _layerData[layerIndex].Tiles; TileData* tileData = _layerData[layerIndex].Tiles;
uint8_t mosaicCounter = applyMosaic ? (_drawStartX % _state.MosaicSize) : 0; uint8_t mosaicCounter = applyMosaic ? _state.MosaicSize - (_drawStartX % _state.MosaicSize) : 0;
uint8_t lookupIndex; uint8_t lookupIndex;
uint8_t chrDataOffset; uint8_t chrDataOffset;
@ -988,7 +988,7 @@ void Ppu::RenderTilemap()
uint8_t priority = (tilemapData & 0x2000) ? highPriority : normalPriority; uint8_t priority = (tilemapData & 0x2000) ? highPriority : normalPriority;
if(applyMosaic) { if(applyMosaic) {
if(mosaicCounter == 0) { if(mosaicCounter == _state.MosaicSize) {
mosaicCounter = 1; mosaicCounter = 1;
if(hiResMode) { if(hiResMode) {
color = hiresSubColor; color = hiresSubColor;
@ -997,9 +997,6 @@ void Ppu::RenderTilemap()
_mosaicPriority[layerIndex] = priority; _mosaicPriority[layerIndex] = priority;
} else { } else {
mosaicCounter++; mosaicCounter++;
if(mosaicCounter == _state.MosaicSize) {
mosaicCounter = 0;
}
color = _mosaicColor[layerIndex] & 0xFF; color = _mosaicColor[layerIndex] & 0xFF;
paletteIndex = _mosaicColor[layerIndex] >> 8; paletteIndex = _mosaicColor[layerIndex] >> 8;
priority = _mosaicPriority[layerIndex]; priority = _mosaicPriority[layerIndex];
@ -1111,7 +1108,7 @@ void Ppu::RenderTilemapMode7()
//Keep the "scanline" to what it was at the start of this mosaic block //Keep the "scanline" to what it was at the start of this mosaic block
realY -= _state.MosaicSize - _mosaicScanlineCounter; realY -= _state.MosaicSize - _mosaicScanlineCounter;
} }
uint8_t mosaicCounter = applyMosaic ? (_drawStartX % _state.MosaicSize) : 0; uint8_t mosaicCounter = applyMosaic ? _state.MosaicSize - (_drawStartX % _state.MosaicSize) : 0;
int32_t xValue = ( int32_t xValue = (
((_state.Mode7.Matrix[0] * clip(hScroll - centerX)) & ~63) + ((_state.Mode7.Matrix[0] * clip(hScroll - centerX)) & ~63) +
@ -1178,15 +1175,12 @@ void Ppu::RenderTilemapMode7()
} }
if(applyMosaic) { if(applyMosaic) {
if(mosaicCounter == 0) { if(mosaicCounter == _state.MosaicSize) {
mosaicCounter = 1; mosaicCounter = 1;
_mosaicColor[layerIndex] = colorIndex; _mosaicColor[layerIndex] = colorIndex;
_mosaicPriority[layerIndex] = priority; _mosaicPriority[layerIndex] = priority;
} else { } else {
mosaicCounter++; mosaicCounter++;
if(mosaicCounter == _state.MosaicSize) {
mosaicCounter = 0;
}
colorIndex = _mosaicColor[layerIndex]; colorIndex = _mosaicColor[layerIndex];
priority = _mosaicPriority[layerIndex]; priority = _mosaicPriority[layerIndex];
} }