If you go the way kas1e describes, then the final step, imho, will be a nocd OS4 binary of the game, so as to become fully portable.
However, I would opt for a more permanent solution. Exodus suffers the same problem as well. Perhaps we should report as bug or future request for OS4 in Hyperion's forum: a compatibility layer that will translate the analogue input of cd music to digital, something like software ide-to-sata. Because I am afraid that the more we dig to old 68k/cd games, the more we will encounter the same problem.
Imho, the fast/safe/easy way will be to rip CD tracks from original napalm and convert them to MP3.
Actually, it will be easier to play the AIFF files you get in CDFS by default.
The main problem is playing audio in this way requires significantly more code than telling the drive to play a CDDA track. I am using a slightly older DVDRW drive in my SAM simply because it has an audio output on it; Wipeout, Payback and a number of other Amiga CD titles also play background music in this way.
Personally I'd leave the background music code as is and tell people to buy sensible CD drives, but (a) it's not up to me and (b) manufacturers like to cut costs so finding a CD drive with an audio output these days is likely to be almost impossible.
Perhaps we should report as bug or future request for OS4 in Hyperion's forum: a compatibility layer that will translate the analogue input of cd music to digital, something like software ide-to-sata.
I doubt that is possible. When you send the play command to the drive, the drive plays it without any computer involvement, through the audio output at the back of the drive (a 2 or 3 pin flat connector usually).
However some games use cdplayer.library or a variant thereof. It should be possible to create a new cdplayer.library which spawns a process to play the music digitally in the background.
Maybe you can do this in the device driver but it seems a little hacky so I'd be against it.
I've just looked at my Napalm install and it appears to use cdplayer.library - so there's the answer, if anybody is up to the challenge. The 68k version and includes are here (no source, but not really important for emulating it). An OS4 version with a 68k jump table would be ideal given the reason why this is required.
Well, if that does it then it's a lot easier than expected.
Depends what you mean by "it". If you read ville9's post you can see that the only difference in his modified cdplayer.library is that it uses a slightly less obsolete SCSI command for making the CD/DVD drive play CDDA music. It still won't work with modern drives that do not have this facility at all.
For me Speed 7 and scroll speed 8 is quite fine using Alfkils version on Peg2!
@Alfkil: Network fixing would be great! I also own an A4000 but which is currently not ready for action (just dismounted it a few weeks ago due to some renovation work in our home)!
Actually, it will be easier to play the AIFF files you get in CDFS by default.
Reading CDDA data directly from the CD/DVD drive and playing it with ahi.device is pretty easy too. Just look at PlayCDDA source code if you want an example (the code to do with CDDA reading and reading the CD's table of contents (TOC) is in scsicmd.c file as easy to use functions).
The Napalm fix is not dead, although I got a little tired with it, which is why I am doing something else at the moment. I will probably return as soon as I finish CMake.
The last version was pretty stable. I got some strange comments though, fx. people said that there was no sound, although I have sound (almost) fully working here with me. It suggests, that I might have messed up uploading. I will of course fix this asap.
However some games use cdplayer.library or a variant thereof. It should be possible to create a new cdplayer.library which spawns a process to play the music digitally in the background.
I've started working on a cdplayer.library that uses READ MSF command and plays audio through ahi. It is more or less working already in that you can set it play a range of tracks but pause/resume, volume, progress and other commands are not implemented yet.
It should implement all the commands of cdplayer.library V37, as for how well they are implemented that remains to be seen. I did do some testing with the included example code and an audio CD mounted with diskimage.device though and it seemed to work more or less correctly.
Source code of the library is included in the archive under a BSD license.
@salass00 Thanks, I am sure this will help with other games as well
I think your library should also fix WipeOuts CD Audio playback under OS4.1 as if I remember correctly it uses the same library, now we just need to get someone to fix the lockup issue when playing Wipeout on the sam440ep.
Sam440ep 667mhz 512megs OS4.1 + Minimig, 4MB RAM, ARM add-on board WinUae 2.3.2, OS 3.9, BB2, Catweasel MkIV Amiga 1200, BlizzardPPC 060/200 with SCSI, mediatorSX, Voodoo3, pci lan
I tried it with WipeOut and get no CD audio. Figuring it was a bug in Fredrik's new cdplayer.library, I dropped the old one in (I have the necessary ports and cables for normal CD audio to play) and I still got no sound.
I guess this is another SAM-related WipeOut bug.
The new cdplayer.library is working fine here with the old one's mini command line player (the only other thing I could find to test it with last night).
I don't try this new cdplayer.library yet (on WipeOut) so i don't know how it working however i listed all my bugreport concerning this game on my Flex
It should implement all the commands of cdplayer.library V37, as for how well they are implemented that remains to be seen. I did do some testing with the included example code and an audio CD mounted with diskimage.device though and it seemed to work more or less correctly.
Source code of the library is included in the archive under a BSD license.
Hello,
Does the new cdplayer lib means that it will work only with newer IDE CD/DVD?
I had tried it on Ep440 AOS4.1u3 with Exodus (SATA DVD), but no luck on playing the music.