Diff for /np2/sound/opngenc.c between versions 1.9 and 1.11

version 1.9, 2004/02/03 08:24:40 version 1.11, 2005/05/13 05:47:25
Line 366  static void channleupdate(OPNCH *ch) { Line 366  static void channleupdate(OPNCH *ch) {
   
         int             i;          int             i;
         UINT32  fc = ch->keynote[0];                                            // ver0.27          UINT32  fc = ch->keynote[0];                                            // ver0.27
         BYTE    kc = ch->kcode[0];          UINT8   kc = ch->kcode[0];
         BYTE    evr;          UINT    evr;
         OPNSLOT *slot;          OPNSLOT *slot;
         int             s;          int             s;
   
Line 375  static void channleupdate(OPNCH *ch) { Line 375  static void channleupdate(OPNCH *ch) {
         if (!(ch->extop)) {          if (!(ch->extop)) {
                 for (i=0; i<4; i++, slot++) {                  for (i=0; i<4; i++, slot++) {
                         slot->freq_inc = (fc + slot->detune1[kc]) * slot->multiple;                          slot->freq_inc = (fc + slot->detune1[kc]) * slot->multiple;
                         evr = (BYTE)(kc >> slot->keyscale);                          evr = kc >> slot->keyscale;
                         if (slot->envratio != evr) {                          if (slot->envratio != evr) {
                                 slot->envratio = evr;                                  slot->envratio = evr;
                                 slot->env_inc_attack = slot->attack[evr];                                  slot->env_inc_attack = slot->attack[evr];
Line 390  static void channleupdate(OPNCH *ch) { Line 390  static void channleupdate(OPNCH *ch) {
                         s = extendslot[i];                          s = extendslot[i];
                         slot->freq_inc = (ch->keynote[s] + slot->detune1[ch->kcode[s]])                          slot->freq_inc = (ch->keynote[s] + slot->detune1[ch->kcode[s]])
                                                                                                                 * slot->multiple;                                                                                                                  * slot->multiple;
                         evr = (BYTE)(ch->kcode[s] >> slot->keyscale);                          evr = ch->kcode[s] >> slot->keyscale;
                         if (slot->envratio != evr) {                          if (slot->envratio != evr) {
                                 slot->envratio = evr;                                  slot->envratio = evr;
                                 slot->env_inc_attack = slot->attack[evr];                                  slot->env_inc_attack = slot->attack[evr];
Line 435  void opngen_reset(void) { Line 435  void opngen_reset(void) {
                 ch++;                  ch++;
         }          }
         for (i=0x30; i<0xc0; i++) {          for (i=0x30; i<0xc0; i++) {
                 opngen_setreg(0, (REG8)i, 0xff);                  opngen_setreg(0, i, 0xff);
                 opngen_setreg(3, (REG8)i, 0xff);                  opngen_setreg(3, i, 0xff);
                 opngen_setreg(6, (REG8)i, 0xff);                  opngen_setreg(6, i, 0xff);
                 opngen_setreg(9, (REG8)i, 0xff);                  opngen_setreg(9, i, 0xff);
         }          }
 }  }
   
Line 477  void opngen_setextch(UINT chnum, REG8 da Line 477  void opngen_setextch(UINT chnum, REG8 da
         ch[chnum].extop = data;          ch[chnum].extop = data;
 }  }
   
 void opngen_setreg(REG8 chbase, REG8 reg, REG8 value) {  void opngen_setreg(REG8 chbase, UINT reg, REG8 value) {
   
         UINT    chpos;          UINT    chpos;
         OPNCH   *ch;          OPNCH   *ch;
         OPNSLOT *slot;          OPNSLOT *slot;
         UINT    fn;          UINT    fn;
         BYTE    blk;          UINT8   blk;
   
         chpos = reg & 3;          chpos = reg & 3;
         if (chpos == 3) {          if (chpos == 3) {
Line 558  void opngen_setreg(REG8 chbase, REG8 reg Line 558  void opngen_setreg(REG8 chbase, REG8 reg
                                 break;                                  break;
   
                         case 0xb0:                          case 0xb0:
                                 ch->algorithm = (BYTE)(value & 7);                                  ch->algorithm = (UINT8)(value & 7);
                                 value = (value >> 3) & 7;                                  value = (value >> 3) & 7;
                                 if (value) {                                  if (value) {
                                         ch->feedback = 8 - value;                                          ch->feedback = 8 - value;
Line 570  void opngen_setreg(REG8 chbase, REG8 reg Line 570  void opngen_setreg(REG8 chbase, REG8 reg
                                 break;                                  break;
   
                         case 0xb4:                          case 0xb4:
                                 ch->pan = (BYTE)(value & 0xc0);                                  ch->pan = (UINT8)(value & 0xc0);
                                 set_algorithm(ch);                                  set_algorithm(ch);
                                 break;                                  break;
                 }                  }
Line 618  void opngen_keyon(UINT chnum, REG8 value Line 618  void opngen_keyon(UINT chnum, REG8 value
                 slot++;                  slot++;
                 bit <<= 1;                  bit <<= 1;
         }          }
         keydisp_fmkeyon((BYTE)chnum, value);          keydisp_fmkeyon((UINT8)chnum, value);
 }  }
   

Removed from v.1.9  
changed lines
  Added in v.1.11


RetroPC.NET-CVS <cvs@retropc.net>