unknownbrackets / ps2autotests

A set of test programs run on a PS2, with accompanying results.
ISC License
25 stars 7 forks source link

Added vif mskpath3 test #20

Closed jpd002 closed 8 years ago

jpd002 commented 8 years ago

This tests the MSKPATH3 command.

It only verifies that the "path 3 masked" status flag changes on the GIF. It doesn't test actual masking because there's many ways to activate it (it can also be done through the GIF_MODE register) and I think that should be tested else where because it's a feature of the GIF.

I was wondering if the send_simple_fifo_vif function should be moved in a common place since many tests will probably use it.

unknownbrackets commented 8 years ago

Well, my intention was that DMA::SendSimple() would be the normal way to send things, rather than via the FIFO. Is the FIFO more common from games?

I personally prefer the non-FIFO interface because you have more lookahead options for optimization within the emulator. But what matters is what games use.

I agree with you that path 3 itself should be tested under gif/.

-[Unknown]

jpd002 commented 8 years ago

Oh, I was just using the FIFO because the game I was testing was using the FIFO to mask path 3, but AFAIK, it's pretty rare for games to use the FIFO.

On the other hand, I've tried doing the same test using DMA just now and it doesn't seem to work. Maybe it's required to use the FIFO to see the change in GIF_STAT, but that wouldn't make much sense.

I'm going to do some more tests to see what's going on.

jpd002 commented 8 years ago

Ok, my problem was that the DIR bit of CHCR wasn't set. It's used by the VIF1 channel.

I've changed the SendSimple function to always set DIR, which I think makes sense since this is the most common case for DMA transfers. Another possibility would be to add an extra parameter to that function with a default value that says that the DIR bit should be set.

unknownbrackets commented 8 years ago

Ah, my bad. Yeah, that makes sense to me. A "from" test on VIF1 or SIF2 would be the special case, I think it could just have its own send implementation entirely potentially as it might also affect dcache stuff.

-[Unknown]