Contents
Compiling Songs
To compile a song for use on either a real or emulated ZX Spectrum, select "Compile Song..." from the Tools menu. The resulting dialog allows you to specify a number of options for the compiled song:-
Compile to address: This is location in the Spectrum's memory map to which song is compiled. This must be in the top 32K of memory due to issues with contended memory access in the Spectrum hardware. Therefore, values of between 32768 and 65535 are permitted.
Border Colour: The colour of the spectrum's border during song playback. The port that controls the Spectrum's beeper circuitry also controls the screen's border colour so you must choose a value for the border colour used in the compiled song.
Output File: The type of output to produce. The options are TAP file (with a BASIC loader), TAP file (code block only), Binary data file (this is the compiled binary player and data without any additional wrapping), Assembly listing (a partially-commented assembly listing suitable for incorporating into a larger project).
Tone Generator: Specifies the type of tone generator to be used by the compiled song.
When the end of the song is reached: Specify whether, when the song finishes, the player routine exits or jumps back to the defined loop start point.
Player Routine Options: These options are specific to the selected tone generation routine. For the The Music Box engine, the options are to player continuously (ignoring keypresses), exit the player routine when a key is pressed, or exit at regular intervals after each note is played. Only the first two of these options are available for the Special FX engine.
Interrupt Vector Table: The Special FX, Savage and Plip Plop routines use an IM2 Interrupt Service Routine to play percussion and handle the playback timing. This requires the placement of a block of 257 contiguous 0xFF bytes for the interrupt vector table in memory on a 256-byte boundary during the player routine's initialisation. This block can be shared by any other IM2 routines used in a game or utility. The options are:-
0xFE00 - This is the default. The player routine will write out 257 0xFF bytes from address 65024 to 65280 during initialisation. This ensures the player will run correctly on all Spectrums. Other values from 0x8000 to 0xFD00 may be chosen if required, and are equally effective.
0x3900 - ROM. The 48K Spectrum ROM contains a handy block of 0xFF bytes at this location in the ROM which can be used as an interrupt vector table, thus saving 257 bytes of precious Spectrum RAM. However, the various 128K Spectrum models do not have this block present in the ROM in its entirety. With this option selected, the Special FX player will work on all 48K Spectrums, and on 128K Spectrums that do not have attached peripherals that place data onto the Z80 bus during the interrupt fetch. Devices that may cause problems on 128K Spectrums with this option selected include: Kempston joystick interface, AMX mouse interface, DivIDE+. In these circumstances, the player routine may crash the Spectrum.