Diff for /np2/generic/cmver.c between versions 1.3 and 1.4

version 1.3, 2003/12/25 05:07:49 version 1.4, 2005/02/07 14:46:10
Line 13 Line 13
 #define MIDIOUTS2(a)            ((a)[0] + ((a)[1] << 8))  #define MIDIOUTS2(a)            ((a)[0] + ((a)[1] << 8))
 #define MIDIOUTS3(a)            ((a)[0] + ((a)[1] << 8) + ((a)[2] << 16))  #define MIDIOUTS3(a)            ((a)[0] + ((a)[1] << 8) + ((a)[2] << 16))
   
 static const BYTE EXCV_GMRESET[] = {  static const UINT8 EXCV_GMRESET[] = {
                         0xf0, 0x7e, 0x7f, 0x09, 0x01, 0xf7};                          0xf0, 0x7e, 0x7f, 0x09, 0x01, 0xf7};
   
 enum {  enum {
Line 44  enum { Line 44  enum {
 };  };
   
 typedef struct {  typedef struct {
         BYTE    prog;          UINT8   prog;
         BYTE    press;          UINT8   press;
         UINT16  bend;          UINT16  bend;
         BYTE    ctrl[28];          UINT8   ctrl[28];
 } _MIDICH, *MIDICH;  } _MIDICH, *MIDICH;
   
 typedef struct {  typedef struct {
Line 55  typedef struct { Line 55  typedef struct {
         UINT            midictrl;          UINT            midictrl;
         UINT            midisyscnt;          UINT            midisyscnt;
         UINT            mpos;          UINT            mpos;
         BYTE            midilast;          UINT8           midilast;
         _MIDICH         mch[16];          _MIDICH         mch[16];
         BYTE            buffer[MIDI_BUFFER];          UINT8           buffer[MIDI_BUFFER];
 } _CMMIDI, *CMMIDI;  } _CMMIDI, *CMMIDI;
   
 typedef struct {  typedef struct {
Line 65  typedef struct { Line 65  typedef struct {
         UINT    rate;          UINT    rate;
 } CMVER;  } CMVER;
   
 static const BYTE midictrltbl[] = {     0, 1, 5, 7, 10, 11, 64,  static const UINT8 midictrltbl[] = { 0, 1, 5, 7, 10, 11, 64,
                                                                         65, 66, 67, 84, 91, 93,                                                                          65, 66, 67, 84, 91, 93,
                                                                         94,                                             // for SC-88                                                                          94,                                             // for SC-88
                                                                         71, 72, 73, 74};                // for XG                                                                          71, 72, 73, 74};                // for XG
   
 static  CMVER   cmver;  static  CMVER   cmver;
 static  BYTE    midictrlindex[128];  static  UINT8   midictrlindex[128];
   
   
 // ----  // ----
Line 99  const SINT32 *ptr; Line 99  const SINT32 *ptr;
   
 static void midireset(CMMIDI midi) {  static void midireset(CMMIDI midi) {
   
         BYTE    work[4];          UINT8   work[4];
   
         midiout_longmsg(midi->midihdl, EXCV_GMRESET, sizeof(EXCV_GMRESET));          midiout_longmsg(midi->midihdl, EXCV_GMRESET, sizeof(EXCV_GMRESET));
   
Line 114  static void midireset(CMMIDI midi) { Line 114  static void midireset(CMMIDI midi) {
   
 static void midisetparam(CMMIDI midi) {  static void midisetparam(CMMIDI midi) {
   
         BYTE    i;          UINT8   i;
         UINT    j;          UINT    j;
         MIDICH  mch;          MIDICH  mch;
   
Line 127  static void midisetparam(CMMIDI midi) { Line 127  static void midisetparam(CMMIDI midi) {
                 if (mch->bend != 0xffff) {                  if (mch->bend != 0xffff) {
                         midiout_shortmsg(midi->midihdl, (mch->bend << 8) + 0xe0+i);                          midiout_shortmsg(midi->midihdl, (mch->bend << 8) + 0xe0+i);
                 }                  }
                 for (j=0; j<sizeof(midictrltbl)/sizeof(BYTE); j++) {                  for (j=0; j<NELEMENTS(midictrltbl); j++) {
                         if (mch->ctrl[j+1] != 0xff) {                          if (mch->ctrl[j+1] != 0xff) {
                                 midiout_shortmsg(midi->midihdl,                                  midiout_shortmsg(midi->midihdl,
                                                         MIDIOUTS(0xb0+i, midictrltbl[j], mch->ctrl[j+1]));                                                          MIDIOUTS(0xb0+i, midictrltbl[j], mch->ctrl[j+1]));
Line 142  static void midisetparam(CMMIDI midi) { Line 142  static void midisetparam(CMMIDI midi) {
   
 // ----  // ----
   
 static UINT midiread(COMMNG self, BYTE *data) {  static UINT midiread(COMMNG self, UINT8 *data) {
   
         (void)self;          (void)self;
         (void)data;          (void)data;
         return(0);          return(0);
 }  }
   
 static UINT midiwrite(COMMNG self, BYTE data) {  static UINT midiwrite(COMMNG self, UINT8 data) {
   
         CMMIDI  midi;          CMMIDI  midi;
         MIDICH  mch;          MIDICH  mch;
Line 315  static UINT midiwrite(COMMNG self, BYTE  Line 315  static UINT midiwrite(COMMNG self, BYTE 
         return(0);          return(0);
 }  }
   
 static BYTE midigetstat(COMMNG self) {  static UINT8 midigetstat(COMMNG self) {
   
         return(0x00);          return(0x00);
 }  }
Line 375  void cmvermouth_initialize(void) { Line 375  void cmvermouth_initialize(void) {
         UINT    i;          UINT    i;
   
         ZeroMemory(midictrlindex, sizeof(midictrlindex));          ZeroMemory(midictrlindex, sizeof(midictrlindex));
         for (i=0; i<sizeof(midictrltbl)/sizeof(BYTE); i++) {          for (i=0; i<NELEMENTS(midictrltbl); i++) {
                 midictrlindex[midictrltbl[i]] = (BYTE)(i + 1);                  midictrlindex[midictrltbl[i]] = (UINT8)(i + 1);
         }          }
         midictrlindex[32] = 1;          midictrlindex[32] = 1;
 }  }

Removed from v.1.3  
changed lines
  Added in v.1.4


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