Modules/arkos/Usage

From MSX Game Library

Revision as of 22:57, 27 December 2024 by Aoineko (talk | contribs)

< Modules

Music address

Arkos export.png
Arkos Tracker II's AKG exporter
Address at the bottom-left

Arkos music is designed to work only if played at a specific address. When you export a music file from Arkos Tracker, you select this address (e.g., 0xD000). In your program, you must ensure that the music is placed at this address to initialize the playback properly.

There are several possible approaches:

  • Store your music in a compressed format (Pletter, ZX0, etc.) anywhere in your program and then decompress it to the correct address in RAM when needed. In this case, you must reserve enough space in RAM to put the current music and the SFX (if needed). A possible layout maybe:
    • Music at 0xD000 (4 KB up to 0xDFFF)
    • SFX at 0xE000 (1 KB up to 0xE3FF)
  • Put the music directly in the "right" place in your program. This can be quite complicated in C, unless you manually place the data at a given address (with the __at() directive). This is possible in page 0 of 48 KB ROMs, for example, or more simply with mapper segments. For example, with an 8 KB mapper, you could use the last bank (0xA000-0xBFFF) to put your music at the beginning of the segment, so that it's readable in 0xA000.