/[projet1]/public/pc/tools/osdk/main/Ym2Mym/sources/Ym2Mym.cpp
Defence Force logotype

Diff of /public/pc/tools/osdk/main/Ym2Mym/sources/Ym2Mym.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1078 by dbug, Tue Jan 14 18:03:02 2014 UTC revision 1079 by dbug, Tue Jan 14 18:57:41 2014 UTC
# Line 154  int main(int argc,char *argv[]) Line 154  int main(int argc,char *argv[])
154    
155    char ym_new=0;    char ym_new=0;
156    
157    unsigned long n,row;    long n,row;
158    long i,change,pack,biggest=0,hits,oldrow,remain,offi;    long i,change,pack,biggest=0,hits,oldrow,remain,offi;
159    long regbits[REGS]={8,4,8,4, 8,4,5,8, 5,5,5,8, 8,8};                          // Bits per PSG reg    long regbits[REGS]={8,4,8,4, 8,4,5,8, 5,5,5,8, 8,8};                          // Bits per PSG reg
160    long regand[REGS]={255,15,255,15, 255,15,31,255, 31,31,31,255, 255,255};      // AND values to mask out extra bits from register data    long regand[REGS]={255,15,255,15, 255,15,31,255, 31,31,31,255, 255,255};      // AND values to mask out extra bits from register data
# Line 185  int main(int argc,char *argv[]) Line 185  int main(int argc,char *argv[])
185      pcBuffer=pDst;      pcBuffer=pDst;
186      cBufferSize=dstSize;      cBufferSize=dstSize;
187    }    }
188    const char* sourceData=(const char*)pcBuffer;    const unsigned char* sourceData=(const unsigned char*)pcBuffer;
189    
190    // Check if the file is compressed    // Check if the file is compressed
191    length=cBufferSize-4;    length=cBufferSize-4;
192    if (!strncmp(sourceData,"YM2!",4))        //  YM2 is ok    if (!strncmp((const char*)sourceData,"YM2!",4))        //  YM2 is ok
193    {    {
194      sourceData+=4;      sourceData+=4;
195      // YM2!      // YM2!
196      // First four bytes is the ASCII identifier "YM2!".      // First four bytes is the ASCII identifier "YM2!".
197    }    }
198    else    else
199    if (!strncmp(sourceData,"YM3!",4))      //  YM3 is ok    if (!strncmp((const char*)sourceData,"YM3!",4))      //  YM3 is ok
200    {    {
201      sourceData+=4;      sourceData+=4;
202      // YM3!      // YM3!
# Line 224  int main(int argc,char *argv[]) Line 224  int main(int argc,char *argv[])
224      // data block for this interrupt and for this register has the value 255 ($FF).      // data block for this interrupt and for this register has the value 255 ($FF).
225    }    }
226    else    else
227    if (!strncmp(sourceData,"YM3b",4))    //  YM3b is ok    if (!strncmp((const char*)sourceData,"YM3b",4))    //  YM3b is ok
228    {    {
229      sourceData+=4;      sourceData+=4;
230      // YM3b!      // YM3b!
# Line 239  int main(int argc,char *argv[]) Line 239  int main(int argc,char *argv[])
239      length-=4;      length-=4;
240    }    }
241    else    else
242    if (!strncmp(sourceData,"YM4!",4))    //  YM4 is not yet ok    if (!strncmp((const char*)sourceData,"YM4!",4))    //  YM4 is not yet ok
243    {    {
244      sourceData+=4;      sourceData+=4;
245      // YM4!      // YM4!
# Line 248  int main(int argc,char *argv[]) Line 248  int main(int argc,char *argv[])
248      exit(EXIT_FAILURE);      exit(EXIT_FAILURE);
249    }    }
250    else    else
251    if ( (!strncmp(sourceData,"YM5!",4)) || (!strncmp(sourceData,"YM6!",4)) ) //  YM5 is ok but needs a different loader        if ( (!strncmp((const char*)sourceData,"YM5!",4)) || (!strncmp((const char*)sourceData,"YM6!",4)) ) //  YM5 is ok but needs a different loader    
252    {    {
253      sourceData+=4;      sourceData+=4;
254      // YM5!      // YM5!

Legend:
Removed from v.1078  
changed lines
  Added in v.1079

  ViewVC Help
Powered by ViewVC 1.1.26