User:Freem/Sound Drivers/MVSTracker

From NeoGeo Development Wiki
Revision as of 07:24, 11 March 2015 by Freem (talk | contribs) (initial userspace MVSTracker driver page (going to do first version of the driver))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The MVSTracker driver exists in two versions:

  1. The original version by Ivan Mackintosh
  2. The modified version by Pascal and Kaneda

The latter version of the engine is able to target the Neo-Geo and Megadrive/Genesis. It splits out common routines and macros into separate files.

According to Jeff Kurtz [1], this driver does not work on hardware. It seems that the required wait times for the address and data writes are not in place. (This is true for both the original and modified versions.)

Original Version

The original MVSTracker Z80 driver is contained in a file called modplay.asm.

Variables

From vars.inc:

  • SongPos (byte) — Song position
  • SongLen (byte) — Song length
  • FreqHi (byte) — Current working Frequency MSB
  • FreqLo (byte) — Current working Frequency LSB
  • Block (byte) — Current working Block
  • Instr (byte) — Current working instrument number
  • Effect (byte) — Effect number
  • Value (byte) — Effect value
  • CurInstr (byte[4]) — Current instrument number for each channel
  • PatternPos (word) — Pattern position
  • PatternCnt (byte) — Pattern count(?)
  • TempoCount (byte) — Tempo count
  • Tempo (byte) — Current tempo
  • InstrStart (word) — Instrument start address?
  • TuneStart (word) — Tune start address?
  • MusicPlaying (byte) — Music playing flag
  • PatternBreak (byte) — Pattern break(?)
  • NextChannel (byte) — Next ADPCM-A channel to use (cycled in NMI_ProcessADPCM)
  • UseChannel (byte) — Current ADPCM-A channel to use

Macros

  • RAMDB — define a byte in RAM?
  • RAMDW — define a word in RAM?
  • RAMARRAY — define a series of bytes in RAM?
  • sendDEPortA — push af, do rst 0x08 (write to ports 4/5), pop af
  • sendDEPortB — push af, do rst 0x10 (write to ports 6/7), pop af
  • loadDEinstrX32 — do rst 0x18; "instrument# 0..31 multiply by 32; result in de"

Code

(todo; this is going to take a bit to clean up and format into wiki syntax)