English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Releases

 
 
Thread Tools
Old 05 June 2017, 16:39   #41
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 1,740
What does your Player do with samples of size >64kb and <=128kb when used in a protracker module?
daxb is online now  
AdSense AdSense  
Old 06 June 2017, 14:55   #42
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,004
Quote:
Originally Posted by BSzili View Post
Have you considered adding small stubs that take care of the stack/register parameters
Most C compilers support passing arguments in registers and you certainly would like to avoid the overhead passing them over the stack.

Quote:
and get the VBR and the chipset address?
I'm sure you can manage that with a small Supervisor() call and/or a assembler inline function.

BTW, this player is not OS-friendly, but for games which take over the whole system.

Quote:
Originally Posted by daxb View Post
What does your Player do with samples of size >64kb and <=128kb when used in a protracker module?
Didn't try, but I'm quite sure that it would play them. The sample lengths are already stored as words in the MOD header, which is passed unchanged to the hardware.
phx is offline  
Old 06 June 2017, 16:25   #43
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 214
Send a message via MSN to BSzili
Of course, I plan to use it in an A500 game as well. It's going to be very simple, so I prefer the C calling convention, but I get your point I'll probably just use the SDI headers to make things portable.
I looked into what can I do with Supervisor(), and this is what I came up with:

Code:
static APTR GetVBR(void)
{
	APTR vbr = NULL;
	UWORD getvbr[] = {0x4e7a, 0x0801, 0x4e73}; // MOVEC.L VBR,D0 RTE

	if (SysBase->AttnFlags & AFF_68010)
		vbr = (APTR)Supervisor((void *)getvbr);

	return vbr;
}
We'll see how it goes
BSzili is offline  
Old 08 June 2017, 01:24   #44
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,004
Quote:
Originally Posted by BSzili View Post
I'll probably just use the SDI headers to make things portable.
Very good. I can recommend using SDI headers.

Quote:
Code:
    UWORD getvbr[] = {0x4e7a, 0x0801, 0x4e73}; // MOVEC.L VBR,D0 RTE
I guess this might work, if you don't want to link a separate assembler source to it. Although it would be cleaner to have the getvbr-code in the code section. Most compilers will put constant data into the code section: "const UWORD getvbr[]".
phx is offline  
Old 25 June 2017, 21:36   #45
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 214
Send a message via MSN to BSzili
I finally created the C header file for the player. It works nicely with the modified function above, compiled with vasm/vbcc. For some reason .h attachments are not allowed, so I renamed it to .c.
Attached Files
File Type: c ptplayer.c (4.7 KB, 32 views)
BSzili is offline  
Old 26 June 2017, 22:12   #46
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,004
Good work! And thanks for testing.

If you permit I would include your ptplayer.h in the next ptplayer-release.
phx is offline  
Old 27 June 2017, 05:38   #47
Shatterhand
Warhasneverbeensomuchfun

Shatterhand's Avatar
 
Join Date: Jun 2001
Location: Rio de Janeiro / Brazil
Age: 34
Posts: 2,638
Man it would be awesome if someone could do a lib for Blitz Basic using this ..
Shatterhand is offline  
Old 27 June 2017, 11:53   #48
BSzili
Registered User

BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 214
Send a message via MSN to BSzili
Quote:
Originally Posted by phx View Post
Good work! And thanks for testing.

If you permit I would include your ptplayer.h in the next ptplayer-release.
Of course, that would be great! I didn't try the sfx playback yet, but I unless I messed up the registers for those functions I don't see why they wouldn't.
Speaking of sfx, since the functions expect hardware periods, maybe it would make sense to expose mt_timerval with an underscore, so there would be no need to calculated it again in the C program.

Quote:
Originally Posted by Shatterhand View Post
Man it would be awesome if someone could do a lib for Blitz Basic using this ..
I think there already is ITT:
http://eab.abime.net/showpost.php?p=970456&postcount=32
BSzili is offline  
Old 30 June 2017, 14:00   #49
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,004
Quote:
Originally Posted by BSzili View Post
maybe it would make sense to expose mt_timerval with an underscore, so there would be no need to calculated it again in the C program.
Could be done, although I don't want to export too many symbols.
There is also nothing to calculate. Either you take the NTSC or the PAL constant.
phx is offline  
Old 04 July 2017, 22:35   #50
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,051
Quote:
Originally Posted by clenched View Post
This would be good substitute player for what is available for Blitz. Check out the rudimentary library here.
Unfortunately I could not get your library to work. Installing the library did work, and the keywords do tokenise, but I never get any sound out of your program.
idrougge is offline  
Old 05 July 2017, 17:51   #51
clenched
Registered User

 
Join Date: Sep 2008
Location: Gainesville U.S.A.
Posts: 587
I don't know what to tell you. It still works for me. Remember this thing as-is was never meant to be used. It was just to test the feasibility of making a Blitz library. That is why instructions to restore Blitz are provided.

Sound effects capabilities were not included. Not even as much as volume is included. Certainly none of phx's later advancements are included.

It would take someone with a good understanding of modules to make a real library and do a good job of it.

Last edited by clenched; 06 July 2017 at 18:36. Reason: typo
clenched is online now  
Old 05 July 2017, 21:17   #52
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,051
Do you still have the source code, Clenched?
idrougge is offline  
Old 05 July 2017, 21:59   #53
clenched
Registered User

 
Join Date: Sep 2008
Location: Gainesville U.S.A.
Posts: 587
Afraid not.
clenched is online now  
Old 06 July 2017, 14:32   #54
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,051
Never mind, I've got my own port of PHX's routine up and running. Got sound effects working this night, too. I'll upload it once the code has been cleaned up and the API is stable enough. Does anyone have any good resources on Blitz library development or source code for Blitz libs?
idrougge is offline  
Old 08 July 2017, 19:23   #55
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,051
There, after a few days of work I have managed to have a fairly stable, error-checked and user-friendly version of Phx's player.

What remains is optimisation, and possibly implementing the new PlayFX routine recommended by Phx instead of the old SoundFX routine (which is much easier to call!).

To install, copy ptplayer.obj to Blitzlibs:Userlibs or Blitzlibs:Otherlibs and rebuild Deflibs using either Blitzlibs:Makedeflibs or using BlitzLibMan from Aminet.
Attached Thumbnails
Click image for larger version

Name:	a4000os3-crop-1707081812-01.png
Views:	35
Size:	24.6 KB
ID:	53683  

Last edited by idrougge; 18 July 2017 at 02:19.
idrougge is offline  
Old 10 July 2017, 02:29   #56
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,051
Question: I currently init the player with 0 as VBR, but this might not work on 68010+ machines (though it does work on my A600 with Furia EC020). How do I check if MOVEC is a valid instruction or not?
idrougge is offline  
Old 10 July 2017, 06:26   #57
a/b
Registered User

 
Join Date: Jun 2016
Location: europe
Posts: 56
Scroll up, 3rd post on this page by BSzili.
a/b is offline  
Old 18 July 2017, 02:23   #58
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 3,051
I didn't have the luxury of using C like Bszili, and I hardly know assembly either, but by use of AttnFlags in Execbase, I've managed to identify the CPU and move the VBR if necessary. This means that the player works both on 68000 and 68040, and that MTInstall and MTRemove are no longer necessary since installation and removal of the CIA playback routine is handled automatically by the library's init/deinit routines.

New library here: http://eab.abime.net/showthread.php?...28#post1172028

Last edited by idrougge; 18 July 2017 at 02:35.
idrougge is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
MOD-player with external sound effects phx Coders. Asm / Hardware 14 18 June 2012 11:41
Amiga Forever&Protracker bad sound moriez support.WinUAE 14 06 January 2009 02:26
What was the first Amiga tracker to support external midi instruments Kola Amiga scene 3 09 December 2008 20:20
Sound/Protracker package Dunny request.Apps 3 23 July 2008 20:17
Sampled sound player? cdoty Coders. General 7 25 August 2007 17:21

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 16:54.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.30054 seconds with 13 queries