|
@@ -19,8 +19,10 @@
|
|
* rix.cpp - Softstar RIX OPL Format Player by palxex <palxex.ys168.com>
|
|
* rix.cpp - Softstar RIX OPL Format Player by palxex <palxex.ys168.com>
|
|
* BSPAL <BSPAL.ys168.com>
|
|
* BSPAL <BSPAL.ys168.com>
|
|
*/
|
|
*/
|
|
|
|
+#include "common.h"
|
|
|
|
|
|
#include <cstring>
|
|
#include <cstring>
|
|
|
|
+#include <cstdio>
|
|
#include <cstdlib>
|
|
#include <cstdlib>
|
|
#include "rix.h"
|
|
#include "rix.h"
|
|
|
|
|
|
@@ -37,9 +39,17 @@ using namespace std;
|
|
defined(__sparc__)
|
|
defined(__sparc__)
|
|
// big endian
|
|
// big endian
|
|
#define RIX_SWAP32(a) (((a) << 24) | (((a) << 8) & 0x00FF0000) | (((a) >> 8) & 0x0000FF00) | ((a) >> 24))
|
|
#define RIX_SWAP32(a) (((a) << 24) | (((a) << 8) & 0x00FF0000) | (((a) >> 8) & 0x0000FF00) | ((a) >> 24))
|
|
|
|
+ #define RIX_SWAP16(a) ((((a) << 8) & 0xFF00) | ((a) >> 8))
|
|
#else
|
|
#else
|
|
// little endian
|
|
// little endian
|
|
#define RIX_SWAP32(a) (a)
|
|
#define RIX_SWAP32(a) (a)
|
|
|
|
+ #define RIX_SWAP16(a) (a)
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
+#ifdef DEBUG
|
|
|
|
+#define RELEASE_INLINE
|
|
|
|
+#else
|
|
|
|
+#define RELEASE_INLINE inline
|
|
#endif
|
|
#endif
|
|
|
|
|
|
const uint8_t CrixPlayer::adflag[] = {0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1};
|
|
const uint8_t CrixPlayer::adflag[] = {0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1};
|
|
@@ -73,7 +83,7 @@ CPlayer *CrixPlayer::factory(Copl *newopl)
|
|
}
|
|
}
|
|
|
|
|
|
CrixPlayer::CrixPlayer(Copl *newopl)
|
|
CrixPlayer::CrixPlayer(Copl *newopl)
|
|
- : CPlayer(newopl), flag_mkf(0), file_buffer(0), rix_buf(0)
|
|
|
|
|
|
+ : CPlayer(newopl), flag_mkf(0), fp(NULL)
|
|
#if USE_RIX_EXTRA_INIT
|
|
#if USE_RIX_EXTRA_INIT
|
|
, extra_regs(NULL), extra_vals(NULL), extra_length(0)
|
|
, extra_regs(NULL), extra_vals(NULL), extra_length(0)
|
|
#endif
|
|
#endif
|
|
@@ -82,8 +92,7 @@ CrixPlayer::CrixPlayer(Copl *newopl)
|
|
|
|
|
|
CrixPlayer::~CrixPlayer()
|
|
CrixPlayer::~CrixPlayer()
|
|
{
|
|
{
|
|
- if(file_buffer)
|
|
|
|
- delete [] file_buffer;
|
|
|
|
|
|
+ fclose(fp);
|
|
#if USE_RIX_EXTRA_INIT
|
|
#if USE_RIX_EXTRA_INIT
|
|
if (extra_regs) delete[] extra_regs;
|
|
if (extra_regs) delete[] extra_regs;
|
|
if (extra_vals) delete[] extra_vals;
|
|
if (extra_vals) delete[] extra_vals;
|
|
@@ -112,27 +121,36 @@ void CrixPlayer::set_extra_init(uint32_t* regs, uint8_t* datas, int n)
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-bool CrixPlayer::load(const std::string &filename, const CFileProvider &fp)
|
|
|
|
|
|
+bool CrixPlayer::load(const std::string &filename, const CFileProvider &cfp)
|
|
{
|
|
{
|
|
- binistream *f = fp.open(filename); if(!f) return false;
|
|
|
|
- uint32_t i=0;
|
|
|
|
|
|
+ fp = fopen(filename.c_str(),"rb"); if(!fp) return false;
|
|
|
|
|
|
if(stricmp(filename.substr(filename.length()-4,4).c_str(),".mkf")==0)
|
|
if(stricmp(filename.substr(filename.length()-4,4).c_str(),".mkf")==0)
|
|
{
|
|
{
|
|
flag_mkf=1;
|
|
flag_mkf=1;
|
|
- f->seek(0);
|
|
|
|
- int offset=f->readInt(4);
|
|
|
|
- f->seek(offset);
|
|
|
|
|
|
+ fseek(fp,0,SEEK_SET);
|
|
|
|
+ int offset;
|
|
|
|
+ fread(&offset,4,1,fp);
|
|
|
|
+ fseek(fp,RIX_SWAP32(offset),SEEK_SET);
|
|
}
|
|
}
|
|
- if(f->readInt(2)!=0x55aa){ fp.close(f);return false; }
|
|
|
|
- file_buffer = new uint8_t [fp.filesize(f) + 1];
|
|
|
|
- f->seek(0);
|
|
|
|
- while(!f->eof())
|
|
|
|
- file_buffer[i++]=f->readInt(1);
|
|
|
|
- length=i;
|
|
|
|
- fp.close(f);
|
|
|
|
- if(!flag_mkf)
|
|
|
|
- rix_buf=file_buffer;
|
|
|
|
|
|
+ uint16_t signature;
|
|
|
|
+ fread(&signature,2,1,fp);
|
|
|
|
+ if(RIX_SWAP16(signature)!=0x55aa){ fclose(fp);return false; }
|
|
|
|
+ if(!flag_mkf)
|
|
|
|
+ {
|
|
|
|
+ fseek(fp,0,SEEK_END);
|
|
|
|
+ length = (uint32_t)ftell(fp);
|
|
|
|
+ fseek(fp,0,SEEK_SET);
|
|
|
|
+ fread(rix_buf,length,1,fp);
|
|
|
|
+ subsongs = 1;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ fseek(fp,0,SEEK_SET);
|
|
|
|
+ fread(&subsongs,4,1,fp);
|
|
|
|
+ subsongs = RIX_SWAP32(subsongs);
|
|
|
|
+ subsongs/=4;
|
|
|
|
+ }
|
|
rewind(0);
|
|
rewind(0);
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
@@ -142,8 +160,11 @@ bool CrixPlayer::update()
|
|
int_08h_entry();
|
|
int_08h_entry();
|
|
return !play_end;
|
|
return !play_end;
|
|
}
|
|
}
|
|
-
|
|
|
|
-void CrixPlayer::rewind(int subsong, bool reinit)
|
|
|
|
|
|
+void CrixPlayer::rewind(int subsong)
|
|
|
|
+{
|
|
|
|
+ rewindReInit(subsong, true);
|
|
|
|
+}
|
|
|
|
+void CrixPlayer::rewindReInit(int subsong, bool reinit)
|
|
{
|
|
{
|
|
play_end = 0;
|
|
play_end = 0;
|
|
pos = 0;
|
|
pos = 0;
|
|
@@ -176,11 +197,16 @@ void CrixPlayer::rewind(int subsong, bool reinit)
|
|
|
|
|
|
if (flag_mkf)
|
|
if (flag_mkf)
|
|
{
|
|
{
|
|
- uint32_t *buf_index = (uint32_t *)file_buffer;
|
|
|
|
- int offset1 = RIX_SWAP32(buf_index[subsong]), offset2;
|
|
|
|
- while ((offset2 = RIX_SWAP32(buf_index[++subsong])) == offset1);
|
|
|
|
- length = offset2 - offset1 + 1;
|
|
|
|
- rix_buf = file_buffer + offset1;
|
|
|
|
|
|
+ int index,index2;
|
|
|
|
+ fseek(fp,subsong*4,SEEK_SET);
|
|
|
|
+ fread(&index,4,1,fp);
|
|
|
|
+ fread(&index2,4,1,fp);
|
|
|
|
+ index = RIX_SWAP32(index);
|
|
|
|
+ index2 = RIX_SWAP32(index2);
|
|
|
|
+ length = index2 - index;
|
|
|
|
+ fseek(fp,index,SEEK_SET);
|
|
|
|
+ memset(rix_buf, 0, sizeof(rix_buf));
|
|
|
|
+ fread(rix_buf,length,1,fp);
|
|
}
|
|
}
|
|
|
|
|
|
if (reinit)
|
|
if (reinit)
|
|
@@ -194,17 +220,7 @@ void CrixPlayer::rewind(int subsong, bool reinit)
|
|
|
|
|
|
unsigned int CrixPlayer::getsubsongs()
|
|
unsigned int CrixPlayer::getsubsongs()
|
|
{
|
|
{
|
|
- if(flag_mkf)
|
|
|
|
- {
|
|
|
|
- uint32_t *buf_index=(uint32_t *)file_buffer;
|
|
|
|
- int songs=RIX_SWAP32(buf_index[0])/4,i=0;
|
|
|
|
- for(i=0;i<songs;i++)
|
|
|
|
- if(buf_index[i+1]==buf_index[i])
|
|
|
|
- songs--;
|
|
|
|
- return songs;
|
|
|
|
- }
|
|
|
|
- else
|
|
|
|
- return 1;
|
|
|
|
|
|
+ return subsongs;
|
|
}
|
|
}
|
|
|
|
|
|
float CrixPlayer::getrefresh()
|
|
float CrixPlayer::getrefresh()
|
|
@@ -213,13 +229,13 @@ float CrixPlayer::getrefresh()
|
|
}
|
|
}
|
|
|
|
|
|
/*------------------Implemention----------------------------*/
|
|
/*------------------Implemention----------------------------*/
|
|
-inline void CrixPlayer::set_new_int()
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::set_new_int()
|
|
{
|
|
{
|
|
// if(!ad_initial()) exit(1);
|
|
// if(!ad_initial()) exit(1);
|
|
ad_initial();
|
|
ad_initial();
|
|
}
|
|
}
|
|
/*----------------------------------------------------------*/
|
|
/*----------------------------------------------------------*/
|
|
-inline void CrixPlayer::Pause()
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::Pause()
|
|
{
|
|
{
|
|
uint16_t i;
|
|
uint16_t i;
|
|
pause_flag = 1;
|
|
pause_flag = 1;
|
|
@@ -227,13 +243,13 @@ inline void CrixPlayer::Pause()
|
|
switch_ad_bd(i);
|
|
switch_ad_bd(i);
|
|
}
|
|
}
|
|
/*----------------------------------------------------------*/
|
|
/*----------------------------------------------------------*/
|
|
-inline void CrixPlayer::ad_a0b0l_reg_(uint16_t index,uint16_t p2,uint16_t p3)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::ad_a0b0l_reg_(uint16_t index,uint16_t p2,uint16_t p3)
|
|
{
|
|
{
|
|
// uint16_t i = p2+a0b0_data2[index];
|
|
// uint16_t i = p2+a0b0_data2[index];
|
|
a0b0_data4[index] = p3;
|
|
a0b0_data4[index] = p3;
|
|
a0b0_data3[index] = p2;
|
|
a0b0_data3[index] = p2;
|
|
}
|
|
}
|
|
-inline void CrixPlayer::data_initial()
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::data_initial()
|
|
{
|
|
{
|
|
rhythm = rix_buf[2];
|
|
rhythm = rix_buf[2];
|
|
mus_block = (rix_buf[0x0D]<<8)+rix_buf[0x0C];
|
|
mus_block = (rix_buf[0x0D]<<8)+rix_buf[0x0C];
|
|
@@ -266,7 +282,7 @@ inline void CrixPlayer::data_initial()
|
|
band = 0; music_on = 1;
|
|
band = 0; music_on = 1;
|
|
}
|
|
}
|
|
/*----------------------------------------------------------*/
|
|
/*----------------------------------------------------------*/
|
|
-inline uint16_t CrixPlayer::ad_initial()
|
|
|
|
|
|
+RELEASE_INLINE uint16_t CrixPlayer::ad_initial()
|
|
{
|
|
{
|
|
uint16_t i,j,k = 0;
|
|
uint16_t i,j,k = 0;
|
|
for(i=0;i<25;i++)
|
|
for(i=0;i<25;i++)
|
|
@@ -295,14 +311,14 @@ inline uint16_t CrixPlayer::ad_initial()
|
|
return 1;//ad_test();
|
|
return 1;//ad_test();
|
|
}
|
|
}
|
|
/*----------------------------------------------------------*/
|
|
/*----------------------------------------------------------*/
|
|
-inline void CrixPlayer::ad_bop(uint16_t reg,uint16_t value)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::ad_bop(uint16_t reg,uint16_t value)
|
|
{
|
|
{
|
|
//if(reg == 2 || reg == 3)
|
|
//if(reg == 2 || reg == 3)
|
|
// AdPlug_LogWrite("switch OPL2/3 mode!\n");
|
|
// AdPlug_LogWrite("switch OPL2/3 mode!\n");
|
|
opl->write(reg & 0xff, value & 0xff);
|
|
opl->write(reg & 0xff, value & 0xff);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::int_08h_entry()
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::int_08h_entry()
|
|
{
|
|
{
|
|
uint16_t band_sus = 1;
|
|
uint16_t band_sus = 1;
|
|
while(band_sus)
|
|
while(band_sus)
|
|
@@ -325,7 +341,7 @@ inline void CrixPlayer::int_08h_entry()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline uint16_t CrixPlayer::rix_proc()
|
|
|
|
|
|
+RELEASE_INLINE uint16_t CrixPlayer::rix_proc()
|
|
{
|
|
{
|
|
uint8_t ctrl = 0;
|
|
uint8_t ctrl = 0;
|
|
if(music_on == 0||pause_flag == 1) return 0;
|
|
if(music_on == 0||pause_flag == 1) return 0;
|
|
@@ -352,7 +368,7 @@ inline uint16_t CrixPlayer::rix_proc()
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::rix_get_ins()
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::rix_get_ins()
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
uint8_t *baddr = (&rix_buf[ins_block])+(band_low<<6);
|
|
uint8_t *baddr = (&rix_buf[ins_block])+(band_low<<6);
|
|
@@ -361,7 +377,7 @@ inline void CrixPlayer::rix_get_ins()
|
|
insbuf[i] = (baddr[i * 2 + 1] << 8) + baddr[i * 2];
|
|
insbuf[i] = (baddr[i * 2 + 1] << 8) + baddr[i * 2];
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::rix_90_pro(uint16_t ctrl_l)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::rix_90_pro(uint16_t ctrl_l)
|
|
{
|
|
{
|
|
if(rhythm == 0 || ctrl_l < 6)
|
|
if(rhythm == 0 || ctrl_l < 6)
|
|
{
|
|
{
|
|
@@ -382,7 +398,7 @@ inline void CrixPlayer::rix_90_pro(uint16_t ctrl_l)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::rix_A0_pro(uint16_t ctrl_l,uint16_t index)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::rix_A0_pro(uint16_t ctrl_l,uint16_t index)
|
|
{
|
|
{
|
|
if(rhythm == 0 || ctrl_l <= 6)
|
|
if(rhythm == 0 || ctrl_l <= 6)
|
|
{
|
|
{
|
|
@@ -392,7 +408,7 @@ inline void CrixPlayer::rix_A0_pro(uint16_t ctrl_l,uint16_t index)
|
|
else return;
|
|
else return;
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::prepare_a0b0(uint16_t index,uint16_t v) /* important !*/
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::prepare_a0b0(uint16_t index,uint16_t v) /* important !*/
|
|
{
|
|
{
|
|
short high = 0,low = 0; uint32_t res;
|
|
short high = 0,low = 0; uint32_t res;
|
|
int res1 = (v-0x2000)*0x19;
|
|
int res1 = (v-0x2000)*0x19;
|
|
@@ -422,7 +438,7 @@ inline void CrixPlayer::prepare_a0b0(uint16_t index,uint16_t v) /* important !*
|
|
displace[index] = low;
|
|
displace[index] = low;
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::ad_a0b0l_reg(uint16_t index,uint16_t p2,uint16_t p3)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::ad_a0b0l_reg(uint16_t index,uint16_t p2,uint16_t p3)
|
|
{
|
|
{
|
|
uint16_t data; uint16_t i = p2+a0b0_data2[index];
|
|
uint16_t data; uint16_t i = p2+a0b0_data2[index];
|
|
a0b0_data4[index] = p3;
|
|
a0b0_data4[index] = p3;
|
|
@@ -435,7 +451,7 @@ inline void CrixPlayer::ad_a0b0l_reg(uint16_t index,uint16_t p2,uint16_t p3)
|
|
ad_bop(0xB0+index,data);
|
|
ad_bop(0xB0+index,data);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::rix_B0_pro(uint16_t ctrl_l,uint16_t index)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::rix_B0_pro(uint16_t ctrl_l,uint16_t index)
|
|
{
|
|
{
|
|
int temp = 0;
|
|
int temp = 0;
|
|
if(rhythm == 0 || ctrl_l < 6) temp = modify[ctrl_l*2+1];
|
|
if(rhythm == 0 || ctrl_l < 6) temp = modify[ctrl_l*2+1];
|
|
@@ -448,7 +464,7 @@ inline void CrixPlayer::rix_B0_pro(uint16_t ctrl_l,uint16_t index)
|
|
ad_40_reg(temp);
|
|
ad_40_reg(temp);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::rix_C0_pro(uint16_t ctrl_l,uint16_t index)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::rix_C0_pro(uint16_t ctrl_l,uint16_t index)
|
|
{
|
|
{
|
|
uint16_t i = index>=12?index-12:0;
|
|
uint16_t i = index>=12?index-12:0;
|
|
if(ctrl_l < 6 || rhythm == 0)
|
|
if(ctrl_l < 6 || rhythm == 0)
|
|
@@ -473,7 +489,7 @@ inline void CrixPlayer::rix_C0_pro(uint16_t ctrl_l,uint16_t index)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::switch_ad_bd(uint16_t index)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::switch_ad_bd(uint16_t index)
|
|
{
|
|
{
|
|
|
|
|
|
if(rhythm == 0 || index < 6) ad_a0b0l_reg(index,a0b0_data3[index],0);
|
|
if(rhythm == 0 || index < 6) ad_a0b0l_reg(index,a0b0_data3[index],0);
|
|
@@ -484,7 +500,7 @@ inline void CrixPlayer::switch_ad_bd(uint16_t index)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::ins_to_reg(uint16_t index,uint16_t* insb,uint16_t value)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::ins_to_reg(uint16_t index,uint16_t* insb,uint16_t value)
|
|
{
|
|
{
|
|
uint16_t i;
|
|
uint16_t i;
|
|
for(i=0;i<13;i++) reg_bufs[index].v[i] = insb[i];
|
|
for(i=0;i<13;i++) reg_bufs[index].v[i] = insb[i];
|
|
@@ -494,13 +510,13 @@ inline void CrixPlayer::ins_to_reg(uint16_t index,uint16_t* insb,uint16_t value)
|
|
ad_80_reg(index),ad_20_reg(index),ad_E0_reg(index);
|
|
ad_80_reg(index),ad_20_reg(index),ad_E0_reg(index);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::ad_E0_reg(uint16_t index)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::ad_E0_reg(uint16_t index)
|
|
{
|
|
{
|
|
uint16_t data = e0_reg_flag == 0?0:(reg_bufs[index].v[13]&3);
|
|
uint16_t data = e0_reg_flag == 0?0:(reg_bufs[index].v[13]&3);
|
|
ad_bop(0xE0+reg_data[index],data);
|
|
ad_bop(0xE0+reg_data[index],data);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::ad_20_reg(uint16_t index)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::ad_20_reg(uint16_t index)
|
|
{
|
|
{
|
|
uint16_t data = (reg_bufs[index].v[9] < 1?0:0x80);
|
|
uint16_t data = (reg_bufs[index].v[9] < 1?0:0x80);
|
|
data += (reg_bufs[index].v[10] < 1?0:0x40);
|
|
data += (reg_bufs[index].v[10] < 1?0:0x40);
|
|
@@ -510,21 +526,21 @@ inline void CrixPlayer::ad_20_reg(uint16_t index)
|
|
ad_bop(0x20+reg_data[index],data);
|
|
ad_bop(0x20+reg_data[index],data);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::ad_80_reg(uint16_t index)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::ad_80_reg(uint16_t index)
|
|
{
|
|
{
|
|
uint16_t data = (reg_bufs[index].v[7]&0x0F),temp = reg_bufs[index].v[4];
|
|
uint16_t data = (reg_bufs[index].v[7]&0x0F),temp = reg_bufs[index].v[4];
|
|
data |= (temp << 4);
|
|
data |= (temp << 4);
|
|
ad_bop(0x80+reg_data[index],data);
|
|
ad_bop(0x80+reg_data[index],data);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::ad_60_reg(uint16_t index)
|
|
|
|
|
|
+void CrixPlayer::ad_60_reg(uint16_t index)
|
|
{
|
|
{
|
|
uint16_t data = reg_bufs[index].v[6]&0x0F,temp = reg_bufs[index].v[3];
|
|
uint16_t data = reg_bufs[index].v[6]&0x0F,temp = reg_bufs[index].v[3];
|
|
data |= (temp << 4);
|
|
data |= (temp << 4);
|
|
ad_bop(0x60+reg_data[index],data);
|
|
ad_bop(0x60+reg_data[index],data);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::ad_C0_reg(uint16_t index)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::ad_C0_reg(uint16_t index)
|
|
{
|
|
{
|
|
uint16_t data = reg_bufs[index].v[2];
|
|
uint16_t data = reg_bufs[index].v[2];
|
|
if(adflag[index] == 1) return;
|
|
if(adflag[index] == 1) return;
|
|
@@ -533,7 +549,7 @@ inline void CrixPlayer::ad_C0_reg(uint16_t index)
|
|
ad_bop(0xC0+ad_C0_offs[index],data);
|
|
ad_bop(0xC0+ad_C0_offs[index],data);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::ad_40_reg(uint16_t index)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::ad_40_reg(uint16_t index)
|
|
{
|
|
{
|
|
uint32_t res = 0;
|
|
uint32_t res = 0;
|
|
uint16_t data = 0,temp = reg_bufs[index].v[0];
|
|
uint16_t data = 0,temp = reg_bufs[index].v[0];
|
|
@@ -549,20 +565,20 @@ inline void CrixPlayer::ad_40_reg(uint16_t index)
|
|
ad_bop(0x40+reg_data[index],data);
|
|
ad_bop(0x40+reg_data[index],data);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::ad_bd_reg()
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::ad_bd_reg()
|
|
{
|
|
{
|
|
uint16_t data = rhythm < 1? 0:0x20;
|
|
uint16_t data = rhythm < 1? 0:0x20;
|
|
data |= bd_modify;
|
|
data |= bd_modify;
|
|
ad_bop(0xBD,data);
|
|
ad_bop(0xBD,data);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::ad_a0b0_reg(uint16_t index)
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::ad_a0b0_reg(uint16_t index)
|
|
{
|
|
{
|
|
ad_bop(0xA0+index,0);
|
|
ad_bop(0xA0+index,0);
|
|
ad_bop(0xB0+index,0);
|
|
ad_bop(0xB0+index,0);
|
|
}
|
|
}
|
|
/*--------------------------------------------------------------*/
|
|
/*--------------------------------------------------------------*/
|
|
-inline void CrixPlayer::music_ctrl()
|
|
|
|
|
|
+RELEASE_INLINE void CrixPlayer::music_ctrl()
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
for(i=0;i<11;i++)
|
|
for(i=0;i<11;i++)
|