21 October 2019, 17:44 | #61 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,356
|
An update to the latest version of Phx's library is probably overdue. :/
|
18 November 2019, 11:35 | #62 | |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Quote:
Attached is the updated source if you want to try and build it. Last edited by MickGyver; 27 November 2019 at 08:41. Reason: Removed the attached source, not needed any more. |
|
18 November 2019, 12:02 | #63 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
I tried VASM, there I get a few errors about missing symbols (runerrs, _soundobjectcheck and _volumecheck). Searched the sources and it seems that those symbols are indeed missing.
EDIT: I replaced the symbol names with zeroes, it then compiles, I get no errors when I run an example, but only get silence. Building the source on GitHub with vasm also results in just silence, no errors or crashes. Maybe that version you (idrougge) uploaded to GitHub is an older unfinished version? Code:
error 3009 in line 7 of "libheader": undefined symbol <runerrs> at CODE+0x2c, reloc type 1 called from line 112 of "ptplayer.asm" > Dc.l \4,0,0,0,\5 error 3009 in line 2 of "subs": undefined symbol <_soundobjectcheck> at CODE+0x202, reloc type 1 called from line 153 of "ptplayer.asm" > Dc.w \2 error 3009 in line 2 of "subs": undefined symbol <_volumecheck> at CODE+0x270, reloc type 1 called from line 159 of "ptplayer.asm" > Dc.w \2 Last edited by MickGyver; 18 November 2019 at 19:30. |
27 November 2019, 08:40 | #64 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Since I couldn't get any sound from idrougge's source when compiling with VASM, I started from "scratch" with the v5.3 source and referenced the library source based on v5.0 by idrougge. This version might still need some fixes, I have not tested everything thoroughly yet.
Attached is version 5.3 of the bb2 library, with an added statement (below). All the statements from v5.0 work but the author of the original library (phx) recommends to use the new MTPlayFX statement instead of MTSoundFX. New statement and newtype to use with it Code:
MTPlayFX sfxStructAddress.l NEWTYPE .sfx sfxPtr.l ; Pointer to sample start in chip ram, even address sfxLen.w ; Sample length sfxPer.w ; Hardware replay period for sample sfxVol.w ; Volume 0..64, is unaffected by the song's master volume sfxCha.b ; 0..3 selected replay channel, -1 selects best channel sfxPri.b ; unsigned priority, must be non-zero End NEWTYPE Changelog (for the original library) Code:
5.1: - Included C header file, ptplayer.h, provided by BSzili. - Fixed bug where other level 6 interrupts could trigger sample replay. - Eliminated relocations in the fine-tune table, by replacing pointers with word-offsets (asman). - More optimizations in the Timer B interrupt handlers and made it PC-relative (asman). - Include a public domain license. 5.2: - Make it work with broken mods, which have a sample repeat length of zero. - Never break looped samples with sound effects, except we have looped samples on all four channels at once! - New variable _mt_SongEnd to automatically stop the song when having played the last position. Don't use it! Doesn't work perfectly yet. 5.3: - No longer clear the first word of each sample for idle looping. Either we have a good Amiga tracker MOD with repeat-length one, which already cleared that word, or we have a PC tracker MOD with a zero repeat length. In the latter case the idle loop will now point to address $0. Make sure that the word at this address is cleared! - Treat samples with a length of one word the same as with zero length as a workaround for broken PC trackers. - Changed APTR to void* in the C headers, for better Kickstart 1.x OS header file compatibility. - Fixed detection of negative fine-tuning (broken due to optimizations in V5.1). |
27 November 2019, 12:49 | #65 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,379
|
Excellent, thanks! I'll try this library out in a project I'm working on (when I have the time...)
The first change about not clearing the first word: Is that fixing an issue I think I had with the older version where certain sound effects were getting stuck playing a high pitched note? I hadn't gotten around to clearing the first two bytes of the sample to confirm it... |
27 November 2019, 13:43 | #66 |
Registered User
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 1,008
|
Fabulous!
I've just fiddled with the example and it works. sfxCha.b was exactly what I missed in previous version. Thanks! |
27 November 2019, 13:49 | #67 | |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Quote:
|
|
28 November 2019, 11:17 | #68 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,539
|
Quote:
To conclude: Yes, this should hopefully be fixed with 5.3. |
|
28 November 2019, 11:21 | #69 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,379
|
That's great, thanks for the detailed explanation And, of course, your work on the original library!
|
28 November 2019, 15:39 | #70 | |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,356
|
Quote:
|
|
29 November 2019, 10:49 | #71 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,547
|
Thanks for the updates! Amazing work all
I still had some issues with high pitch after some samples, but I didn't know about the first word thing before. With this tiny tweak to the included sample function Code:
Statement SFXInit {*fx.sfx, snd.w, vol.w, cha.b, pri.b} *_snd.sound=Addr Sound(snd) ; Get the pointer to the sound Poke.w *_snd\_data,0 ; Set first word of sample data to 0 *fx\sfxPtr=*_snd\_data ; Copy the data *fx\sfxLen=*_snd\_length ; ... *fx\sfxPer=*_snd\_period *fx\sfxVol=vol *fx\sfxCha=cha *fx\sfxPri=pri End Statement |
29 November 2019, 13:13 | #72 | |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
Quote:
Last edited by MickGyver; 30 November 2019 at 07:46. |
|
30 November 2019, 03:03 | #73 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,547
|
|
30 November 2019, 07:49 | #74 |
Registered User
Join Date: Oct 2008
Location: Finland
Posts: 643
|
|
27 December 2019, 11:47 | #75 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,547
|
I recently released a port of Raid Over Moscow using this library, but it seems that there's some cases where audio doesn't work at all, I've got no idea if it's an issue I've caused or not. It appears the common thread is towered A1200's with sound cards. I know almost nothing about AHI and sound cards so I have no idea what to try, any suggestions would be appreciated!
Raid Over Moscow thread: http://eab.abime.net/showthread.php?...67#post1367467 |
27 December 2019, 12:11 | #76 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,369
|
I cross build the ptplayer lib with vasm without issues:
Code:
vasmm68k_mot -devpac -Faout -o ptplayer.o ptplayer.asm |
27 December 2019, 14:27 | #77 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,539
|
Quote:
I have never seen an Amiga sound card, and I don't even understand why you need one in an Amiga, but from what I have read, some sound cards can use the Paula-output as external input (into their mixer?). Probably this won't work either when it requires any OS support. BTW, -devpac is suboptimal when assembling ptplayer.asm, as it disables all optimizations. And I always write code which relys on assembler optimizations (mostly branch sizes). |
|
27 December 2019, 14:40 | #78 |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,307
|
As far as I know AHI and Paula direct are independent from each other. So if the library don't use AHI then it shouldn't responsible for audio issues.
Edit: phx was faster. |
28 December 2019, 02:57 | #79 |
Registered User
Join Date: Dec 2013
Location: Auckland
Posts: 3,547
|
Thanks guys.
As I understand it, Paula feeds audio directly into the sound card so (for example) WHDLoad games still output audio. My current line of thinking is that it's to do with how I'm dropping in-and-out of OS friendly mode to load from disk when needed, though I'm not sure why it'd only affect some machines. I'll try some things for the next build. |
28 December 2019, 09:41 | #80 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,369
|
problem when you want to be 100% user friendly it's very difficult to achieve performance or perform things that you can so more easily with hardware banging (reading joysticks, double buffering, blitting). I'm sure AHI interface is super simple stream based and works perfect with a sound card, but so few games will benefit from it.
no wonder why all great games from the golden era were asm+hardware banging. Personally I'd recommend C or C++ instead of asm. You never have register size issues, register corruption, custom write size errors, ... Problem is: it creates much bigger executables. Once again paying for simplicity... |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Demos with music or sound effects in time with graphic effects | mark_k | request.Demos | 7 | 07 December 2016 20:23 |
Sound issue, not all sound effects played. | Connorsdad | support.WinUAE | 16 | 23 February 2015 16:32 |
Sound Effects in IK+ | noel411 | support.Games | 3 | 07 September 2007 03:12 |
IK+ sound effects not working | andreas | support.WinUAE | 4 | 26 July 2005 20:21 |
How to rip sound / effects | wlcina | support.Games | 16 | 18 April 2005 03:09 |
|
|