Library for launch sound effects for the PSG AY-3-8910 or compatible.
It is an adaptation of ayFX REPLAYER Fixed Volume v1.31 made by SapphiRe.
The names of the functions have been changed to adapt it to the nomenclature of the sound libraries of the fR3eL project.
To function it requires the AY38910BF library. The function that dumps the registers buffer to the sound processor (PlayAY), has been moved to AY38910BF library because it is applicable to other music libraries (such as PT3player). You also get the possibility of selecting to which sound processor the data processed by the players should be directed (internal or external AY).
Use them for developing MSX applications using Small Device C Compiler (SDCC).
This project is an Open Source library. You can add part or all of this code in your application development or include it in other libraries/engines.
This library is part of the MSX fR3eL Project
.
Enjoy it!
- Designed for developing MSX applications using Small Device C Compiler (SDCC).
- It does not use the BIOS so it can be used to program both ROMs or MSX-DOS executables.
- Up to 256 effects per bank. Multiple banks can be defined and changed from the initialization function.
- Priority parameter. The effects with the highest priority will be executed on the ones with the lowest.
- 2 modes of operation:
- Fixed. They will be heard on the indicated channel.
- Cyclical. The ayFX sample will be mixed on a different PSG channel in each frame.
- AY Sound FX Editor by Shiru
- AY Sound FX Editor (Improved) by Shiru and Robin Verhagen-Guest
The AY38910BF
, PT3player
and ayFXplayer
libraries are designed to work together, so you will have a system to provide music and effects in game development.
This parameter can be changed from the ayFX_Setup
function or directly by writing in the static variable ayFX_MODE
.
Label | Value |
---|---|
ayFX_FIXED | 0 |
ayFX_CYCLE | 1 |
ayFX_Setup | ||
---|---|---|
ayFX player setup | ||
Function | ayFX_Setup(unsigned int BANKaddr, char mode, char channel) | |
Input | [unsigned int] | Samples Bank memory address |
[char] | mode (0=Fixed channel;0=Cycle channel) | |
[char] | Channel number (0=A;1=B;2=C) | |
Output | --- | |
Example: | ayFX_Setup((unsigned int) BANK00, ayFX_FIXED ,AY_Channel_C); |
ayFX_SetChannel | ||
---|---|---|
Change output channel (useful only in Fixed channel mode). | ||
Function | ayFX_SetChannel(char channel) | |
Input | [char] | Channel number (0=A;1=B;2=C) |
Output | --- | |
Example: | VPRINTN("Alea iacta est",10); |
ayFX_Play | ||
---|---|---|
Play FX | ||
Function | ayFX_Play(char FXnumber, char FXpriority) | |
Input | [char] | FX to be played (0 to 255) |
[char] | FX priority (0 to 15) | |
Output | [char] | 0: no errors, the new sample has been correctly initialized 1: priority error, there's a sample with higher priority being played 2: index error, the current bank don't have a sample with such index |
Example: | ayFX_Play(5,0); |
ayFX_Decode | |
---|---|
Generates the values of registers of a frame of the ayFX in progress. It has to be executed in every frame, not necessarily in the interrupt routine. | |
Function | ayFX_Decode() |
Input | --- |
Output | --- |
Examples: | ayFX_Decode(); |
This document is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.