Skip to content

Commit

Permalink
Merge pull request #17028 from hrydgard/crashfix-softgpu-frameskip
Browse files Browse the repository at this point in the history
Fix crash in SoftGPU when frameskipping, noticed by sum2012 in Daxter
  • Loading branch information
unknownbrackets authored Mar 1, 2023
2 parents e9182a6 + c6352a2 commit 0a01655
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions GPU/Software/SoftGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,9 @@ void SoftGPU::MarkDirty(uint32_t addr, uint32_t bytes, SoftGPUVRAMDirty value) {

uint32_t start = ((addr - PSP_GetVidMemBase()) & 0x001FFFFF) >> 10;
uint32_t end = start + ((bytes + 1023) >> 10);
if (end > sizeof(vramDirty_)) {
end = sizeof(vramDirty_);
}
if (value == SoftGPUVRAMDirty::CLEAR || value == (SoftGPUVRAMDirty::DIRTY | SoftGPUVRAMDirty::REALLY_DIRTY)) {
memset(vramDirty_ + start, (uint8_t)value, end - start);
} else {
Expand Down

0 comments on commit 0a01655

Please sign in to comment.