Classic Arkos Player - z88dk/z88dk GitHub Wiki

Introduction

Arkos Tracker is a cross-platform music and sound effects player for targets containing an AY-891x.

Machine support

Arkos Tracker is still under development and in order to ease the process of taking newer versions from upstream, machine support is limited to that provided by upstream. The following targets are supported:

  • CPC
  • MSX
  • ZX Spectrum
  • ZX Spectrum Next (3 channel)

Playing music

The API to the tracker library is defined in <psg/arkos.h> and consists of the following functions:

extern void __LIB__ ply_akg_init( void *song, uint16_t subsong ) __z88dk_callee __smallc;
extern void __LIB__ ply_akg_play( void );
extern void __LIB__ ply_akg_stop( void );
extern void __LIB__ ply_akg_initsoundeffects( void *effects_table[] ) __z88dk_fastcall;
extern void __LIB__ ply_akg_playsoundeffect( uint16_t effect, uint16_t channel, uint16_t inv_volume ) __z88dk_callee __smallc;

The main function is ply_akg_play() which should be called with interrupts disabled on the interrupt or periodically - note it uses all available registers so if called on the interrupt, main, alternate and index registers should be saved.

Converting Arkos Tracker output to usable files

The directory support/arkos contains tools to convert between the exported format from Arkos Tracker into a format that can be used by a z88dk project.

Converting a song from a file called my_song.aks and exporting the binary data to your program as a byte array called _my_song_data, and redirecting the output to my_song.asm:

./arkos-song-to-asm.pl -s _my_song_data my_song.aks > my_song.asm

Converting sound effects from a file called my_effects.aks and exporting the binary data to your program as a table called _my_effects_data, and redirecting the output to my_effects.asm:

./arkos-song-to-asm.pl -e -s _my_effects_data my_effects.aks > my_effects.asm

Example

An example showing both playing music is available in the examples/sound/arkos directory.