Skip to content

Commit

Permalink
Correct subscreen hack
Browse files Browse the repository at this point in the history
see #2784
  • Loading branch information
gonetz committed Mar 10, 2024
1 parent 525ce82 commit e568bab
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/BufferCopy/ColorBufferToRDRAM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,10 @@ void ColorBufferToRDRAM::_copy(u32 _startAddress, u32 _endAddress, bool _sync)
u32 *ptr_src = (u32*)pPixels;
u16 *ptr_dst = (u16*)(RDRAM + _startAddress);
m_blueNoiseIdx++;
if ((config.generalEmulation.hacks & hack_subscreen) != 0u && height == 1u)
if (gDP.m_subscreen) {
copyWhiteToRDRAM(m_pCurFrameBuffer);
else
gDP.m_subscreen = false;
} else
writeToRdram<u32, u16>(ptr_src, ptr_dst, &ColorBufferToRDRAM::_RGBAtoRGBA16, dummyTester<u32>, 1, width, height, numPixels, _startAddress, m_pCurFrameBuffer->m_startAddress, m_pCurFrameBuffer->m_size);
} else if (m_pCurFrameBuffer->m_size == G_IM_SIZ_8b) {
u8 *ptr_src = (u8*)pPixels;
Expand Down
4 changes: 4 additions & 0 deletions src/FrameBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -918,6 +918,10 @@ void FrameBufferList::saveBuffer(u32 _address, u16 _format, u16 _size, u16 _widt
wnd.getDrawer().clearDepthBuffer();
}

if ((config.generalEmulation.hacks & hack_subscreen) != 0u &&
_format == G_IM_FMT_I && _size == G_IM_SIZ_8b)
gDP.m_subscreen = gDP.otherMode._u64 == 0x00000cf00f0a0004;

m_pCurrent->m_isDepthBuffer = _address == gDP.depthImageAddress;
m_pCurrent->m_isPauseScreen = m_pCurrent->m_isOBScreen = false;
m_pCurrent->m_copied = false;
Expand Down
1 change: 1 addition & 0 deletions src/gDP.h
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ struct gDPInfo
gDPLoadTileInfo loadInfo[512];
gDPTexrectInfo lastTexRectInfo;
texCoordBounds m_texCoordBounds;
bool m_subscreen{ false };
};

extern gDPInfo gDP;
Expand Down

0 comments on commit e568bab

Please sign in to comment.