2025-03-11 21:12:06 -05:00
|
|
|
// Copyright 2025 Dolphin Emulator Project
|
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "Common/CommonTypes.h"
|
|
|
|
|
|
|
|
enum class EFBReinterpretType;
|
|
|
|
|
|
|
|
class EFBInterfaceBase
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~EFBInterfaceBase();
|
|
|
|
|
|
|
|
virtual void ReinterpretPixelData(EFBReinterpretType convtype) = 0;
|
|
|
|
|
|
|
|
virtual void PokeColor(u16 x, u16 y, u32 color) = 0;
|
|
|
|
virtual void PokeDepth(u16 x, u16 y, u32 depth) = 0;
|
|
|
|
|
|
|
|
u32 PeekColor(u16 x, u16 y);
|
2025-03-26 00:55:40 -05:00
|
|
|
u32 PeekDepth(u16 x, u16 y);
|
2025-03-11 21:12:06 -05:00
|
|
|
|
|
|
|
protected:
|
2025-03-26 00:55:40 -05:00
|
|
|
bool ShouldSkipAccess(u16 x, u16 y) const;
|
|
|
|
|
2025-03-11 21:12:06 -05:00
|
|
|
virtual u32 PeekColorInternal(u16 x, u16 y) = 0;
|
2025-03-26 00:55:40 -05:00
|
|
|
virtual u32 PeekDepthInternal(u16 x, u16 y) = 0;
|
2025-03-11 21:12:06 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
class HardwareEFBInterface final : public EFBInterfaceBase
|
|
|
|
{
|
|
|
|
void ReinterpretPixelData(EFBReinterpretType convtype) override;
|
|
|
|
|
|
|
|
void PokeColor(u16 x, u16 y, u32 color) override;
|
|
|
|
void PokeDepth(u16 x, u16 y, u32 depth) override;
|
|
|
|
|
|
|
|
u32 PeekColorInternal(u16 x, u16 y) override;
|
2025-03-26 00:55:40 -05:00
|
|
|
u32 PeekDepthInternal(u16 x, u16 y) override;
|
2025-03-11 21:12:06 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
extern std::unique_ptr<EFBInterfaceBase> g_efb_interface;
|