User:Freem/Sound Drivers/MVSTracker
The MVSTracker driver exists in two versions:
- The original version by Ivan Mackintosh
- 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 positionSongLen
(byte) — Song lengthFreqHi
(byte) — Current working Frequency MSBFreqLo
(byte) — Current working Frequency LSBBlock
(byte) — Current working BlockInstr
(byte) — Current working instrument numberEffect
(byte) — Effect numberValue
(byte) — Effect valueCurInstr
(byte[4]) — Current instrument number for each channelPatternPos
(word) — Pattern positionPatternCnt
(byte) — Pattern count(?)TempoCount
(byte) — Tempo countTempo
(byte) — Current tempoInstrStart
(word) — Instrument start address?TuneStart
(word) — Tune start address?MusicPlaying
(byte) — Music playing flagPatternBreak
(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 afsendDEPortB
— push af, do rst 0x10 (write to ports 6/7), pop afloadDEinstrX32
— 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.