Mercurial > audlegacy
annotate Plugins/Input/adplug/core/rix.cpp @ 637:2b06eb5e472d trunk
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
| author | chainsaw |
|---|---|
| date | Sat, 18 Feb 2006 08:23:30 -0800 |
| parents | 0a73d1faeb4e |
| children | 1cd8716972df |
| rev | line source |
|---|---|
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
1 /* |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
2 * Adplug - Replayer for many OPL2/OPL3 audio file formats. |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
3 * Copyright (C) 1999 - 2006 Simon Peter, <dn.tlp@gmx.net>, et al. |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
4 * |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
5 * This library is free software; you can redistribute it and/or |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
6 * modify it under the terms of the GNU Lesser General Public |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
7 * License as published by the Free Software Foundation; either |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
8 * version 2.1 of the License, or (at your option) any later version. |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
9 * |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
10 * This library is distributed in the hope that it will be useful, |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
13 * Lesser General Public License for more details. |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
14 * |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
15 * You should have received a copy of the GNU Lesser General Public |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
16 * License along with this library; if not, write to the Free Software |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
18 * |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
19 * rix.c - Dayu OPL Format Player by palxex <palxex@163.com/palxex.ys168.com> |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
20 */ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
21 |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
22 #include "rix.h" |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
23 #include <binfile.h> |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
24 |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
25 const unsigned char CrixPlayer::adflag[] = {0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1}; |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
26 const unsigned char CrixPlayer::reg_data[] = {0,1,2,3,4,5,8,9,10,11,12,13,16,17,18,19,20,21}; |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
27 const unsigned char CrixPlayer::ad_C0_offs[] = {0,1,2,0,1,2,3,4,5,3,4,5,6,7,8,6,7,8}; |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
28 const unsigned char CrixPlayer::modify[] = {0,3,1,4,2,5,6,9,7,10,8,11,12,15,13,16,14,17,12,\ |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
29 15,16,0,14,0,17,0,13,0}; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
30 const unsigned char CrixPlayer::bd_reg_data[] = { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
31 0x00,0x00,0x00,0x00,0x00,0x00,0x10,0x08,0x04,0x02,0x01, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
32 0x00,0x01,0x01,0x03,0x0F,0x05,0x00,0x01,0x03,0x0F,0x00, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
33 0x00,0x00,0x01,0x00,0x00,0x01,0x01,0x0F,0x07,0x00,0x02, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
34 0x04,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x0A, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
35 0x04,0x00,0x08,0x0C,0x0B,0x00,0x00,0x00,0x01,0x00,0x00, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
36 0x00,0x00,0x0D,0x04,0x00,0x06,0x0F,0x00,0x00,0x00,0x00, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
37 0x01,0x00,0x00,0x0C,0x00,0x0F,0x0B,0x00,0x08,0x05,0x00, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
38 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x0F,0x0B,0x00, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
39 0x07,0x05,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x00, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
40 0x0F,0x0B,0x00,0x05,0x05,0x00,0x00,0x00,0x00,0x00,0x00, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
41 0x00,0x01,0x00,0x0F,0x0B,0x00,0x07,0x05,0x00,0x00,0x00, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
42 0x00,0x00,0x00}; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
43 unsigned char CrixPlayer::for40reg[] = {0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
44 0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F,0x7F}; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
45 unsigned short CrixPlayer::mus_time = 0x4268; |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
46 |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
47 /*** public methods *************************************/ |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
48 |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
49 CPlayer *CrixPlayer::factory(Copl *newopl) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
50 { |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
51 return new CrixPlayer(newopl); |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
52 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
53 |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
54 CrixPlayer::CrixPlayer(Copl *newopl) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
55 : CPlayer(newopl),I(0),T(0),mus_block(0),ins_block(0),rhythm(0),mutex(0), |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
56 music_on(0),pause_flag(0),band(0),band_low(0),e0_reg_flag(0),bd_modify(0), |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
57 sustain(0),dro_end(0), mstotal(0), opl3_mode(0) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
58 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
59 memset(dro, 0, 64000); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
60 memset(buf_addr, 0, 655360); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
61 memset(buffer, 0, sizeof(unsigned short) * 300); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
62 memset(a0b0_data2, 0, sizeof(unsigned short) * 11); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
63 memset(a0b0_data3, 0, 18); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
64 memset(a0b0_data4, 0, 18); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
65 memset(a0b0_data5, 0, 96); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
66 memset(addrs_head, 0, 96); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
67 memset(insbuf, 0, 28 * sizeof(unsigned short)); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
68 memset(displace, 0, 11 * sizeof(unsigned short)); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
69 memset(reg_bufs, 0, 18 * sizeof(ADDT)); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
70 memset(for40reg, 0, 18); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
71 |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
72 if(opl->gettype() == Copl::TYPE_OPL2) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
73 opl3_mode = 0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
74 else |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
75 opl3_mode = 1; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
76 }; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
77 |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
78 bool CrixPlayer::load(const std::string &filename, const CFileProvider &fp) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
79 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
80 binistream *f = fp.open(filename); if(!f) return false; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
81 unsigned long i=0; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
82 |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
83 if(f->readInt(2)!=0x55aa) {fp.close(f);return false; } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
84 buf_addr[i++]=0xaa;buf_addr[i++]=0x55; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
85 while(!f->eof()) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
86 buf_addr[i++]=f->readInt(1); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
87 length=i; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
88 fp.close(f); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
89 set_new_int(); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
90 data_initial(); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
91 while(!dro_end) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
92 int_08h_entry(); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
93 |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
94 length=T; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
95 mode = (OplMode)1; // Type of opl data this can contain |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
96 |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
97 // binofstream *g=new binofstream(filename+string(".dro")); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
98 // g->writeString("DBRAWOPL",8); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
99 // g->writeInt(mstotal,4); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
100 // g->writeInt(length+1,4); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
101 // g->writeInt(1,1); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
102 // for(int t=0;t<length;t++) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
103 // g->writeInt(dro[t],1); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
104 // g->close(); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
105 // delete g; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
106 |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
107 rewind(0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
108 return true; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
109 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
110 |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
111 bool CrixPlayer::update() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
112 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
113 if (delay>500) { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
114 delay-=500; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
115 return true; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
116 } else delay=1; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
117 while (pos < length) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
118 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
119 unsigned char cmd = dro[pos++]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
120 switch(cmd) { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
121 case 0: |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
122 delay = 1 + dro[pos++]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
123 return true; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
124 case 1: |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
125 delay = 1 + dro[pos] + (dro[pos+1]<<8); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
126 pos+=2; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
127 return true; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
128 case 2: |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
129 index = 0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
130 opl->setchip(0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
131 break; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
132 case 3: |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
133 index = 1; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
134 opl->setchip(1); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
135 break; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
136 default: |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
137 if(index == 0 || opl3_mode) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
138 opl->write(cmd,dro[pos++]); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
139 break; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
140 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
141 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
142 return pos<length; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
143 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
144 |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
145 void CrixPlayer::rewind(int subsong) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
146 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
147 delay=1; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
148 pos = index = 0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
149 opl->init(); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
150 opl->write(1,32); // go to OPL2 mode |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
151 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
152 |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
153 float CrixPlayer::getrefresh() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
154 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
155 if (delay > 500) return 1000 / 500; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
156 else return 1000 / (double)delay; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
157 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
158 |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
159 /*------------------Implemention----------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
160 inline void CrixPlayer::set_new_int() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
161 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
162 if(!ad_initial()) exit(1); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
163 prep_int(); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
164 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
165 /*----------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
166 inline void CrixPlayer::Pause() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
167 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
168 register unsigned short i; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
169 pause_flag = 1; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
170 for(i=0;i<11;i++) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
171 switch_ad_bd(i); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
172 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
173 /*----------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
174 inline void CrixPlayer::ad_a0b0l_reg_(unsigned short index,unsigned short p2,unsigned short p3) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
175 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
176 // unsigned short i = p2+a0b0_data2[index]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
177 a0b0_data4[index] = p3; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
178 a0b0_data3[index] = p2; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
179 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
180 inline void CrixPlayer::data_initial() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
181 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
182 rhythm = buf_addr[2]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
183 mus_block = (buf_addr[0x0D]<<8)+buf_addr[0x0C]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
184 ins_block = (buf_addr[0x09]<<8)+buf_addr[0x08]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
185 I = mus_block+1; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
186 if(rhythm != 0) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
187 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
188 // ad_a0b0_reg(6); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
189 // ad_a0b0_reg(7); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
190 // ad_a0b0_reg(8); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
191 ad_a0b0l_reg_(8,0x18,0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
192 ad_a0b0l_reg_(7,0x1F,0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
193 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
194 bd_modify = 0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
195 // ad_bd_reg(); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
196 band = 0; music_on = 1; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
197 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
198 /*----------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
199 inline unsigned short CrixPlayer::ad_initial() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
200 { |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
201 register unsigned short i,j,k = 0; |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
202 for(i=0;i<25;i++) crc_trans(i,i*4); |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
203 for(i=0;i<8;i++) |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
204 for(j=0;j<12;j++) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
205 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
206 a0b0_data5[k] = i; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
207 addrs_head[k] = j; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
208 k++; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
209 } |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
210 //ad_bd_reg(); |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
211 //ad_08_reg(); |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
212 //for(i=0;i<9;i++) ad_a0b0_reg(i); |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
213 e0_reg_flag = 0x20; |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
214 //for(i=0;i<18;i++) ad_bop(0xE0+reg_data[i],0); |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
215 //ad_bop(1,e0_reg_flag); |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
216 return 1;//ad_test(); |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
217 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
218 /*----------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
219 inline void CrixPlayer::crc_trans(unsigned short index,unsigned short v) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
220 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
221 register unsigned short i; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
222 unsigned int res; unsigned short low; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
223 res = strm_and_fr(v); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
224 low = res; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
225 buffer[index*12] = (low+4)>>3; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
226 for(i=1;i<=11;i++) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
227 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
228 res = (unsigned int)((double)res * 1.06); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
229 buffer[index*12+i] = res>>3; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
230 } |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
231 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
232 |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
233 /*----------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
234 inline void CrixPlayer::prep_int() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
235 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
236 mutex = 0; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
237 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
238 /*----------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
239 inline void CrixPlayer::ad_bop(unsigned short reg,unsigned short value) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
240 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
241 dro[T++]=reg;dro[T++]=value; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
242 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
243 /*------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
244 inline unsigned short CrixPlayer::ad_test() /* Test the SoundCard */ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
245 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
246 ad_bop(0x04,0x60); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
247 ad_bop(0x04,0x80); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
248 ad_bop(0x02,0xFF); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
249 ad_bop(0x04,0x21); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
250 ad_bop(0x04,0x60); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
251 ad_bop(0x04,0x80); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
252 return 1; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
253 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
254 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
255 inline void CrixPlayer::int_08h_entry() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
256 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
257 unsigned short band_sus = 1; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
258 while(band_sus) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
259 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
260 if(sustain <= 0 && mutex == 0) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
261 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
262 mutex++; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
263 band_sus = rix_proc(); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
264 if(band_sus) sustain += (int)((double)band_sus * 1.06); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
265 mstotal+=sustain; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
266 dro[T++]=(sustain>=0x100?1:0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
267 dro[T++]=sustain&0xff; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
268 if(sustain>=0x100) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
269 dro[T++]=(sustain>>8)&0xff; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
270 mutex--; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
271 if(band_sus == 0) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
272 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
273 dro_end=1; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
274 break; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
275 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
276 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
277 else |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
278 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
279 if(band_sus) sustain -= 14; /* aging */ |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
280 break; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
281 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
282 } |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
283 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
284 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
285 inline unsigned short CrixPlayer::rix_proc() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
286 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
287 unsigned char ctrl = 0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
288 if(music_on == 0||pause_flag == 1) return 0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
289 band = 0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
290 while(buf_addr[I] != 0x80 && I<length-1) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
291 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
292 band_low = buf_addr[I-1]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
293 ctrl = buf_addr[I]; I+=2; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
294 switch(ctrl&0xF0) |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
295 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
296 case 0x90: rix_get_ins(); rix_90_pro(ctrl&0x0F); break; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
297 case 0xA0: rix_A0_pro(ctrl&0x0F,((unsigned short)band_low)<<6); break; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
298 case 0xB0: rix_B0_pro(ctrl&0x0F,band_low); break; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
299 case 0xC0: switch_ad_bd(ctrl&0x0F); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
300 if(band_low != 0) rix_C0_pro(ctrl&0x0F,band_low); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
301 break; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
302 default: band = (ctrl<<8)+band_low; break; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
303 } |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
304 if(band != 0) return band; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
305 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
306 music_ctrl(); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
307 I = mus_block+1; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
308 band = 0; music_on = 1; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
309 return 0; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
310 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
311 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
312 inline void CrixPlayer::rix_get_ins() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
313 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
314 memcpy(insbuf,(&buf_addr[ins_block])+(band_low<<6),56); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
315 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
316 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
317 inline void CrixPlayer::rix_90_pro(unsigned short ctrl_l) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
318 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
319 if(rhythm == 0 || ctrl_l < 6) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
320 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
321 ins_to_reg(modify[ctrl_l*2],insbuf,insbuf[26]); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
322 ins_to_reg(modify[ctrl_l*2+1],insbuf+13,insbuf[27]); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
323 return; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
324 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
325 else |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
326 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
327 if(ctrl_l > 6) |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
328 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
329 ins_to_reg(modify[ctrl_l*2+6],insbuf,insbuf[26]); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
330 return; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
331 } |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
332 else |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
333 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
334 ins_to_reg(12,insbuf,insbuf[26]); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
335 ins_to_reg(15,insbuf+13,insbuf[27]); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
336 return; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
337 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
338 } |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
339 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
340 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
341 inline void CrixPlayer::rix_A0_pro(unsigned short ctrl_l,unsigned short index) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
342 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
343 if(rhythm == 0 || ctrl_l <= 6) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
344 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
345 prepare_a0b0(ctrl_l,index>0x3FFF?0x3FFF:index); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
346 ad_a0b0l_reg(ctrl_l,a0b0_data3[ctrl_l],a0b0_data4[ctrl_l]); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
347 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
348 else return; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
349 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
350 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
351 inline void CrixPlayer::prepare_a0b0(unsigned short index,unsigned short v) /* important !*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
352 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
353 short high = 0,low = 0; unsigned int res; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
354 low = ((unsigned short)(v-0x2000))*0x19; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
355 high = ((short)v)<0x2000?0xFFFF:0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
356 if(low == 0xFF && high == 0) return; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
357 res = ((((unsigned int)high)<<16)|low)/0x2000; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
358 low = res&0xFFFF; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
359 if(low < 0) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
360 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
361 low = 0x18-low; high = (signed short)low<0?0xFFFF:0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
362 res = high; res<<=16; res+=low; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
363 low = ((signed short)res)/(signed short)0xFFE7; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
364 a0b0_data2[index] = low; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
365 low = res; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
366 res = low - 0x18; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
367 high = (signed short)res%0x19; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
368 low = (signed short)res/0x19; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
369 if(high != 0) {low = 0x19; low = low-high;} |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
370 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
371 else |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
372 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
373 res = high = low; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
374 low = (signed short)res/(signed short)0x19; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
375 a0b0_data2[index] = low; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
376 res = high; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
377 low = (signed short)res%(signed short)0x19; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
378 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
379 low = (signed short)low*(signed short)0x18; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
380 displace[index] = low; |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
381 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
382 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
383 inline void CrixPlayer::ad_a0b0l_reg(unsigned short index,unsigned short p2,unsigned short p3) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
384 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
385 unsigned short data; unsigned short i = p2+a0b0_data2[index]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
386 a0b0_data4[index] = p3; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
387 a0b0_data3[index] = p2; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
388 i = ((signed short)i<=0x5F?i:0x5F); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
389 i = ((signed short)i>=0?i:0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
390 data = buffer[addrs_head[i]+displace[index]/2]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
391 ad_bop(0xA0+index,data); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
392 data = a0b0_data5[i]*4+(p3<1?0:0x20)+((data>>8)&3); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
393 ad_bop(0xB0+index,data); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
394 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
395 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
396 inline void CrixPlayer::rix_B0_pro(unsigned short ctrl_l,unsigned short index) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
397 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
398 register int temp = 0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
399 if(rhythm == 0 || ctrl_l < 6) temp = modify[ctrl_l*2+1]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
400 else |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
401 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
402 temp = ctrl_l > 6?ctrl_l*2:ctrl_l*2+1; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
403 temp = modify[temp+6]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
404 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
405 for40reg[temp] = index>0x7F?0x7F:index; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
406 ad_40_reg(temp); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
407 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
408 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
409 inline void CrixPlayer::rix_C0_pro(unsigned short ctrl_l,unsigned short index) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
410 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
411 register unsigned short i = index>=12?index-12:0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
412 if(ctrl_l < 6 || rhythm == 0) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
413 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
414 ad_a0b0l_reg(ctrl_l,i,1); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
415 return; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
416 } |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
417 else |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
418 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
419 if(ctrl_l != 6) |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
420 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
421 if(ctrl_l == 8) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
422 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
423 ad_a0b0l_reg(ctrl_l,i,0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
424 ad_a0b0l_reg(7,i+7,0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
425 } |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
426 } |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
427 else ad_a0b0l_reg(ctrl_l,i,0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
428 bd_modify |= bd_reg_data[ctrl_l]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
429 ad_bd_reg(); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
430 return; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
431 } |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
432 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
433 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
434 inline void CrixPlayer::switch_ad_bd(unsigned short index) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
435 { |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
436 |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
437 if(rhythm == 0 || index < 6) ad_a0b0l_reg(index,a0b0_data3[index],0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
438 else |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
439 { |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
440 bd_modify &= (~bd_reg_data[index]), |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
441 ad_bd_reg(); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
442 } |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
443 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
444 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
445 inline void CrixPlayer::ins_to_reg(unsigned short index,unsigned short* insb,unsigned short value) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
446 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
447 register unsigned short i; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
448 for(i=0;i<13;i++) reg_bufs[index].v[i] = insb[i]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
449 reg_bufs[index].v[13] = value&3; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
450 ad_bd_reg(),ad_08_reg(), |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
451 ad_40_reg(index),ad_C0_reg(index),ad_60_reg(index), |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
452 ad_80_reg(index),ad_20_reg(index),ad_E0_reg(index); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
453 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
454 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
455 inline void CrixPlayer::ad_E0_reg(unsigned short index) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
456 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
457 unsigned short data = e0_reg_flag == 0?0:(reg_bufs[index].v[13]&3); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
458 ad_bop(0xE0+reg_data[index],data); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
459 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
460 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
461 inline void CrixPlayer::ad_20_reg(unsigned short index) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
462 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
463 unsigned short data = (reg_bufs[index].v[9] < 1?0:0x80); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
464 data += (reg_bufs[index].v[10] < 1?0:0x40); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
465 data += (reg_bufs[index].v[5] < 1?0:0x20); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
466 data += (reg_bufs[index].v[11] < 1?0:0x10); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
467 data += (reg_bufs[index].v[1]&0x0F); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
468 ad_bop(0x20+reg_data[index],data); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
469 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
470 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
471 inline void CrixPlayer::ad_80_reg(unsigned short index) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
472 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
473 unsigned short data = (reg_bufs[index].v[7]&0x0F),temp = reg_bufs[index].v[4]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
474 data |= (temp << 4); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
475 ad_bop(0x80+reg_data[index],data); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
476 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
477 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
478 inline void CrixPlayer::ad_60_reg(unsigned short index) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
479 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
480 unsigned short data = reg_bufs[index].v[6]&0x0F,temp = reg_bufs[index].v[3]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
481 data |= (temp << 4); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
482 ad_bop(0x60+reg_data[index],data); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
483 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
484 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
485 inline void CrixPlayer::ad_C0_reg(unsigned short index) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
486 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
487 unsigned short data = reg_bufs[index].v[2]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
488 if(adflag[index] == 1) return; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
489 data *= 2, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
490 data |= (reg_bufs[index].v[12] < 1?1:0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
491 ad_bop(0xC0+ad_C0_offs[index],data); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
492 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
493 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
494 inline void CrixPlayer::ad_40_reg(unsigned short index) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
495 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
496 unsigned int res = 0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
497 unsigned short data = 0,temp = reg_bufs[index].v[0]; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
498 data = 0x3F - (0x3F & reg_bufs[index].v[8]), |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
499 data *= for40reg[index], |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
500 data *= 2, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
501 data += 0x7F, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
502 res = data; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
503 data = res/0xFE, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
504 data -= 0x3F, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
505 data = -data, |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
506 data |= temp<<6; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
507 ad_bop(0x40+reg_data[index],data); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
508 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
509 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
510 inline void CrixPlayer::ad_bd_reg() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
511 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
512 unsigned short data = rhythm < 1? 0:0x20; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
513 data |= bd_modify; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
514 ad_bop(0xBD,data); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
515 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
516 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
517 inline void CrixPlayer::ad_a0b0_reg(unsigned short index) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
518 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
519 ad_bop(0xA0+index,0); |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
520 ad_bop(0xB0+index,0); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
521 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
522 /*--------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
523 inline void CrixPlayer::music_ctrl() |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
524 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
525 register int i; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
526 music_on = 0; |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
527 for(i=0;i<11;i++) |
|
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
528 switch_ad_bd(i); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
529 } |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
530 /*----------------------------------------------------------------------*/ |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
531 inline unsigned int CrixPlayer::strm_and_fr(unsigned short parm) |
|
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
532 { |
|
637
2b06eb5e472d
[svn] Sync with upstream. Drop hardware OPL2/3 support, it throws warnings and is not used on most modern machines. Added var inits where GCC 4.0 thought it was a good idea.
chainsaw
parents:
625
diff
changeset
|
533 return (int)(((unsigned int)parm*6+10000)*0.27461678223); |
|
428
15ca2ea93a30
[svn] Sync with upstream CVS. This implements RIX playback.
chainsaw
parents:
diff
changeset
|
534 } |
