User:Freem/Sound Drivers/Mr.Pac

From NeoGeo Development Wiki
Jump to: navigation, search

The Mr.Pac Sound Driver exists in two versions:

  • Ver 1.5b by Mr.Pac h Ber.02/01/08 (January 8th, 1990)
  • Ver 2.0 by Mr.Pac h Ber.02/02/14 (February 14th, 1990)

The information on this page primarily deals with the first version of the driver as it appears on the SM1 chip.

Origin

It is likely that this sound driver is based off of the one found in Beast Busters, which contains this signature:

SOUND CONDUCTER Ver 1.0a for YM2610(OPNB) by Mr.Pac hector Ber.1989/06/17

Command Codes

Code Description
0x00 No operation
0x01 Slot Switch
0x02 Play Eyecatch Music
0x03 Reset
0x04 Disable music/sound effect playback
0x05 Disable music playback
0x06 Disable sound effect playback
0x07 Enable music/sound effect playback
0x08 Enable music playback
0x09 Enable sound effect playback
0x0A Fade out (0 in SM1's TBL_MCODE)
0x0F Stop SSG (0 in SM1's TBL_MCODE)
0x10 ROM/RAM Check
0x11 Stop fade out (0 in SM1's TBL_MCODE)

Voice/Instrument Formats

ADPCM-A

Offset Size Description
0x00 byte Priority (lower value = higher priority)
0x01 word Start Address
0x03 word End Address
0x05 byte Loop Count
0x06 word Loop Start Address
0x08 word Loop End Address
0x0A byte Volume and Left/Right Output

ADPCM-B

Offset Size Description
0x00 byte Priority
0x01 word Start Address
0x03 word End Address
0x05 byte Loop Count
0x06 word Loop Start Address
0x08 word Loop End Address
0x0A word Delta-N Sampling Rate
0x0C byte Volume
0x0D byte LFO Sync/Delay
0x0E byte LFO Envelope, Left/Right Output
0x0F word Minimum LFO Pitch
0x11 word Maximum LFO Pitch
0x13 word LFO Speed
0x15 byte Volume Portamento
0x16 byte Volume Speed
0x17 byte Initial Volume
0x18 byte Final Volume
0x19 byte Portamento Speed

FM

Offset Size Description
0x00 byte Feedback
0x01 byte Algorithm
0x02 byte Detune (Op1)
0x03 byte Detune (Op2)
0x04 byte Detune (Op3)
0x05 byte Detune (Op4)
0x06 byte Multi (Op1)
0x07 byte Multi (Op2)
0x08 byte Multi (Op3)
0x09 byte Multi (Op4)
0x0A byte Output (Op1)
0x0B byte Output (Op2)
0x0C byte Output (Op3)
0x0D byte Output (Op4)
0x0E byte Key Scale Rate (Op1)
0x0F byte Key Scale Rate (Op2)
0x10 byte Key Scale Rate (Op3)
0x11 byte Key Scale Rate (Op4)
0x12 byte Attack Rate (Op1)
0x13 byte Attack Rate (Op2)
0x14 byte Attack Rate (Op3)
0x15 byte Attack Rate (Op4)
0x16 byte Decay Rate (Op1)
0x17 byte Decay Rate (Op2)
0x18 byte Decay Rate (Op3)
0x19 byte Decay Rate (Op4)
0x1A byte Sustain Rate (Op1)
0x1B byte Sustain Rate (Op2)
0x1C byte Sustain Rate (Op3)
0x1D byte Sustain Rate (Op4)
0x1E byte Sustain Level (Op1)
0x1F byte Sustain Level (Op2)
0x20 byte Sustain Level (Op3)
0x21 byte Sustain Level (Op4)
0x22 byte Release Rate (Op1)
0x23 byte Release Rate (Op2)
0x24 byte Release Rate (Op3)
0x25 byte Release Rate (Op4)
0x26 byte SSG-type Envelope (Op1)
0x27 byte SSG-type Envelope (Op2)
0x28 byte SSG-type Envelope (Op3)
0x29 byte SSG-type Envelope (Op4)
0x2A byte "lfoWave"
0x2B byte LFO Delay
0x2C word LFO Speed
0x2E byte "pmd"
0x2F byte "pms"
0x30 byte "intCount"
0x31 byte (unused)
0x32 byte Hardware LFO AMS/PMS
0x33 byte Hardware LFO ??

Sequence Data Header Formats

Some values need verification.

Music

Offset Size Description
0x00 byte "Select Code"
0x01 word Pointer to FM Channel 1 sequence data
0x03 word Pointer to FM Channel 2 sequence data
0x05 word Pointer to FM Channel 3 sequence data
0x07 word Pointer to FM Channel 4 sequence data
0x09 word Pointer to ADPCM-A Channel 1 sequence data
0x0B word Pointer to ADPCM-A Channel 2 sequence data
0x0D word Pointer to ADPCM-A Channel 3 sequence data
0x0F word Pointer to ADPCM-A Channel 4 sequence data
0x11 word Pointer to ADPCM-A Channel 5 sequence data
0x13 word Pointer to ADPCM-A Channel 6 sequence data
0x15 word Pointer to ADPCM-B Channel sequence data
0x17 byte Tempo (music)/Priority (effect)
0x18 byte Initial FM Volume
0x19 byte Initial ADPCM-A Volume
0x1A byte Initial ADPCM-B Volume
0x1B byte Open/Close Flag (FM Channel 1)
0x1C byte Open/Close Flag (FM Channel 2)
0x1D byte Open/Close Flag (FM Channel 3)
0x1E byte Open/Close Flag (FM Channel 4)
0x1F byte Open/Close Flag (ADPCM-A Channel 1)
0x20 byte Open/Close Flag (ADPCM-A Channel 2)
0x21 byte Open/Close Flag (ADPCM-A Channel 3)
0x22 byte Open/Close Flag (ADPCM-A Channel 4)
0x23 byte Open/Close Flag (ADPCM-A Channel 5)
0x24 byte Open/Close Flag (ADPCM-A Channel 6)
0x25 byte Open/Close Flag (ADPCM-B)

Sound Effects

Offset Size Description
0x00 byte Priority
0x01 word Pointer to SSG Channel A sequence data
0x03 word Pointer to SSG Channel B sequence data
0x05 word Pointer to SSG Channel C sequence data
0x07 word Pointer to SSG Noise Channel sequence data
0x09 byte Open/Close Flag (SSG Channel A)
0x0A byte Open/Close Flag (SSG Channel B)
0x0B byte Open/Close Flag (SSG Channel C)
0x0C byte Open/Close Flag (SSG Noise Channel)
0x0D byte Open/Close Flag (Software-mixed Noise)

Other Notes

  • Timer A seems to be used for sound effect playback. (The Timer A value is also stored in 0xFAD3 (lower 2 bits) and 0xFAD4 (upper 8 bits) in the SM1/BIOS driver)
  • Timer B is used as the tempo for music playback. (The Timer B value is also stored in 0xFAD4 in the SM1/BIOS driver)