refactor: refactor VU1 (#191)

* feat: implement fix and changes based on dark cloud report
fix: fix GS AFAIL for RGB/alpha/Z, ZMSK
fix: fix VU1 flags mask and pipeline
fix: small VU1 cache fix
feat: __ct__, __sinit_ are not sillent stubs anymore

* feat: fix song JP pulling

* feat: sound update for lotR

* feat: prevent guest execution to be very slow

* fix: small gs size bug

* feat: refactor VU
fix: fix cliping and other issues on gs
fix: fix wrong vu0 register on recompiler

* fix fix ACC scheduler stall
feat: remove unused test
fix: .fix overflow e underflow on FMAC

* feat: small setting  for windows test
This commit is contained in:
Ranieri
2026-08-05 14:50:24 -03:00
committed by GitHub
parent 61300792a0
commit f49ca4edbc
34 changed files with 5506 additions and 1015 deletions
+63
View File
@@ -440,6 +440,69 @@ void register_ps2_iop_tests()
"reset should restore per-instance service state");
});
tc.Run("LotR sound update completes queued PlayStream slots", [](TestCase &t)
{
FakeIopHost host;
ps2x::iop::IopSubsystem subsystem(host);
std::string error;
t.IsTrue(subsystem.configure({"SLUS_205.78", 0u, 0u}, &error),
"LotR profile should configure");
constexpr uint32_t kSendAddress = 0x0800u;
constexpr uint32_t kReceiveAddress = 0x1000u;
constexpr uint16_t kStreamSlot = 7u;
const std::array<uint16_t, 10> playStreamPacket = {
1u, // command count
1u, // PlayStream
7u, // argument count
0u,
static_cast<uint16_t>(kStreamSlot << 8u),
0u,
0u,
0u,
0u,
0u,
};
t.IsTrue(host.writeGuest(kSendAddress,
playStreamPacket.data(),
sizeof(playStreamPacket)),
"PlayStream command packet should fit in guest memory");
ps2x::iop::RpcRequest request{};
request.sid = 0x00012345u;
request.send = {kSendAddress, sizeof(playStreamPacket)};
request.receive = {kReceiveAddress, 0x100u};
t.IsTrue(subsystem.handleRpc(request).handled,
"LotR sound service should handle PlayStream");
t.Equals(host.readWord(kReceiveAddress), 1u,
"PlayStream response should expose one active record");
const uint32_t packedStream = host.readWord(kReceiveAddress + 4u);
t.Equals((packedStream >> 4u) & 0x3Fu,
static_cast<uint32_t>(kStreamSlot),
"active record should identify the queued EE stream slot");
t.Equals(host.readWord(kReceiveAddress + 0x24u), 1u,
"response counter should follow the active record");
const std::array<uint16_t, 5> statusPacket = {
1u, // command count
9u, // GetStatus
2u, // argument count
kStreamSlot,
0u,
};
t.IsTrue(host.writeGuest(kSendAddress, statusPacket.data(), sizeof(statusPacket)),
"GetStatus command packet should fit in guest memory");
request.send.size = sizeof(statusPacket);
t.IsTrue(subsystem.handleRpc(request).handled,
"LotR sound service should handle the following status update");
t.Equals(host.readWord(kReceiveAddress), 0u,
"the update after PlayStream should report no active records");
t.Equals(host.readWord(kReceiveAddress + 4u), 2u,
"empty response counter should return to the base offset");
});
tc.Run("TSNDDRV uses profile checksum bindings without writing invalid ports", [](TestCase &t)
{
FakeIopHost host(0x02000000u);