]> 4ch.mooo.com Git - 16.git/blob - 16/adplug/adplug-2.2.1/src/rix.h
Please enter the commit message for your changes. Lines starting
[16.git] / 16 / adplug / adplug-2.2.1 / src / rix.h
1 /*
2  * Adplug - Replayer for many OPL2/OPL3 audio file formats.
3  * Copyright (C) 1999 - 2006 Simon Peter, <dn.tlp@gmx.net>, et al.
4  * 
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.
9  * 
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.
14  * 
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
18  *
19  * rix.h - Softstar RIX OPL Format Player by palxex <palxex.ys168.com>
20  *                                           BSPAL <BSPAL.ys168.com>
21  */
22
23 #include "player.h"
24
25 class CrixPlayer: public CPlayer
26 {
27  public:
28   static CPlayer *factory(Copl *newopl);
29
30   CrixPlayer(Copl *newopl);
31   ~CrixPlayer();
32
33   bool load(const std::string &filename, const CFileProvider &fp);
34   bool update();
35   void rewind(int subsong);
36   float getrefresh();
37   unsigned int getsubsongs();
38
39   std::string gettype()
40     { return std::string("Softstar RIX OPL Music Format"); };
41
42  protected:     
43   typedef struct {
44     unsigned char v[14];
45   } ADDT;
46
47   int flag_mkf;
48   unsigned char *file_buffer;
49   unsigned char *buf_addr;  /* rix files' f_buffer */
50   unsigned short f_buffer[300];//9C0h-C18h
51   unsigned short a0b0_data2[11];
52   unsigned char a0b0_data3[18];
53   unsigned char a0b0_data4[18];
54   unsigned char a0b0_data5[96];
55   unsigned char addrs_head[96];
56   unsigned short insbuf[28];
57   unsigned short displace[11];
58   ADDT reg_bufs[18];
59   unsigned long pos,length;
60   unsigned char index;
61
62   static const unsigned char adflag[18];
63   static const unsigned char reg_data[18];
64   static const unsigned char ad_C0_offs[18];
65   static const unsigned char modify[28];
66   static const unsigned char bd_reg_data[124];
67   static unsigned char for40reg[18];
68   static unsigned short mus_time;
69   unsigned int I,T;
70   unsigned short mus_block;
71   unsigned short ins_block;
72   unsigned char rhythm;
73   unsigned char music_on;
74   unsigned char pause_flag;
75   unsigned short band;
76   unsigned char band_low;
77   unsigned short e0_reg_flag;
78   unsigned char bd_modify;
79   int sustain;
80   int play_end;
81
82 #define ad_08_reg() ad_bop(8,0)    /**/
83   inline void ad_20_reg(unsigned short);              /**/
84   inline void ad_40_reg(unsigned short);              /**/
85   inline void ad_60_reg(unsigned short);              /**/
86   inline void ad_80_reg(unsigned short);              /**/
87   inline void ad_a0b0_reg(unsigned short);            /**/
88   inline void ad_a0b0l_reg(unsigned short,unsigned short,unsigned short); /**/
89   inline void ad_a0b0l_reg_(unsigned short,unsigned short,unsigned short); /**/
90   inline void ad_bd_reg();                  /**/
91   inline void ad_bop(unsigned short,unsigned short);                     /**/
92   inline void ad_C0_reg(unsigned short);              /**/
93   inline void ad_E0_reg(unsigned short);              /**/
94   inline unsigned short ad_initial();                 /**/
95   inline unsigned short ad_test();                    /**/
96   inline void crc_trans(unsigned short,unsigned short);         /**/
97   inline void data_initial();               /* done */
98   inline void init();                       /**/
99   inline void ins_to_reg(unsigned short,unsigned short*,unsigned short);  /**/
100   inline void int_08h_entry();    /**/
101   inline void music_ctrl();                 /**/
102   inline void Pause();                      /**/
103   inline void prepare_a0b0(unsigned short,unsigned short);      /**/
104   inline void rix_90_pro(unsigned short);             /**/
105   inline void rix_A0_pro(unsigned short,unsigned short);        /**/
106   inline void rix_B0_pro(unsigned short,unsigned short);        /**/
107   inline void rix_C0_pro(unsigned short,unsigned short);        /**/
108   inline void rix_get_ins();                /**/
109   inline unsigned short rix_proc();                   /**/
110   inline void set_new_int();
111   inline void switch_ad_bd(unsigned short);           /**/
112 };