Public Member Functions |
| SidTune (const char *fileName, const char **fileNameExt=0, const bool separatorIsSlash=false) |
| SidTune (const uint_least8_t *oneFileFormatSidtune, const uint_least32_t sidtuneLength) |
void | setFileNameExtensions (const char **fileNameExt) |
bool | load (const char *fileName, const bool separatorIsSlash=false) |
bool | read (const uint_least8_t *sourceBuffer, const uint_least32_t bufferLen) |
const SidTuneInfo & | operator[] (const uint_least16_t songNum) |
uint_least16_t | selectSong (const uint_least16_t songNum) |
const SidTuneInfo & | getInfo () |
void | getInfo (SidTuneInfo &) |
| operator bool () |
bool | getStatus () |
bool | isStereo () |
bool | placeSidTuneInC64mem (uint_least8_t *c64buf) |
bool | saveC64dataFile (const char *destFileName, const bool overWriteFlag=false) |
bool | saveSIDfile (const char *destFileName, const bool overWriteFlag=false) |
bool | savePSIDfile (const char *destFileName, const bool overWriteFlag=false) |
void | fixLoadAddress (const bool force=false, uint_least16_t initAddr=0, uint_least16_t playAddr=0) |
bool | loadFile (const char *fileName, Buffer_sidtt< const uint_least8_t > &bufferRef) |
bool | saveToOpenFile (std::ofstream &toFile, const uint_least8_t *buffer, uint_least32_t bufLen) |
Protected Member Functions |
void | convertOldStyleSpeedToTables (uint_least32_t speed, int clock=SIDTUNE_CLOCK_PAL) |
| Convert 32-bit PSID-style speed word to internal tables.
|
virtual int | convertPetsciiToAscii (SmartPtr_sidtt< const uint_least8_t > &, char *) |
bool | checkCompatibility (void) |
| Check compatibility details are sensible.
|
bool | checkRelocInfo (void) |
| Check for valid relocation information.
|
bool | resolveAddrs (const uint_least8_t *c64data) |
| Common address resolution procedure.
|
virtual LoadStatus | PSID_fileSupport (Buffer_sidtt< const uint_least8_t > &dataBuf) |
virtual bool | PSID_fileSupportSave (std::ofstream &toFile, const uint_least8_t *dataBuffer) |
virtual LoadStatus | SID_fileSupport (Buffer_sidtt< const uint_least8_t > &dataBuf, Buffer_sidtt< const uint_least8_t > &sidBuf) |
virtual bool | SID_fileSupportSave (std::ofstream &toFile) |
virtual LoadStatus | MUS_fileSupport (Buffer_sidtt< const uint_least8_t > &musBuf, Buffer_sidtt< const uint_least8_t > &strBuf) |
LoadStatus | MUS_load (Buffer_sidtt< const uint_least8_t > &musBuf, bool init=false) |
LoadStatus | MUS_load (Buffer_sidtt< const uint_least8_t > &musBuf, Buffer_sidtt< const uint_least8_t > &strBuf, bool init=false) |
virtual bool | MUS_detect (const void *buffer, const uint_least32_t bufLen, uint_least32_t &voice3Index) |
virtual bool | MUS_mergeParts (Buffer_sidtt< const uint_least8_t > &musBuf, Buffer_sidtt< const uint_least8_t > &strBuf) |
virtual void | MUS_setPlayerAddress () |
virtual void | MUS_installPlayer (uint_least8_t *c64buf) |
virtual LoadStatus | INFO_fileSupport (Buffer_sidtt< const uint_least8_t > &dataBuf, Buffer_sidtt< const uint_least8_t > &infoBuf) |
virtual LoadStatus | PRG_fileSupport (const char *fileName, Buffer_sidtt< const uint_least8_t > &dataBuf) |
virtual LoadStatus | X00_fileSupport (const char *fileName, Buffer_sidtt< const uint_least8_t > &dataBuf) |
Static Protected Attributes |
static const char ** | fileNameExtensions = defaultFileNameExt |
| Filename extensions to append for various file types.
|
|
static const char * | txt_songNumberExceed = "SIDTUNE WARNING: Selected song number was too high" |
static const char * | txt_empty = "SIDTUNE ERROR: No data to load" |
static const char * | txt_unrecognizedFormat = "SIDTUNE ERROR: Could not determine file format" |
static const char * | txt_noDataFile = "SIDTUNE ERROR: Did not find the corresponding data file" |
static const char * | txt_notEnoughMemory = "SIDTUNE ERROR: Not enough free memory" |
static const char * | txt_cantLoadFile = "SIDTUNE ERROR: Could not load input file" |
static const char * | txt_cantOpenFile = "SIDTUNE ERROR: Could not open file for binary input" |
static const char * | txt_fileTooLong = "SIDTUNE ERROR: Input data too long" |
static const char * | txt_dataTooLong = "SIDTUNE ERROR: Size of music data exceeds C64 memory" |
static const char * | txt_cantCreateFile = "SIDTUNE ERROR: Could not create output file" |
static const char * | txt_fileIoError = "SIDTUNE ERROR: File I/O error" |
static const char * | txt_VBI = "VBI" |
static const char * | txt_CIA = "CIA 1 Timer A" |
static const char * | txt_noErrors = "No errors" |
static const char * | txt_na = "N/A" |
static const char * | txt_badAddr = "SIDTUNE ERROR: Bad address data" |
static const char * | txt_badReloc = "SIDTUNE ERROR: Bad reloc data" |
static const char * | txt_corrupt = "SIDTUNE ERROR: File is incomplete or corrupt" |
SidTune::SidTune |
( |
const char * |
fileName, |
|
|
const char ** |
fileNameExt = 0 , |
|
|
const bool |
separatorIsSlash = false |
|
) |
| |
Load a sidtune from a file.
To retrieve data from standard input pass in filename "-". If you want to override the default filename extensions use this contructor. Please note, that if the specified ``sidTuneFileName'' does exist and the loader is able to determine its file format, this function does not try to append any file name extension. See sidtune.cpp'' for the default list of file name extensions. You can specific
sidTuneFileName = 0'', if you do not want to load a sidtune. You can later load one with open().
void SidTune::fixLoadAddress |
( |
const bool |
force = false , |
|
|
uint_least16_t |
initAddr = 0 , |
|
|
uint_least16_t |
playAddr = 0 |
|
) |
| |
This function can be used to remove a duplicate C64 load address in the C64 data (example: FE 0F 00 10 4C ...). A duplicate load address of offset 0x02 is indicated by the ``fixLoad'' flag in the SidTuneInfo structure.
The ``force'' flag here can be used to remove the first load address and set new INIT/PLAY addresses regardless of whether a duplicate load address has been detected and indicated by ``fixLoad''. For instance, some position independent sidtunes contain a load address of 0xE000, but are loaded to 0x0FFE and call the player code at 0x1000.
Do not forget to save the sidtune file.