30 const uint_least16_t SIDTUNE_MAX_SONGS = 256;
32 const uint_least16_t SIDTUNE_MAX_CREDIT_STRINGS = 10;
35 const uint_least16_t SIDTUNE_MAX_CREDIT_STRLEN = 80+1;
37 const uint_least32_t SIDTUNE_MAX_MEMORY = 65536;
40 const uint_least32_t SIDTUNE_MAX_FILELEN = 65536+2+0x7C;
43 const int SIDTUNE_SPEED_VBI = 0;
46 const int SIDTUNE_SPEED_CIA_1A = 60;
48 const int SIDTUNE_CLOCK_UNKNOWN = 0x00;
49 const int SIDTUNE_CLOCK_PAL = 0x01;
50 const int SIDTUNE_CLOCK_NTSC = 0x02;
51 const int SIDTUNE_CLOCK_ANY = (SIDTUNE_CLOCK_PAL | SIDTUNE_CLOCK_NTSC);
53 const int SIDTUNE_SIDMODEL_UNKNOWN = 0x00;
54 const int SIDTUNE_SIDMODEL_6581 = 0x01;
55 const int SIDTUNE_SIDMODEL_8580 = 0x02;
56 const int SIDTUNE_SIDMODEL_ANY = (SIDTUNE_SIDMODEL_6581 | SIDTUNE_SIDMODEL_8580);
58 const int SIDTUNE_COMPATIBILITY_C64 = 0x00;
59 const int SIDTUNE_COMPATIBILITY_PSID = 0x01;
60 const int SIDTUNE_COMPATIBILITY_R64 = 0x02;
61 const int SIDTUNE_COMPATIBILITY_BASIC = 0x03;
91 uint_least16_t loadAddr;
92 uint_least16_t initAddr;
93 uint_least16_t playAddr;
96 uint_least16_t startSong;
148 char* infoString[SIDTUNE_MAX_CREDIT_STRINGS];
199 SidTune(
const char* fileName,
const char **fileNameExt = 0,
200 const bool separatorIsSlash =
false);
206 SidTune(
const uint_least8_t* oneFileFormatSidtune,
const uint_least32_t sidtuneLength);
217 void setFileNameExtensions(
const char **fileNameExt);
223 bool load(
const char* fileName,
const bool separatorIsSlash =
false);
228 bool read(
const uint_least8_t* sourceBuffer,
const uint_least32_t bufferLen);
234 const SidTuneInfo& operator[](
const uint_least16_t songNum);
240 uint_least16_t selectSong(
const uint_least16_t songNum);
259 operator bool() {
return status; }
260 bool getStatus() {
return status; }
267 return (info.sidChipBase1!=0 && info.sidChipBase2!=0);
273 bool placeSidTuneInC64mem(uint_least8_t* c64buf);
286 bool saveC64dataFile(
const char* destFileName,
const bool overWriteFlag =
false );
287 bool saveSIDfile(
const char* destFileName,
const bool overWriteFlag =
false );
288 bool savePSIDfile(
const char* destFileName,
const bool overWriteFlag =
false );
304 void fixLoadAddress(
const bool force =
false, uint_least16_t initAddr = 0,
305 uint_least16_t playAddr = 0);
313 bool saveToOpenFile( std::ofstream& toFile,
const uint_least8_t* buffer, uint_least32_t bufLen );
320 uint_least8_t songSpeed[SIDTUNE_MAX_SONGS];
321 uint_least8_t clockSpeed[SIDTUNE_MAX_SONGS];
322 uint_least16_t songLength[SIDTUNE_MAX_SONGS];
325 char infoString[SIDTUNE_MAX_CREDIT_STRINGS][SIDTUNE_MAX_CREDIT_STRLEN];
353 void convertOldStyleSpeedToTables(uint_least32_t speed,
354 int clock = SIDTUNE_CLOCK_PAL);
359 bool checkCompatibility(
void);
361 bool checkRelocInfo(
void);
363 bool resolveAddrs(
const uint_least8_t* c64data);
368 virtual bool PSID_fileSupportSave(std::ofstream& toFile,
const uint_least8_t* dataBuffer);
372 virtual bool SID_fileSupportSave (std::ofstream& toFile);
381 virtual bool MUS_detect (
const void* buffer,
const uint_least32_t bufLen,
382 uint_least32_t& voice3Index);
385 virtual void MUS_setPlayerAddress();
386 virtual void MUS_installPlayer (uint_least8_t *c64buf);
390 virtual LoadStatus PRG_fileSupport (
const char* fileName,
392 virtual LoadStatus X00_fileSupport (
const char* fileName,
397 static const char* txt_songNumberExceed;
398 static const char* txt_empty;
399 static const char* txt_unrecognizedFormat;
400 static const char* txt_noDataFile;
401 static const char* txt_notEnoughMemory;
402 static const char* txt_cantLoadFile;
403 static const char* txt_cantOpenFile;
404 static const char* txt_fileTooLong;
405 static const char* txt_dataTooLong;
406 static const char* txt_cantCreateFile;
407 static const char* txt_fileIoError;
408 static const char* txt_VBI;
409 static const char* txt_CIA;
410 static const char* txt_noErrors;
411 static const char* txt_na;
412 static const char* txt_badAddr;
413 static const char* txt_badReloc;
414 static const char* txt_corrupt;
421 #if !defined(SIDTUNE_NO_STDIN_LOADER)
424 void getFromFiles(
const char* name);
426 void deleteFileNameCopies();
429 void getFromBuffer(
const uint_least8_t*
const buffer,
const uint_least32_t bufferLen);
435 bool acceptSidTune(
const char* dataFileName,
const char* infoFileName,
439 const char* sourceName,
const char* sourceExt);