|
|
| version 1.1, 2004/08/01 05:31:31 | version 1.8, 2005/02/07 16:56:33 |
|---|---|
| Line 1 | Line 1 |
| #include "compiler.h" | #include "compiler.h" |
| #if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM) | |
| #ifndef PALMOS | |
| #include <math.h> | #include <math.h> |
| #endif | |
| #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 22 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 125 void opmgen_initialize(UINT rate) { | Line 123 void opmgen_initialize(UINT rate) { |
| detune2table[3] = D2(3.0); | detune2table[3] = D2(3.0); |
| } | } |
| void opmgen_setvol(UINT vol) { | |
| opmcfg.fmvol = vol; | |
| } | |
| // ---- | // ---- |
| Line 182 static void set_algorithm(OPMCH *ch, REG | Line 185 static void set_algorithm(OPMCH *ch, REG |
| ch->feedback = 0; | ch->feedback = 0; |
| } | } |
| switch(value & 0xc0) { | switch((value >> 6) & 3) { |
| case 0x40: | case 0: |
| outd = &opmgen.feedback4; | |
| break; | |
| case 1: | |
| outd = &opmgen.outdl; | outd = &opmgen.outdl; |
| break; | break; |
| case 0x80: | case 2: |
| outd = &opmgen.outdr; | outd = &opmgen.outdr; |
| break; | break; |
| default: | case 3: |
| outd = &opmgen.outdc; | outd = &opmgen.outdc; |
| break; | break; |
| } | } |
| Line 353 void opmgen_reset(void) { | Line 360 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 387 void opmgen_setreg(REG8 reg, REG8 value) | Line 391 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]; |
| Line 480 void opmgen_setreg(REG8 reg, REG8 value) | Line 477 void opmgen_setreg(REG8 reg, REG8 value) |
| } | } |
| } | } |
| #endif | |