comparison src/xs_length.c @ 316:2b22c1f45097

PSID/RSID
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 04 Jan 2005 00:32:04 +0000
parents cab5ec6127ee
children dd201740a720
comparison
equal deleted inserted replaced
315:24cf384ba6db 316:2b22c1f45097
394 394
395 395
396 /* Compute md5hash of given SID-file 396 /* Compute md5hash of given SID-file
397 */ 397 */
398 typedef struct { 398 typedef struct {
399 gchar magicID[4]; /* "PSID" magic identifier */ 399 gchar magicID[4]; /* "PSID" / "RSID" magic identifier */
400 guint16 version, /* Version number */ 400 guint16 version, /* Version number */
401 dataOffset, /* Start of actual c64 data in file */ 401 dataOffset, /* Start of actual c64 data in file */
402 loadAddress, /* Loading address */ 402 loadAddress, /* Loading address */
403 initAddress, /* Initialization address */ 403 initAddress, /* Initialization address */
404 playAddress, /* Play one frame */ 404 playAddress, /* Play one frame */
437 if ((inFile = fopen(pcFilename, "rb")) == NULL) 437 if ((inFile = fopen(pcFilename, "rb")) == NULL)
438 return -1; 438 return -1;
439 439
440 /* Read PSID header in */ 440 /* Read PSID header in */
441 xs_rd_str(inFile, psidH.magicID, sizeof(psidH.magicID)); 441 xs_rd_str(inFile, psidH.magicID, sizeof(psidH.magicID));
442 if ((psidH.magicID[0] != 'P') || (psidH.magicID[1] != 'S') || 442 if ((psidH.magicID[0] != 'P' && psidH.magicID[0] != 'R') ||
443 (psidH.magicID[2] != 'I') || (psidH.magicID[3] != 'D')) 443 (psidH.magicID[1] != 'S') || (psidH.magicID[2] != 'I') || (psidH.magicID[3] != 'D'))
444 { 444 {
445 fclose(inFile); 445 fclose(inFile);
446 return -2; 446 return -2;
447 } 447 }
448 448