Moonblaster Wave for Moonsound
After R.Schrijvers more or less quite the MSX scene round 1997 he passed me (Marcel Delorme) the source files of MBWAVE and MBFM, and I decided to continue the development of MBWAVE. All releases starting from version 1.05 where made by M. Delorme.
Back in 1997 I was still part of NWO and MBWAVE was always downloadable from the NWO website. However, Ziggo has cancelled their website services so I decided, with the consent of Jorito, to move some of the programs to the Teambomba website.
The final release version is 1.17.
TNI has started developing a new version of Moonblaster. Merging MBFM and MBWAVE as a starting point. Check their website for more information.
Revision history
Version 1.17 (release date 28/12/2005)
Improvements / other modifications
- Changed default start note from C1 to C5
- File name of a loaded raw sample is copied into tone name
- Changed the int value for 60hz files to 49 (was 48)
- Own waves above 32 couldn't be used in the replayer
Version 1.16 (release date 29/05/2004)
Improvements / other modifications
- Added Solo support in pattern editor. Press space bar to set current channel to solo, additional channels can be activated with CTRL-W. To activate all channels press space again on the channel that was set to solo.
Bugfixes:
- 2 settings variables were not saved. Don't use your old settings file!!
Version 1.15 (release date 26/04/2001)
Improvements / other modifications
- Added Toshiba Keyboard support
- Added Trim sample function in Tone editor (F9). NOTE: SRAMdefrag routines need to be modified. You have to save and reload the waves to free SRAM no longer used by samples.
- Removed some unused code.
Bugfixes
- Some variables overlaped each other.
Version 1.14 (release date 28/01/2001)
Improvements / other modifications
- Add Rom Tone copy function in tone editor (F9).
Version 1.13 (release date 24/04/1999)
Improvements / other modifications
- Master volume can be altered during playing by means of CTRL-up & CTRL-down
- Enhanced the key scan routine (while playing).
Bugfixes
- Fixed: Sometimes Moonblaster crashed on a Turbo R while saving settings.
Version 1.12 (release date 19/09/1998)
Improvements / other modifications
- New CMD option implayed for changing the base frequency during playing.
Bugfixes
- The base frequency was not always correctly displayed.
Version 1.11 (release date 03/08/1998)
Improvements / other modifications
- During playing: Cursor left is now fast forward and cursor right restores old speed.
Bugfixes
- The base frequency was not set correctli when loading an MB1.4 song.
- Changed standard volume that was set by clear song to 28 (from 31).
- Removed the drive letter from the screen that you saw after loading a song.
- The note data was written to the wrong channel (only if you didn't change the channel before typing) after loading a song if the channels displayed before loading was for example channel 13 until 24. This is okay now.
Version 1.1 (release date 29/06/1998)
Improvements / other modifications
- Little speed improvement in the replayer, SRAM load and wave menu part.
- You don't see the directory anymore, because this 'directory' is only useful in DOS.
- Replaced all the
sla a
instructions with add a,a
.
- The OPL4 wait routine is faster now.
- Removed the Herz Speed equalizer.
- MBWave routine uses the OPL4 interrupt now instead of the VDP interrupt. You can enter a 'base frequency' between 1 and 133 (48Hz to
100Hz) (CTRL-F in edit mode and Cursor Up & Down in play mode (realtime speed editing)).
- Removed some unused code in the replayer.
Bugfixes
- MB crashed (DOS2) if you accessed an empty directory. It's okay now.
Version 1.08 (release date 08/06/1998)
Improvements / other modifications
- Little speed improvement in the replayer part. MB waited for tone header loading also when this was not really necessary.
- Added Volume Transpose, now you can decrease/increase all the volumes in a block/channel with
[
for down and ]
for up.
- Load routines use DOS2 routines now for loading (if present ofcourse), this means that you can load files from CD now.
- The 60/50hz speed equalizer setting is saved in the configuration file now.
- Added master volume setting (CTRL-J). You can set the volume of the Mixer unit of the OPL4 now. This setting is also saved in the configuration file.
Version 1.07 (release date 25/04/1998)
Improvements / other modifications
- Added Delete All Tones function (finally) in the tone editor (F10).
- Little speed improvement in the replayer part.
- If there is no OPL4 connected the program will abort. (This feature was gone)
Version 1.06 (release date 12/01/1998)
Improvements / other modifications
- Added two extra octaves for the 44.1Khz frequency table.
- Added LFO editor. It's now possible to alter the LFO, VIB and TRM when playing the song.
- The default volume of the waves is changed from 31 to 28.
- 3 new drum sounds added to the drum kit. (D#8, E8, F8)
- New SRAM check routine implemented. (Thanks to Koen van Hartingsveld)
- Step size of the sample addresses in the tone menu changed from 1 and 10 to 1 and 100, so now you can select the right sample offsets much faster.
Bugfixes
- Reverb is now reset when you clear, load or restart a song.
Version 1.05 (release date 28/10/1997)
Improvements / other modifications
- Added Reverb option in the Wave menus.
- Added Random panning option in the Wave menus.
- The "clicking" of the voices in the Wave menus is gone.
- Added Reverb on/off option in the song editor.
- Added LFO switch in the song editor.
- Improved speed for the Z80 in the replayer.
Bugfixes
- MBWAVE crashed in R800 mode, it works okay now.
Releases made by R. Schrijvers
Version 1.04
Bugfixes
- Fixed wrong transpose error bug.
- It was possible to select 48 waves, but only 32 were allowed in a song! (Why didn't anyone notice this before??!!)
Version 1.03A (release date 11/12/95)
Bugfixes
- Version v1.03 was completely unreliable. My harddisk interface destroyed several bytes in each file!
- When a stereo event was handled, the pitch bend/modulation should continue.
Version 1.03 (release date 28/11/95)
Improvements / other modifications
- Included option to load 16-bit samples with little endian and big endian byte ordering.
- Modified frequency of snare B7 in GM drum patch.
- Block marks are removed when a song is cleared.
Bugfixes
- Fixed channel on/off bug in channel 1. (thanx Marcel!!)
- When a volume event was handled, the pitch bend/modulation should continue.
- The 22050 Hz freq. table in the replayer differed from the one in the wave editor. The freq table in the replayer is shifted up one octave.
- When HOME was pressed in the stereo settings menu only the first 6 channels were reset.
- Fixed memory freeing bug when CTRL-STOP was pressed. (DOS2 only).
- RAW mode wavekits are supposed to be handled as EDIT mode, but they were not.
- After naming a tone the audition didn't work until it was reinitialised.
Version 1.02 (release date 01/10/95)
Improvements / other modifications
Bugfixes
- Fixed another bug in the memory defragmentation. Samples > 16K were destroyed during fragmentation.
- Fixed bug with disk stop. On Philips MSX computers the drive kept spinning in the tone and wave menu.
- Did something *really* stupid. Forgot to switch speed test off before uploading!
Version 1.01 (release date 27/09/95)
Bugfixes
- Fixed bug in replayer initialisation. After loading a wavekit from the main-diskmenu you had to press F3 to initialise the waves.
- Fixed major bug in memory defragmentation. It worked only with a music module inserted! Oops, used wrong I/O port, forgot to use my constant...
- Fixed major bug in sample end address check. It was possible to set the address out of the sample range with 8-bit samples.
Version 1.00 (release date 23/09/95)
Improvements / other modifications
- Improved MIDI routines for Z80 speed.
- Added settings scan in song info menu.
- Found some extra samples in the ROM! Some new drums were added to the GM drum wave, the Telephone wave also contains Bird Tweet now, and the Bass & Snare drum waves now contain two different Bass/Snare drums.
- Improved pattern-print routine. It shouldn't slow the music down anymore.
Bugfixes
- Fixed bug in replayer. Detunes caused notes to be played in the wrong octave sometimes.
- Fixed typo in one of the frequency tables. Brigth Piano and Elec Piano 2B were wrong with note F#6.
Version 0.92 (release date 20/07/95)
Improvements / other modifications
- Improved SRAM check (I hope). It should work with sizes >128K and all variable configurations that are possible with the new MoonSound generation now.
- Added Play-time errors. These are errors that can occur when a song is played. These checks can and will be removed in the separate replayers to gain some extra speed.
- Added transpose.
- Included the drive selection in the main disk menu too.
- Many people were complaining about a crashing computer when they started MB without an OPL4 connected. Since this cannot be solved, Ijust won't start the program without OPL4.
- Wait-timing is improved. This was possible because of new technicalOPL4 info sheets. No difference will be noticed though, except that it will probably work safer/better on 7.16MHz.
- Added support of songs > 32K with USER and EDIT mode. Since it is almost impossible to make such a song, I didn't think it was neccessary at first.
Bugfixes
- Fixed major bug in crunch and loadroutines of EDIT and USER mode songs. Songs > 16K weren't handled correctly.
- Fixed bug in block copy. Copying wasn't possible when the block ended on channel 24.
- Fixed Atmosphere B and Fifths B
I would like to thank the following persons for their USEFUL bug reports and some for routines or ideas:
- Simon Vis
- Patriek Lesparre
- Stefan Boer
- Peter Burkhard
- Radik ...
- Koen van Hartingsveld
- Jos van den Biggelaar
- Hans Chossen
- Laurens Holst
Moonblaster wavedriver TSR for DOS 2.XX.
System requirements: OPL4, DOS2.XX with atleast 2 free segements.
Supports: MBWAVE 1.14 MWM files. Also files bigger than 16KB can be played. Try to start some games while playing a MWM file and you will see that the music playes on. (Works for example with Be-Bop-Bout)
The driver automatically loads the correct kernel for either the Z80 or the R800 mode.
More info is in the driver itself.
How to use the MBWAVE BASIC driver 1.14
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.14.
- DOS1 and DOS2
- Z80, Z80H and R800 (three different drivers)
For 7MHz Users there is a special version available (WAVDRV7.BIN). This version is much 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 replaced by:
NOP (only 4 Cycles)
This means 17 cycles faster by almost each OUT or IN. And there are a lot of those.
Basic calls
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 until 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:
&HDA00 0 = not playing, 255 = playing
&HDA01 1st mapperbank with song data
&HDA02 2nd mapperbank with song data
&HDA03 3rd mapperbank with song data
&HDA04 address of song data
&HDA06 current position
&HDA07 current step
&HDA08 3 status bytes (0 = off)
&HDA0B song data that will be played the next interrupt
&HDA26 Available 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!
Usaage in assembler
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:
- Assemble it for R800 or Z80
-
Include the FADE
-
Include a speed test
-
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! In addition the Z80 version will tend to crash systems with a higher clock speed than 3.54Mhz.
The replayer is now on the Hook #FD9A, because it uses the OPL4 interrupt now. (So no difference between 50/60Hz anymore!)
Warning: The replayer doesn't perform a page select (it only performs a slot-select), so if you integrate the replayer in your own program: Take care that the right ram page is selected!!!
Wavekits
The following wavekits have been made using WAV2MTN.
It converts Windows WAV files to MTN. It supports 8 and 16 bits mono WAVs inclusing loop addressing. 16 bit samples can be upto 128KB.