From a29b73f01ac385e142ce188b7640ee8cfd6ffd5e Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Fri, 28 Aug 2026 20:28:46 +0000 Subject: [PATCH] tests: record what spr/normal claims, and why it is not scored tests/dma/spr/normal.expected is about the DMA registers rather than the transfer: SADR keeps bits 4 to 13, so its 0x81234028 reads back as 0x20, and MADR drops bit 31, which is why its own harness reports that the transfer "did not accept MADR: 80000000". Dmac.cpp's write path applies 0x3FF0 and 0x7FFFFFFF, so both claims hold; that was checked by reading it. I wrote it as a scored check first and threw that away. The cases were "input & mask == expected" with the mask copied out of Dmac.cpp and the expected value copied out of the capture, which compares two constants I had transcribed and can only fail if I mistyped one. It passed 6 of 6 and proved nothing about the emulator: driving the real write path needs the hardware register file and its dispatch, which this harness does not have. So it is recorded as an inspection instead. That is the same call already made in this series for the arm64 switch dispatch and the MDEC status register -- an inspection recorded as an inspection is worth more than a check that cannot fail, and a score of 6 of 6 sitting in the output would have implied coverage nothing was providing. --- tests/ee/hwspr.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/ee/hwspr.cpp b/tests/ee/hwspr.cpp index b4df195af..e5bfa91b9 100644 --- a/tests/ee/hwspr.cpp +++ b/tests/ee/hwspr.cpp @@ -295,6 +295,22 @@ int main(int argc, char** argv) { printf("hwspr: parsed no cases; the capture's line shape changed\n"); return 1; } + /* tests/dma/spr/normal.expected is about the registers rather than the + * transfer, and it is not scored here. Its two claims are that SADR + * keeps bits 4 to 13 -- the scratchpad is 16K and the address must be + * quadword aligned, so its 0x81234028 reads back as 0x20 -- and that + * MADR drops bit 31, which is why its harness reports the transfer + * "did not accept MADR: 80000000". Dmac.cpp's write path applies + * 0x3FF0 and 0x7FFFFFFF respectively, which is checked by reading it. + * + * Not scored because it cannot be, cheaply: reaching that path needs + * the hardware register file and its dispatch, and a test that + * restated the two masks here would be comparing constants I copied + * out of the source against constants I copied out of the capture -- + * arithmetic, not the emulator. An inspection recorded as an + * inspection is worth more than a check that cannot fail. + */ + printf("hwspr: %d/%d scratchpad interleave rows match the console\n", pass, cases); return pass != cases;