| 1 | /* |
| 2 | * OpenTyrian: A modern cross-platform port of Tyrian |
| 3 | * Copyright (C) 2007-2009 The OpenTyrian Development Team |
| 4 | * |
| 5 | * This program is free software; you can redistribute it and/or |
| 6 | * modify it under the terms of the GNU General Public License |
| 7 | * as published by the Free Software Foundation; either version 2 |
| 8 | * of the License, or (at your option) any later version. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this program; if not, write to the Free Software |
| 17 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 18 | */ |
| 19 | #ifndef LDS_PLAY_H |
| 20 | #define LDS_PLAY_H |
| 21 | |
| 22 | #include "opentyr.h" |
| 23 | |
| 24 | #include <stdio.h> |
| 25 | |
| 26 | extern bool playing, songlooped; |
| 27 | |
| 28 | int lds_update(void); |
| 29 | bool lds_load(FILE *f, unsigned int music_offset, unsigned int music_size); |
| 30 | void lds_free(void); |
| 31 | void lds_rewind(void); |
| 32 | void lds_fade(Uint8 speed); |
| 33 | |
| 34 | /*unsigned int getorders() { return numposi; } |
| 35 | unsigned int getorder() { return posplay; } |
| 36 | unsigned int getrow() { return pattplay; } |
| 37 | unsigned int getspeed() { return speed; } |
| 38 | unsigned int getinstruments() { return numpatch; }*/ |
| 39 | |
| 40 | typedef struct { |
| 41 | unsigned char mod_misc, mod_vol, mod_ad, mod_sr, mod_wave, |
| 42 | car_misc, car_vol, car_ad, car_sr, car_wave, feedback, keyoff, |
| 43 | portamento, glide, finetune, vibrato, vibdelay, mod_trem, car_trem, |
| 44 | tremwait, arpeggio, arp_tab[12]; |
| 45 | unsigned short start, size; |
| 46 | unsigned char fms; |
| 47 | unsigned short transp; |
| 48 | unsigned char midinst, midvelo, midkey, midtrans, middum1, middum2; |
| 49 | } SoundBank; |
| 50 | |
| 51 | typedef struct { |
| 52 | unsigned short gototune, lasttune, packpos; |
| 53 | unsigned char finetune, glideto, portspeed, nextvol, volmod, volcar, |
| 54 | vibwait, vibspeed, vibrate, trmstay, trmwait, trmspeed, trmrate, trmcount, |
| 55 | trcwait, trcspeed, trcrate, trccount, arp_size, arp_speed, keycount, |
| 56 | vibcount, arp_pos, arp_count, packwait, arp_tab[12]; |
| 57 | struct { |
| 58 | unsigned char chandelay, sound; |
| 59 | unsigned short high; |
| 60 | } chancheat; |
| 61 | } Channel; |
| 62 | |
| 63 | typedef struct { |
| 64 | unsigned short patnum; |
| 65 | unsigned char transpose; |
| 66 | } Position; |
| 67 | |
| 68 | void lds_playsound(int inst_number, int channel_number, int tunehigh); |
| 69 | void lds_setregs(unsigned char reg, unsigned char val); |
| 70 | void lds_setregs_adv(unsigned char reg, unsigned char mask, unsigned char val); |
| 71 | |
| 72 | #endif /* LDS_PLAY_H */ |