User:Freem/Sound Drivers/MVSTracker

From NeoGeo Development Wiki
Revision as of 17:42, 9 July 2016 by Freem (talk | contribs) (→‎Modified (v0.2, 08Sep2006 by Kaneda): some information about the modified version)
(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, 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 (v0.1)

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)

Modified (v0.2, 08Sep2006 by Kaneda)

The modified version of the MVSTracker driver is split into multiple files:

  • common_func.inc – Shared functions between Megadrive/Neo-Geo drivers.
  • common_macro.inc – Shared macros between Megadrive/Neo-Geo drivers.
  • common_vars.inc – Shared variables between Megadrive/Neo-Geo drivers.
  • modplay_md.asm – Megadrive/Genesis Z80 sound driver code.
  • modplay_ng.asm – Neo-Geo Z80 sound driver code.

This version of the code is meant to be assembled with WLA-DX. The Neo-Geo driver code has been reformatted and updated to work with the new common files, but is mostly unchanged from the original version.