Difference between revisions of "Modules/arkos/Usage"

From MSX Game Library

< Modules

(Created page with "Arkos music is designed to work only 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...")
 
(Music address)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
Arkos music is designed to work only at a specific address.
+
=== Music address ===
When you export a music file from Arkos Tracker, you select this address (e.g., 0xD000).
+
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., <tt>0xD000</tt>).
 +
{|
 +
| [[image:Arkos export.png|x400px|thumb|Arkos Tracker II's AKG exporter<br/>Encode to address (bottom-left)]]
 +
| [[image:Arkos3 export.png|x400px|thumb|Arkos Tracker 3's AKG exporter<br/>Encode to address (middle)]]
 +
|}
 
In your program, you must ensure that the music is placed at this address to initialize the playback properly.
 
In your program, you must ensure that the music is placed at this address to initialize the playback properly.
  
 
There are several possible approaches:
 
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:
 
* 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)
+
** Music at <tt>0xD000</tt> (4 KB up to <tt>0xDFFF</tt>)
** SFX at 0xE000 (1 KB up to 0xE3FF)
+
** SFX at <tt>0xE000</tt> (1 KB up to <tt>0xE3FF</tt>)
* 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.
+
* 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 <tt>__at()</tt> 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 (<tt>0xA000</tt>-<tt>0xBFFF</tt>) to put your music at the beginning of the segment, so that it's readable in <tt>0xA000</tt>.

Latest revision as of 23:12, 27 December 2024

Music address

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).

Arkos Tracker II's AKG exporter
Encode to address (bottom-left)
Arkos Tracker 3's AKG exporter
Encode to address (middle)

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.