# HG changeset patch # User Matti Hamalainen # Date 1169676600 0 # Node ID 9e683fb666bab4e52675c6facdd8a0ff9c1d7ab2 # Parent 023fed5602f301dd448574be20c2ec25aac423aa Updates diff -r 023fed5602f3 -r 9e683fb666ba src/xs_sidplay.h --- a/src/xs_sidplay.h Wed Jan 24 22:08:02 2007 +0000 +++ b/src/xs_sidplay.h Wed Jan 24 22:10:00 2007 +0000 @@ -1,7 +1,7 @@ /* Here comes the really ugly code... Get all SID-tune information * for all sub-tunes, including name, length, etc. */ -t_xs_tuneinfo *TFUNCTION(gchar * pcFilename) +t_xs_tuneinfo *TFUNCTION(gchar *pcFilename) { t_xs_tuneinfo *pResult; TTUNEINFO tuneInfo; @@ -37,11 +37,18 @@ } -t_xs_tuneinfo *TFUNCTION2(t_xs_status * myStatus) +gboolean TFUNCTION2(t_xs_status *myStatus) { - t_xs_tuneinfo *pResult; TTUNEINFO tuneInfo; - TTUNE *testTune; +#ifdef _XS_SIDPLAY1_H + t_xs_sidplay1 *myEngine; +#endif +#ifdef _XS_SIDPLAY2_H + t_xs_sidplay2 *myEngine; +#endif + + if (!myStatus || !myStatus->tuneInfo) + return FALSE; /* Get general tune information */ #ifdef _XS_SIDPLAY1_H @@ -51,22 +58,23 @@ tuneInfo = testTune->getInfo(); #endif + if (!tuneInfo) + return FALSE; + + /* Allocate tuneinfo structure */ - pResult = xs_tuneinfo_new(pcFilename, + pResult = xs_tuneinfo_new(->pcFilename, tuneInfo.songs, tuneInfo.startSong, tuneInfo.infoString[0], tuneInfo.infoString[1], tuneInfo.infoString[2], tuneInfo.loadAddr, tuneInfo.initAddr, tuneInfo.playAddr, tuneInfo.dataFileLen, tuneInfo.formatString, tuneInfo.sidModel, tuneInfo.songSpeed, tuneInfo.clockSpeed); - delete testTune; - - return pResult; + return TRUE; } - - /* Undefine these */ #undef TFUNCTION +#undef TFUNCTION2 #undef TTUNEINFO #undef TTUNE diff -r 023fed5602f3 -r 9e683fb666ba src/xs_sidplay1.cc --- a/src/xs_sidplay1.cc Wed Jan 24 22:08:02 2007 +0000 +++ b/src/xs_sidplay1.cc Wed Jan 24 22:10:00 2007 +0000 @@ -24,8 +24,8 @@ #ifdef HAVE_SIDPLAY1 +#include #include "xs_sidplay1.h" -#include #include "xs_config.h" #include @@ -289,7 +289,7 @@ /* Load a given SID-tune file */ -gboolean xs_sidplay1_loadsid(t_xs_status * myStatus, gchar * pcFilename) +gboolean xs_sidplay1_load(t_xs_status * myStatus, gchar * pcFilename) { t_xs_sidplay1 *myEngine; sidTune *newTune; @@ -312,7 +312,7 @@ /* Delete INTERNAL information */ -void xs_sidplay1_deletesid(t_xs_status * myStatus) +void xs_sidplay1_delete(t_xs_status * myStatus) { t_xs_sidplay1 *myEngine; assert(myStatus); @@ -329,7 +329,8 @@ /* Return song information */ -#define TFUNCTION xs_sidplay1_getsidinfo +#define TFUNCTION xs_sidplay1_getinfo +#define TFUNCTION2 xs_sidplay1_updateinfo #define TTUNEINFO sidTuneInfo #define TTUNE sidTune #include "xs_sidplay.h" diff -r 023fed5602f3 -r 9e683fb666ba src/xs_sidplay2.cc --- a/src/xs_sidplay2.cc Wed Jan 24 22:08:02 2007 +0000 +++ b/src/xs_sidplay2.cc Wed Jan 24 22:10:00 2007 +0000 @@ -24,8 +24,8 @@ #ifdef HAVE_SIDPLAY2 +#include #include "xs_sidplay2.h" -#include #include "xs_config.h" #include "xs_support.h" @@ -53,7 +53,7 @@ /* Check if we can play the given file */ -gboolean xs_sidplay2_isourfile(gchar * pcFilename) +gboolean xs_sidplay2_isourfile(gchar *pcFilename) { SidTune *testTune = new SidTune(pcFilename); @@ -69,10 +69,9 @@ } - /* Initialize SIDPlay2 */ -gboolean xs_sidplay2_init(t_xs_status * myStatus) +gboolean xs_sidplay2_init(t_xs_ t_xs_status * myStatus) { gint tmpFreq; t_xs_sidplay2 *myEngine; @@ -376,7 +375,7 @@ return FALSE; } - myEngine->isInitialized = TRUE; + myStatus->isInitialized = TRUE; return TRUE; } @@ -398,7 +397,7 @@ /* Load a given SID-tune file */ -gboolean xs_sidplay2_loadsid(t_xs_status * myStatus, gchar * pcFilename) +gboolean xs_sidplay2_load(t_xs_status * myStatus, gchar * pcFilename) { t_xs_sidplay2 *myEngine; assert(myStatus); @@ -406,7 +405,7 @@ myEngine = (t_xs_sidplay2 *) myStatus->sidEngine; if (!myEngine) return FALSE; - myEngine->isInitialized = FALSE; + myStatus->isInitialized = FALSE; /* Try to get the tune */ if (!pcFilename) return FALSE; @@ -420,7 +419,7 @@ /* Delete INTERNAL information */ -void xs_sidplay2_deletesid(t_xs_status * myStatus) +void xs_sidplay2_delete(t_xs_status * myStatus) { assert(myStatus); @@ -430,7 +429,8 @@ /* Return song information */ -#define TFUNCTION xs_sidplay2_getsidinfo +#define TFUNCTION xs_sidplay2_getinfo +#define TFUNCTION2 xs_sidplay2_updateinfo #define TTUNEINFO SidTuneInfo #define TTUNE SidTune #include "xs_sidplay.h"