GFA
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.
-20%
Le deal à ne pas rater :
Ecran PC GIGABYTE 28″ LED M28U 4K ( IPS, 1 ms, 144 Hz, FreeSync ...
399 € 499 €
Voir le deal

MP2 replay en GFA pour FALCON

Aller en bas

MP2 replay en GFA pour FALCON Empty MP2 replay en GFA pour FALCON

Message par Shadow272 Mer 25 Nov - 11:09

MP2 replay en GFA pour FALCON
Par Cooper


Voici en exclu du fin fond des studios Paradize la routine qui permet de rejouer en GFA avec le DSP du Falcon des fichiers .MP2, ancêtres des MP3 ! Pas encore swappée sur d'autres forums Wink

La routine originale est de NoCrew, et l'implémentation GFA est de GGN/Paradize.

Exclamation : La routine originale ne gère pas le loop mode, ce qui veut dire qu'il vous faudra relancer à la main votre MP2 une fois la lecture de ce dernier terminée.

Exclamation ² : Il semblerait qu'après une lecture "intensive" du MP2 (genre 30x en boucle Razz) la routine ne sorte plus un son... A confirmer et à tester...

[Vous devez être inscrit et connecté pour voir ce lien] :

Code:

musicflag=1
mp2_address=28
mp2_length=32
mp2_freq=36
mp2_ext=40
mp2_repeat=44
mp2_start=48
mp2_stop=52
mp2_intspeed=32000 !internal speed
mp2_extspeed=0 !external speed (0=disable)
mp2_loop=1 !0=single play 1=loop
'
OPEN "i",#1,"aura.mp2"
mp2len=LOF(#1)
DIM mp2|(mp2len-1)
song%=V:mp2|(0)
BGET #1,song%,mp2len
CLOSE #1
'
OPEN "i",#1,"mp2inc.bin"
len=LOF(#1)
DIM player|(len-1)
mp2_player%=V:player|(0)
BGET #1,mp2_player%,len
CLOSE #1
'
' Relocate
'
reloc%=mp2_player%
reloc_table%=reloc%+LPEEK(reloc%+2)+LPEEK(reloc%+6)+&H1C
' ==>    move.l   2(a0),d0
' ==>    add.l   6(a0),d0
' ==>    lea   $1c(a0,d0.l),a1   ;reloc table
bss_size%=LPEEK(10+reloc%)
' ==>    move.l   a1,a2   ;bss address
' ==>    move.l   10(a0),d0   ;bss size
ADD reloc%,&H1C
base%=reloc%
' ==>    lea   $1c(a0),a0
' ==>    move.l   a0,d3   ;base
' ==> ;relocate:
temp%=LPEEK(reloc_table%)
ADD reloc_table%,4
'  ==>    move.l   (a1)+,d1
IF temp%=0
  GOTO endreloc
ENDIF
'  ==>    beq.s   .endofreloc   ;shouldn't happen (unfortunately)
reloc:
ADD reloc%,temp%
'  .reloc   add.l   d1,a0
PRINT reloc%,temp%,base%
LPOKE reloc%,LPEEK(reloc%)+base%
'  ==>    add.l   d3,(a0)
temp%=0
'  ==>    moveq   #0,d1
getstep:
temp%=PEEK(reloc_table%)
INC reloc_table%
'  .getstep   move.b   (a1)+,d1
IF temp%=0
  GOTO endreloc
ENDIF
'  ==>    beq.s   .endofreloc
IF temp%<>1
  GOTO reloc
ENDIF
'  ==>    cmp.b   #1,d1
'  ==>    bne.s   .reloc
ADD reloc%,&HFE
'  ==>    lea   $fe(a0),a0
GOTO getstep
'  ==>    bra.s   .getstep
endreloc:
' END
'
' ==> ; --------------------------------------------------------------
' ==> ;      start mpeg player
' ==> ; --------------------------------------------------------------
LPOKE mp2_player%+mp2_address,song%
LPOKE mp2_player%+mp2_length,mp2len
LPOKE mp2_player%+mp2_freq,mp2_intspeed
LPOKE mp2_player%+mp2_ext,mp2_extspeed
LPOKE mp2_player%+mp2_repeat,mp2_loop
PRINT mp2_player%+mp2_address,song%
PRINT mp2_player%+mp2_length,mp2len
PRINT mp2_player%+mp2_freq,mp2_intspeed
PRINT mp2_player%+mp2_ext,mp2_extspeed
PRINT mp2_player%+mp2_repeat,mp2_loop
' END
' DIM regs%(15)
' RCALL mp2_player%+mp2_start,regs%()
' PRINT mp2_player%+mp2_start
' MONITOR
~XBIOS(&H26,L:mp2_player%+mp2_start)
' ==> mp2_begin:   move.l   mp2_adr,mp2_player+mp2_address      ;setup player preferences
' ==>       move.l   mp2_size,mp2_player+mp2_length      ;
' ==>       move.l   #mp2_intspeed,mp2_player+mp2_freq   ;
' ==>       move.l   #mp2_extspeed,mp2_player+mp2_ext   ;
' ==>       move.l   #mp2_loop,mp2_player+mp2_repeat      ;
' ==>       jsr   mp2_player+mp2_start(pc)      ;start mpeg music
' ==>       rts                  ;
~INP(2)
' ==> ; --------------------------------------------------------------
' ==> ;      stop mpeg player
' ==> ; --------------------------------------------------------------
' RCALL mp2_player%+mp2_stop,regs%()
~XBIOS(&H26,L:mp2_player%+mp2_stop)
'
Shadow272
Shadow272
Admin

Messages : 328
Date d'inscription : 28/12/2017
Age : 65
Localisation : Hainaut Belgique

http://toutatari.blog4ever.xyz/

Revenir en haut Aller en bas

Revenir en haut

- Sujets similaires

 
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum