English Amiga Board


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

 
 
Thread Tools
Old 30 May 2014, 12:16   #21
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Quote:
Originally Posted by Galahad/FLT View Post
Thanks for doing this, assembles properly in Devpac now

However, not sure if its something i'm doing wrong, or if theres a problem with the routine, but i've tried two separate modules now, and after playing about 20 seconds or so, both stop playing using this routine.

Is it just me?
Anyone?
Galahad/FLT is offline  
Old 30 May 2014, 13:57   #22
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Just tried it again with some different mods. Stringray's source and my updated version both seem to work here.

Which one did you use? Note, that when using the updated version (2.0 on Aminet) the API for mt_init changed. You have to pass additionally A1=0 (no separated samples) and D0=0 (start playing at position 0).

Otherwise, on which hardware did you test. And which mod? Maybe you can provide a test source or binary?
phx is offline  
Old 31 May 2014, 00:16   #23
spud
Registered User
 
Join Date: May 2010
Location: London, UK
Posts: 268
I've been trying to read up and figure out amiga interrupts because this is one of many areas I'm pretty ignorant on so I thought I'd edit it the code to show at which scan line the player starts and for how long it runs. It seems to start slightly earlier each frame, should this be the case?
spud is offline  
Old 31 May 2014, 12:39   #24
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Quote:
Originally Posted by phx View Post
Just tried it again with some different mods. Stringray's source and my updated version both seem to work here.

Which one did you use? Note, that when using the updated version (2.0 on Aminet) the API for mt_init changed. You have to pass additionally A1=0 (no separated samples) and D0=0 (start playing at position 0).

Otherwise, on which hardware did you test. And which mod? Maybe you can provide a test source or binary?
I used Stingrays attachment, all conditions were correctly set, and I'm using WinUAE in an A1200 environment and using cycle exact.

The mods are for Where Time Stood Still. I thought it was an error in one mod that had an unsupported effect, but then I tried it with another mod and the same problem occurred, 20 seconds or so into playback, it stopped playing.

I will download your version from Aminet and see if that makes a difference.
Galahad/FLT is offline  
Old 01 June 2014, 13:19   #25
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by spud View Post
I've been trying to read up and figure out amiga interrupts because this is one of many areas I'm pretty ignorant on so I thought I'd edit it the code to show at which scan line the player starts and for how long it runs. It seems to start slightly earlier each frame, should this be the case?
Yes, that's normal. The player doesn't use the VERTB interrupt, which would be synchronized with the raster beam. It uses a CIA-B timer interrupt at a speed close to 50Hz, but it cannot and must not match perfectly.
You could run a 60Hz screen mode and the playback still has the expected speed.
phx is offline  
Old 01 June 2014, 13:28   #26
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by Galahad/FLT View Post
I used Stingrays attachment, all conditions were correctly set, and I'm using WinUAE in an A1200 environment and using cycle exact.
I tried to verify that: WinUAE, A1200, 3.1, 68EC020, 2MB Chip RAM, cycle exact CPU and chipset. No problem.


Quote:
The mods are for Where Time Stood Still. I thought it was an error in one mod that had an unsupported effect, but then I tried it with another mod and the same problem occurred, 20 seconds or so into playback, it stopped playing.
I wouldn't exclude the possibility that there is still a strange effect which is unsupported, although I tried a lot of different mods. The Sqrxz-mods, for example, are quite complex.

Does it stop at exactly the same position everytime? What does "stopping" mean? The player becomes silent? The last notes continue to play forever? Something crashed?

I really would like to help, if I had something to reproduce.
phx is offline  
Old 01 June 2014, 14:41   #27
spud
Registered User
 
Join Date: May 2010
Location: London, UK
Posts: 268
Quote:
Originally Posted by phx View Post
Yes, that's normal. The player doesn't use the VERTB interrupt, which would be synchronized with the raster beam. It uses a CIA-B timer interrupt at a speed close to 50Hz, but it cannot and must not match perfectly.
You could run a 60Hz screen mode and the playback still has the expected speed.
Makes sense, thanks for the explanation! Kind of obvious I suppose.
spud is offline  
Old 02 June 2014, 02:38   #28
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Quote:
Originally Posted by phx View Post
I tried to verify that: WinUAE, A1200, 3.1, 68EC020, 2MB Chip RAM, cycle exact CPU and chipset. No problem.


I wouldn't exclude the possibility that there is still a strange effect which is unsupported, although I tried a lot of different mods. The Sqrxz-mods, for example, are quite complex.

Does it stop at exactly the same position everytime? What does "stopping" mean? The player becomes silent? The last notes continue to play forever? Something crashed?

I really would like to help, if I had something to reproduce.
EDIT: I'll punch myself in the face, save anyone else having to do it. I had some debug interrupt code still present and one tiny piece of keyboard code was wrong, which meant spurious results were interpreted as a key press and restoring all the interrupts back as they would be had AmigaDOS been reactivated.

I.AM.A.TWAT


One thing I had to do though was put an EVEN statement before MT_VAR otherwise there was some addressing problems for 68000 Amigas.

Last edited by Galahad/FLT; 02 June 2014 at 03:18.
Galahad/FLT is offline  
Old 02 June 2014, 14:20   #29
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by Galahad/FLT View Post
I had some debug interrupt code still present and one tiny piece of keyboard code was wrong
LOL



Quote:
One thing I had to do though was put an EVEN statement before MT_VAR
That was already fixed in the Aminet release. Stingray removed one CNOP too much while optimising mt_MasterVolTabs away.
phx is offline  
Old 03 June 2014, 07:20   #30
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by phx View Post
That was already fixed in the Aminet release. Stingray removed one CNOP too much while optimising mt_MasterVolTabs away.
Indeed, happened when I changed the mt_mastervol routine and deleted the pointer tables.

Last edited by StingRay; 03 June 2014 at 07:25.
StingRay is offline  
Old 03 June 2014, 09:42   #31
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
Well the routine works a treat gents, and you both get a credit in the game, so now its nearly finished
Galahad/FLT is offline  
Old 17 August 2014, 22:45   #32
clenched
Registered User
 
Join Date: Sep 2008
Location: Gainesville U.S.A.
Posts: 771
Quote:
Originally Posted by Coagulus View Post
Might be a long shot but can anyone (or is it even possible to!) make a Blitzlib out of this?
This would be good substitute player for what is available for Blitz. Check out the rudimentary library here. It already scores three points ahead of others because:
- no KS2 dependency
- no guru (yet) on 68000
- doesn't demand 1meg to run.

Experimental commands:
PHXInst vbr,pal or nts - Install the player (if vbr is not 0 the value can be found in the debugger)
PHXInit address - initialize mod at address
PHXEnable 0=no music not0=music
PHXRem - remove the player.

How to install:
Put phx.obj into Blitz2:Blitzlibs/Otherlibs drawer.
Run the makedeflibs program.
Shutdown and restart Blitz.
Paste the test program into the editor.

If all went well the PHX commands will be highlighted the same as BASIC keywords. Fill in the path and name of a module and try to compile and run it.

To put Blitz back the way it was delete phx.obj and re-run makedeflibs.
Code:
chip.l=2
vbr.l=0
pal.l=1
nts.l=0
LoadBank 0,"some.mod",chip
a.l = Peek.l(Addr Bank(0))
NPrint a
PHXInst vbr,pal
PHXInit a
PHXEnable 1 ;0 no music
For j.l=1 To 25000
NPrint j
Next j
PHXRem
Attached Files
File Type: lha phxobj.lha (5.2 KB, 351 views)
clenched is offline  
Old 22 July 2016, 05:06   #33
sandruzzo
Registered User
 
Join Date: Feb 2011
Location: Italy/Rome
Posts: 2,281
are there some example to show how it work?
sandruzzo is offline  
Old 22 July 2016, 09:45   #34
alpine9000
Registered User
 
Join Date: Mar 2016
Location: Australia
Posts: 881
Quote:
Originally Posted by sandruzzo View Post
are there some example to show how it work?
I just did a quick hack to play a module and it seemed to work. Haven't tried SFX yet.

Note: I didn't use the small data model version. I used ptplayer_noa4.asm.

Code:
        ; mt_init(a6=CUSTOM,a0=TrackerModule, a1=Samples|NULL,d0=InitialSongPos)                                            
        lea CUSTOM,a6
        lea module,a0
        move.l #0,a1
        move.l #0,d0
        jsr mt_init

	; mt_install_cia(a6=CUSTOM, a0=AutoVecBase, d0=PALflag.b)                                                               
        move.l vectorBase,a0
	move.b #1,d0
        jsr mt_install_cia

	move.b #1,mt_Enable ; Start playing

module: incbin "module.mod"
vectorBase: dc.l 0 ; make sure this has the correct vector base
alpine9000 is offline  
Old 22 July 2016, 12:13   #35
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Just a note, because the order of mt_init and mt_install_cia in alpine9000's example might be confusing:

Usually you will do mt_install_cia only once at the start of your program. It install a level 6 CIA-B interrupt handler and enables TimerA/B interrupts.

mt_init is called for every new module you want to play. Also for sub-modules, as you can pass the start position.
phx is offline  
Old 03 September 2016, 14:02   #36
Photon
Moderator
 
Photon's Avatar
 
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,602
Quote:
Originally Posted by phx View Post
From the ReadMe:
Code:
The source is tested with the vasm assembler, but should work with most
assemblers after minor modifications (e.g. NEAR directive). Static
variables are accessed using the Small Data model, with base register
in A4.
Perhaps I should release a more portable source without using the small data model, as many people seem to have problems with it. Sorry for that.

The "minor" modifications would include:
- remove "xref _LinkerDB" and "near a4"
- remove the two "lea _LinkerDB,a4"
- remove the "(a4)" in all base-relative addressing modes
- optionally rename or remove "section __MERGED,bss"

The resulting code will be bigger and slower, but it might assemble with AsmPro after after that.
Or um just replace with BASEREG

If you need the compression for the module then P6112 supports sound effects by way of setting the number of channels, freeing the other channels for playing samples at any time.
Photon is offline  
Old 16 November 2016, 17:09   #37
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
I tried to include this in my code, but get lots of errors when compiling (./vasmm68k_mot -Fhunkexe -o e -nosym Innviya/main.asm):

error 3005: reloc type 10, size 16, mask 0xffffffffffffffff (symbol mt_Enable + 0xff800000) not supported

error 3009: undefined symbol <_LinkerDB> at CODE+0x81c, reloc type 1

error 3005: reloc type 10, size 16, mask 0xffffffffffffffff (symbol mt_Enable + 0xffffffc0) not supported

error 3009: undefined symbol <_LinkerDB> at CODE+0x8aa, reloc type 1

error 3005: reloc type 10, size 16, mask 0xffffffffffffffff (symbol mt_chan1 + 0xffffe000) not supported

Anyone any ideas whats wrong here and how I can fix it??
Tigerskunk is offline  
Old 16 November 2016, 17:28   #38
Tigerskunk
Inviyya Dude!
 
Tigerskunk's Avatar
 
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,770
Quote:
Originally Posted by Steril707 View Post
I tried to include this in my code, but get lots of errors when compiling (./vasmm68k_mot -Fhunkexe -o e -nosym Innviya/main.asm):

error 3005: reloc type 10, size 16, mask 0xffffffffffffffff (symbol mt_Enable + 0xff800000) not supported

error 3009: undefined symbol <_LinkerDB> at CODE+0x81c, reloc type 1

error 3005: reloc type 10, size 16, mask 0xffffffffffffffff (symbol mt_Enable + 0xffffffc0) not supported

error 3009: undefined symbol <_LinkerDB> at CODE+0x8aa, reloc type 1

error 3005: reloc type 10, size 16, mask 0xffffffffffffffff (symbol mt_chan1 + 0xffffe000) not supported

Anyone any ideas whats wrong here and how I can fix it??

Works with ptplayer_noa4.asm though, so maybe I will just use that one..

edit: but now my program hangs... damn...

Last edited by Tigerskunk; 16 November 2016 at 17:38.
Tigerskunk is offline  
Old 05 June 2017, 10:26   #39
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
There have been some improvements to the ptplayer 2.0 release on Aminet, years ago. Besides some bug fixes and enhancements there is a more flexible function for playing sound effects, which was already used in games like Power Glove and Tiger Claw. From the readme:

Quote:
The sound fx system gives you the possibility to play samples on a channel of your choice or on the channel which the player thinks is the best one.

It may be a channel which is currently not replaying music and/or has the longest period of silence ahead. This has the effect that the replayed song is often not disturbed at all.

Up to four sound effects can be played at the same time and any of them has its own priority, which is especially useful when trying to play several sounds on the same channel. You may for example define that a shooting-sound has a higher priority than a jumping-sound.

For automatic channel selection you can additionally reserve specific channels for music only, or define the maximum number of channels which may be used for sound effects at once.

The master volume is always applied to the music, but does not affect external sound effects at all.
The new sound-fx function interface:
Code:
_mt_playfx(a6=CUSTOM, a0=SfxStructurePointer)
  Request playing of a prioritized external sound effect, either on a
  fixed channel or on the most unused one.
  Structure layout of SfxStructure:
    APTR sfx_ptr (pointer to sample start in Chip RAM, even address)
    WORD sfx_len (sample length in words)
    WORD sfx_per (hardware replay period for sample)                
    WORD sfx_vol (volume 0..64, is unaffected by the song's master volume)
    BYTE sfx_cha (0..3 selected replay channel, -1 selects best channel)  
    BYTE sfx_pri (unsigned priority, must be non-zero)
  When multiple samples are assigned to the same channel the lower
  priority sample will be replaced. When priorities are the same, then
  the older sample is replaced.
  The chosen channel is blocked for music until the effect has
  completely been replayed.
To make the ptplayer 4.0 easier to maintain for me I integrated the small-data and the single-section variants into a single source text, using BASEREG by default. But I never released it, because I was not happy about the fact that BASEREG is only supported by vasm and AsmOne.

Now a reworked 5.0 can be found on Aminet (http://aminet.net/mus/play/ptplayer.lha), which is portable enough to work on most assemblers. Tested are: Devpac, vasm, PhxAss, Basm, SNMA, AsmOne, AsmPro. Additionally I added a leading underscore to all exported function- and variable-names, so they can be directly accessed from C source texts as well.
phx is offline  
Old 05 June 2017, 15:29   #40
BSzili
old chunk of coal
 
BSzili's Avatar
 
Join Date: Nov 2011
Location: Hungary
Posts: 1,289
Nice! Have you considered adding small stubs that take care of the stack/register parameters, and get the VBR and the chipset address? That would make it much easier to use it from C.
BSzili is offline  
 


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 10:41
Amiga Forever&Protracker bad sound moriez support.WinUAE 14 06 January 2009 01:26
What was the first Amiga tracker to support external midi instruments Kola Amiga scene 3 09 December 2008 19:20
Sound/Protracker package Dunny request.Apps 3 23 July 2008 19:17
Sampled sound player? cdoty Coders. General 7 25 August 2007 16: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 10:53.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10930 seconds with 16 queries