2015-05-24 04:55:12 +00:00
|
|
|
// Copyright 2009 Dolphin Emulator Project
|
2015-05-17 23:08:10 +00:00
|
|
|
// Licensed under GPLv2+
|
2013-04-18 03:29:41 +00:00
|
|
|
// Refer to the license.txt file included.
|
2010-06-09 01:37:08 +00:00
|
|
|
|
2016-06-24 08:43:46 +00:00
|
|
|
#include "VideoBackends/Software/EfbCopy.h"
|
2016-01-17 21:54:31 +00:00
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
#include "Common/Logging/Log.h"
|
2014-02-17 10:18:15 +00:00
|
|
|
#include "Core/HW/Memmap.h"
|
|
|
|
#include "VideoBackends/Software/EfbInterface.h"
|
|
|
|
#include "VideoBackends/Software/TextureEncoder.h"
|
2015-10-09 18:50:36 +00:00
|
|
|
|
|
|
|
#include "VideoCommon/BPMemory.h"
|
2014-07-08 14:49:33 +00:00
|
|
|
#include "VideoCommon/Fifo.h"
|
2010-06-09 01:37:08 +00:00
|
|
|
|
|
|
|
namespace EfbCopy
|
|
|
|
{
|
2016-06-24 08:43:46 +00:00
|
|
|
void ClearEfb()
|
|
|
|
{
|
|
|
|
u32 clearColor = (bpmem.clearcolorAR & 0xff) << 24 | bpmem.clearcolorGB << 8 |
|
|
|
|
(bpmem.clearcolorAR & 0xff00) >> 8;
|
|
|
|
|
|
|
|
int left = bpmem.copyTexSrcXY.x;
|
|
|
|
int top = bpmem.copyTexSrcXY.y;
|
|
|
|
int right = left + bpmem.copyTexSrcWH.x;
|
|
|
|
int bottom = top + bpmem.copyTexSrcWH.y;
|
|
|
|
|
|
|
|
for (u16 y = top; y <= bottom; y++)
|
|
|
|
{
|
|
|
|
for (u16 x = left; x <= right; x++)
|
|
|
|
{
|
|
|
|
EfbInterface::SetColor(x, y, (u8*)(&clearColor));
|
|
|
|
EfbInterface::SetDepth(x, y, bpmem.clearZValue);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2019-05-05 23:48:12 +00:00
|
|
|
} // namespace EfbCopy
|