XM.IRX ====== an XM Player for the Playstation2 IOP by Timm S. Mueller About ----- In 2006 I've hacked together an XM player for the IOP in about two days, when we urgently needed a sound system for our next demo. For getting this to work as quickly as possible, I used the XM player from libmodplug (see http://modplug-xmms.sourceforge.net/ ), the PS2dev build infrastructure (see http://ps2dev.org/ ), and a AHX player for the IOP (which I can't seem to get hold of from the net anymore). I removed the AHX-specific playroutine and from libmodplug everything I deemed unnecessary. In particular, I converted the XM player from C++ to plain C and all floating point arithmetics to 32bit integer. The player doesn't operate on the XM directly. The XM is loaded on the EE side, where initialization takes place. The prepared data is then uploaded to the IOP. Obviously it should be possible to use the same routine for any format that libmodplug can handle, but I concentrated on the XM loader and removed everything else and I may have caused damage to the player's general applicability during the process. License ------- I didn't take the time to look up all comments and headers. It seemed to me like the IOP sound framework was Artistic Free License, most of the XM player was Public Domain, only the DSP effects may have been licensed differently. Take a look yourself. My contributions are Public Domain. Limitations ----------- The XM should have no more than about 12-16 channels playing at the same time. Avoid extensive use of special effects such as panning envelopes. The maximum size of the XM cannot be evaluated exactly, I only recall that I reserved roughly 1mb of memory on the IOP side for music data. You should be on the safe side if the XM doesn't exceed 800k or so. Usage ----- Load the supplied IRX into the IOP and link against lib/libxm.a on the EE side. The API consists of this simple set of functions (see include/xm_rpch): int XMP_Init(); int XMP_LoadSongBuffer(char* songdata, int songsize); int XMP_SetVolume(int volumePercentage); int XMP_Quit(); int XMP_Play(); int XMP_Pause(); Notes ----- * We use our AmigaOS-like operating system on the PS2 (see http://www.teklib.org/ ) which comes with its own memory manager, so you will probably have to go to ee/xm_init.c, remove the include and references to the "TExecBase" symbol. Simply replace TExecAlloc() with malloc() and TExecFree with free(), and after a rebuild you should be all set. * If you want to tweak player settings, see XMP_LoadSongBuffer() for the available options. By default, noise reduction and oversampling is enabled.