OPMDRV

From vgmrips
Jump to: navigation, search

OPMDRV is a MML-based music driver for the Sharp X68000. Many games use it, for a list see here. There are several versions found on game floppies, here are a few:

FM音源ドライバー Ver. 0.80
FM音源 DRIVER for X68000 version 1.00
FM音源 DRIVER for X68000 version 1.01
FM音源 DRIVER for X68000 version 1.02

Playing songs

To load the driver, simply execute OPMDRV.X or OPMDRV2.X. To play a song type

copy <file.opm> OPM

OPM is a special file that the driver traps and begins to play the music.

PCM Samples

To load PCM data, you need a separate tool. So far I've fond OPMD.X and OPMZ.X. An example game that uses OPMD.X is Dark Castle (1991)(Biwahosi Software). The PCM samples are listed in a file, for example:

1 =\PCMS\bd1v12.pcm
2 =\PCMS\sd3v13.pcm
3 =\PCMS\sd1v12.pcm
4 =\PCMS\sd2v13.pcm
5 =\PCMS\sd2v15.pcm
6 =\PCMS\sd3v15.pcm
7 =\PCMS\bd1v15.pcm.

This file is loaded after OPMDRV with:

OPMD -a <FILE>

Where <FILE> is the text file listed above, and the pcm files contain the PCM samples.

For OPMZ.X:

Usage:

OPMZ n1=<file1.PCM> [n2=<file2.PCM> ...] (0-255)

OPMZ i=<list.ind>
or
OPMZ -r (unload driver)

An example .ind file:

01 = n1.pcm
02 = n2.pcm
03 = n3.pcm
04 = n4.pcm
05 = n5.pcm
06 = n6.pcm

To stop playback, first create a file called STOP.OPM, or any other name. Run ed STOP.OPM, type (i), press ESC, X to save it, then run copy STOP.OPM OPM.

MML

Without access to the manual, we can only reverse engineer existing songs. Here are some examples: S68MUS01.OPM S68MUS02.OPM.

It seems:

  • (i) initializes/clears the player
  • (vN,...) creates voice with the id N. Voices seem to be between 0 and 255. Example: (v4,0,58,15,0,0,0,0,0,0,0,3,0,31,10,7,8,2,33,0,0,7,0,0,31,8,8,7,5,23,3,7,7,2,0,31,5,6,7,1,37,0,0,3,0,0,31,8,6,7,5,0,0,1,7,0,0)
  • (tN), where N is between 1 and 8, lines starting with this command are actual MML lines.
  • @N use voice N. Example: @199
  • cdefgab play a note
  • oN choose octave. Example: o4
  • vN set volume, where N between 0 and 15
  • (mN,X) unkown command. N is between 1 and 8. Example: (m8,8000)
  • (aN,M) unknown commmand, where N is between 1 and 8, and M seems to be between 1 and 8 as well.
  • (p) unknown command, found at end of file