2 * Adplug - Replayer for many OPL2/OPL3 audio file formats.
3 * Copyright (C) 1999 - 2003 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 * [xad] RAT player, by Riven the Mage <riven@ok.ru>
24 class CxadratPlayer: public CxadPlayer
27 static CPlayer *factory(Copl *newopl);
29 CxadratPlayer(Copl *newopl): CxadPlayer(newopl)
36 unsigned char version;
38 unsigned char numchan;
39 unsigned char reserved_25;
40 unsigned char order_end;
41 unsigned char reserved_27;
42 unsigned char numinst; // ?: Number of Instruments
43 unsigned char reserved_29;
44 unsigned char numpat; // ?: Number of Patterns
45 unsigned char reserved_2B;
46 unsigned char order_start;
47 unsigned char reserved_2D;
48 unsigned char order_loop;
49 unsigned char reserved_2F;
52 unsigned char reserved_32[12];
53 unsigned char patseg[2];
59 unsigned char instrument;
67 unsigned char freq[2];
68 unsigned char reserved_2[2];
69 unsigned char mod_ctrl;
70 unsigned char car_ctrl;
71 unsigned char mod_volume;
72 unsigned char car_volume;
77 unsigned char mod_wave;
78 unsigned char car_wave;
79 unsigned char connect;
80 unsigned char reserved_F;
82 unsigned char reserved_11[3];
90 unsigned char order_pos;
91 unsigned char pattern_pos;
97 rat_event tracks[256][64][9];
101 unsigned char instrument;
102 unsigned char volume;
108 bool xadplayer_load();
109 void xadplayer_rewind(int subsong);
110 void xadplayer_update();
111 float xadplayer_getrefresh();
112 std::string xadplayer_gettype();
113 std::string xadplayer_gettitle();
114 unsigned int xadplayer_getinstruments();
117 static const unsigned char rat_adlib_bases[18];
118 static const unsigned short rat_notes[16];
120 unsigned char __rat_calc_volume(unsigned char ivol, unsigned char cvol, unsigned char gvol);