Diff for /xmil/io/sndboard.c between versions 1.2 and 1.6

version 1.2, 2004/08/02 11:48:14 version 1.6, 2005/02/04 06:42:11
Line 2 Line 2
 #include        "joymng.h"  #include        "joymng.h"
 #include        "pccore.h"  #include        "pccore.h"
 #include        "iocore.h"  #include        "iocore.h"
 #include        "sndctrl.h"  
 #include        "keystat.h"  #include        "keystat.h"
   #include        "sound.h"
   #include        "sndctrl.h"
   #include        "x1f.h"
   
   
 void IOOUTCALL sndboard_opmreg(UINT port, REG8 value) {  #if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
   void IOOUTCALL opm_o(UINT port, REG8 dat) {
   
 //      TRACEOUT(("%.4x, %.2x", port, value));          REG8    lsb;
         sndboard.opmreg = (UINT8)value;          REG8    reg;
 }  
   
 void IOOUTCALL sndboard_opmdat(UINT port, REG8 value) {          lsb = (UINT8)port;
           if (lsb == 0x00) {                                      // 0700
 //      TRACEOUT(("%.4x, %.2x", port, value));                  sndboard.opmreg = (UINT8)dat;
         opmgen_setreg(sndboard.opmreg, value);          }
           else if (lsb == 0x01) {                         // 0701
                   reg = sndboard.opmreg;
                   sndboard.opmdat[reg] = dat;
                   x1f_opm(reg, dat);
   #if !defined(DISABLE_SOUND)
                   opmgen_setreg(reg, dat);
   #endif
           }
           else if ((lsb & (~3)) == 0x04) {        // 0704-0707
                   ctc_o(port, dat);
           }
 }  }
   
 REG8 IOINPCALL sndboard_opmsta(UINT port) {  REG8 IOINPCALL opm_i(UINT port) {
   
           REG8    lsb;
   
         if (pccore.SOUND_SW) {          lsb = (UINT8)port;
                 return(0x00);                                                           // ゼリアード対策          if ((lsb & (~1)) == 0x00) {                     // 0700/0701
                   return(0x00);                                                                                   // ゼリアード
           }
           else if ((lsb & (~3)) == 0x04) {        // 0704-0707
                   return(ctc_i(port));
           }
           else {
                   return(0xff);
         }          }
         return(0xff);  
 }  }
   #endif
   
   
 void IOOUTCALL sndboard_psgreg(UINT port, REG8 value) {  void IOOUTCALL sndboard_psgreg(UINT port, REG8 dat) {
   
 //      TRACEOUT(("OUT %.4x, %.2x", port, value));          sndboard.psgreg = dat;
         sndboard.psgreg = value;          (void)port;
 }  }
   
 void IOOUTCALL sndboard_psgdat(UINT port, REG8 value) {  void IOOUTCALL sndboard_psgdat(UINT port, REG8 dat) {
   
 //      TRACEOUT(("OUT %.4x, %.2x", port, value));          REG8    reg;
         if (sndboard.psgreg < 0x0e) {  
                 psggen_setreg(&psggen, sndboard.psgreg, value);          reg = sndboard.psgreg;
           if (reg < 0x0e) {
                   sndboard.psgdat[reg] = dat;
                   x1f_psg(reg, dat);
   #if !defined(DISABLE_SOUND)
                   psggen_setreg(&psggen, reg, dat);
   #endif
         }          }
           (void)port;
 }  }
   
 REG8 IOINPCALL sndboard_psgsta(UINT port) {  REG8 IOINPCALL sndboard_psgsta(UINT port) {
Line 46  REG8 IOINPCALL sndboard_psgsta(UINT port Line 75  REG8 IOINPCALL sndboard_psgsta(UINT port
         REG8    ret;          REG8    ret;
   
         if (sndboard.psgreg < 0x0e) {          if (sndboard.psgreg < 0x0e) {
                 return(psggen_getreg(&psggen, sndboard.psgreg));                  return(sndboard.psgdat[sndboard.psgreg]);
         }          }
         else if (sndboard.psgreg < 0x10) {          else if (sndboard.psgreg < 0x10) {
                 ret = 0xff;                  ret = 0xff;
Line 66  REG8 IOINPCALL sndboard_psgsta(UINT port Line 95  REG8 IOINPCALL sndboard_psgsta(UINT port
                 return(ret);                  return(ret);
         }          }
         else {          else {
                   (void)port;
                 return(0xff);                  return(0xff);
         }          }
 }  }
Line 73  REG8 IOINPCALL sndboard_psgsta(UINT port Line 103  REG8 IOINPCALL sndboard_psgsta(UINT port
   
 // ----  // ----
   
   #if !defined(DISABLE_SOUND)
   void sndboard_update(void) {
   
           UINT    i;
   
           for (i=0; i<14; i++) {
                   psggen_setreg(&psggen, (REG8)i, sndboard.psgdat[i]);
           }
   #if defined(SUPPORT_TURBOZ) || defined(SUPPORT_OPM)
           for (i=0x20; i<0x100; i++) {
                   opmgen_setreg((REG8)i, sndboard.opmdat[i]);
           }
   #endif
   }
   #endif
   
 void sndboard_reset(void) {  void sndboard_reset(void) {
   
         sndboard.opmreg = 0;          ZeroMemory(&sndboard, sizeof(sndboard));
         sndboard.psgreg = 0;          sndboard.psgdat[0x07] = 0x3f;
         sndctrl_reset();          sndctrl_reset();
 }  }
   

Removed from v.1.2  
changed lines
  Added in v.1.6


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