(→Описание) |
Pixelrat (обсуждение | вклад) (→Использование) |
||
Строка 21: | Строка 21: | ||
===Подготовка=== | ===Подготовка=== | ||
Для использования Sleizsa Trio требуются: | Для использования Sleizsa Trio требуются: | ||
− | + | * [http://dasm-dillon.sourceforge.net dasm macro assembler] | |
− | + | * XM tracker | |
− | + | * MAME | |
− | + | Установить Milkytracker, dasm и MAME. | |
− | + | Чтобы не искать эти утилиты, можно прописать их в compile.bat/compile.sh. Пользователи Windows могут скопировать файлы dasm и MAME в папку SleizsaTrio | |
− | |||
− | |||
− | |||
− | + | Нужно найти дампы BIOS'а Channel F и поместить их по пути SleizsaTrio/roms/channelf. Найти дампы можно, например, в оригинальном пакете [[Sleizsa]]. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
+ | Вместо MAME можно использовать MESS, но скрипты компиляции нужно будет отреактировать. | ||
===Как использовать=== | ===Как использовать=== | ||
+ | # Написать музыку, используя шаблон music.xm | ||
+ | # Выполнить compile.bat / compile.sh | ||
+ | # PROFIT! | ||
− | + | Прилагаемый шаблон music.xm даёт только прриблизительное предстваление, как будет звучать музыка на реальной консоли. | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
Tones must be entered into tracks 1-3, using instrument 01. Valid notes | Tones must be entered into tracks 1-3, using instrument 01. Valid notes |
Версия 22:39, 19 марта 2018
Описание
Трёх-канальный шаблон для консоли Fairchild Channel F, использующий алгоритм Zilogat0r'а для бипера ZX Spectrum'а.
Возможности:
- 3 канала, 16-разрядные делители частоты
- большие возможности по настройке тонов
- режим шума для канала 3
- 2 барабанных прерывания
- 6-битное разрешение темпа
Использование
Подготовка
Для использования Sleizsa Trio требуются:
- dasm macro assembler
- XM tracker
- MAME
Установить Milkytracker, dasm и MAME.
Чтобы не искать эти утилиты, можно прописать их в compile.bat/compile.sh. Пользователи Windows могут скопировать файлы dasm и MAME в папку SleizsaTrio
Нужно найти дампы BIOS'а Channel F и поместить их по пути SleizsaTrio/roms/channelf. Найти дампы можно, например, в оригинальном пакете Sleizsa.
Вместо MAME можно использовать MESS, но скрипты компиляции нужно будет отреактировать.
Как использовать
- Написать музыку, используя шаблон music.xm
- Выполнить compile.bat / compile.sh
- PROFIT!
Прилагаемый шаблон music.xm даёт только прриблизительное предстваление, как будет звучать музыка на реальной консоли.
Tones must be entered into tracks 1-3, using instrument 01. Valid notes are A-0 - B-5.
On channel 3, noise can be played instead of tones. For this, use instrument 2. Note that the actual noise is very different from the XM template. It does change with pitch, but not in a linear manner. For best results, use notes A-5 or A#5.
There are two interrupting drum sounds (instrument 03 and 04), they can only be used in channel 4. Only one drum sound can be active at a given time.
You can change the tempo with the Fxx command, or globally with the tempo setting. You cannot change the BPM. So, only values F01..F1F are allowed. Beware that after each pattern, the speed will be reset to the global value.
You can set a loop point with command Bxx. If no loop point is specified, the player will loop back to the start once it has finished the playing the song.
Other than Fxx/Bxx, all effects will be ignored. Changes made to the instruments as well as volume settings are also ignored.
You can change the duty cycle (pulse width) settings globally for each channel by editing lines 36-38 of main.asm. Higher values may give more beefy sound, but have a higher chance of overloading/glitching the output. As a rule of thumb, stick to values lower than $40.
If you are running out of space in the binary, try increasing the value in line 34 of main.asm. In theory, up to 62 KB are possible, but MAME will break when trying to use more than 8 KB.
I tried my best to correct the drum speed shift. If you do however find it to be insufficient, you can try to experiment with the values in line 95 resp. 145 of main.asm.
Note to Programmers
=======
You are free to use Sleizsa Trio in your programs, as long as you credit me. Beware that Sleizsa Trio is not guaranteed to work on all Channel F versions.
The routine normally resides at $800, but can be relocated to any other address. The musicData section can reside anywhere in memory. Sleizsa Trio takes all the CPU time, so you can't do much else while music is playing. You could, however, update graphics between notes (calling gfx code in the .readPtn section), at the cost of introducing additional noise during note transitions.
Scratchpad registers r0-r16 including the K register are used, so you'll have to work around that.
In case you are using external interrupts in your homebrew, you must disable interrupts prior to calling Sleizsa Trio.
However, it is possible to update graphics within the sound loop
(thereby lowering pitch and decreasing overall sound quality) as long as your gfx code always takes a fixed number of cycles and restores scratchpad contents on return (except Q which may be trashed).
Music Data Layout
=====
The first section is contains the order in which patterns will be played. It consists of word-length pointers to the patterns and is terminated with an $ff byte.
The following sections are the actual patterns, containing the music data. Patterns can be of arbitrary length, and must be terminated with a $00 byte.
Each row in the pattern data consists of 4 bytes. The first byte contains information about the speed of the row. A higher value corresponds to a lower speed. The speed value must be >0 and <$40. Setting bit 6 of the first byte will trigger the kick drum, setting bit 7 will trigger the noise drum. Only one drum can be triggered on any given row. The noise drum takes precedence over the kick drum.
Bytes 2-4 of a row are pointers to note values for channel 1-3, respectively. A value of 0 signifies silence, available notes are 2-$7e. Note values must be even, except on channel 3, where uneven notes trigger the noise mode.