things prettified

This commit is contained in:
psucien 2024-06-27 15:47:18 +02:00
parent 91940781b8
commit 7fd832b68c

View File

@ -40,6 +40,180 @@ static constexpr std::array indirect_sgpr_offsets{0u, 0u, 0x4cu, 0u, 0xccu, 0u,
static constexpr auto HwInitPacketSize = 0x100u;
// clang-format off
static constexpr std::array InitSequence{
0xc0017600u, 0x216u, 0xffffffffu,
0xc0017600u, 0x217u, 0xffffffffu,
0xc0017600u, 0x215u, 0u,
0xc0016900u, 0x2f9u, 0x2du,
0xc0016900u, 0x282u, 8u,
0xc0016900u, 0x280u, 0x80008u,
0xc0016900u, 0x281u, 0xffff0000u,
0xc0016900u, 0x204u, 0u,
0xc0016900u, 0x206u, 0x43fu,
0xc0016900u, 0x83u, 0xffffu,
0xc0016900u, 0x317u, 0x10u,
0xc0016900u, 0x2fau, 0x3f800000u,
0xc0016900u, 0x2fcu, 0x3f800000u,
0xc0016900u, 0x2fbu, 0x3f800000u,
0xc0016900u, 0x2fdu, 0x3f800000u,
0xc0016900u, 0x202u, 0xcc0010u,
0xc0016900u, 0x30eu, 0xffffffffu,
0xc0016900u, 0x30fu, 0xffffffffu,
0xc0002f00u, 1u,
0xc0017600u, 7u, 0x1ffu,
0xc0017600u, 0x46u, 0x1ffu,
0xc0017600u, 0x87u, 0x1ffu,
0xc0017600u, 0xc7u, 0x1ffu,
0xc0017600u, 0x107u, 0u,
0xc0017600u, 0x147u, 0x1ffu,
0xc0016900u, 0x1b1u, 2u,
0xc0016900u, 0x101u, 0u,
0xc0016900u, 0x100u, 0xffffffffu,
0xc0016900u, 0x103u, 0u,
0xc0016900u, 0x284u, 0u,
0xc0016900u, 0x290u, 0u,
0xc0016900u, 0x2aeu, 0u,
0xc0016900u, 0x292u, 0u,
0xc0016900u, 0x293u, 0x6000000u,
0xc0016900u, 0x2f8u, 0u,
0xc0016900u, 0x2deu, 0x1e9u,
0xc0036900u, 0x295u, 0x100u, 0x100u, 4u,
0xc0017900u, 0x200u, 0xe0000000u,
};
static_assert(InitSequence.size() == 0x73);
static constexpr std::array InitSequence175{
0xc0017600u, 0x216u, 0xffffffffu,
0xc0017600u, 0x217u, 0xffffffffu,
0xc0017600u, 0x215u, 0u,
0xc0016900u, 0x2f9u, 0x2du,
0xc0016900u, 0x282u, 8u,
0xc0016900u, 0x280u, 0x80008u,
0xc0016900u, 0x281u, 0xffff0000u,
0xc0016900u, 0x204u, 0u,
0xc0016900u, 0x206u, 0x43fu,
0xc0016900u, 0x83u, 0xffffu,
0xc0016900u, 0x317u, 0x10u,
0xc0016900u, 0x2fau, 0x3f800000u,
0xc0016900u, 0x2fcu, 0x3f800000u,
0xc0016900u, 0x2fbu, 0x3f800000u,
0xc0016900u, 0x2fdu, 0x3f800000u,
0xc0016900u, 0x202u, 0xcc0010u,
0xc0016900u, 0x30eu, 0xffffffffu,
0xc0016900u, 0x30fu, 0xffffffffu,
0xc0002f00u, 1u,
0xc0017600u, 7u, 0x1ffu,
0xc0017600u, 0x46u, 0x1ffu,
0xc0017600u, 0x87u, 0x1ffu,
0xc0017600u, 0xc7u, 0x1ffu,
0xc0017600u, 0x107u, 0u,
0xc0017600u, 0x147u, 0x1ffu,
0xc0016900u, 0x1b1u, 2u,
0xc0016900u, 0x101u, 0u,
0xc0016900u, 0x100u, 0xffffffffu,
0xc0016900u, 0x103u, 0u,
0xc0016900u, 0x284u, 0u,
0xc0016900u, 0x290u, 0u,
0xc0016900u, 0x2aeu, 0u,
0xc0016900u, 0x292u, 0u,
0xc0016900u, 0x293u, 0x6020000u,
0xc0016900u, 0x2f8u, 0u,
0xc0016900u, 0x2deu, 0x1e9u,
0xc0036900u, 0x295u, 0x100u, 0x100u, 4u,
0xc0017900u, 0x200u, 0xe0000000u,
};
static_assert(InitSequence175.size() == 0x73);
static constexpr std::array InitSequence200{
0xc0017600u, 0x216u, 0xffffffffu,
0xc0017600u, 0x217u, 0xffffffffu,
0xc0017600u, 0x215u, 0u,
0xc0016900u, 0x2f9u, 0x2du,
0xc0016900u, 0x282u, 8u,
0xc0016900u, 0x280u, 0x80008u,
0xc0016900u, 0x281u, 0xffff0000u,
0xc0016900u, 0x204u, 0u,
0xc0016900u, 0x206u, 0x43fu,
0xc0016900u, 0x83u, 0xffffu,
0xc0016900u, 0x317u, 0x10u,
0xc0016900u, 0x2fau, 0x3f800000u,
0xc0016900u, 0x2fcu, 0x3f800000u,
0xc0016900u, 0x2fbu, 0x3f800000u,
0xc0016900u, 0x2fdu, 0x3f800000u,
0xc0016900u, 0x202u, 0xcc0010u,
0xc0016900u, 0x30eu, 0xffffffffu,
0xc0016900u, 0x30fu, 0xffffffffu,
0xc0002f00u, 1u,
0xc0017600u, 7u, 0x1701ffu,
0xc0017600u, 0x46u, 0x1701fdu,
0xc0017600u, 0x87u, 0x1701ffu,
0xc0017600u, 0xc7u, 0x1701fdu,
0xc0017600u, 0x107u, 0x17u,
0xc0017600u, 0x147u, 0x1701fdu,
0xc0017600u, 0x47u, 0x1cu,
0xc0016900u, 0x1b1u, 2u,
0xc0016900u, 0x101u, 0u,
0xc0016900u, 0x100u, 0xffffffffu,
0xc0016900u, 0x103u, 0u,
0xc0016900u, 0x284u, 0u,
0xc0016900u, 0x290u, 0u,
0xc0016900u, 0x2aeu, 0u,
0xc0016900u, 0x292u, 0u,
0xc0016900u, 0x293u, 0x6020000u,
0xc0016900u, 0x2f8u, 0u,
0xc0016900u, 0x2deu, 0x1e9u,
0xc0036900u, 0x295u, 0x100u, 0x100u, 4u,
0xc0017900u, 0x200u, 0xe0000000u,
};
static_assert(InitSequence200.size() == 0x76);
static constexpr std::array InitSequence350{
0xc0017600u, 0x216u, 0xffffffffu,
0xc0017600u, 0x217u, 0xffffffffu,
0xc0017600u, 0x215u, 0u,
0xc0016900u, 0x2f9u, 0x2du,
0xc0016900u, 0x282u, 8u,
0xc0016900u, 0x280u, 0x80008u,
0xc0016900u, 0x281u, 0xffff0000u,
0xc0016900u, 0x204u, 0u,
0xc0016900u, 0x206u, 0x43fu,
0xc0016900u, 0x83u, 0xffffu,
0xc0016900u, 0x317u, 0x10u,
0xc0016900u, 0x2fau, 0x3f800000u,
0xc0016900u, 0x2fcu, 0x3f800000u,
0xc0016900u, 0x2fbu, 0x3f800000u,
0xc0016900u, 0x2fdu, 0x3f800000u,
0xc0016900u, 0x202u, 0xcc0010u,
0xc0016900u, 0x30eu, 0xffffffffu,
0xc0016900u, 0x30fu, 0xffffffffu,
0xc0002f00u, 1u,
0xc0017600u, 7u, 0x1701ffu,
0xc0017600u, 0x46u, 0x1701fdu,
0xc0017600u, 0x87u, 0x1701ffu,
0xc0017600u, 0xc7u, 0x1701fdu,
0xc0017600u, 0x107u, 0x17u,
0xc0017600u, 0x147u, 0x1701fdu,
0xc0017600u, 0x47u, 0x1cu,
0xc0016900u, 0x1b1u, 2u,
0xc0016900u, 0x101u, 0u,
0xc0016900u, 0x100u, 0xffffffffu,
0xc0016900u, 0x103u, 0u,
0xc0016900u, 0x284u, 0u,
0xc0016900u, 0x290u, 0u,
0xc0016900u, 0x2aeu, 0u,
0xc0016900u, 0x102u, 0u,
0xc0016900u, 0x292u, 0u,
0xc0016900u, 0x293u, 0x6020000u,
0xc0016900u, 0x2f8u, 0u,
0xc0016900u, 0x2deu, 0x1e9u,
0xc0036900u, 0x295u, 0x100u, 0x100u, 4u,
0xc0017900u, 0x200u, 0xe0000000u,
0xc0016900u, 0x2aau, 0xffu,
};
static_assert(InitSequence350.size() == 0x7c);
// clang-format on
// In case if `submitDone` is issued we need to block submissions until GPU idle
static u32 submission_lock{};
static std::mutex m_submission{};
@ -77,22 +251,14 @@ static inline u32* WriteTrailingNop(u32* cmdbuf) {
}
static inline u32* ClearContextState(u32* cmdbuf) {
cmdbuf[0x00] = 0xc0012800;
cmdbuf[0x01] = 0x80000000;
cmdbuf[0x02] = 0x80000000;
static constexpr std::array ClearStateSequence{
0xc0012800u, 0x80000000u, 0x80000000u, 0xc0001200u, 0u, 0xc0055800u,
0x2ec47fc0u, 0xffffffffu, 0u, 0u, 0u, 10u,
};
static_assert(ClearStateSequence.size() == 0xc);
cmdbuf[0x03] = 0xc0001200;
cmdbuf[0x04] = 0;
cmdbuf[0x05] = 0xc0055800;
cmdbuf[0x06] = 0x2ec47fc0;
cmdbuf[0x07] = 0xffffffff;
cmdbuf[0x08] = 0;
cmdbuf[0x09] = 0;
cmdbuf[0x0a] = 0;
cmdbuf[0x0b] = 10;
return cmdbuf + 0xc;
std::memcpy(cmdbuf, ClearStateSequence.data(), ClearStateSequence.size() * 4);
return cmdbuf + ClearStateSequence.size();
}
s32 PS4_SYSV_ABI sceGnmAddEqEvent(SceKernelEqueue eq, u64 id, void* udata) {
@ -475,161 +641,12 @@ u32 PS4_SYSV_ABI sceGnmDrawInitDefaultHardwareState(u32* cmdbuf, u32 size) {
cmdbuf = ClearContextState(cmdbuf);
}
cmdbuf[0x00] = 0xc0017600;
cmdbuf[0x01] = 0x216;
cmdbuf[0x02] = 0xffffffff;
std::memcpy(cmdbuf, InitSequence.data(), InitSequence.size() * 4);
cmdbuf += InitSequence.size();
cmdbuf[0x03] = 0xc0017600;
cmdbuf[0x04] = 0x217;
cmdbuf[0x05] = 0xffffffff;
cmdbuf[0x06] = 0xc0017600;
cmdbuf[0x07] = 0x215;
cmdbuf[0x08] = 0;
cmdbuf[0x09] = 0xc0016900;
cmdbuf[0x0a] = 0x2f9;
cmdbuf[0x0b] = 0x2d;
cmdbuf[0x0c] = 0xc0016900;
cmdbuf[0x0d] = 0x282;
cmdbuf[0x0e] = 8;
cmdbuf[0x0f] = 0xc0016900;
cmdbuf[0x10] = 0x280;
cmdbuf[0x11] = 0x80008;
cmdbuf[0x12] = 0xc0016900;
cmdbuf[0x13] = 0x281;
cmdbuf[0x14] = 0xffff0000;
cmdbuf[0x15] = 0xc0016900;
cmdbuf[0x16] = 0x204;
cmdbuf[0x17] = 0;
cmdbuf[0x18] = 0xc0016900;
cmdbuf[0x19] = 0x206;
cmdbuf[0x1a] = 0x43f;
cmdbuf[0x1b] = 0xc0016900;
cmdbuf[0x1c] = 0x83;
cmdbuf[0x1d] = 0xffff;
cmdbuf[0x1e] = 0xc0016900;
cmdbuf[0x1f] = 0x317;
cmdbuf[0x20] = 0x10;
cmdbuf[0x21] = 0xc0016900;
cmdbuf[0x22] = 0x2fa;
cmdbuf[0x23] = 0x3f800000;
cmdbuf[0x24] = 0xc0016900;
cmdbuf[0x25] = 0x2fc;
cmdbuf[0x26] = 0x3f800000;
cmdbuf[0x27] = 0xc0016900;
cmdbuf[0x28] = 0x2fb;
cmdbuf[0x29] = 0x3f800000;
cmdbuf[0x2a] = 0xc0016900;
cmdbuf[0x2b] = 0x2fd;
cmdbuf[0x2c] = 0x3f800000;
cmdbuf[0x2d] = 0xc0016900;
cmdbuf[0x2e] = 0x202;
cmdbuf[0x2f] = 0xcc0010;
cmdbuf[0x30] = 0xc0016900;
cmdbuf[0x31] = 0x30e;
cmdbuf[0x32] = 0xffffffff;
cmdbuf[0x33] = 0xc0016900;
cmdbuf[0x34] = 0x30f;
cmdbuf[0x35] = 0xffffffff;
cmdbuf[0x36] = 0xc0002f00;
cmdbuf[0x37] = 1;
cmdbuf[0x38] = 0xc0017600;
cmdbuf[0x39] = 7;
cmdbuf[0x3a] = 0x1ff;
cmdbuf[0x3b] = 0xc0017600;
cmdbuf[0x3c] = 0x46;
cmdbuf[0x3d] = 0x1ff;
cmdbuf[0x3e] = 0xc0017600;
cmdbuf[0x3f] = 0x87;
cmdbuf[0x40] = 0x1ff;
cmdbuf[0x41] = 0xc0017600;
cmdbuf[0x42] = 199;
cmdbuf[0x43] = 0x1ff;
cmdbuf[0x44] = 0xc0017600;
cmdbuf[0x45] = 0x107;
cmdbuf[0x46] = 0;
cmdbuf[0x47] = 0xc0017600;
cmdbuf[0x48] = 0x147;
cmdbuf[0x49] = 0x1ff;
cmdbuf[0x4a] = 0xc0016900;
cmdbuf[0x4b] = 0x1b1;
cmdbuf[0x4c] = 2;
cmdbuf[0x4d] = 0xc0016900;
cmdbuf[0x4e] = 0x101;
cmdbuf[0x4f] = 0;
cmdbuf[0x50] = 0xc0016900;
cmdbuf[0x51] = 0x100;
cmdbuf[0x52] = 0xffffffff;
cmdbuf[0x53] = 0xc0016900;
cmdbuf[0x54] = 0x103;
cmdbuf[0x55] = 0;
cmdbuf[0x56] = 0xc0016900;
cmdbuf[0x57] = 0x284;
cmdbuf[0x58] = 0;
cmdbuf[0x59] = 0xc0016900;
cmdbuf[0x5a] = 0x290;
cmdbuf[0x5b] = 0;
cmdbuf[0x5c] = 0xc0016900;
cmdbuf[0x5d] = 0x2ae;
cmdbuf[0x5e] = 0;
cmdbuf[0x5f] = 0xc0016900;
cmdbuf[0x60] = 0x292;
cmdbuf[0x61] = 0;
cmdbuf[0x62] = 0xc0016900;
cmdbuf[0x63] = 0x293;
cmdbuf[0x64] = 0x6000000;
cmdbuf[0x65] = 0xc0016900;
cmdbuf[0x66] = 0x2f8;
cmdbuf[0x67] = 0;
cmdbuf[0x68] = 0xc0016900;
cmdbuf[0x69] = 0x2de;
cmdbuf[0x6a] = 0x1e9;
cmdbuf[0x6b] = 0xc0036900;
cmdbuf[0x6c] = 0x295;
cmdbuf[0x6d] = 0x100;
cmdbuf[0x6e] = 0x100;
cmdbuf[0x6f] = 4;
cmdbuf[0x70] = 0xc0017900;
cmdbuf[0x71] = 0x200;
cmdbuf[0x72] = 0xe0000000;
const auto cmdbuf_left = 0x100 - 0x74 - (clear_state ? 0xc : 0);
cmdbuf = WriteHeader<PM4ItOpcode::Nop>(cmdbuf + 0x73, cmdbuf_left);
const auto cmdbuf_left =
HwInitPacketSize - InitSequence.size() - (clear_state ? 0xc : 0) - 1;
cmdbuf = WriteHeader<PM4ItOpcode::Nop>(cmdbuf, cmdbuf_left);
cmdbuf = WriteBody(cmdbuf, 0u);
return HwInitPacketSize;
@ -645,160 +662,8 @@ u32 PS4_SYSV_ABI sceGnmDrawInitDefaultHardwareState175(u32* cmdbuf, u32 size) {
return 0;
}
ClearContextState(cmdbuf);
cmdbuf[0x0c] = 0xc0017600;
cmdbuf[0x0d] = 0x216;
cmdbuf[0x0e] = 0xffffffff;
cmdbuf[0x0f] = 0xc0017600;
cmdbuf[0x10] = 0x217;
cmdbuf[0x11] = 0xffffffff;
cmdbuf[0x12] = 0xc0017600;
cmdbuf[0x13] = 0x215;
cmdbuf[0x14] = 0;
cmdbuf[0x15] = 0xc0016900;
cmdbuf[0x16] = 0x2f9;
cmdbuf[0x17] = 0x2d;
cmdbuf[0x18] = 0xc0016900;
cmdbuf[0x19] = 0x282;
cmdbuf[0x1a] = 8;
cmdbuf[0x1b] = 0xc0016900;
cmdbuf[0x1c] = 0x280;
cmdbuf[0x1d] = 0x80008;
cmdbuf[0x1e] = 0xc0016900;
cmdbuf[0x1f] = 0x281;
cmdbuf[0x20] = 0xffff0000;
cmdbuf[0x21] = 0xc0016900;
cmdbuf[0x22] = 0x204;
cmdbuf[0x23] = 0;
cmdbuf[0x24] = 0xc0016900;
cmdbuf[0x25] = 0x206;
cmdbuf[0x26] = 0x43f;
cmdbuf[0x27] = 0xc0016900;
cmdbuf[0x28] = 0x83;
cmdbuf[0x29] = 0xffff;
cmdbuf[0x2a] = 0xc0016900;
cmdbuf[0x2b] = 0x317;
cmdbuf[0x2c] = 0x10;
cmdbuf[0x2d] = 0xc0016900;
cmdbuf[0x2e] = 0x2fa;
cmdbuf[0x2f] = 0x3f800000;
cmdbuf[0x30] = 0xc0016900;
cmdbuf[0x31] = 0x2fc;
cmdbuf[0x32] = 0x3f800000;
cmdbuf[0x33] = 0xc0016900;
cmdbuf[0x34] = 0x2fb;
cmdbuf[0x35] = 0x3f800000;
cmdbuf[0x36] = 0xc0016900;
cmdbuf[0x37] = 0x2fd;
cmdbuf[0x38] = 0x3f800000;
cmdbuf[0x39] = 0xc0016900;
cmdbuf[0x3a] = 0x202;
cmdbuf[0x3b] = 0xcc0010;
cmdbuf[0x3c] = 0xc0016900;
cmdbuf[0x3d] = 0x30e;
cmdbuf[0x3e] = 0xffffffff;
cmdbuf[0x3f] = 0xc0016900;
cmdbuf[0x40] = 0x30f;
cmdbuf[0x41] = 0xffffffff;
cmdbuf[0x42] = 0xc0002f00;
cmdbuf[0x43] = 1;
cmdbuf[0x44] = 0xc0017600;
cmdbuf[0x45] = 7;
cmdbuf[0x46] = 0x1ff;
cmdbuf[0x47] = 0xc0017600;
cmdbuf[0x48] = 0x46;
cmdbuf[0x49] = 0x1ff;
cmdbuf[0x4a] = 0xc0017600;
cmdbuf[0x4b] = 0x87;
cmdbuf[0x4c] = 0x1ff;
cmdbuf[0x4d] = 0xc0017600;
cmdbuf[0x4e] = 199;
cmdbuf[0x4f] = 0x1ff;
cmdbuf[0x50] = 0xc0017600;
cmdbuf[0x51] = 0x107;
cmdbuf[0x52] = 0;
cmdbuf[0x53] = 0xc0017600;
cmdbuf[0x54] = 0x147;
cmdbuf[0x55] = 0x1ff;
cmdbuf[0x56] = 0xc0016900;
cmdbuf[0x57] = 0x1b1;
cmdbuf[0x58] = 2;
cmdbuf[0x59] = 0xc0016900;
cmdbuf[0x5a] = 0x101;
cmdbuf[0x5b] = 0;
cmdbuf[0x5c] = 0xc0016900;
cmdbuf[0x5d] = 0x100;
cmdbuf[0x5e] = 0xffffffff;
cmdbuf[0x5f] = 0xc0016900;
cmdbuf[0x60] = 0x103;
cmdbuf[0x61] = 0;
cmdbuf[0x62] = 0xc0016900;
cmdbuf[0x63] = 0x284;
cmdbuf[0x64] = 0;
cmdbuf[0x65] = 0xc0016900;
cmdbuf[0x66] = 0x290;
cmdbuf[0x67] = 0;
cmdbuf[0x68] = 0xc0016900;
cmdbuf[0x69] = 0x2ae;
cmdbuf[0x6a] = 0;
cmdbuf[0x6b] = 0xc0016900;
cmdbuf[0x6c] = 0x292;
cmdbuf[0x6d] = 0;
cmdbuf[0x6e] = 0xc0016900;
cmdbuf[0x6f] = 0x293;
cmdbuf[0x70] = 0x6020000;
cmdbuf[0x71] = 0xc0016900;
cmdbuf[0x72] = 0x2f8;
cmdbuf[0x73] = 0;
cmdbuf[0x74] = 0xc0016900;
cmdbuf[0x75] = 0x2de;
cmdbuf[0x76] = 0x1e9;
cmdbuf[0x77] = 0xc0036900;
cmdbuf[0x78] = 0x295;
cmdbuf[0x79] = 0x100;
cmdbuf[0x7a] = 0x100;
cmdbuf[0x7b] = 4;
cmdbuf[0x7c] = 0xc0017900;
cmdbuf[0x7d] = 0x200;
cmdbuf[0x7e] = 0xe0000000;
cmdbuf = ClearContextState(cmdbuf);
std::memcpy(cmdbuf, InitSequence175.data(), InitSequence175.size() * 4);
cmdbuf[0x7f] = 0xc07f1000;
cmdbuf[0x80] = 0;
@ -818,165 +683,12 @@ u32 PS4_SYSV_ABI sceGnmDrawInitDefaultHardwareState200(u32* cmdbuf, u32 size) {
cmdbuf = ClearContextState(cmdbuf);
}
cmdbuf[0x00] = 0xc0017600;
cmdbuf[0x01] = 0x216;
cmdbuf[0x02] = 0xffffffff;
std::memcpy(cmdbuf, InitSequence200.data(), InitSequence200.size() * 4);
cmdbuf += InitSequence200.size();
cmdbuf[0x03] = 0xc0017600;
cmdbuf[0x04] = 0x217;
cmdbuf[0x05] = 0xffffffff;
cmdbuf[0x06] = 0xc0017600;
cmdbuf[0x07] = 0x215;
cmdbuf[0x08] = 0;
cmdbuf[0x09] = 0xc0016900;
cmdbuf[0x0a] = 0x2f9;
cmdbuf[0x0b] = 0x2d;
cmdbuf[0x0c] = 0xc0016900;
cmdbuf[0x0d] = 0x282;
cmdbuf[0x0e] = 8;
cmdbuf[0x0f] = 0xc0016900;
cmdbuf[0x10] = 0x280;
cmdbuf[0x11] = 0x80008;
cmdbuf[0x12] = 0xc0016900;
cmdbuf[0x13] = 0x281;
cmdbuf[0x14] = 0xffff0000;
cmdbuf[0x15] = 0xc0016900;
cmdbuf[0x16] = 0x204;
cmdbuf[0x17] = 0;
cmdbuf[0x18] = 0xc0016900;
cmdbuf[0x19] = 0x206;
cmdbuf[0x1a] = 0x43f;
cmdbuf[0x1b] = 0xc0016900;
cmdbuf[0x1c] = 0x83;
cmdbuf[0x1d] = 0xffff;
cmdbuf[0x1e] = 0xc0016900;
cmdbuf[0x1f] = 0x317;
cmdbuf[0x20] = 0x10;
cmdbuf[0x21] = 0xc0016900;
cmdbuf[0x22] = 0x2fa;
cmdbuf[0x23] = 0x3f800000;
cmdbuf[0x24] = 0xc0016900;
cmdbuf[0x25] = 0x2fc;
cmdbuf[0x26] = 0x3f800000;
cmdbuf[0x27] = 0xc0016900;
cmdbuf[0x28] = 0x2fb;
cmdbuf[0x29] = 0x3f800000;
cmdbuf[0x2a] = 0xc0016900;
cmdbuf[0x2b] = 0x2fd;
cmdbuf[0x2c] = 0x3f800000;
cmdbuf[0x2d] = 0xc0016900;
cmdbuf[0x2e] = 0x202;
cmdbuf[0x2f] = 0xcc0010;
cmdbuf[0x30] = 0xc0016900;
cmdbuf[0x31] = 0x30e;
cmdbuf[0x32] = 0xffffffff;
cmdbuf[0x33] = 0xc0016900;
cmdbuf[0x34] = 0x30f;
cmdbuf[0x35] = 0xffffffff;
cmdbuf[0x36] = 0xc0002f00;
cmdbuf[0x37] = 1;
cmdbuf[0x38] = 0xc0017600;
cmdbuf[0x39] = 7;
cmdbuf[0x3a] = 0x1701ff;
cmdbuf[0x3b] = 0xc0017600;
cmdbuf[0x3c] = 0x46;
cmdbuf[0x3d] = 0x1701fd;
cmdbuf[0x3e] = 0xc0017600;
cmdbuf[0x3f] = 0x87;
cmdbuf[0x40] = 0x1701ff;
cmdbuf[0x41] = 0xc0017600;
cmdbuf[0x42] = 199;
cmdbuf[0x43] = 0x1701fd;
cmdbuf[0x44] = 0xc0017600;
cmdbuf[0x45] = 0x107;
cmdbuf[0x46] = 0x17;
cmdbuf[0x47] = 0xc0017600;
cmdbuf[0x48] = 0x147;
cmdbuf[0x49] = 0x1701fd;
cmdbuf[0x4a] = 0xc0017600;
cmdbuf[0x4b] = 0x47;
cmdbuf[0x4c] = 0x1c;
cmdbuf[0x4d] = 0xc0016900;
cmdbuf[0x4e] = 0x1b1;
cmdbuf[0x4f] = 2;
cmdbuf[0x50] = 0xc0016900;
cmdbuf[0x51] = 0x101;
cmdbuf[0x52] = 0;
cmdbuf[0x53] = 0xc0016900;
cmdbuf[0x54] = 0x100;
cmdbuf[0x55] = 0xffffffff;
cmdbuf[0x56] = 0xc0016900;
cmdbuf[0x57] = 0x103;
cmdbuf[0x58] = 0;
cmdbuf[0x59] = 0xc0016900;
cmdbuf[0x5a] = 0x284;
cmdbuf[0x5b] = 0;
cmdbuf[0x5c] = 0xc0016900;
cmdbuf[0x5d] = 0x290;
cmdbuf[0x5e] = 0;
cmdbuf[0x5f] = 0xc0016900;
cmdbuf[0x60] = 0x2ae;
cmdbuf[0x61] = 0;
cmdbuf[0x62] = 0xc0016900;
cmdbuf[0x63] = 0x292;
cmdbuf[0x64] = 0;
cmdbuf[0x65] = 0xc0016900;
cmdbuf[0x66] = 0x293;
cmdbuf[0x67] = 0x6020000;
cmdbuf[0x68] = 0xc0016900;
cmdbuf[0x69] = 0x2f8;
cmdbuf[0x6a] = 0;
cmdbuf[0x6b] = 0xc0016900;
cmdbuf[0x6c] = 0x2de;
cmdbuf[0x6d] = 0x1e9;
cmdbuf[0x6e] = 0xc0036900;
cmdbuf[0x6f] = 0x295;
cmdbuf[0x70] = 0x100;
cmdbuf[0x71] = 0x100;
cmdbuf[0x72] = 4;
cmdbuf[0x73] = 0xc0017900;
cmdbuf[0x74] = 0xe0000000;
cmdbuf[0x75] = 0x200;
const auto cmdbuf_left = 0x100 - 0x77 - (clear_state ? 0xc : 0);
cmdbuf = WriteHeader<PM4ItOpcode::Nop>(cmdbuf + 0x76, cmdbuf_left);
const auto cmdbuf_left =
HwInitPacketSize - InitSequence200.size() - (clear_state ? 0xc : 0) - 1;
cmdbuf = WriteHeader<PM4ItOpcode::Nop>(cmdbuf, cmdbuf_left);
cmdbuf = WriteBody(cmdbuf, 0u);
return HwInitPacketSize;
@ -997,173 +709,12 @@ u32 PS4_SYSV_ABI sceGnmDrawInitDefaultHardwareState350(u32* cmdbuf, u32 size) {
cmdbuf = ClearContextState(cmdbuf);
}
cmdbuf[0x00] = 0xc0017600;
cmdbuf[0x01] = 0x216;
cmdbuf[0x02] = 0xffffffff;
std::memcpy(cmdbuf, InitSequence350.data(), InitSequence350.size() * 4);
cmdbuf += InitSequence350.size();
cmdbuf[0x03] = 0xc0017600;
cmdbuf[0x04] = 0x217;
cmdbuf[0x05] = 0xffffffff;
cmdbuf[0x06] = 0xc0017600;
cmdbuf[0x07] = 0x215;
cmdbuf[0x08] = 0;
cmdbuf[0x09] = 0xc0016900;
cmdbuf[0x0a] = 0x2f9;
cmdbuf[0x0b] = 0x2d;
cmdbuf[0x0c] = 0xc0016900;
cmdbuf[0x0d] = 0x282;
cmdbuf[0x0e] = 8;
cmdbuf[0x0f] = 0xc0016900;
cmdbuf[0x10] = 0x280;
cmdbuf[0x11] = 0x80008;
cmdbuf[0x12] = 0xc0016900;
cmdbuf[0x13] = 0x281;
cmdbuf[0x14] = 0xffff0000;
cmdbuf[0x15] = 0xc0016900;
cmdbuf[0x16] = 0x204;
cmdbuf[0x17] = 0;
cmdbuf[0x18] = 0xc0016900;
cmdbuf[0x19] = 0x206;
cmdbuf[0x1a] = 0x43f;
cmdbuf[0x1b] = 0xc0016900;
cmdbuf[0x1c] = 0x83;
cmdbuf[0x1d] = 0xffff;
cmdbuf[0x1e] = 0xc0016900;
cmdbuf[0x1f] = 0x317;
cmdbuf[0x20] = 0x10;
cmdbuf[0x21] = 0xc0016900;
cmdbuf[0x22] = 0x2fa;
cmdbuf[0x23] = 0x3f800000;
cmdbuf[0x24] = 0xc0016900;
cmdbuf[0x25] = 0x2fc;
cmdbuf[0x26] = 0x3f800000;
cmdbuf[0x27] = 0xc0016900;
cmdbuf[0x28] = 0x2fb;
cmdbuf[0x29] = 0x3f800000;
cmdbuf[0x2a] = 0xc0016900;
cmdbuf[0x2b] = 0x2fd;
cmdbuf[0x2c] = 0x3f800000;
cmdbuf[0x2d] = 0xc0016900;
cmdbuf[0x2e] = 0x202;
cmdbuf[0x2f] = 0xcc0010;
cmdbuf[0x30] = 0xc0016900;
cmdbuf[0x31] = 0x30e;
cmdbuf[0x32] = 0xffffffff;
cmdbuf[0x33] = 0xc0016900;
cmdbuf[0x34] = 0x30f;
cmdbuf[0x35] = 0xffffffff;
cmdbuf[0x36] = 0xc0002f00;
cmdbuf[0x37] = 1;
cmdbuf[0x38] = 0xc0017600;
cmdbuf[0x39] = 7;
cmdbuf[0x3a] = 0x1701ff;
cmdbuf[0x3b] = 0xc0017600;
cmdbuf[0x3c] = 0x46;
cmdbuf[0x3d] = 0x1701fd;
cmdbuf[0x3e] = 0xc0017600;
cmdbuf[0x3f] = 0x87;
cmdbuf[0x40] = 0x1701ff;
cmdbuf[0x41] = 0xc0017600;
cmdbuf[0x42] = 199;
cmdbuf[0x43] = 0x1701fd;
cmdbuf[0x44] = 0xc0017600;
cmdbuf[0x45] = 0x107;
cmdbuf[0x46] = 0x17;
cmdbuf[0x47] = 0xc0017600;
cmdbuf[0x48] = 0x147;
cmdbuf[0x49] = 0x1701fd;
cmdbuf[0x4a] = 0xc0017600;
cmdbuf[0x4b] = 0x47;
cmdbuf[0x4c] = 0x1c;
cmdbuf[0x4d] = 0xc0016900;
cmdbuf[0x4e] = 0x1b1;
cmdbuf[0x4f] = 2;
cmdbuf[0x50] = 0xc0016900;
cmdbuf[0x51] = 0x101;
cmdbuf[0x52] = 0;
cmdbuf[0x53] = 0xc0016900;
cmdbuf[0x54] = 0x100;
cmdbuf[0x55] = 0xffffffff;
cmdbuf[0x56] = 0xc0016900;
cmdbuf[0x57] = 0x103;
cmdbuf[0x58] = 0;
cmdbuf[0x59] = 0xc0016900;
cmdbuf[0x5a] = 0x284;
cmdbuf[0x5b] = 0;
cmdbuf[0x5c] = 0xc0016900;
cmdbuf[0x5d] = 0x290;
cmdbuf[0x5e] = 0;
cmdbuf[0x5f] = 0xc0016900;
cmdbuf[0x60] = 0x2ae;
cmdbuf[0x61] = 0;
cmdbuf[0x62] = 0xc0016900;
cmdbuf[0x63] = 0x102;
cmdbuf[0x64] = 0;
cmdbuf[0x65] = 0xc0016900;
cmdbuf[0x66] = 0x292;
cmdbuf[0x67] = 0;
cmdbuf[0x68] = 0xc0016900;
cmdbuf[0x69] = 0x293;
cmdbuf[0x6a] = 0x6020000;
cmdbuf[0x6b] = 0xc0016900;
cmdbuf[0x6c] = 0x2f8;
cmdbuf[0x6d] = 0;
cmdbuf[0x6e] = 0xc0016900;
cmdbuf[0x6f] = 0x2de;
cmdbuf[0x70] = 0x1e9;
cmdbuf[0x71] = 0xc0036900;
cmdbuf[0x72] = 0x295;
cmdbuf[0x73] = 0x100;
cmdbuf[0x74] = 0x100;
cmdbuf[0x75] = 4;
cmdbuf[0x76] = 0xc0017900;
cmdbuf[0x77] = 0x200;
cmdbuf[0x78] = 0xe0000000;
cmdbuf[0x79] = 0xc0016900;
cmdbuf[0x7a] = 0x000002aa;
cmdbuf[0x7b] = 0xff;
const auto cmdbuf_left = 0x100 - 0x7d - (clear_state ? 0xc : 0);
cmdbuf = WriteHeader<PM4ItOpcode::Nop>(cmdbuf + 0x7c, cmdbuf_left);
const auto cmdbuf_left =
HwInitPacketSize - InitSequence350.size() - (clear_state ? 0xc : 0) - 1;
cmdbuf = WriteHeader<PM4ItOpcode::Nop>(cmdbuf, cmdbuf_left);
cmdbuf = WriteBody(cmdbuf, 0u);
return HwInitPacketSize;