English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Language > Coders. Blitz Basic

 
 
Thread Tools
Old 07 January 2021, 02:30   #101
idrougge
Registered User
 
Join Date: Sep 2007
Location: Stockholm
Posts: 4,332
No, you can’t.
idrougge is offline  
Old 17 February 2021, 07:21   #102
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
Did it happen to anyone that some samples are mixed up here and there during play?
I'mean it plays wrong samples occasionally.
Cobe is offline  
Old 01 March 2021, 07:54   #103
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Alpine9000 helped me diagnose and fix an issue in the MickGyver blitzlib - the call to MTInstall had A0 hardcoded as #0, which would break the library on systems with non-zero VBRs (which is sometimes done on workbench systems)

Attached is a patch, the relevant section of source code changed is below if there's any issues with it.

Code:
; Blitz Basic stubs
_MTInstall
  movem.l a3-a6,-(sp) ; Save registers for Blitz 2
  ; _mt_install_cia(a6=CUSTOM, a0=AutoVecBase, d0=PALflag.b)
  bsr __hw_getvbr
  lea CUSTOM,a6  
  bra _mt_install_cia
  
;Erik added for VBR support
__hw_getvbr:
        move.l   #0,a0                   ; default at $0                                                                                                                                                                
        move.l  $4.w,a6
        btst    #0,296+1(a6)            ; 68010+?                                                                                                                                                                      
        beq.b   .is68k                  ; nope.                                                                                                                                                                        
        lea     .getit(pc),a5
        jsr     -30(a6)                 ; SuperVisor()                                                                                                                                                                 
.is68k:
        rts
.getit:
        dc.w    $4e7a,$8801     ;hex for "movec VBR,a0"                                                                                                                                                      
        rte                             ; back to user state code
Attached Files
File Type: zip ptplayer53_vba.zip (53.7 KB, 128 views)
earok is offline  
Old 01 March 2021, 16:49   #104
MickGyver
Registered User
 
MickGyver's Avatar
 
Join Date: Oct 2008
Location: Finland
Posts: 643
Quote:
Originally Posted by earok View Post
Alpine9000 helped me diagnose and fix an issue in the MickGyver blitzlib - the call to MTInstall had A0 hardcoded as #0, which would break the library on systems with non-zero VBRs (which is sometimes done on workbench systems)
Cheers! I will update my Ultimate Blitz Basic 2 package with this fixed version at some point.
MickGyver is offline  
Old 01 March 2021, 23:46   #105
earok
Registered User
 
Join Date: Dec 2013
Location: Auckland
Posts: 3,539
Quote:
Originally Posted by MickGyver View Post
Cheers! I will update my Ultimate Blitz Basic 2 package with this fixed version at some point.
Great

Cheers to PHX for the library and to you and idrougge for the Blitz library, it's been a major help for the Scorpion project
earok is offline  
Old 02 March 2021, 01:48   #106
Cobe
Registered User
 
Join Date: Jan 2014
Location: Belgrade / Serbia
Age: 41
Posts: 999
Cheers to all of you!
Cobe is offline  
Old 22 March 2021, 00:57   #107
saimon69
J.M.D - Bedroom Musician
 
Join Date: Apr 2014
Location: los angeles,ca
Posts: 3,519
Is the repeat command E6x supported? Have a mod where i used it often and seems not to work
saimon69 is offline  
Old 22 March 2021, 01:21   #108
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Theoretically it should work, as the code is there. If it doesn't either you or me made a mistake. Maybe send me an example for reproduction.
phx is offline  
Old 22 May 2021, 23:04   #109
jotd
This cat is no more
 
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,164
I love ptplayer, really. I just could replace the music player in Supercars 2 (which used horrible active dbf loops) by this player, in no time.

Now saimon69 provided me with 2 track music modules (channel 2 and 3) so we can have in-game music in the game. I've redirected sfx to channels 0 and 1 but not using ptplayer to handle them (if I could avoid that...)

Now the sfx play but speed/period is wrong. I'm wondering if the music player isn't tampering with channels it doesn't use. I mean: player should only play channels 2 and 3 and I'm under the impression that it changes stuff to 0 and 1: as a result, sfx pitch is wrong.
jotd is online now  
Old 09 June 2021, 06:18   #110
neumanix
Registered User
 
Join Date: Jan 2017
Location: Jakobstad/Finland
Posts: 13
Hi! I've noticed a problem using this ptplayer library. It seems it causes periodic stutters. I have coded this textscroller that is pretty fast, only takes around 10 rasterlines or so, on a standard A500.
I've used the latest version of the ptplayer and everything works,
apart from the very annoying hard stutter every now and then.
If I don't use the music, it's completely smooth.
I've attached a .zip containing two versions, one with and one without sound. Sources and .mod file are also included.
I hope it's just something I've done or else I hope it can be fixed.

And yes, it's the same on my real A500 and different WinUAE configs.
Attached Files
File Type: zip scroller.zip (42.8 KB, 74 views)

Last edited by neumanix; 09 June 2021 at 07:02.
neumanix is offline  
Old 09 June 2021, 13:42   #111
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
If you turn on visual dma debugger in winuae (v -4) you can see where the music player is interrupting. There is a red 3 or so scanline "portion" that is moving up the screen (as it triggers at a slightly different time each frame). There looks to be some activity in the middle of the screen and the glitch happens just as the interrupt crosses that code. It won't be a bug in the player but more likely something in that code section that is messing up - or maybe the blitz wrapper for the player is not quite correct. I don't know blitz so can't really help with the source but the above may give you ideas.
Antiriad_UK is offline  
Old 09 June 2021, 14:14   #112
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by neumanix View Post
Hi! I've noticed a problem using this ptplayer library...
ptplayer is working properly.

You wait for a precise line ($96).
Obviously if the ptplayer IRQ code is executed in that line, your wait code fails (and you skip a full frame, minimum).

Change the wait code, setting the loop for a <= condition.
ross is offline  
Old 09 June 2021, 14:41   #113
Antiriad_UK
OCS forever!
 
Antiriad_UK's Avatar
 
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
Quote:
Originally Posted by ross View Post
ptplayer is working properly.

You wait for a precise line ($96).
Obviously if the ptplayer IRQ code is executed in that line, your wait code fails (and you skip a full frame, minimum).

Change the wait code, setting the loop for a <= condition.
I was close
Antiriad_UK is offline  
Old 09 June 2021, 14:57   #114
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Sorry, missed that:
Quote:
Originally Posted by jotd View Post
Now the sfx play but speed/period is wrong. I'm wondering if the music player isn't tampering with channels it doesn't use. I mean: player should only play channels 2 and 3 and I'm under the impression that it changes stuff to 0 and 1: as a result, sfx pitch is wrong.
Indeed, the player writes AUDxPER with each new line from the track, even when there is nothing in it. In this case it writes the last period used (which defaults to 320 at start).
I inherited that code from the original Protracker 2.3B play routine, and I'm not sure if I can easily remove these writes. Needs some investigation.
phx is offline  
Old 09 June 2021, 15:13   #115
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by Antiriad_UK View Post
.. There is a red 3 or so scanline "portion" that is moving up the screen (as it triggers at a slightly different time each frame)..
Quote:
Originally Posted by Antiriad_UK View Post
I was close


There is a little trick to avoid this (that can lead in extreme situations to two execution per frame).

All of these modules were meant to work in the VBI, which is in fact not exactly each 50Hz but at 3546895/(313*227)=49.9204Hz.
If you set the CIA prescaler to (313*227)/(3546895/709379)=14210 you have an IRQ call at 709379/(14210+1*)=49.9176Hz.
You can notice it because the "3 red scanline portion" is moving VERY slowly down the screen and not up.
[*+1 because CIA trigger on underflow]

Two advantages:
- you definitely only have a single execution of the ptplayer code per frame
- tempo is much more like what the original composer had thought
ross is offline  
Old 09 June 2021, 15:39   #116
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by ross View Post
Two advantages:
- you definitely only have a single execution of the ptplayer code per frame
- tempo is much more like what the original composer had thought
@phx:
hmm, why not add an optional parameter for this setting when using the CIA replayer?
So I stop hacking the code
ross is offline  
Old 09 June 2021, 16:56   #117
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by ross View Post
hmm, why not add an optional parameter for this setting when using the CIA replayer?
I'm not sure if this is a good idea. As soon as the mod changes the tempo with a Fxx command your precise timing will be lost, even when resetting it to the default tempo of 125.
EDIT: Hmm... ok, it will work when the composer only changes speed, but not tempo.

I don't think it would make a song sound more like the original composer had intended either. Only the very first Soundtrackers, which were limited to VERTB instead of CIA-timing, come close to your value. I guess that 99% of composers are used to the setting from ptplayer, because it's the same in Protracker itself.

But I'm no musician. So I'm open for comments.
phx is offline  
Old 09 June 2021, 17:16   #118
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by phx View Post
EDIT: Hmm... ok, it will work when the composer only changes speed, but not tempo.
Yes, this is the main idea.

Quote:
I don't think it would make a song sound more like the original composer had intended either. Only the very first Soundtrackers, which were limited to VERTB instead of CIA-timing, come close to your value. I guess that 99% of composers are used to the setting from ptplayer, because it's the same in Protracker itself.
Yes and no.
Many people still in their intros/demos/games use routines linked to the VBI (for convenience and to keep audio play under control and consistent*).
And composer are forced to a 'wrong' VBI based tempo.
EDIT: however, it is such a small difference that 99% of people would not hear the difference


Off course this 'advanced' option need to be a coder choice, well aware of the pros and cons.
But this is an idea that can very well be ignored, whoever wants to make a change like that can easily put his hand to the sources

[*IRQ6 could be a bit invasive for very synced CPU effects]

Last edited by ross; 09 June 2021 at 17:36.
ross is offline  
Old 09 June 2021, 18:01   #119
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
Quote:
Originally Posted by ross View Post
Many people still in their intros/demos/games use routines linked to the VBI (for convenience and to keep audio play under control and consistent*).
Makes sense. But when they don't want to use the level-6 interrupt for music ptplayer wouldn't work anyway, and precise CIA-timings wouldn't help.

That reminds me on adding VERTB-replay to ptplayer. I remember that DMACON and AUDxLC can be written by the copper a few lines after VERTB? Then ptplayer would need pointers to two copper list locations during init to fill in the values.

Maybe that's even the better solution?
phx is offline  
Old 09 June 2021, 18:13   #120
ross
Defendit numerus
 
ross's Avatar
 
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,468
Quote:
Originally Posted by phx View Post
Makes sense. But when they don't want to use the level-6 interrupt for music ptplayer wouldn't work anyway, and precise CIA-timings wouldn't help.
Yep, the only advantage is the 'consistency': never a 'double' call per frame.
Or an old module that 'sound' better.. maybe..

Quote:
That reminds me on adding VERTB-replay to ptplayer. I remember that DMACON and AUDxLC can be written by the copper a few lines after VERTB? Then ptplayer would need pointers to two copper list locations during init to fill in the values.
This would be great!

Different possibilities:
- copper, but you need to be the first routine in VBI or you call for problem
- a CIA IRQ , which, however, would not be invasive because it is linked to the VBI
- next VBI, but you would have the same problems as p61
ross 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
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

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:48.

Top

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