aopsf by kode54 at 6:24 PM EDT on September 9, 2015
I created another fork library, this time based on the Audio Overload PSF/PSF2 player engine. I replaced PEOpS/PEOpS2 with Highly Experimental's SPU core, which supports both SPU and SPU2 emulation, and I also fixed a number of bugs along the way. I have also replaced the original PSF2 file access system, which repeatedly unpacked whole files each to their own 6MB buffers, with Neill Corlett's original psf2fs based code, which I include in libpsflib.
The result is now located here:
https://gitlab.kode54.net/kode54/aopsf
I will also be replacing Highly Experimental itself in various players with this, as it also eliminates the need for a PS2 BIOS derived image in the resulting binary.
edited 12:07 AM EDT September 10, 2015
As a starter, here's nenolod's rip of Final Fantasy X, retagged a bit:
I found another fork that may be relevant to my coding interests:
DeaDBeeF has the entire library in its source tree, including multi-instance safety across the board. I may just fork that, and slip in some alternate SPUs from the Highly* PSF libraries. I got Neill Corlett's permission to release source at a late point. Unlike the rest of the emulator, the SPU core should be legally clean as well, since it doesn't touch the BIOS code.
Same for the SSF/DSF and QSF cores, but I'm not sure if they're better or worse really.
Neill's R3000 core may also be slightly faster than the MAME(?) core used in the AO code, but it's less accurate. It only emulates delay slots in that it will execute opcodes following branches before executing the branch, but it won't actually lock the system to how delay slot opcodes are actually limited, which is why at least one rip was allowed to be released without hardware testing that would have shown that it crashed.
E: I plan to drill the AOSDK code out of DeaDBeeF's repository, into its own repository, maintaining the entire edit history.
Sounds interesting. And good catch on the channel 7 DMA being weird! Either way I'll backport whatever interesting changes you and DeaDBeeF have and put up the resulting AOSDK on my Github account.
For some reason, some of my psf's didn't want to work with it during testing. It's probably the driver.
https://www.sendspace.com/file/hvtjuv
by MarkGrass at 11:14 AM EDT on September 11, 2015
No clue why the driver for that PSF wouldn't work, considering it was compiled with the official SDK, not hacked via assembly. That said, it most definitely isn't a delay load slot error.
You can always try a newer driver version using the utility found here.
I'm interested to see what the error could be. Any information on this would be greatly appreciated.
HLE BIOS malloc was incorrectly calculating the size of the following free block to be larger by 16 bytes than it should be, the size of the new block's header.
And it also wants a free function, which I threw in for free. I'll update foo_psf and my DeaDBeeF fork with that shortly.
by punk7890-2 at 2:51 PM EDT on September 11, 2015
Noticed that Final Fantasy 10 doesn't work anymore with this in Foobar after updating. Thought I'd give you a heads up.
Proper rip, thanks to nenolod, which I autocapitalized, maybe someone else can do better?
https://static.kode54.net/ffx.7z
Original rip even crashed on real hardware, apparently. If anyone wants to consolidate the redundant tiny set of files between each .psf2 into a minipsf2/psf2lib set, they're welcome to as well.
by punk7890-2 at 4:43 PM EDT on September 11, 2015
Awesome, thanks.
EDIT: Noticed a few tracks that have errors: Hopeless Desire, Oui Are Al Bhed, Cloister Of Trials (weird clicks happen every now and then) Haven't went through the entire set yet.
The rip managed to work in Highly Experimental, due to its acceptance of bad code.
I think its delay slot implementation is as simple as many MIPS console emulators are, in that it just executes the opcode immediately following a branch, before committing that branch, and all without actually validating the operation. Easiest way to do it while still remaining capable of running assumedly valid code.
The MIPS core in Audio Overload, on the other hand, has full delay slot emulation, and emulates all delayed load operations the way one would expect a strict machine to do it. Invalid operations will throw exceptions, like a real MIPS processor should.
There are a few other rips that need fixing.
I need to go in and fix the entirety of the Chocobo's Dungeon 2 rip that CaitSith2 made. There's a dirty hack in the official Audio Overload code, but that relies on tag reading, so I didn't want to include it in my version of AOPSF, so that set is still broken.
The bug there is exactly delay slot. An infinite loop branch placed in the delay slot of another branch opcode, which throws a MIPS exception. The fix is extremely simple, to move the infinite loop branch forward by one opcode, and fill its old place with a NOP. Easy peasy lemon squeezy.
The problem with this set is that it's not minipsf based, so it will involve mass unpack/patch/repack cycling the entire set. Should be easy enough to write a tool to do it.
E: I think the fixed set gets away with using some code borrowed from the FFX-2 rip, which never had this problem. Or at least, I saw an ffx2.irx being loaded during the boot up process.
Reverb would be fairly simple to implement a switch for again, but I don't intend to make a switch for Emulation, since the only thing it really did was make DMA transfers fire completion interrupts instantly instead of with a realistic delay, which doesn't seem to break any sets yet.
As for Output debug information to console, that mostly caught debug printfs from the emulator, and forwarded them to the caller. That may be useful in PSFLab, or in debug builds of the player to track down broken sets, but how useful is it in the player for normal use? I could still try to implement this again, though.
More bugs? by Yoshinkeru at 6:10 PM EDT on September 12, 2015
On this information, I went ahead and updated my foobar2000 components, including foo_psf.
For some reason, it still has the Highly Experimental header in the component list and the logo on its configuration page.
Also, the Brave Fencer Musashi and Rayman rips aren't working anymore.
I fixed Brave Fencer Musashi by implementing support for event 9 spec 5, which is for waiting or polling on the SPU DMA interrupt status. A few, such as the last track, also rely on the TestEvent function not setting psx->WAI to 1, or at least the event clearing it afterward, or else it can't poll properly.
One down. Many to go.
by punk7890-2 at 9:29 AM EDT on September 13, 2015
Noticed Chrono Cross doesn't work at all anymore either. :/
I have one more thing I'd like at least looked at.
https://www.sendspace.com/file/nz0jeo
I made/hacked/butchered these some time ago in a shoddy attempt at completing the ffVI psf's and they play fine on the original Highly Experimental, but with this plugin they have a delay at the start. Is there anyway to fix?
Possibly silence at the start of the sequences? At least foo_psf should be able to skip startup silence, or at least I think it used to default to doing that.
Fixed. First, the DMA4 wasn't setting the signal registers, which may or may not have broken it. But what really was breaking it was that DeliverEvent that detected it was trying to signal an event that wasn't in the "active" state, (in this case, already signaled) was returning from the HLE BIOS function without jumping back to the return address, thus getting caught in a loop.
Bumping this topic to report on that library, which I looked at after it was posted back in September of 2015.
Basically, that whole library is a gigantic mess of C++11 type code, which means I can't use it with older compilers. Mainly this is/was an issue because I am/was still using Visual Studio 2010.
Plus, the entire architecture of the player is that it expects a callback to receive output sample data, while the library itself is expected to run near-indefinitely. This would also require some working around.
Oh, and even better. Half of its speed advantage comes from implementing the CPU cores using dynamic recompilation. This will not fly on all of the platforms I try to support, like iOS, where you cannot write self-modifying code.