2015-05-23 22:55:12 -06:00
|
|
|
// Copyright 2008 Dolphin Emulator Project
|
2021-07-04 19:22:19 -06:00
|
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2014-02-10 11:54:46 -07:00
|
|
|
#pragma once
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2014-02-17 03:18:15 -07:00
|
|
|
#include "Common/CommonTypes.h"
|
2022-01-29 14:28:17 -07:00
|
|
|
|
2009-10-10 15:19:39 -06:00
|
|
|
class PointerWrap;
|
2022-01-29 14:28:17 -07:00
|
|
|
|
2014-02-02 06:16:43 -07:00
|
|
|
namespace MMIO
|
|
|
|
{
|
|
|
|
class Mapping;
|
|
|
|
}
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2017-02-28 04:57:31 -07:00
|
|
|
namespace PixelEngine
|
|
|
|
{
|
2009-10-10 15:19:39 -06:00
|
|
|
// internal hardware addresses
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
PE_ZCONF = 0x00, // Z Config
|
|
|
|
PE_ALPHACONF = 0x02, // Alpha Config
|
|
|
|
PE_DSTALPHACONF = 0x04, // Destination Alpha Config
|
|
|
|
PE_ALPHAMODE = 0x06, // Alpha Mode Config
|
|
|
|
PE_ALPHAREAD = 0x08, // Alpha Read
|
|
|
|
PE_CTRL_REGISTER = 0x0a, // Control
|
|
|
|
PE_TOKEN_REG = 0x0e, // Token
|
2014-09-14 10:52:51 -06:00
|
|
|
PE_BBOX_LEFT = 0x10, // Bounding Box Left Pixel
|
|
|
|
PE_BBOX_RIGHT = 0x12, // Bounding Box Right Pixel
|
|
|
|
PE_BBOX_TOP = 0x14, // Bounding Box Top Pixel
|
|
|
|
PE_BBOX_BOTTOM = 0x16, // Bounding Box Bottom Pixel
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2012-05-29 05:54:20 -06:00
|
|
|
// NOTE: Order not verified
|
|
|
|
// These indicate the number of quads that are being used as input/output for each particular
|
|
|
|
// stage
|
|
|
|
PE_PERF_ZCOMP_INPUT_ZCOMPLOC_L = 0x18,
|
|
|
|
PE_PERF_ZCOMP_INPUT_ZCOMPLOC_H = 0x1a,
|
|
|
|
PE_PERF_ZCOMP_OUTPUT_ZCOMPLOC_L = 0x1c,
|
|
|
|
PE_PERF_ZCOMP_OUTPUT_ZCOMPLOC_H = 0x1e,
|
|
|
|
PE_PERF_ZCOMP_INPUT_L = 0x20,
|
|
|
|
PE_PERF_ZCOMP_INPUT_H = 0x22,
|
|
|
|
PE_PERF_ZCOMP_OUTPUT_L = 0x24,
|
|
|
|
PE_PERF_ZCOMP_OUTPUT_H = 0x26,
|
|
|
|
PE_PERF_BLEND_INPUT_L = 0x28,
|
|
|
|
PE_PERF_BLEND_INPUT_H = 0x2a,
|
|
|
|
PE_PERF_EFB_COPY_CLOCKS_L = 0x2c,
|
|
|
|
PE_PERF_EFB_COPY_CLOCKS_H = 0x2e,
|
2009-10-10 15:19:39 -06:00
|
|
|
};
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2010-10-24 13:52:52 -06:00
|
|
|
// ReadMode specifies the returned alpha channel for EFB peeks
|
2022-01-29 14:28:17 -07:00
|
|
|
enum class AlphaReadMode : u16
|
2017-01-04 04:45:40 -07:00
|
|
|
{
|
2022-01-29 14:28:17 -07:00
|
|
|
Read00 = 0, // Always read 0x00
|
|
|
|
ReadFF = 1, // Always read 0xFF
|
|
|
|
ReadNone = 2, // Always read the real alpha value
|
2010-10-24 13:52:52 -06:00
|
|
|
};
|
|
|
|
|
2009-10-10 15:19:39 -06:00
|
|
|
void Init();
|
|
|
|
void DoState(PointerWrap& p);
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2014-02-02 06:16:43 -07:00
|
|
|
void RegisterMMIO(MMIO::Mapping* mmio, u32 base);
|
|
|
|
|
2011-02-13 19:18:03 -07:00
|
|
|
// gfx backend support
|
2021-11-24 15:01:37 -07:00
|
|
|
void SetToken(const u16 token, const bool interrupt, int cycle_delay);
|
|
|
|
void SetFinish(int cycle_delay);
|
2022-01-29 14:28:17 -07:00
|
|
|
AlphaReadMode GetAlphaReadMode();
|
2010-06-08 19:37:08 -06:00
|
|
|
|
2021-06-07 02:55:52 -06:00
|
|
|
} // namespace PixelEngine
|