|
|
| version 1.1, 2004/08/01 05:31:31 | version 1.4, 2004/08/10 09:06:57 |
|---|---|
| Line 2 | Line 2 |
| #include <math.h> | #include <math.h> |
| #include "sound.h" | #include "sound.h" |
| #include "sndctrl.h" | #include "sndctrl.h" |
| #include "juliet.h" | |
| #include "x1f.h" | |
| extern int s_cnt; | |
| extern DWORD basedclk; | |
| #define OPM_ARRATE 399128L | #define OPM_ARRATE 399128L |
| Line 23 extern DWORD basedclk; | Line 17 extern DWORD basedclk; |
| OPMCFG opmcfg; | OPMCFG opmcfg; |
| UINT8 fmop[256]; | |
| static SINT32 detunetable[8][32]; | static SINT32 detunetable[8][32]; |
| static SINT32 attacktable[94]; | static SINT32 attacktable[94]; |
| static SINT32 decaytable[94]; | static SINT32 decaytable[94]; |
| Line 353 void opmgen_reset(void) { | Line 346 void opmgen_reset(void) { |
| OPMSLOT *slot; | OPMSLOT *slot; |
| UINT j; | UINT j; |
| juliet_YM2151Reset(); | |
| juliet_YMF288Reset(); | |
| opmgen.mode = 0; | opmgen.mode = 0; |
| ch = opmch; | ch = opmch; |
| for(i=0; i<OPMCH_MAX; i++) { | for(i=0; i<OPMCH_MAX; i++) { |
| Line 376 void opmgen_reset(void) { | Line 366 void opmgen_reset(void) { |
| ch++; | ch++; |
| } | } |
| for (i=0x20; i<0x100; i++) { | for (i=0x20; i<0x100; i++) { |
| opmgen_setreg((REG8)i, 0); | opmgen_setreg((REG8)i, 0xff); |
| } | } |
| } | } |
| Line 387 void opmgen_setreg(REG8 reg, REG8 value) | Line 377 void opmgen_setreg(REG8 reg, REG8 value) |
| OPMCH *ch; | OPMCH *ch; |
| OPMSLOT *slot; | OPMSLOT *slot; |
| fmop[reg] = value; | sound_sync(); |
| x1f_opm(reg, value); | |
| if (romeo_exist) { | |
| juliet2_YM2151W(reg, value, (basedclk * s_cnt / 1600)); | |
| return; | |
| } | |
| c = reg & 7; | c = reg & 7; |
| ch = opmch + c; | ch = opmch + c; |
| slot = ch->slot + fmslot[(reg >> 3) & 3]; | slot = ch->slot + fmslot[(reg >> 3) & 3]; |