Diff for /np2/sound/psggenc.c between versions 1.9 and 1.12

version 1.9, 2003/12/24 14:01:56 version 1.12, 2005/05/13 05:47:25
Line 7 Line 7
   
         PSGGENCFG       psggencfg;          PSGGENCFG       psggencfg;
   
 static const BYTE psggen_deftbl[0x10] =  static const UINT8 psggen_deftbl[0x10] =
                                 {0, 0, 0, 0, 0, 0, 0, 0xbf, 0, 0, 0, 0, 0, 0, 0xff, 0xff};                                  {0, 0, 0, 0, 0, 0, 0, 0xbf, 0, 0, 0, 0, 0, 0, 0xff, 0xff};
   
 static const BYTE psgenv_pat[16] = {  static const UINT8 psgenv_pat[16] = {
                                         PSGENV_ONESHOT,                                          PSGENV_ONESHOT,
                                         PSGENV_ONESHOT,                                          PSGENV_ONESHOT,
                                         PSGENV_ONESHOT,                                          PSGENV_ONESHOT,
Line 70  void psggen_reset(PSGGEN psg) { Line 70  void psggen_reset(PSGGEN psg) {
                 psg->tone[i].pvol = psggencfg.volume + 0;                  psg->tone[i].pvol = psggencfg.volume + 0;
         }          }
         for (i=0; i<sizeof(psggen_deftbl); i++) {          for (i=0; i<sizeof(psggen_deftbl); i++) {
                 psggen_setreg(psg, (REG8)i, psggen_deftbl[i]);                  psggen_setreg(psg, i, psggen_deftbl[i]);
         }          }
 }  }
   
 void psggen_setreg(PSGGEN psg, REG8 reg, REG8 value) {  void psggen_restore(PSGGEN psg) {
   
           UINT    i;
   
           for (i=0; i<0x0e; i++) {
                   psggen_setreg(psg, i, ((UINT8 *)&psg->reg)[i]);
           }
   }
   
   void psggen_setreg(PSGGEN psg, UINT reg, REG8 value) {
   
         UINT    freq;  
         UINT    ch;          UINT    ch;
           UINT    freq;
   
         reg &= 15;          reg = reg & 15;
         if (reg < 14) {          if (reg < 14) {
                 sound_sync();                  sound_sync();
         }          }
         ((BYTE *)&psg->reg)[reg] = value;          ((UINT8 *)&psg->reg)[reg] = value;
         switch(reg) {          switch(reg) {
                 case 0:                  case 0:
                 case 1:                  case 1:
Line 121  void psggen_setreg(PSGGEN psg, REG8 reg, Line 130  void psggen_setreg(PSGGEN psg, REG8 reg,
                 case 9:                  case 9:
                 case 10:                  case 10:
                         ch = reg - 8;                          ch = reg - 8;
                         keydisp_psgvol(psg, (BYTE)ch);                          keydisp_psgvol(psg, (UINT8)ch);
                         if (value & 0x10) {                          if (value & 0x10) {
                                 psg->tone[ch].pvol = &psg->evol;                                  psg->tone[ch].pvol = &psg->evol;
                         }                          }
Line 151  void psggen_setreg(PSGGEN psg, REG8 reg, Line 160  void psggen_setreg(PSGGEN psg, REG8 reg,
         }          }
 }  }
   
 REG8 psggen_getreg(PSGGEN psg, REG8 reg) {  REG8 psggen_getreg(PSGGEN psg, UINT reg) {
   
         return(((BYTE *)&psg->reg)[reg & 15]);          return(((UINT8 *)&psg->reg)[reg & 15]);
 }  }
   
 void psggen_setpan(PSGGEN psg, UINT ch, REG8 pan) {  void psggen_setpan(PSGGEN psg, UINT ch, REG8 pan) {

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


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