MSX Village forum

Le Kiosque à Musique [Réglé] MoonBlaster Wave Basic Driver 1.14 Jouer des Musiques OPL4 Wav depuis le Basic.

igal Membre non connecté

Conseiller Municipal

Rang

Avatar

Groupe : compte ++

Inscrit le : 29/07/2010 à 17h19

Messages: 5492

Le 08/11/2013 à 19h57
En cherchant sur le site de Marcel Delorme, j'ai trouvé un Replayer pour musiques au format MoonBlaster Wav .MWM avec support de banque Wave .MWK.

Contrairement à Magic MWM Replayer, ce logiciel n'a pas besoin d'un Gfx9000. ;)

Reste à savoir si il est possible de l'utiliser sans trop puiser les ressources du Z80 de sorte à permettre son utilisation simultanément à un jeu ou animation en Basic :D

Voici la source => http://members.chello.nl/m.delorme/
Les fichiers utiles => http://members.chello.nl/m.delorme/WAVEDRV.LZH

L'explication contenu dans le Pack:
Code TEXT :
 
How to use the MBWAVE BASIC driver 1.13
=======================================
 
This BASIC driver is spread as a binary file for BASIC programmers
and as a source file for ML programmers. The first part of this
text will explain how to use this driver for BASIC programmers. The
second part is meant for ML programmers.
 
The driver supports:
- MoonBlaster for MoonSound Wave songs from version 0.90 to 1.12.
- DOS1 and DOS2
- Z80,Z80H and R800 (three different drivers)
 
For 7MHz Users is now a special version available (WAVDRV7.BIN). This version
is  mutch faster because (for 7Mhz that is) the wait for the Turbo R is:
 
PUSH BC
POP  BC  (This is a total of 21 cycles for the Z80)
 
In the 7Mhz version this is replayced by:
 
NOP (only 4 Cycles)
 
This means 17 cycles faster by almost each OUT or IN. And there are a lot of
those.
 
 
BASIC
-----
To load the driver type BLOAD"WAVEDRVx.BIN",R and then protect the
upper memory from BASIC with CLEAR 200,&HDA00.
 
Below is a short overview of all new BASIC commands:
 
_MBVER
Displays version number
 
_MBINIT
It is very important that this call is done first! This will initialise
the mapper routines and allocate the first 4 mapper banks.
 
_MBADDR(load address)
This sets the current load/play address.
 
_MBBANK1(bank)
_MBBANK2(bank)
_MBBANK3(bank)
These routines set the current load/play mapper bank. In theory a Wave
song can be slightly larger than 32KB. Therefore 3 mapper banks may be
neccessary. However, in practice songs abover 16K will be very rare and
it will suffice to set only _MBBANK1. Note that with songs > 16K MBBANK1
is always used as the first bank to fill and only when the song is too
big to fit MBBANK2 and 3 will be used.
 
In theory you can use 64K after a MBINIT command (bank 0-3). But unfortunately
you cannot use bank 0 (system page), 2 (replayer page) and you can only
use bank 1 if you move the BASIC start address to &HC000. So only bank 3
is available most of the time unless you use the MBALLOC command.
 
_MWKLOAD("filename")
This will load a wavekit with name "filename". It uses MBBANK1 as a
buffer to move the data to Sample RAM. Do not forget to load a wavekit
before playing a song. The replayer may crash if you try to play a song
that uses a wavekit when no wavekit was loaded!
 
_MWMLOAD("filename")
This will load a wave song with name "filename" in the current bank at
the current address.
 
_MBPLAY
Starts playing of a song using current address and current bank.
 
_MBSTOP
Stops playing.
 
_MBHALT
Pauses music.
 
_MBCONT
Continues music after MBHALT.
 
_MBFADE(speed)
The music will fade out at the given speed.
 
_MBALLOC(extra banks)
If you need more than the first 64K (see MBBANK) use this command. Note that
the driver will NOT check if enough free memory is available. The programmer
needs to do that himself! You can only use MBALLOC once. If you need more,
use MBFREE first and then MBALLOC again. MBALLOC will only allocate *extra*
segments. E.g. with MBALLOC(4) you will have 4 + 4 = 8 banks (128K) available.
 
_MBFREE
This will free all segments that were allocated with MBALLOC. Especially
for DOS2 usage it is VERY important that this is always done before you return
to the system. If you forget this the allocated segments will be wasted untill
the computer is restarted!!
 
_Z80, _R800
Turbo-R users can use these commands to change the current CPU. Great care
must be taken however because it is impossible to use the Z80 version of the
replayer in R800 speed and vice versa!
 
The BASIC programmer can read several variables with the PEEK command from
the following table:
 
&HDA000 = not playing, 255 = playing
&HDA011st mapperbank with song data
&HDA022nd mapperbank with song data
&HDA033rd mapperbank with song data
&HDA04address of song data
&HDA06current position
&HDA07current step
&HDA083 status bytes (0 = off)
&HDA0Bsong data that will be played the next interrupt
 
&HDA26Available free segments. This is only valid in DOS2! It can
be used to check if enough memory is available for the MBALLOC
command. Note that it is not updated after an MBALLOC command.
 
Do not POKE in this table, this may give unexpected results!
 
 
ML programmers
--------------
ML programmers will find most of the explanation they need in the BASIC text
above and in the source. Some additional notes are given here.
 
- The source uses a lot of conditional assembly. You can select the following:
  1. Assemble it for R800,Z80H or Z80
  2. Include the FADE
  3. Include a speed test
  4. Disable RAM headers for extra speed (try to avoid this!)
 
- The replayer is using routines called selbank_FE and curbank_FE to select
  or to read the current mapper bank from 08000h - 0BFFFh. You may wish to
  replace these with your own routines.
 
- Read the comment at the MWM loading routine. It is possible to simplify this
  routine, but take care doing so!
 
- The MWK loading routine needs several variables in the replayer bank. It
  may be convenient to place the loader in the same bank as the replayer but
  do not forget that the FCB cannot be in the page 04000h-07FFFh unless you
  are in MSX-DOS!!! Some MSX computers can handle this, but most of them
  cannot!
 
- Note that the R800 version will not crash in Z80 mode on a MSX2 but it is
  strongly advised to use the Z80 version! Using the R800 version on Z80 will
  slow the replayer down incredibly and it will crash on a Turbo-R in Z80 mode!
 
- The replayer is now on the Hook #FD9A, because it uses the OPL4 interrupt
  now.(So no difference between 50/60Hz anymore!)
 
 


A suivre... Edité par igal Le 18/11/2013 à 15h54


Tiens... voila du boudin, voila du boudin, voila du boudin... :siffle
igal Membre non connecté

Conseiller Municipal

Rang

Avatar

Groupe : compte ++

Inscrit le : 29/07/2010 à 17h19

Messages: 5492

Le 09/11/2013 à 20h40
J'ai essayé ce programme sur BlueMsx.

0 'SAVE"mbwbdrv.asc",A
10 BLOAD"wavedrvz.bin",R
20 CLEAR 200,&HDA00
30 CALL MBINIT
40 CALL MBADDR ???
50 CALL MBBANK ???
60 CALL MWKLOAD"AURORA.MWK"
70 CALL MWMLOAD"AURORA.MWM"
80 CALL MBPLAY

En Vert
Ligne 40 => il faut mettre &HDA03 pour utiliser l"adresse qui contient le mapper de la Banque 3 ?
Ligne 50 => Il faut indiquer la banque 3 qui devrait pas poser de problèmes à utiliser?

En rouge
Ligne 60 => J'indique le MWK à charger, mais les "Doubles Primes" ainsi que le "Point" disparaissent dès que je fait un simple LIST :heink
Ligne 70 => J'indique le MWM à charger, mais les "Doubles Primes" ainsi que le "Point" disparaissent dès que je fait un simple LIST :heink

si quelqu'un peut m'aider, j'ai peur de pas avoir compris ce qui est demandé :oups


Tiens... voila du boudin, voila du boudin, voila du boudin... :siffle
gradius Membre non connecté

Maire-adjoint

Rang

Avatar

Inscrit le : 06/10/2009 à 18h27

Messages: 613

Le 11/11/2013 à 11h55
J'ai également testé ce listing sous BlueMSX et effectivement, les guillemets et points disparaissent :gne
Une énigme à résoudre ;)


MSX Turbo-R FS A1GT - 1 Mo de RAM - Disque dur SCSI Syquest cartouches de 270 Mo - Lecteur CD. Musique, musique, musique et encore musique !
   
ericb59 Membre non connecté

Conseiller Municipal

Rang

Avatar

Groupe : compte ++ Groupe : Shoutbox

Inscrit le : 17/04/2012 à 10h25

Messages: 5486

Le 11/11/2013 à 11h58
faudrait pas mettre des parenthèses ?

70 CALL MWMLOAD ("AURORA.MWM")


banniere-ericb59e
Site web    
gradius Membre non connecté

Maire-adjoint

Rang

Avatar

Inscrit le : 06/10/2009 à 18h27

Messages: 613

Le 11/11/2013 à 13h11
Yep ! Merci ericb59 :top
Ca fait penser qu'il faut bien sauvegarder le listing avant de le lancer et de faire un CALL MBSTOP avant de faire un LIST sinon on perd tout...


MSX Turbo-R FS A1GT - 1 Mo de RAM - Disque dur SCSI Syquest cartouches de 270 Mo - Lecteur CD. Musique, musique, musique et encore musique !
   
igal Membre non connecté

Conseiller Municipal

Rang

Avatar

Groupe : compte ++

Inscrit le : 29/07/2010 à 17h19

Messages: 5492

Le 11/11/2013 à 14h21
Merci EricB59 :top

@Gradius: T'as mis quoi en ligne 50? J'ai beau essayer différentes combinaisons, j'ai tjrs un [Syntax Error] en ligne 50 :fou

Code TEXT :
 
0   'SAVE"mbwbdrv.asc",A
10  BLOAD"wavedrvz.bin",R
20 CLEAR 200,&HDA00
30 CALL MBINIT
40 CALL MBADDR(&HDA03)
50 CALL MBBANK(3)
60 CALL MWKLOAD("aurora.mwk")
70 CALL MWMLOAD("aurora.mwm")
80 CALL MBPLAY


Nb: J'ai essayé différentes formules en ligne 50, mais rien y fait :oups Edité par igal Le 11/11/2013 à 14h21


Tiens... voila du boudin, voila du boudin, voila du boudin... :siffle
Jipe Membre non connecté

Maire-adjoint

Rang

Avatar

Association

Inscrit le : 02/10/2009 à 19h41

Messages: 10360

Le 11/11/2013 à 14h39
dans le fichier c'est CALL MBBANK1(n° bank)

_MBBANK1(bank)
_MBBANK2(bank)
_MBBANK3(bank)
These routines set the current load/play mapper bank. In theory a Wave
song can be slightly larger than 32KB. Therefore 3 mapper banks may be
neccessary. However, in practice songs abover 16K will be very rare and
it will suffice to set only _MBBANK1. Note that with songs > 16K MBBANK1
is always used as the first bank to fill and only when the song is too
big to fit MBBANK2 and 3 will be used.

Ces routines fixé la Banque mappeur de charge/lecture à l'adresse actuelle. En théorie une vague
la chanson peut être légèrement supérieure à 32 Ko. 3 Banques de Mappeur peuvent donc être
nécessaire. Toutefois, en pratique, chansons confiées 16K sera très rare et
Il suffit de mettre seulement _MBBANK1. Notez qu'avec des chansons > 16K MBBANK1
est toujours utilisé comme la première banque à remplir, et seulement quand la chanson est trop
gros pour tenir MBBANK2 et 3 seront utilisés.


:noel
Site web    
igal Membre non connecté

Conseiller Municipal

Rang

Avatar

Groupe : compte ++

Inscrit le : 29/07/2010 à 17h19

Messages: 5492

Le 11/11/2013 à 15h16
Est ce que tu as essayé jipe?

Si tu as la commande "fonctionnelle" chez toi ce serait top

J'ai beau essayer différentes commandes, soit j'ai un Syntax error ou alors ca reste figé et ca me rend pas la main :oups


Tiens... voila du boudin, voila du boudin, voila du boudin... :siffle
gradius Membre non connecté

Maire-adjoint

Rang

Avatar

Inscrit le : 06/10/2009 à 18h27

Messages: 613

Le 11/11/2013 à 16h59
@Igal : sans la commande CALL MBBANK ça passe. Mais je découvre.

10 BLOAD"wavedrvz.bin",R
20 CLEAR 200,&HDA00
30 CALL MBINIT
60 CALL MWKLOAD("xxxx.mwk")
70 CALL MWMLOAD("xxxx.mwm")
80 CALL MBPLAY


MSX Turbo-R FS A1GT - 1 Mo de RAM - Disque dur SCSI Syquest cartouches de 270 Mo - Lecteur CD. Musique, musique, musique et encore musique !
   
igal Membre non connecté

Conseiller Municipal

Rang

Avatar

Groupe : compte ++

Inscrit le : 29/07/2010 à 17h19

Messages: 5492

Le 11/11/2013 à 17h13
@Gradius: Tu utilise un véritable MSX ou alors BlueMSX?

Avec BlueMsx j'ai coché Moonsound, j'ai appliqué ton listing, j'exécute mais pas de SONS.
Ca me rend pas la main...On dirait que ca freeze.

Tu utilise un vrai MSX?
Tu lances quelle musique stp?



Tiens... voila du boudin, voila du boudin, voila du boudin... :siffle
gradius Membre non connecté

Maire-adjoint

Rang

Avatar

Inscrit le : 06/10/2009 à 18h27

Messages: 613

Le 11/11/2013 à 20h27
@Igal : j'émule un Turbo-R sous BlueMSX. Je lance une de mes musiques perso.


MSX Turbo-R FS A1GT - 1 Mo de RAM - Disque dur SCSI Syquest cartouches de 270 Mo - Lecteur CD. Musique, musique, musique et encore musique !
   
igal Membre non connecté

Conseiller Municipal

Rang

Avatar

Groupe : compte ++

Inscrit le : 29/07/2010 à 17h19

Messages: 5492

Le 11/11/2013 à 23h50
Super, je te remercie.

Ton explication m'a fait comprendre qu'il fallait chercher le problème ailleurs et effectivement, j'avais "viré" l'émulation MoonSound ainsi que sa ROM de 2MB dans Editeur de Machines Mémoires.

Maintenant, tout est OK :top :top :top



Tiens... voila du boudin, voila du boudin, voila du boudin... :siffle
igal Membre non connecté

Conseiller Municipal

Rang

Avatar

Groupe : compte ++

Inscrit le : 29/07/2010 à 17h19

Messages: 5492

Le 18/11/2013 à 16h01
Je suis loin d'avoir fait le tour de ce player, mais il est clair qu'il fonctionne très bien vu ressources demandées simultanément au MSX.

Pour rappel, ce Player reproduit les Musique .MWM et prend en charge leurs .MWK assez simplement à l'aide de fonctions CALL MBSTOP, CALL MBPLAY etc...

Cette vidéo joue des images en SCREEN12 stockées sur un CF FAT16. Simultanément, le Player joue une Musique .MWM et MWK.

http://youtu.be/UigcyoFEre8



Tiens... voila du boudin, voila du boudin, voila du boudin... :siffle
ericb59 Membre non connecté

Conseiller Municipal

Rang

Avatar

Groupe : compte ++ Groupe : Shoutbox

Inscrit le : 17/04/2012 à 10h25

Messages: 5486

Le 18/11/2013 à 17h32
encore faut il avoir une moonblaster... :heink


banniere-ericb59e
Site web    
igal Membre non connecté

Conseiller Municipal

Rang

Avatar

Groupe : compte ++

Inscrit le : 29/07/2010 à 17h19

Messages: 5492

Le 18/11/2013 à 18h21
Je pense que tu veux dire une MoonSound ;)

Je peux essayer différents players de sorte à voir si on peut jouer des mélodies MoonBlaster (OPLL+OPL1).

si t'as des suggestions ^^



Tiens... voila du boudin, voila du boudin, voila du boudin... :siffle
Répondre
Vous n'êtes pas autorisé à écrire dans cette catégorie