2 * Adplug - Replayer for many OPL2/OPL3 audio file formats.
3 * Copyright (C) 1999 - 2004 Simon Peter, <dn.tlp@gmx.net>, et al.
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library 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 GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 * lds.h - LOUDNESS Player by Simon Peter <dn.tlp@gmx.net>
24 class CldsPlayer: public CPlayer
27 static CPlayer *factory(Copl *newopl) { return new CldsPlayer(newopl); }
29 CldsPlayer(Copl *newopl);
30 virtual ~CldsPlayer();
32 bool load(const std::string &filename, const CFileProvider &fp);
33 virtual bool update();
34 virtual void rewind(int subsong = -1);
35 float getrefresh() { return 70.0f; }
37 std::string gettype() { return std::string("LOUDNESS Sound System"); }
38 unsigned int getorders() { return numposi; }
39 unsigned int getorder() { return posplay; }
40 unsigned int getrow() { return pattplay; }
41 unsigned int getspeed() { return speed; }
42 unsigned int getinstruments() { return numpatch; }
46 unsigned char mod_misc, mod_vol, mod_ad, mod_sr, mod_wave,
47 car_misc, car_vol, car_ad, car_sr, car_wave, feedback, keyoff,
48 portamento, glide, finetune, vibrato, vibdelay, mod_trem, car_trem,
49 tremwait, arpeggio, arp_tab[12];
50 unsigned short start, size;
52 unsigned short transp;
53 unsigned char midinst, midvelo, midkey, midtrans, middum1, middum2;
57 unsigned short gototune, lasttune, packpos;
58 unsigned char finetune, glideto, portspeed, nextvol, volmod, volcar,
59 vibwait, vibspeed, vibrate, trmstay, trmwait, trmspeed, trmrate, trmcount,
60 trcwait, trcspeed, trcrate, trccount, arp_size, arp_speed, keycount,
61 vibcount, arp_pos, arp_count, packwait, arp_tab[12];
64 unsigned char chandelay, sound;
70 unsigned short patnum;
71 unsigned char transpose;
74 static const unsigned short frequency[];
75 static const unsigned char vibtab[], tremtab[];
76 static const unsigned short maxsound, maxpos;
81 unsigned char fmchip[0xff], jumping, fadeonoff, allvolume, hardfade,
82 tempo_now, pattplay, tempo, regbd, chandelay[9], mode, pattlen;
83 unsigned short posplay, jumppos, *patterns, speed;
84 bool playing, songlooped;
85 unsigned int numpatch, numposi, patterns_size, mainvolume;
87 void playsound(int inst_number, int channel_number, int tunehigh);
88 inline void setregs(unsigned char reg, unsigned char val);
89 inline void setregs_adv(unsigned char reg, unsigned char mask,