]]>https://jasonoakley.com/podcasts/aussie-tech-heads-episode-679/feed/0Add Vortex Tracker to MPAGDhttps://jasonoakley.com/programming/add-vortex-tracker-to-mpagd/?utm_source=rss&utm_medium=rss&utm_campaign=add-vortex-tracker-to-mpagd
https://jasonoakley.com/programming/add-vortex-tracker-to-mpagd/#respondSat, 23 May 2020 06:01:46 +0000https://jasonoakley.com/?p=1200Read more »]]>I’ve recently completed my Spectrum game and wanted to add music to it. A cool guy I met on Twitter by the name of Mike Richmond kindly wrote a wonderful tune for my game using Vortex Tracker. Unfortunately, it’s been quite the headache to get this working with my MPAGD game. But, I’ve finally done it!

To start off, I’ve edited the trailer.txt file which comes in the MPAGD ZX Suite to the following:

Kees was kind enough to provide me with a user.asm file which he was using to preserve colour in MPAGD and allows USER X calls to run z80 code.

I added my own code for USER 6 for MPAGD:

chk6 cp 6
jr nz,chk7
ld hl,corey_mod
call ay_player_init
ret

To initialise the music player, you need to call USER 6 in the INTRO MENU event script. I call is just after “EVENT INTROMENU”. You could possibly put it in the GAME INITIALISATION section but I have not tested that.

Now for the tricky bit. You need to edit the EngineZX.asm file to play the music from the correct location. Edit the vsync0 section to add the call to the music player:

The player needs to be put here otherwise you will only hear a static hissing sound while the player isn’t being called due to the cpu being busy waiting for the vsync.Also, if you are using MPAGD v0.7.9 or later you will need to edit BUILD.BAT file and remove code where it does the ‘del user.asm’ part in the sjasm folder.